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.
393 lines
986 KiB
393 lines
986 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[102,5,7,8,9,16],{"+ua5":function(Je,be,V){},"/cxE":function(Je,be,V){"use strict";V.d(be,"f",function(){return A}),V.d(be,"g",function(){return k}),V.d(be,"h",function(){return w}),V.d(be,"e",function(){return H}),V.d(be,"b",function(){return U}),V.d(be,"c",function(){return e}),V.d(be,"d",function(){return S}),V.d(be,"a",function(){return f});class ae{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(d){setTimeout(()=>{throw d.stack?new Error(d.message+`
|
|
|
|
`+d.stack):d},0)}}emit(d){this.listeners.forEach(o=>{o(d)})}onUnexpectedError(d){this.unexpectedErrorHandler(d),this.emit(d)}onUnexpectedExternalError(d){this.unexpectedErrorHandler(d)}}const B=new ae;function A(d){H(d)||B.onUnexpectedError(d);return}function k(d){H(d)||B.onUnexpectedExternalError(d);return}function w(d){if(d instanceof Error){let{name:o,message:a}=d;const r=d.stacktrace||d.stack;return{$isError:!0,name:o,message:a,stack:r}}return d}const R="Canceled";function H(d){return d instanceof Error&&d.name===R&&d.message===R}function U(){const d=new Error(R);return d.name=d.message,d}function e(d){return d?new Error(`Illegal argument: ${d}`):new Error("Illegal argument")}function S(d){return d?new Error(`Illegal state: ${d}`):new Error("Illegal state")}class f extends Error{constructor(d){super("NotSupported");d&&(this.message=d)}}},"24hK":function(Je,be,V){"use strict";V.d(be,"a",function(){return B});class ae{constructor(A){this.element=A,this.next=ae.Undefined,this.prev=ae.Undefined}}ae.Undefined=new ae(void 0);class B{constructor(){this._first=ae.Undefined,this._last=ae.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ae.Undefined}clear(){let A=this._first;for(;A!==ae.Undefined;){const k=A.next;A.prev=ae.Undefined,A.next=ae.Undefined,A=k}this._first=ae.Undefined,this._last=ae.Undefined,this._size=0}unshift(A){return this._insert(A,!1)}push(A){return this._insert(A,!0)}_insert(A,k){const w=new ae(A);if(this._first===ae.Undefined)this._first=w,this._last=w;else if(k){const H=this._last;this._last=w,w.prev=H,H.next=w}else{const H=this._first;this._first=w,w.next=H,H.prev=w}this._size+=1;let R=!1;return()=>{R||(R=!0,this._remove(w))}}shift(){if(this._first===ae.Undefined)return;{const A=this._first.element;return this._remove(this._first),A}}pop(){if(this._last===ae.Undefined)return;{const A=this._last.element;return this._remove(this._last),A}}_remove(A){if(A.prev!==ae.Undefined&&A.next!==ae.Undefined){const k=A.prev;k.next=A.next,A.next.prev=k}else A.prev===ae.Undefined&&A.next===ae.Undefined?(this._first=ae.Undefined,this._last=ae.Undefined):A.next===ae.Undefined?(this._last=this._last.prev,this._last.next=ae.Undefined):A.prev===ae.Undefined&&(this._first=this._first.next,this._first.prev=ae.Undefined);this._size-=1}*[Symbol.iterator](){let A=this._first;for(;A!==ae.Undefined;)yield A.element,A=A.next}}},"3/fG":function(Je,be,V){"use strict";V.d(be,"a",function(){return B});function ae(A,k){let w;return k.length===0?w=A:w=A.replace(/\{(\d+)\}/g,function(R,H){const U=H[0];return typeof k[U]!="undefined"?k[U]:R}),w}function B(A,k,...w){return ae(k,w)}},"479L":function(Je,be){Je.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAWCAYAAAAvg9c4AAAAAXNSR0IArs4c6QAABPdJREFUSEullWloHGUYx//vzO7sHDuzm93sZpM2l/SgRyK7xSYxrfYgbdUq6JcixXqAUrxItGAVMT1A+kH7Re1WWppa6afiAYJIi7ZB07vkIARzVJqYbJMmu90zszOzM6/MVEXQotR3mPky8/7e//N7ZuYl+J+jt7fX7/f7i/X19cU/UORemZRSZnBwsKNQKLztdrtHOI57sqGhYcbm3ROUUsoOD4++Mz9f2CtJItE0DaVSqTMWi+27Jyil1DM0NLTfsmgHpZbLhthQSmlfTU3NmkgkUvjPSSmlZGRkZI2maZ2mWdpAGBehpgnd0KBpOkzTLPn9/gei0Wjfv0JHR0cXGpq2xTDNHZTSJsu0OJNaIIRFUc07KXXdgGVZCAQCL7e0tMT/Br3ja3iRaZptlmU9YVHayhBGoAApGTpKhgHCsFCLRaRvp+yEtk9QaiEYDHy0cWPb639CbdjAwADP8/zRkmk9BYADIU4nLUqdycX5Agxdh4cXkLh5E8m5WTD2A4SAZVmEwxVnNm3a9AiJx+MrdSI8nslm25YtqlMaVi6LWab1+2IUFIB9NXQDuUwapmFAUnwYHBhAOp0Ex3nAcRx4QUA4FL62ecuWVnL01Om8V1YkXdewpMoLn6zYC4NhGLhcLng4t4OdnEognUqCIQSSJOPipYvI5gsQBBGyV4KiyAgFgz83NDauImevDtFUJo+ZqXGsW7UcvjK/zQDDEBBCHF+pZBKTU1NOl1mWgYfnMTNzy1FTWbUA6UzWuVce9N2QRKmRfP3d9zSRLOBS9xlsbVsLv893p2TLcjzqhgGtqEEvGWAI47izyx27ft2ppq6uHpIoIFcowqfIkz7Fu4LEjxyhVUtX4cuTn2FxdQiiKILYKe3DbpTtwu4Fw4Bzu8F5PGAZFqnbKWdhRVEQDkegm5YNnVhYFVlJ9uzbb2x++iXXxwf2o0Jxg+N5J4ENs/0RlgVLCFwuNyRJhCAITgX+sgCyubzjXZK88Hq9ttuRMr8SI2d+OHdCqFz8zMkjh1SeqqXy8qBsGIbj0rQs56UGpXCxLCRZhiLLmFdVyF4FmmFAUXzw+RRIogSvV+xdUFX5ILl07drBIh/quHD2bNeK+vLLum7ENXUe+Xweqqo6p6brMEsleDweJ1Eul0MgWA7Too6uYCAAryxDEvlzzU1NbeTClSsHDTHScaG7+/D6pmU9k2nt8/TU+NUl91UP53K5dblcrjKfzzOFQsFpmu01k8mgrCwAC4yjygZXVkYgy9LR1paWF0n3jz0fMMGaN8+f6z68oXnp+V/T1omRgd7ju9t3Pp9IJMTZ2dmHMpnMtnQ6/Wg2mw2pqkqy2SzcbjdcnAiOczuJIxUhVIRCu5qbV39Ivj19+oBSvfytyz/1HG5trLs4NU+O3xge6npj53Mv/PUHPj09HR4bG9s+NzfXnkymatSiCoEX4C8rA+fh4eE4GioPrI1Goz3k1Fdf7KlcEuvsu3z1mN9jjY3fSr/vgX5oV/trr/zTrtDf379wYmIinkqlHrMsi8iyDFnxQRCFsdrq6tW1tbW3yXt79z77y42J44KL5FPJOeJiXUb0/oYdu9/t/OZuW42tpa+v75iqqtvy+RwqwiEIvPjJw+vXv+q8011dXXx/f/9WWZaVQCBwE0Bfe3v7NCHE/rDuOmzw+Pj4p4lEYruLZWeqa2o2xmKxIXvCb487Tm3fsdeDAAAAAElFTkSuQmCC"},"55Ip":function(Je,be,V){"use strict";V.d(be,"a",function(){return i});var ae=V("Ty5D"),B=V("dI71"),A=V("q1tI"),k=V.n(A),w=V("YS25"),R=V("17x9"),H=V.n(R),U=V("wx14"),e=V("zLVn"),S=V("9R94"),f=function(c){Object(B.a)(u,c);function u(){for(var v,p=arguments.length,T=new Array(p),L=0;L<p;L++)T[L]=arguments[L];return v=c.call.apply(c,[this].concat(T))||this,v.history=Object(w.a)(v.props),v}var l=u.prototype;return l.render=function(){return k.a.createElement(ae.c,{history:this.history,children:this.props.children})},u}(k.a.Component),d=function(c){Object(B.a)(u,c);function u(){for(var v,p=arguments.length,T=new Array(p),L=0;L<p;L++)T[L]=arguments[L];return v=c.call.apply(c,[this].concat(T))||this,v.history=Object(w.b)(v.props),v}var l=u.prototype;return l.render=function(){return k.a.createElement(ae.c,{history:this.history,children:this.props.children})},u}(k.a.Component),o=function(u,l){return typeof u=="function"?u(l):u},a=function(u,l){return typeof u=="string"?Object(w.c)(u,null,null,l):u},r=function(u){return u},h=k.a.forwardRef;typeof h=="undefined"&&(h=r);function s(c){return!!(c.metaKey||c.altKey||c.ctrlKey||c.shiftKey)}var n=h(function(c,u){var l=c.innerRef,v=c.navigate,p=c.onClick,T=Object(e.a)(c,["innerRef","navigate","onClick"]),L=T.target,D=Object(U.a)({},T,{onClick:function(M){try{p&&p(M)}catch(j){throw M.preventDefault(),j}!M.defaultPrevented&&M.button===0&&(!L||L==="_self")&&!s(M)&&(M.preventDefault(),v())}});return r!==h?D.ref=u||l:D.ref=l,k.a.createElement("a",D)}),i=h(function(c,u){var l=c.component,v=l===void 0?n:l,p=c.replace,T=c.to,L=c.innerRef,D=Object(e.a)(c,["component","replace","to","innerRef"]);return k.a.createElement(ae.e.Consumer,null,function(x){x||Object(S.a)(!1);var M=x.history,j=a(o(T,x.location),x.location),I=j?M.createHref(j):"",W=Object(U.a)({},D,{href:I,navigate:function(){var fe=o(T,x.location),le=p?M.replace:M.push;le(fe)}});return r!==h?W.ref=u||L:W.innerRef=L,k.a.createElement(v,W)})});if(!1)var t,b;var m=function(u){return u},g=k.a.forwardRef;typeof g=="undefined"&&(g=m);function E(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];return u.filter(function(v){return v}).join(" ")}var _=g(function(c,u){var l=c["aria-current"],v=l===void 0?"page":l,p=c.activeClassName,T=p===void 0?"active":p,L=c.activeStyle,D=c.className,x=c.exact,M=c.isActive,j=c.location,I=c.sensitive,W=c.strict,Q=c.style,fe=c.to,le=c.innerRef,Ce=Object(e.a)(c,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return k.a.createElement(ae.e.Consumer,null,function(Oe){Oe||Object(S.a)(!1);var Re=j||Oe.location,Le=a(o(fe,Re),Re),Pe=Le.pathname,_e=Pe&&Pe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),N=_e?Object(ae.f)(Re.pathname,{path:_e,exact:x,sensitive:I,strict:W}):null,O=!!(M?M(N,Re):N),C=O?E(D,T):D,F=O?Object(U.a)({},Q,{},L):Q,z=Object(U.a)({"aria-current":O&&v||null,className:C,style:F,to:Le},Ce);return m!==g?z.ref=u||le:z.innerRef=le,k.a.createElement(i,z)})});if(!1)var y},"5VLF":function(Je,be,V){"use strict";var ae,B;function A(k,w,R){var H=function(U,e){return k.js_beautify(U,e)};return H.js=k.js_beautify,H.css=w.css_beautify,H.html=R.html_beautify,H.js_beautify=k.js_beautify,H.css_beautify=w.css_beautify,H.html_beautify=R.html_beautify,H}!(ae=[V("6UM0"),V("TXwP"),V("psGv")],B=function(k,w,R){return A(k,w,R)}.apply(be,ae),B!==void 0&&(Je.exports=B))},"5Y4S":function(Je,be,V){"use strict";V.d(be,"a",function(){return A});var ae=V("MNsG");const B=ae.b.performance&&typeof ae.b.performance.now=="function";class A{constructor(k){this._highResolution=B&&k,this._startTime=this._now(),this._stopTime=-1}static create(k=!0){return new A(k)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ae.b.performance.now():Date.now()}}},"6+eU":function(Je,be,V){"use strict";V.d(be,"a",function(){return g});var ae=V("wx14"),B=V("rePB"),A=V("VTBJ"),k=V("1OyB"),w=V("vuIU"),R=V("Ji7U"),H=V("LK+K"),U=V("q1tI"),e=V.n(U),S=V("TSYQ"),f=V.n(S),d=function(_){var y,c="".concat(_.rootPrefixCls,"-item"),u=f()(c,"".concat(c,"-").concat(_.page),(y={},Object(B.a)(y,"".concat(c,"-active"),_.active),Object(B.a)(y,_.className,!!_.className),Object(B.a)(y,"".concat(c,"-disabled"),!_.page),y)),l=function(){_.onClick(_.page)},v=function(T){_.onKeyPress(T,_.onClick,_.page)};return e.a.createElement("li",{title:_.showTitle?_.page:null,className:u,onClick:l,onKeyPress:v,tabIndex:"0"},_.itemRender(_.page,"page",e.a.createElement("a",{rel:"nofollow"},_.page)))},o=d,a={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},r=function(E){Object(R.a)(y,E);var _=Object(H.a)(y);function y(){var c;Object(k.a)(this,y);for(var u=arguments.length,l=new Array(u),v=0;v<u;v++)l[v]=arguments[v];return c=_.call.apply(_,[this].concat(l)),c.state={goInputText:""},c.buildOptionText=function(p){return"".concat(p," ").concat(c.props.locale.items_per_page)},c.changeSize=function(p){c.props.changeSize(Number(p))},c.handleChange=function(p){c.setState({goInputText:p.target.value})},c.handleBlur=function(p){var T=c.props,L=T.goButton,D=T.quickGo,x=T.rootPrefixCls,M=c.state.goInputText;if(L||M==="")return;if(p.relatedTarget&&(p.relatedTarget.className.indexOf("".concat(x,"-prev"))>=0||p.relatedTarget.className.indexOf("".concat(x,"-next"))>=0))return;c.setState({goInputText:""}),D(c.getValidValue())},c.go=function(p){var T=c.state.goInputText;if(T==="")return;(p.keyCode===a.ENTER||p.type==="click")&&(c.setState({goInputText:""}),c.props.quickGo(c.getValidValue()))},c}return Object(w.a)(y,[{key:"getValidValue",value:function(){var u=this.state,l=u.goInputText,v=u.current;return!l||isNaN(l)?v:Number(l)}},{key:"getPageSizeOptions",value:function(){var u=this.props,l=u.pageSize,v=u.pageSizeOptions;return v.some(function(p){return p.toString()===l.toString()})?v:v.concat([l.toString()]).sort(function(p,T){var L=isNaN(Number(p))?0:Number(p),D=isNaN(Number(T))?0:Number(T);return L-D})}},{key:"render",value:function(){var u=this,l=this.props,v=l.pageSize,p=l.locale,T=l.rootPrefixCls,L=l.changeSize,D=l.quickGo,x=l.goButton,M=l.selectComponentClass,j=l.buildOptionText,I=l.selectPrefixCls,W=l.disabled,Q=this.state.goInputText,fe="".concat(T,"-options"),le=M,Ce=null,Oe=null,Re=null;if(!L&&!D)return null;var Le=this.getPageSizeOptions();if(L&&le){var Pe=Le.map(function(_e,N){return e.a.createElement(le.Option,{key:N,value:_e.toString()},(j||u.buildOptionText)(_e))});Ce=e.a.createElement(le,{disabled:W,prefixCls:I,showSearch:!1,className:"".concat(fe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(v||Le[0]).toString(),onChange:this.changeSize,getPopupContainer:function(N){return N.parentNode}},Pe)}return D&&(x&&(Re=typeof x=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:W,className:"".concat(fe,"-quick-jumper-button")},p.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},x)),Oe=e.a.createElement("div",{className:"".concat(fe,"-quick-jumper")},p.jump_to,e.a.createElement("input",{disabled:W,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),p.page,Re)),e.a.createElement("li",{className:"".concat(fe)},Ce,Oe)}}]),y}(e.a.Component);r.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=r,s=V("N2Kk");function n(){}function i(E){return typeof E=="number"&&isFinite(E)&&Math.floor(E)===E}function t(E,_,y){return y}function b(E,_,y){var c=typeof E=="undefined"?_.pageSize:E;return Math.floor((y.total-1)/c)+1}var m=function(E){Object(R.a)(y,E);var _=Object(H.a)(y);function y(c){var u;Object(k.a)(this,y),u=_.call(this,c),u.getJumpPrevPage=function(){return Math.max(1,u.state.current-(u.props.showLessItems?3:5))},u.getJumpNextPage=function(){return Math.min(b(void 0,u.state,u.props),u.state.current+(u.props.showLessItems?3:5))},u.getItemIcon=function(L,D){var x=u.props.prefixCls,M=L||e.a.createElement("button",{type:"button","aria-label":D,className:"".concat(x,"-item-link")});return typeof L=="function"&&(M=e.a.createElement(L,Object(A.a)({},u.props))),M},u.savePaginationNode=function(L){u.paginationNode=L},u.isValid=function(L){return i(L)&&L!==u.state.current},u.shouldDisplayQuickJumper=function(){var L=u.props,D=L.showQuickJumper,x=L.pageSize,M=L.total;return M<=x?!1:D},u.handleKeyDown=function(L){(L.keyCode===a.ARROW_UP||L.keyCode===a.ARROW_DOWN)&&L.preventDefault()},u.handleKeyUp=function(L){var D=u.getValidValue(L),x=u.state.currentInputValue;D!==x&&u.setState({currentInputValue:D}),L.keyCode===a.ENTER?u.handleChange(D):L.keyCode===a.ARROW_UP?u.handleChange(D-1):L.keyCode===a.ARROW_DOWN&&u.handleChange(D+1)},u.changePageSize=function(L){var D=u.state.current,x=b(L,u.state,u.props);D=D>x?x:D,x===0&&(D=u.state.current),typeof L=="number"&&("pageSize"in u.props||u.setState({pageSize:L}),"current"in u.props||u.setState({current:D,currentInputValue:D})),u.props.onShowSizeChange(D,L),"onChange"in u.props&&u.props.onChange&&u.props.onChange(D,L)},u.handleChange=function(L){var D=u.props.disabled,x=L;if(u.isValid(x)&&!D){var M=b(void 0,u.state,u.props);x>M?x=M:x<1&&(x=1),"current"in u.props||u.setState({current:x,currentInputValue:x});var j=u.state.pageSize;return u.props.onChange(x,j),x}return u.state.current},u.prev=function(){u.hasPrev()&&u.handleChange(u.state.current-1)},u.next=function(){u.hasNext()&&u.handleChange(u.state.current+1)},u.jumpPrev=function(){u.handleChange(u.getJumpPrevPage())},u.jumpNext=function(){u.handleChange(u.getJumpNextPage())},u.hasPrev=function(){return u.state.current>1},u.hasNext=function(){return u.state.current<b(void 0,u.state,u.props)},u.runIfEnter=function(L,D){if(L.key==="Enter"||L.charCode===13){for(var x=arguments.length,M=new Array(x>2?x-2:0),j=2;j<x;j++)M[j-2]=arguments[j];D.apply(void 0,M)}},u.runIfEnterPrev=function(L){u.runIfEnter(L,u.prev)},u.runIfEnterNext=function(L){u.runIfEnter(L,u.next)},u.runIfEnterJumpPrev=function(L){u.runIfEnter(L,u.jumpPrev)},u.runIfEnterJumpNext=function(L){u.runIfEnter(L,u.jumpNext)},u.handleGoTO=function(L){(L.keyCode===a.ENTER||L.type==="click")&&u.handleChange(u.state.currentInputValue)};var l=c.onChange!==n,v="current"in c;v&&!l&&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=c.defaultCurrent;"current"in c&&(p=c.current);var T=c.defaultPageSize;return"pageSize"in c&&(T=c.pageSize),p=Math.min(p,b(T,void 0,c)),u.state={current:p,currentInputValue:p,pageSize:T},u}return Object(w.a)(y,[{key:"componentDidUpdate",value:function(u,l){var v=this.props.prefixCls;if(l.current!==this.state.current&&this.paginationNode){var p=this.paginationNode.querySelector(".".concat(v,"-item-").concat(l.current));p&&document.activeElement===p&&p.blur()}}},{key:"getValidValue",value:function(u){var l=u.target.value,v=b(void 0,this.state,this.props),p=this.state.currentInputValue,T;return l===""?T=l:isNaN(Number(l))?T=p:l>=v?T=v:T=Number(l),T}},{key:"getShowSizeChanger",value:function(){var u=this.props,l=u.showSizeChanger,v=u.total,p=u.totalBoundaryShowSizeChanger;return typeof l!="undefined"?l:v>p}},{key:"renderPrev",value:function(u){var l=this.props,v=l.prevIcon,p=l.itemRender,T=p(u,"prev",this.getItemIcon(v,"prev page")),L=!this.hasPrev();return Object(U.isValidElement)(T)?Object(U.cloneElement)(T,{disabled:L}):T}},{key:"renderNext",value:function(u){var l=this.props,v=l.nextIcon,p=l.itemRender,T=p(u,"next",this.getItemIcon(v,"next page")),L=!this.hasNext();return Object(U.isValidElement)(T)?Object(U.cloneElement)(T,{disabled:L}):T}},{key:"render",value:function(){var u=this,l=this.props,v=l.prefixCls,p=l.className,T=l.style,L=l.disabled,D=l.hideOnSinglePage,x=l.total,M=l.locale,j=l.showQuickJumper,I=l.showLessItems,W=l.showTitle,Q=l.showTotal,fe=l.simple,le=l.itemRender,Ce=l.showPrevNextJumpers,Oe=l.jumpPrevIcon,Re=l.jumpNextIcon,Le=l.selectComponentClass,Pe=l.selectPrefixCls,_e=l.pageSizeOptions,N=this.state,O=N.current,C=N.pageSize,F=N.currentInputValue;if(D===!0&&x<=C)return null;var z=b(void 0,this.state,this.props),P=[],oe=null,we=null,Ae=null,ee=null,de=null,ge=j&&j.goButton,xe=I?1:2,Me=O-1>0?O-1:0,Ue=O+1<z?O+1:z,He=Object.keys(this.props).reduce(function(X,$){return($.substr(0,5)==="data-"||$.substr(0,5)==="aria-"||$==="role")&&(X[$]=u.props[$]),X},{});if(fe)return ge&&(typeof ge=="boolean"?de=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},M.jump_to_confirm):de=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ge),de=e.a.createElement("li",{title:W?"".concat(M.jump_to).concat(O,"/").concat(z):null,className:"".concat(v,"-simple-pager")},de)),e.a.createElement("ul",Object(ae.a)({className:f()(v,"".concat(v,"-simple"),Object(B.a)({},"".concat(v,"-disabled"),L),p),style:T,ref:this.savePaginationNode},He),e.a.createElement("li",{title:W?M.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:f()("".concat(v,"-prev"),Object(B.a)({},"".concat(v,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Me)),e.a.createElement("li",{title:W?"".concat(O,"/").concat(z):null,className:"".concat(v,"-simple-pager")},e.a.createElement("input",{type:"text",value:F,disabled:L,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),e.a.createElement("span",{className:"".concat(v,"-slash")},"/"),z),e.a.createElement("li",{title:W?M.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:f()("".concat(v,"-next"),Object(B.a)({},"".concat(v,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Ue)),de);if(z<=3+xe*2){var Be={locale:M,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:W,itemRender:le};z||P.push(e.a.createElement(o,Object(ae.a)({},Be,{key:"noPager",page:z,className:"".concat(v,"-disabled")})));for(var ze=1;ze<=z;ze+=1){var We=O===ze;P.push(e.a.createElement(o,Object(ae.a)({},Be,{key:ze,page:ze,active:We})))}}else{var Ke=I?M.prev_3:M.prev_5,Fe=I?M.next_3:M.next_5;Ce&&(oe=e.a.createElement("li",{title:W?Ke:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:f()("".concat(v,"-jump-prev"),Object(B.a)({},"".concat(v,"-jump-prev-custom-icon"),!!Oe))},le(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Oe,"prev page"))),we=e.a.createElement("li",{title:W?Fe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:f()("".concat(v,"-jump-next"),Object(B.a)({},"".concat(v,"-jump-next-custom-icon"),!!Re))},le(this.getJumpNextPage(),"jump-next",this.getItemIcon(Re,"next page")))),ee=e.a.createElement(o,{locale:M,last:!0,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:z,page:z,active:!1,showTitle:W,itemRender:le}),Ae=e.a.createElement(o,{locale:M,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:W,itemRender:le});var Ye=Math.max(1,O-xe),$e=Math.min(O+xe,z);O-1<=xe&&($e=1+xe*2),z-O<=xe&&(Ye=z-xe*2);for(var q=Ye;q<=$e;q+=1){var K=O===q;P.push(e.a.createElement(o,{locale:M,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:q,page:q,active:K,showTitle:W,itemRender:le}))}O-1>=xe*2&&O!==1+2&&(P[0]=Object(U.cloneElement)(P[0],{className:"".concat(v,"-item-after-jump-prev")}),P.unshift(oe)),z-O>=xe*2&&O!==z-2&&(P[P.length-1]=Object(U.cloneElement)(P[P.length-1],{className:"".concat(v,"-item-before-jump-next")}),P.push(we)),Ye!==1&&P.unshift(Ae),$e!==z&&P.push(ee)}var G=null;Q&&(G=e.a.createElement("li",{className:"".concat(v,"-total-text")},Q(x,[x===0?0:(O-1)*C+1,O*C>x?x:O*C])));var Z=!this.hasPrev()||!z,te=!this.hasNext()||!z;return e.a.createElement("ul",Object(ae.a)({className:f()(v,p,Object(B.a)({},"".concat(v,"-disabled"),L)),style:T,unselectable:"unselectable",ref:this.savePaginationNode},He),G,e.a.createElement("li",{title:W?M.prev_page:null,onClick:this.prev,tabIndex:Z?null:0,onKeyPress:this.runIfEnterPrev,className:f()("".concat(v,"-prev"),Object(B.a)({},"".concat(v,"-disabled"),Z)),"aria-disabled":Z},this.renderPrev(Me)),P,e.a.createElement("li",{title:W?M.next_page:null,onClick:this.next,tabIndex:te?null:0,onKeyPress:this.runIfEnterNext,className:f()("".concat(v,"-next"),Object(B.a)({},"".concat(v,"-disabled"),te)),"aria-disabled":te},this.renderNext(Ue)),e.a.createElement(h,{disabled:L,locale:M,rootPrefixCls:v,selectComponentClass:Le,selectPrefixCls:Pe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:O,pageSize:C,pageSizeOptions:_e,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ge}))}}],[{key:"getDerivedStateFromProps",value:function(u,l){var v={};if("current"in u&&(v.current=u.current,u.current!==l.current&&(v.currentInputValue=v.current)),"pageSize"in u&&u.pageSize!==l.pageSize){var p=l.current,T=b(u.pageSize,l,u);p=p>T?T:p,"current"in u||(v.current=p,v.currentInputValue=p),v.pageSize=u.pageSize}return v}}]),y}(e.a.Component);m.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:s.a,style:{},itemRender:t,totalBoundaryShowSizeChanger:50};var g=m},"6UM0":function(Je,be,V){var ae,B;(function(){var A;(function(){"use strict";var w=[function(e,S,f){var d=f(1).Beautifier,o=f(5).Options;function a(r,h){var s=new d(r,h);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new o}},function(e,S,f){var d=f(2).Output,o=f(3).Token,a=f(4),r=f(5).Options,h=f(7).Tokenizer,s=f(7).line_starters,n=f(7).positionable_operators,i=f(7).TOKEN;function t(I,W){return W.indexOf(I)!==-1}function b(I){return I.replace(/^\s+/g,"")}function m(I){for(var W={},Q=0;Q<I.length;Q++)W[I[Q].replace(/-/g,"_")]=I[Q];return W}function g(I,W){return I&&I.type===i.RESERVED&&I.text===W}function E(I,W){return I&&I.type===i.RESERVED&&t(I.text,W)}var _=["case","return","do","if","throw","else","await","break","continue","async"],y=["before-newline","after-newline","preserve-newline"],c=m(y),u=[c.before_newline,c.preserve_newline],l={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function v(I,W){if(W.multiline_frame||W.mode===l.ForInitializer||W.mode===l.Conditional)return;I.remove_indent(W.start_line_index)}function p(I){I=I.replace(a.allLineBreaks,`
|
|
`);for(var W=[],Q=I.indexOf(`
|
|
`);Q!==-1;)W.push(I.substring(0,Q)),I=I.substring(Q+1),Q=I.indexOf(`
|
|
`);return I.length&&W.push(I),W}function T(I){return I===l.ArrayLiteral}function L(I){return t(I,[l.Expression,l.ForInitializer,l.Conditional])}function D(I,W){for(var Q=0;Q<I.length;Q++){var fe=I[Q].trim();if(fe.charAt(0)!==W)return!1}return!0}function x(I,W){for(var Q=0,fe=I.length,le;Q<fe;Q++)if(le=I[Q],le&&le.indexOf(W)!==0)return!1;return!0}function M(I,W){W=W||{},this._source_text=I||"",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 r(W)}M.prototype.create_flags=function(I,W){var Q=0;I&&(Q=I.indentation_level,!this._output.just_added_newline()&&I.line_indent_level>Q&&(Q=I.line_indent_level));var fe={mode:W,parent:I,last_token:I?I.last_token:new o(i.START_BLOCK,""),last_word:I?I.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:Q,alignment:0,line_indent_level:I?I.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return fe},M.prototype._reset=function(I){var W=I.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new d(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(l.BlockStatement);var Q=new h(I,this._options);return this._tokens=Q.tokenize(),I},M.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var I,W=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=`
|
|
`,W&&a.lineBreak.test(W||"")&&(Q=W.match(a.lineBreak)[0]));for(var fe=this._tokens.next();fe;)this.handle_token(fe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=fe,fe=this._tokens.next();return I=this._output.get_code(Q),I},M.prototype.handle_token=function(I,W){I.type===i.START_EXPR?this.handle_start_expr(I):I.type===i.END_EXPR?this.handle_end_expr(I):I.type===i.START_BLOCK?this.handle_start_block(I):I.type===i.END_BLOCK?this.handle_end_block(I):I.type===i.WORD?this.handle_word(I):I.type===i.RESERVED?this.handle_word(I):I.type===i.SEMICOLON?this.handle_semicolon(I):I.type===i.STRING?this.handle_string(I):I.type===i.EQUALS?this.handle_equals(I):I.type===i.OPERATOR?this.handle_operator(I):I.type===i.COMMA?this.handle_comma(I):I.type===i.BLOCK_COMMENT?this.handle_block_comment(I,W):I.type===i.COMMENT?this.handle_comment(I,W):I.type===i.DOT?this.handle_dot(I):I.type===i.EOF?this.handle_eof(I):I.type===i.UNKNOWN?this.handle_unknown(I,W):this.handle_unknown(I,W)},M.prototype.handle_whitespace_and_comments=function(I,W){var Q=I.newlines,fe=this._options.keep_array_indentation&&T(this._flags.mode);if(I.comments_before)for(var le=I.comments_before.next();le;)this.handle_whitespace_and_comments(le,W),this.handle_token(le,W),le=I.comments_before.next();if(fe)for(var Ce=0;Ce<Q;Ce+=1)this.print_newline(Ce>0,W);else if(this._options.max_preserve_newlines&&Q>this._options.max_preserve_newlines&&(Q=this._options.max_preserve_newlines),this._options.preserve_newlines&&Q>1){this.print_newline(!1,W);for(var Oe=1;Oe<Q;Oe+=1)this.print_newline(!0,W)}};var j=["async","break","continue","return","throw","yield"];M.prototype.allow_wrap_or_preserved_newline=function(I,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var Q=this._options.preserve_newlines&&I.newlines||W,fe=t(this._flags.last_token.text,n)||t(I.text,n);if(fe){var le=t(this._flags.last_token.text,n)&&t(this._options.operator_position,u)||t(I.text,n);Q=Q&&le}if(Q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(E(this._flags.last_token,j))return;this._output.set_wrap_point()}},M.prototype.print_newline=function(I,W){if(!W&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Q=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&g(Q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(I)&&(this._flags.multiline_frame=!0)},M.prototype.print_token_line_indentation=function(I){this._output.just_added_newline()&&(this._options.keep_array_indentation&&I.newlines&&(I.text==="["||T(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(I.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))},M.prototype.print_token=function(I){if(this._output.raw){this._output.add_raw_token(I);return}if(this._options.comma_first&&I.previous&&I.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(I),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(I),this._output.non_breaking_space=!0,this._output.add_token(I.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},M.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.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))},M.prototype.set_mode=function(I){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,I),this._flags=this.create_flags(this._previous_flags,I),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},M.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===l.Statement&&v(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},M.prototype.start_of_object_property=function(){return this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"]))},M.prototype.start_of_statement=function(I){var W=!1;return W=W||E(this._flags.last_token,["var","let","const"])&&I.type===i.WORD,W=W||g(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement)&&E(this._flags.last_token,j)&&!I.newlines,W=W||g(this._flags.last_token,"else")&&!(g(I,"if")&&!I.comments_before),W=W||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===l.ForInitializer||this._previous_flags.mode===l.Conditional),W=W||this._flags.last_token.type===i.WORD&&this._flags.mode===l.BlockStatement&&!this._flags.in_case&&!(I.text==="--"||I.text==="++")&&this._last_last_text!=="function"&&I.type!==i.WORD&&I.type!==i.RESERVED,W=W||this._flags.mode===l.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"])),W?(this.set_mode(l.Statement),this.indent(),this.handle_whitespace_and_comments(I,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I,E(I,["do","for","if","while"])),!0):!1},M.prototype.handle_start_expr=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I);var W=l.Expression;if(I.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){E(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(I),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=l.ArrayLiteral,T(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,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=l.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=l.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&I.whitespace_before===""?this._output.space_before_token=!1:(t(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var fe=this._tokens.peek(-4);E(Q,["async","function"])||Q.text==="*"&&E(fe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===l.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(fe.text==="{"||fe.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(I);(this._flags.last_token.type===i.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===l.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===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(I,I.newlines),this.print_token(I),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},M.prototype.handle_end_expr=function(I){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(I,I.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(I),this.restore_mode(),v(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===l.Conditional&&(this._previous_flags.mode=l.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},M.prototype.handle_start_block=function(I){this.handle_whitespace_and_comments(I);var W=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(l.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(l.BlockStatement):Q&&(t(Q.text,[":",","])&&t(W.type,[i.STRING,i.WORD,i.RESERVED])||t(W.text,["get","set","..."])&&t(Q.type,[i.WORD,i.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(Q.text,[":",","])?this.set_mode(l.BlockStatement):this.set_mode(l.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(l.BlockStatement):t(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||E(this._flags.last_token,["return","throw","import","default"])?this.set_mode(l.ObjectLiteral):this.set_mode(l.BlockStatement),this._flags.last_token&&(E(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var fe=!W.comments_before&&W.text==="}",le=fe&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Ce=0,Oe=null;this._flags.inline_frame=!0;do if(Ce+=1,Oe=this._tokens.peek(Ce-1),Oe.newlines){this._flags.inline_frame=!1;break}while(Oe.type!==i.EOF&&!(Oe.type===i.END_BLOCK&&Oe.opened===I))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(le||this._flags.last_token.type===i.EQUALS||E(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(I),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(I),this.indent(),!fe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},M.prototype.handle_end_block=function(I){for(this.handle_whitespace_and_comments(I);this._flags.mode===l.Statement;)this.restore_mode();var W=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(T(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(I)},M.prototype.handle_word=function(I){if(I.type===i.RESERVED){if(t(I.text,["set","get"])&&this._flags.mode!==l.ObjectLiteral)I.type=i.WORD;else if(I.text==="import"&&t(this._tokens.peek().text,["(","."]))I.type=i.WORD;else if(t(I.text,["as","from"])&&!this._flags.import_block)I.type=i.WORD;else if(this._flags.mode===l.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(I.type=i.WORD)}}if(this.start_of_statement(I)?E(this._flags.last_token,["var","let","const"])&&I.type===i.WORD&&(this._flags.declaration_statement=!0):I.newlines&&!L(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!E(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(I),this.print_newline()):this.handle_whitespace_and_comments(I),this._flags.do_block&&!this._flags.do_while)if(g(I,"while")){this._output.space_before_token=!0,this.print_token(I),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&&g(I,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===l.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&E(I,["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(I),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I)),g(I,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!I.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?E(this._flags.last_token,["get","set","new","export"])||E(this._flags.last_token,j)?this._output.space_before_token=!0:g(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(L(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(I),this._flags.last_word=I.text;return}var Q="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":E(I,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===l.BlockStatement?Q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&L(this._flags.mode)?Q="SPACE":this._flags.last_token.type===i.STRING?Q="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&t(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),E(I,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Q="SPACE":Q="NEWLINE"),E(I,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===l.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var fe=this._output.current_line;fe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?E(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&E(I,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!E(I,["var","let","const"]))&&this._flags.last_token.text!==":"&&(g(I,"if")&&g(I.previous,"else")?this._output.space_before_token=!0:this.print_newline()):E(I,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);I.previous&&(I.previous.type===i.WORD||I.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(I),this._flags.last_word=I.text,I.type===i.RESERVED&&(I.text==="do"?this._flags.do_block=!0:I.text==="if"?this._flags.if_block=!0:I.text==="import"?this._flags.import_block=!0:this._flags.import_block&&g(I,"from")&&(this._flags.import_block=!1))},M.prototype.handle_semicolon=function(I){this.start_of_statement(I)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(I);for(var W=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&g(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(I)},M.prototype.handle_string=function(I){I.text.startsWith("`")&&I.newlines===0&&I.whitespace_before===""&&(I.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(I)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(I),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I):I.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(I.previous.text==="]"||I.previous.text===")")&&I.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(I)},M.prototype.handle_equals=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0},M.prototype.handle_comma=function(I){this.handle_whitespace_and_comments(I,!0),this.print_token(I),this._output.space_before_token=!0,this._flags.declaration_statement?(L(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(I)):this._flags.mode===l.ObjectLiteral||this._flags.mode===l.Statement&&this._flags.parent.mode===l.ObjectLiteral?(this._flags.mode===l.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(I)},M.prototype.handle_operator=function(I){var W=I.text==="*"&&(E(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),Q=t(I.text,["-","+"])&&(t(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||t(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(I)){var fe=!W;this.handle_whitespace_and_comments(I,fe)}if(I.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(I);return}if(I.text==="::"){this.print_token(I);return}if(this._flags.last_token.type===i.OPERATOR&&t(this._options.operator_position,u)&&this.allow_wrap_or_preserved_newline(I),I.text===":"&&this._flags.in_case){this.print_token(I),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var le=!0,Ce=!0,Oe=!1;if(I.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,Oe=!0):I.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!W&&this._options.preserve_newlines&&t(I.text,n)){var Re=I.text===":",Le=Re&&Oe,Pe=Re&&!Oe;switch(this._options.operator_position){case c.before_newline:this._output.space_before_token=!Pe,this.print_token(I),(!Re||Le)&&this.allow_wrap_or_preserved_newline(I),this._output.space_before_token=!0;return;case c.after_newline:this._output.space_before_token=!0,!Re||Le?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(I):this._output.space_before_token=!1,this.print_token(I),this._output.space_before_token=!0;return;case c.preserve_newline:Pe||this.allow_wrap_or_preserved_newline(I),le=!(this._output.just_added_newline()||Pe),this._output.space_before_token=le,this.print_token(I),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(I),le=!1;var _e=this._tokens.peek();Ce=_e&&t(_e.type,[i.WORD,i.RESERVED])}else if(I.text==="...")this.allow_wrap_or_preserved_newline(I),le=this._flags.last_token.type===i.START_BLOCK,Ce=!1;else if(t(I.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(I),le=!1,Ce=!1,I.newlines&&(I.text==="--"||I.text==="++"||I.text==="~")){var N=E(this._flags.last_token,_)&&I.newlines;N&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(N,!0)}this._flags.last_token.text===";"&&L(this._flags.mode)&&(le=!0),this._flags.last_token.type===i.RESERVED?le=!0:this._flags.last_token.type===i.END_EXPR?le=!(this._flags.last_token.text==="]"&&(I.text==="--"||I.text==="++")):this._flags.last_token.type===i.OPERATOR&&(le=t(I.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(I.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(Ce=!0)),(this._flags.mode===l.BlockStatement&&!this._flags.inline_frame||this._flags.mode===l.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||le,this.print_token(I),this._output.space_before_token=Ce},M.prototype.handle_block_comment=function(I,W){if(this._output.raw){this._output.add_raw_token(I),I.directives&&I.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(I.directives){this.print_newline(!1,W),this.print_token(I),I.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(I.text)&&!I.newlines){this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0;return}else this.print_block_commment(I,W)},M.prototype.print_block_commment=function(I,W){var Q=p(I.text),fe,le=!1,Ce=!1,Oe=I.whitespace_before,Re=Oe.length;if(this.print_newline(!1,W),this.print_token_line_indentation(I),this._output.add_token(Q[0]),this.print_newline(!1,W),Q.length>1){for(Q=Q.slice(1),le=D(Q,"*"),Ce=x(Q,Oe),le&&(this._flags.alignment=1),fe=0;fe<Q.length;fe++)le?(this.print_token_line_indentation(I),this._output.add_token(b(Q[fe]))):Ce&&Q[fe]?(this.print_token_line_indentation(I),this._output.add_token(Q[fe].substring(Re))):(this._output.current_line.set_indent(-1),this._output.add_token(Q[fe])),this.print_newline(!1,W);this._flags.alignment=0}},M.prototype.handle_comment=function(I,W){I.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(I),this.print_newline(!1,W)},M.prototype.handle_dot=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),E(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(I,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(I)},M.prototype.handle_unknown=function(I,W){this.print_token(I),I.text[I.text.length-1]===`
|
|
`&&this.print_newline(!1,W)},M.prototype.handle_eof=function(I){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I)},e.exports.Beautifier=M},function(e){function S(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}S.prototype.clone_empty=function(){var o=new S(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},S.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},S.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},S.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},S.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)},S.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},S.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},S.prototype.is_empty=function(){return this.__items.length===0},S.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},S.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},S.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},S.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},S.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},S.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},S.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function f(o,a){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}f.prototype.get_indent_size=function(o,a){var r=this.__base_string_length;return a=a||0,o<0&&(r=0),r+=o*this.__indent_size,r+=a,r},f.prototype.get_indent_string=function(o,a){var r=this.__base_string;return a=a||0,o<0&&(o=0,r=""),a+=o*this.__indent_size,this.__ensure_cache(a),r+=this.__cache[a],r},f.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var o=this.__cache.length,a=0,r="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,r=new Array(a+1).join(this.__indent_string)),o&&(r+=new Array(o+1).join(" ")),this.__cache.push(r)};function d(o,a){this.__indent_cache=new f(o,a),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new S(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(o,a){return this.__indent_cache.get_indent_string(o,a)},d.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(r=r.replace(/[\n]/g,o)),r},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.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(" "))},d.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(o,a){for(var r=this.__lines.length-2;r>=0;){var h=this.__lines[r];if(h.is_empty())break;if(h.item(0).indexOf(o)!==0&&h.item(-1)!==a){this.__lines.splice(r+1,0,new S(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=d},function(e){function S(f,d,o,a){this.type=f,this.text=d,this.comments_before=null,this.newlines=o||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=S},function(e,S){var f="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",o="\\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",a="\\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",r="(?:\\\\u[0-9a-fA-F]{4}|["+f+o+"])",h="(?:\\\\u[0-9a-fA-F]{4}|["+d+o+a+"])*";S.identifier=new RegExp(r+h,"g"),S.identifierStart=new RegExp(r),S.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+d+o+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;S.newline=/[\n\r\u2028\u2029]/,S.lineBreak=new RegExp(`\r
|
|
|`+S.newline.source),S.allLineBreaks=new RegExp(S.lineBreak.source,"g")},function(e,S,f){var d=f(6).Options,o=["before-newline","after-newline","preserve-newline"];function a(r){d.call(this,r,"js");var h=this.raw_options.brace_style||null;h==="expand-strict"?this.raw_options.brace_style="expand":h==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=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<s.length;n++)s[n]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[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",o),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new d,e.exports.Options=a},function(e){function S(o,a){this.raw_options=f(o,a),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"])}S.prototype._get_array=function(o,a){var r=this.raw_options[o],h=a||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(h=r.concat()):typeof r=="string"&&(h=r.split(/[^a-zA-Z0-9_\/\-]+/)),h},S.prototype._get_boolean=function(o,a){var r=this.raw_options[o],h=r===void 0?!!a:!!r;return h},S.prototype._get_characters=function(o,a){var r=this.raw_options[o],h=a||"";return typeof r=="string"&&(h=r.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},S.prototype._get_number=function(o,a){var r=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var h=parseInt(r,10);return isNaN(h)&&(h=a),h},S.prototype._get_selection=function(o,a,r){var h=this._get_selection_list(o,a,r);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h[0]},S.prototype._get_selection_list=function(o,a,r){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[a[0]],!this._is_valid_selection(r,a))throw new Error("Invalid Default Value!");var h=this._get_array(o,r);if(!this._is_valid_selection(h,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h},S.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(r){return a.indexOf(r)===-1})};function f(o,a){var r={};o=d(o);var h;for(h in o)h!==a&&(r[h]=o[h]);if(a&&o[a])for(h in o[a])r[h]=o[a][h];return r}function d(o){var a={},r;for(r in o){var h=r.replace(/-/g,"_");a[h]=o[r]}return a}e.exports.Options=S,e.exports.normalizeOpts=d,e.exports.mergeOpts=f},function(e,S,f){var d=f(8).InputScanner,o=f(9).Tokenizer,a=f(9).TOKEN,r=f(13).Directives,h=f(4),s=f(12).Pattern,n=f(14).TemplatablePattern;function i(D,x){return x.indexOf(D)!==-1}var t={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},b=new r(/\/\*/,/\*\//),m=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,g=/[0-9]/,E=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),y=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";y=y.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),y="\\?\\.(?!\\d) "+y,y=y.replace(/ /g,"|");var c=new RegExp(y),u="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),l=u.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),v=new RegExp("^(?:"+l.join("|")+")$"),p,T=function(D,x){o.call(this,D,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var M=new s(this._input),j=new n(this._input).read_options(this._options);this.__patterns={template:j,identifier:j.starting_with(h.identifier).matching(h.identifierMatch),number:M.matching(m),punct:M.matching(c),comment:M.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:M.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:M.matching(/<!--/),html_comment_end:M.matching(/-->/),include:M.starting_with(/#include/).until_after(h.lineBreak),shebang:M.starting_with(/#!/).until_after(h.lineBreak),xml:M.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:j.until(/['\\\n\r\u2028\u2029]/),double_quote:j.until(/["\\\n\r\u2028\u2029]/),template_text:j.until(/[`\\$]/),template_expression:j.until(/[`}\\]/)}};T.prototype=new o,T.prototype._is_comment=function(D){return D.type===t.COMMENT||D.type===t.BLOCK_COMMENT||D.type===t.UNKNOWN},T.prototype._is_opening=function(D){return D.type===t.START_BLOCK||D.type===t.START_EXPR},T.prototype._is_closing=function(D,x){return(D.type===t.END_BLOCK||D.type===t.END_EXPR)&&x&&(D.text==="]"&&x.text==="["||D.text===")"&&x.text==="("||D.text==="}"&&x.text==="{")},T.prototype._reset=function(){p=!1},T.prototype._get_next_token=function(D,x){var M=null;this._readWhitespace();var j=this._input.peek();return j===null?this._create_token(t.EOF,""):(M=M||this._read_non_javascript(j),M=M||this._read_string(j),M=M||this._read_word(D),M=M||this._read_singles(j),M=M||this._read_comment(j),M=M||this._read_regexp(j,D),M=M||this._read_xml(j,D),M=M||this._read_punctuation(),M=M||this._create_token(t.UNKNOWN,this._input.next()),M)},T.prototype._read_word=function(D){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(h.allLineBreaks,`
|
|
`),!(D.type===t.DOT||D.type===t.RESERVED&&(D.text==="set"||D.text==="get"))&&v.test(x)?(x==="in"||x==="of")&&(D.type===t.WORD||D.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)},T.prototype._read_singles=function(D){var x=null;return D==="("||D==="["?x=this._create_token(t.START_EXPR,D):D===")"||D==="]"?x=this._create_token(t.END_EXPR,D):D==="{"?x=this._create_token(t.START_BLOCK,D):D==="}"?x=this._create_token(t.END_BLOCK,D):D===";"?x=this._create_token(t.SEMICOLON,D):D==="."&&E.test(this._input.peek(1))?x=this._create_token(t.DOT,D):D===","&&(x=this._create_token(t.COMMA,D)),x&&this._input.next(),x},T.prototype._read_punctuation=function(){var D=this.__patterns.punct.read();if(D!=="")return D==="="?this._create_token(t.EQUALS,D):D==="?."?this._create_token(t.DOT,D):this._create_token(t.OPERATOR,D)},T.prototype._read_non_javascript=function(D){var x="";if(D==="#"){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()+`
|
|
`);D=this._input.next();var M="#";if(this._input.hasNext()&&this._input.testChar(g)){do D=this._input.next(),M+=D;while(this._input.hasNext()&&D!=="#"&&D!=="=");return D==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(M+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(M+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,M)}this._input.back()}else if(D==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(h.newline);)x+=this._input.next();return p=!0,this._create_token(t.COMMENT,x)}}else if(p&&D==="-"&&(x=this.__patterns.html_comment_end.read(),x))return p=!1,this._create_token(t.COMMENT,x);return null},T.prototype._read_comment=function(D){var x=null;if(D==="/"){var M="";if(this._input.peek(1)==="*"){M=this.__patterns.block_comment.read();var j=b.get_directives(M);j&&j.ignore==="start"&&(M+=b.readIgnored(this._input)),M=M.replace(h.allLineBreaks,`
|
|
`),x=this._create_token(t.BLOCK_COMMENT,M),x.directives=j}else this._input.peek(1)==="/"&&(M=this.__patterns.comment.read(),x=this._create_token(t.COMMENT,M))}return x},T.prototype._read_string=function(D){if(D==="`"||D==="'"||D==='"'){var x=this._input.next();return this.has_char_escapes=!1,D==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(D),this.has_char_escapes&&this._options.unescape_strings&&(x=L(x)),this._input.peek()===D&&(x+=this._input.next()),x=x.replace(h.allLineBreaks,`
|
|
`),this._create_token(t.STRING,x)}return null},T.prototype._allow_regexp_or_xml=function(D){return D.type===t.RESERVED&&i(D.text,["return","case","throw","else","do","typeof","yield"])||D.type===t.END_EXPR&&D.text===")"&&D.opened.previous.type===t.RESERVED&&i(D.opened.previous.text,["if","while","for"])||i(D.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},T.prototype._read_regexp=function(D,x){if(D==="/"&&this._allow_regexp_or_xml(x)){for(var M=this._input.next(),j=!1,I=!1;this._input.hasNext()&&(j||I||this._input.peek()!==D)&&!this._input.testChar(h.newline);)M+=this._input.peek(),j?j=!1:(j=this._input.peek()==="\\",this._input.peek()==="["?I=!0:this._input.peek()==="]"&&(I=!1)),this._input.next();return this._input.peek()===D&&(M+=this._input.next(),M+=this._input.read(h.identifier)),this._create_token(t.STRING,M)}return null},T.prototype._read_xml=function(D,x){if(this._options.e4x&&D==="<"&&this._allow_regexp_or_xml(x)){var M="",j=this.__patterns.xml.read_match();if(j){for(var I=j[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=I.indexOf("{")===0,Q=0;j;){var fe=!!j[1],le=j[2],Ce=!!j[j.length-1]||le.slice(0,8)==="![CDATA[";if(!Ce&&(le===I||W&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(fe?--Q:++Q),M+=j[0],Q<=0)break;j=this.__patterns.xml.read_match()}return j||(M+=this._input.match(/[\s\S]*/g)[0]),M=M.replace(h.allLineBreaks,`
|
|
`),this._create_token(t.STRING,M)}}return null};function L(D){for(var x="",M=0,j=new d(D),I=null;j.hasNext();)if(I=j.match(/([\s]|[^\\]|\\\\)+/g),I&&(x+=I[0]),j.peek()==="\\"){if(j.next(),j.peek()==="x")I=j.match(/x([0-9A-Fa-f]{2})/g);else if(j.peek()==="u")I=j.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",j.hasNext()&&(x+=j.next());continue}if(!I)return D;if(M=parseInt(I[1],16),M>126&&M<=255&&I[0].indexOf("x")===0)return D;if(M>=0&&M<32){x+="\\"+I[0];continue}else M===34||M===39||M===92?x+="\\"+String.fromCharCode(M):x+=String.fromCharCode(M)}return x}T.prototype._read_string_recursive=function(D,x,M){var j,I;D==="'"?I=this.__patterns.single_quote:D==='"'?I=this.__patterns.double_quote:D==="`"?I=this.__patterns.template_text:D==="}"&&(I=this.__patterns.template_expression);for(var W=I.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===D||!x&&h.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(j=this._input.peek(),j==="x"||j==="u"?this.has_char_escapes=!0:j==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Q+=this._input.next()):M&&(M==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),M===Q&&(D==="`"?Q+=this._read_string_recursive("}",x,"`"):Q+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=I.read(),W+=Q}return W},e.exports.Tokenizer=T,e.exports.TOKEN=t,e.exports.positionable_operators=_.slice(),e.exports.line_starters=u.slice()},function(e){var S=RegExp.prototype.hasOwnProperty("sticky");function f(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},f.prototype.peek=function(d){var o=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(o=this.__input.charAt(d)),o},f.prototype.__match=function(d,o){d.lastIndex=o;var a=d.exec(this.__input);return a&&!(S&&d.sticky)&&(a.index!==o&&(a=null)),a},f.prototype.test=function(d,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(d,o):!1},f.prototype.testChar=function(d,o){var a=this.peek(o);return d.lastIndex=0,a!==null&&d.test(a)},f.prototype.match=function(d){var o=this.__match(d,this.__position);return o?this.__position+=o[0].length:o=null,o},f.prototype.read=function(d,o,a){var r="",h;return d&&(h=this.match(d),h&&(r+=h[0])),o&&(h||!d)&&(r+=this.readUntil(o,a)),r},f.prototype.readUntil=function(d,o){var a="",r=this.__position;d.lastIndex=this.__position;var h=d.exec(this.__input);return h?(r=h.index,o&&(r+=h[0].length)):r=this.__input_length,a=this.__input.substring(this.__position,r),this.__position=r,a},f.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},f.prototype.get_regexp=function(d,o){var a=null,r="g";return o&&S&&(r="y"),typeof d=="string"&&d!==""?a=new RegExp(d,r):d&&(a=new RegExp(d.source,r)),a},f.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(d){var o=this.__position,a=this.readUntilAfter(d);return this.__position=o,a},f.prototype.lookBack=function(d){var o=this.__position-1;return o>=d.length&&this.__input.substring(o-d.length,o).toLowerCase()===d},e.exports.InputScanner=f},function(e,S,f){var d=f(8).InputScanner,o=f(3).Token,a=f(10).TokenStream,r=f(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(n,i){this._input=new d(n),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var n,i=new o(h.START,""),t=null,b=[],m=new a;i.type!==h.EOF;){for(n=this._get_next_token(i,t);this._is_comment(n);)m.add(n),n=this._get_next_token(i,t);m.isEmpty()||(n.comments_before=m,m=new a),n.parent=t,this._is_opening(n)?(b.push(t),t=n):t&&this._is_closing(n,t)&&(n.opened=t,t.closed=n,t=b.pop(),n.parent=t),n.previous=i,i.next=n,this.__tokens.add(n),i=n}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(n,i){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(h.RAW,t):this._create_token(h.EOF,"")},s.prototype._is_comment=function(n){return!1},s.prototype._is_opening=function(n){return!1},s.prototype._is_closing=function(n,i){return!1},s.prototype._create_token=function(n,i){var t=new o(n,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return t},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=s,e.exports.TOKEN=h},function(e){function S(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}S.prototype.restart=function(){this.__position=0},S.prototype.isEmpty=function(){return this.__tokens_length===0},S.prototype.hasNext=function(){return this.__position<this.__tokens_length},S.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__tokens[this.__position],this.__position+=1),f},S.prototype.peek=function(f){var d=null;return f=f||0,f+=this.__position,f>=0&&f<this.__tokens_length&&(d=this.__tokens[f]),d},S.prototype.add=function(f){this.__parent_token&&(f.parent=this.__parent_token),this.__tokens.push(f),this.__tokens_length+=1},e.exports.TokenStream=S},function(e,S,f){var d=f(12).Pattern;function o(a,r){d.call(this,a,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new d,o.prototype.__set_whitespace_patterns=function(a,r){a+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var r=this.__split(this._newline_regexp,a);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return a},o.prototype.matching=function(a,r){var h=this._create();return h.__set_whitespace_patterns(a,r),h._update(),h},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(a,r){a.lastIndex=0;for(var h=0,s=[],n=a.exec(r);n;)s.push(r.substring(h,n.index)),h=n.index+n[0].length,n=a.exec(r);return h<r.length?s.push(r.substring(h,r.length)):s.push(""),s},e.exports.WhitespacePattern=o},function(e){function S(f,d){this._input=f,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,d&&(this._starting_pattern=this._input.get_regexp(d._starting_pattern,!0),this._match_pattern=this._input.get_regexp(d._match_pattern,!0),this._until_pattern=this._input.get_regexp(d._until_pattern),this._until_after=d._until_after)}S.prototype.read=function(){var f=this._input.read(this._starting_pattern);return(!this._starting_pattern||f)&&(f+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),f},S.prototype.read_match=function(){return this._input.match(this._match_pattern)},S.prototype.until_after=function(f){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(f),d._update(),d},S.prototype.until=function(f){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(f),d._update(),d},S.prototype.starting_with=function(f){var d=this._create();return d._starting_pattern=this._input.get_regexp(f,!0),d._update(),d},S.prototype.matching=function(f){var d=this._create();return d._match_pattern=this._input.get_regexp(f,!0),d._update(),d},S.prototype._create=function(){return new S(this._input,this)},S.prototype._update=function(){},e.exports.Pattern=S},function(e){function S(f,d){f=typeof f=="string"?f:f.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+d,"g")}S.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(f);o;)d[o[1]]=o[2],o=this.__directive_pattern.exec(f);return d},S.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=S},function(e,S,f){var d=f(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(r,h){d.call(this,r,h),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),h&&(this.__template_pattern=this._input.get_regexp(h.__template_pattern),this._excluded=Object.assign(this._excluded,h._excluded),this._disabled=Object.assign(this._disabled,h._disabled));var s=new d(r);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new d,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(r){var h=this._create();return h._disabled[r]=!0,h._update(),h},a.prototype.read_options=function(r){var h=this._create();for(var s in o)h._disabled[s]=r.templating.indexOf(s)===-1;return h._update(),h},a.prototype.exclude=function(r){var h=this._create();return h._excluded[r]=!0,h._update(),h},a.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),r+=h,h=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},a.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},a.prototype._read_template=function(){var r="",h=this._input.peek();if(h==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(r=r||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},e.exports.TemplatablePattern=a}],R={};function H(e){var S=R[e];if(S!==void 0)return S.exports;var f=R[e]={exports:{}};return w[e](f,f.exports,H),f.exports}var U=H(0);A=U})();var k=A;!(ae=[],B=function(){return{js_beautify:k}}.apply(be,ae),B!==void 0&&(Je.exports=B))})()},"746U":function(Je,be,V){"use strict";V.d(be,"f",function(){return ae}),V.d(be,"l",function(){return B}),V.d(be,"k",function(){return A}),V.d(be,"j",function(){return k}),V.d(be,"g",function(){return w}),V.d(be,"m",function(){return R}),V.d(be,"h",function(){return H}),V.d(be,"n",function(){return U}),V.d(be,"c",function(){return e}),V.d(be,"a",function(){return S}),V.d(be,"i",function(){return f}),V.d(be,"o",function(){return d}),V.d(be,"e",function(){return r}),V.d(be,"d",function(){return h}),V.d(be,"p",function(){return s}),V.d(be,"b",function(){return n});function ae(i){return Array.isArray(i)}function B(i){return typeof i=="string"}function A(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function k(i){return typeof i=="number"&&!isNaN(i)}function w(i){return i===!0||i===!1}function R(i){return typeof i=="undefined"}function H(i){return!U(i)}function U(i){return R(i)||i===null}function e(i,t){if(!i)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function S(i){if(U(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function f(i){return typeof i=="function"}function d(i,t){const b=Math.min(i.length,t.length);for(let m=0;m<b;m++)o(i[m],t[m])}function o(i,t){if(B(t)){if(typeof i!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(f(t)){try{if(i instanceof t)return}catch(b){}if(!U(i)&&i.constructor===t)return;if(t.length===1&&t.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(i){let t=[],b=Object.getPrototypeOf(i);for(;Object.prototype!==b;)t=t.concat(Object.getOwnPropertyNames(b)),b=Object.getPrototypeOf(b);return t}function r(i){const t=[];for(const b of a(i))typeof i[b]=="function"&&t.push(b);return t}function h(i,t){const b=g=>function(){const E=Array.prototype.slice.call(arguments,0);return t(g,E)};let m={};for(const g of i)m[g]=b(g);return m}function s(i){return i===null?void 0:i}function n(i,t="Unreachable"){throw new Error(t)}},"8HAY":function(Je,be,V){"use strict";V.d(be,"a",function(){return w}),V.d(be,"b",function(){return R}),V.d(be,"d",function(){return H}),V.d(be,"e",function(){return U}),V.d(be,"c",function(){return e});var ae=V("MI8n"),B=V("pmY6"),A=V("3/fG"),k=function(S,f,d,o){function a(r){return r instanceof d?r:new d(function(h){h(r)})}return new(d||(d=Promise))(function(r,h){function s(t){try{i(o.next(t))}catch(b){h(b)}}function n(t){try{i(o.throw(t))}catch(b){h(b)}}function i(t){t.done?r(t.value):a(t.value).then(s,n)}i((o=o.apply(S,f||[])).next())})};class w extends B.a{constructor(S,f="",d="",o=!0,a){super();this._onDidChange=this._register(new ae.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=S,this._label=f,this._cssClass=d,this._enabled=o,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(S){this._setLabel(S)}_setLabel(S){this._label!==S&&(this._label=S,this._onDidChange.fire({label:S}))}get tooltip(){return this._tooltip||""}set tooltip(S){this._setTooltip(S)}_setTooltip(S){this._tooltip!==S&&(this._tooltip=S,this._onDidChange.fire({tooltip:S}))}get class(){return this._cssClass}set class(S){this._setClass(S)}_setClass(S){this._cssClass!==S&&(this._cssClass=S,this._onDidChange.fire({class:S}))}get enabled(){return this._enabled}set enabled(S){this._setEnabled(S)}_setEnabled(S){this._enabled!==S&&(this._enabled=S,this._onDidChange.fire({enabled:S}))}get checked(){return this._checked}set checked(S){this._setChecked(S)}_setChecked(S){this._checked!==S&&(this._checked=S,this._onDidChange.fire({checked:S}))}run(S,f){return k(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(S))})}}class R extends B.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ae.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ae.b),this.onDidRun=this._onDidRun.event}run(S,f){return k(this,void 0,void 0,function*(){if(!S.enabled)return;this._onBeforeRun.fire({action:S});let d;try{yield this.runAction(S,f)}catch(o){d=o}this._onDidRun.fire({action:S,error:d})})}runAction(S,f){return k(this,void 0,void 0,function*(){yield S.run(f)})}}class H extends w{constructor(S){super(H.ID,S,S?"separator text":"separator");this.checked=!1,this.enabled=!1}}H.ID="vs.actions.separator";class U{constructor(S,f,d,o){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=S,this.label=f,this.class=o,this._actions=d}get actions(){return this._actions}dispose(){}run(){return k(this,void 0,void 0,function*(){})}}class e extends w{constructor(){super(e.ID,A.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(Je,be,V){Je.exports={button:"button___1wy9m"}},"9Bee":function(Je,be,V){"use strict";var ae=V("DYRE"),B=V("zeV3"),A=V("+L6B"),k=V("2/Rp"),w=V("k1fw"),R=V("9og8"),H=V("tJVT"),U=V("WmNS"),e=V.n(U),S=V("q1tI"),f=V.n(S),d=V("vg9a"),o=V("DlQD"),a=V.n(o),r=V("rUJ1");function h(q,K){var G=q.match(/^(\s+)(?:```)/);if(G===null)return K;var Z=G[1];return K.split(`
|
|
`).map(function(te){var X=te.match(/^\s+/);if(X===null)return te;var $=Object(H.a)(X,1),ne=$[0];return ne.length>=Z.length?te.slice(Z.length):te}).join(`
|
|
`)}var s=[],n=["<ul>"],i=new a.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){s.length=0,n=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function g(q,K,G,Z){if(K>=q.length||q[K].level<=G)return K;var te=q[K];Z.push("<li><a href='#"+te.anchor+"'>"+te.text+"</a>"),K++;var X=[];return K=g(q,K,te.level,X),X.length>0&&(Z.push("<ul>"),X.forEach(function($){Z.push($)}),Z.push("</ul>")),Z.push("</li>"),K=g(q,K,G,Z),K}function E(){return g(s,0,0,n),n.push("</ul>"),n.join("")}var _={heading:function(K){var G=t.exec(K);if(G)return{type:"heading",raw:G[0],depth:G[1].length,text:G[2]}},fences:function(K){var G=this.rules.block.fences.exec(K);if(G){var Z=G[0],te=h(Z,G[3]||""),X=G[2]?G[2].trim():G[2];if(["latex","katex","math"].indexOf(X)>=0){var $=u(),ne=te;te=$,l[$]={type:"block",expression:ne}}return{type:"code",raw:Z,lang:X,text:te}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,u=function(){return"__special_katext_id_".concat(c++,"__")},l={};function v(){return l}function p(){c=0,l={}}function T(q){return q=q.replace(y,function(K,G){var Z=u();return l[Z]={type:"inline",expression:G},Z}),q}var L=i.listitem;i.listitem=function(q){return L(T(q))};var D=i.paragraph;i.paragraph=function(q){return D(T(q))};var x=i.tablecell;i.tablecell=function(q,K){return x(T(q),K)},i.code=function(q,K,G){var Z=(K||"").match(/\S*/)[0];return Z?["latex","katex","math"].indexOf(Z)>=0?"<p class='editormd-tex'>".concat(q,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(K,'">').concat(G?q:Object(r.escape)(q,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(G?q:Object(r.escape)(q,!0))+"</code></pre>"},i.heading=function(q,K,G){var Z=this.options.headerPrefix+G.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:Z,level:K,text:q}),"<h"+K+' id="'+Z+'">'+q+"</h"+K+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:_,renderer:i});var M=a.a,j=V("SJMd"),I=V("ulZh"),W=V.n(I),Q=V("m3rI"),fe=V("Oy/b"),le=V("p5ED"),Ce=V("ErOA"),Oe=V("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 Re=function(q,K){return(Re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,Z){G.__proto__=Z}||function(G,Z){for(var te in Z)Object.prototype.hasOwnProperty.call(Z,te)&&(G[te]=Z[te])})(q,K)};function Le(q,K){if(typeof K!="function"&&K!==null)throw new TypeError("Class extends value "+String(K)+" is not a constructor or null");function G(){this.constructor=q}Re(q,K),q.prototype=K===null?Object.create(K):(G.prototype=K.prototype,new G)}function Pe(q,K,G,Z){return new(G||(G=Promise))(function(te,X){function $(Te){try{se(Z.next(Te))}catch(Ee){X(Ee)}}function ne(Te){try{se(Z.throw(Te))}catch(Ee){X(Ee)}}function se(Te){var Ee;Te.done?te(Te.value):(Ee=Te.value,Ee instanceof G?Ee:new G(function(De){De(Ee)})).then($,ne)}se((Z=Z.apply(q,K||[])).next())})}function _e(q,K){var G,Z,te,X,$={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return X={next:ne(0),throw:ne(1),return:ne(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function ne(se){return function(Te){return function(Ee){if(G)throw new TypeError("Generator is already executing.");for(;$;)try{if(G=1,Z&&(te=2&Ee[0]?Z.return:Ee[0]?Z.throw||((te=Z.return)&&te.call(Z),0):Z.next)&&!(te=te.call(Z,Ee[1])).done)return te;switch(Z=0,te&&(Ee=[2&Ee[0],te.value]),Ee[0]){case 0:case 1:te=Ee;break;case 4:return $.label++,{value:Ee[1],done:!1};case 5:$.label++,Z=Ee[1],Ee=[0];continue;case 7:Ee=$.ops.pop(),$.trys.pop();continue;default:if(!(te=$.trys,(te=te.length>0&&te[te.length-1])||Ee[0]!==6&&Ee[0]!==2)){$=0;continue}if(Ee[0]===3&&(!te||Ee[1]>te[0]&&Ee[1]<te[3])){$.label=Ee[1];break}if(Ee[0]===6&&$.label<te[1]){$.label=te[1],te=Ee;break}if(te&&$.label<te[2]){$.label=te[2],$.ops.push(Ee);break}te[2]&&$.ops.pop(),$.trys.pop();continue}Ee=K.call(q,$)}catch(De){Ee=[6,De],Z=0}finally{G=te=0}if(5&Ee[0])throw Ee[1];return{value:Ee[0]?Ee[1]:void 0,done:!0}}([se,Te])}}}var N=function(){function q(){}return q.addKey=function(K){q.key=K},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),O=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(K,G){for(var Z=0,te=G;Z<te.length;Z++){var X=te[Z],$=X[0],ne=X[1];K.setAttribute($,ne)}},q.createRect=function(K,G,Z){var te=document.createElementNS("http://www.w3.org/2000/svg","rect");return te.setAttribute("width",K.toString()),te.setAttribute("height",G.toString()),Z&&q.setAttributes(te,Z),te},q.createLine=function(K,G,Z,te,X){var $=document.createElementNS("http://www.w3.org/2000/svg","line");return $.setAttribute("x1",K.toString()),$.setAttribute("y1",G.toString()),$.setAttribute("x2",Z.toString()),$.setAttribute("y2",te.toString()),X&&q.setAttributes($,X),$},q.createPolygon=function(K,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Z.setAttribute("points",K),G&&q.setAttributes(Z,G),Z},q.createCircle=function(K,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","circle");return Z.setAttribute("cx",(K/2).toString()),Z.setAttribute("cy",(K/2).toString()),Z.setAttribute("r",K.toString()),G&&q.setAttributes(Z,G),Z},q.createEllipse=function(K,G,Z){var te=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return te.setAttribute("cx",(K/2).toString()),te.setAttribute("cy",(G/2).toString()),te.setAttribute("rx",(K/2).toString()),te.setAttribute("ry",(G/2).toString()),Z&&q.setAttributes(te,Z),te},q.createGroup=function(K){var G=document.createElementNS("http://www.w3.org/2000/svg","g");return K&&q.setAttributes(G,K),G},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(K,G,Z,te,X,$,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(se,[["id",K],["orient",G],["markerWidth",Z.toString()],["markerHeight",te.toString()],["refX",X.toString()],["refY",$.toString()]]),se.appendChild(ne),se},q.createText=function(K){var G=document.createElementNS("http://www.w3.org/2000/svg","text");return G.setAttribute("x","0"),G.setAttribute("y","0"),K&&q.setAttributes(G,K),G},q.createTSpan=function(K,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Z.textContent=K,G&&q.setAttributes(Z,G),Z},q.createImage=function(K){var G=document.createElementNS("http://www.w3.org/2000/svg","image");return K&&q.setAttributes(G,K),G},q.createPoint=function(K,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Z.x=K,Z.y=G,Z},q.createPath=function(K,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","path");return Z.setAttribute("d",K),G&&q.setAttributes(Z,G),Z},q.createElement=function(K,G){var Z=document.createElementNS("http://www.w3.org/2000/svg",K);return G&&q.setAttributes(Z,G),Z},q.getHollowRectanglePath=function(K,G,Z,te,X,$,ne,se){return"M"+K+","+G+"V"+(G+te)+"H"+(K+Z)+"V"+G+"H"+X+"V"+$+"H"+(X+ne)+"V"+($+se)+"H"+X+"V"+G+"Z"},q}(),C=function(){function q(K){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+K+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(K){return this.styleSheet===void 0&&this.addStyleSheet(),K.name=""+this.classNamePrefix+K.localName,this.classes.push(K),this.styleSheet.sheet.insertRule("."+K.name+" {"+K.style+"}",this.styleSheet.sheet.cssRules.length),K},q.prototype.addRule=function(K){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(K),this.styleSheet.sheet.insertRule(K.selector+" {"+K.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var K;this.styleSheet=document.createElement("style"),((K=this.styleSheetRoot)!==null&&K!==void 0?K:document.head).appendChild(this.styleSheet),this.addRule(new F("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new F("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new F("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new z("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new z("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},q.prototype.removeStyleSheet=function(){var K;this.styleSheet&&(((K=this.styleSheetRoot)!==null&&K!==void 0?K:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),F=function(q,K){this.selector=q,this.style=K},z=function(q,K){this.localName=q,this.style=K},P=function(){function q(){this.blocks=[],this.display=""}return q.prototype.addButtonBlock=function(K){K.className=this.blockClassName,K.buttonClassName=this.buttonClassName,K.buttonColorsClassName=this.buttonColorsClassName,K.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(K)},q.prototype.addElementBlock=function(K){K.className===void 0&&(K.className=this.blockClassName),this.blocks.push(K)},q.prototype.getUI=function(){var K=document.createElement("div");return K.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,K.style.display=this.display,this.blocks.forEach(function(G){return K.appendChild(G.getUI())}),K},q}(),oe=function(){function q(){}return q.prototype.getUI=function(){var K=document.createElement("div");if(K.className=this.className,this.minWidth!==void 0&&(K.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":K.style.justifyContent="flex-start";break;case"center":K.style.justifyContent="center";break;case"end":K.style.justifyContent="flex-end"}return K.style.whiteSpace="nowrap",K},q}(),we=function(q){function K(){var G=q!==null&&q.apply(this,arguments)||this;return G.buttons=[],G}return Le(K,q),K.prototype.addButton=function(G){G.className=this.buttonClassName,G.colorsClassName=this.buttonColorsClassName,G.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(G)},K.prototype.getUI=function(){var G=q.prototype.getUI.call(this);return this.buttons.forEach(function(Z){return G.appendChild(Z.getUI())}),G},K}(oe),Ae=function(){function q(K,G){this._isActive=!1,this._isHidden=!1,this._icon=K,this.title=G,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(q.prototype,"icon",{get:function(){return this._icon},set:function(K){this._icon=K,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isActive",{get:function(){return this._isActive},set:function(K){this._isActive=K,this.adjustClassName()},enumerable:!1,configurable:!0}),q.prototype.getUI=function(){var K=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return K.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},q.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},q.prototype.hide=function(){this._isHidden=!0},q}(),ee=function(q){function K(){var G=q!==null&&q.apply(this,arguments)||this;return G.elements=[],G}return Le(K,q),K.prototype.addElement=function(G){this.elements.push(G)},K.prototype.getUI=function(){var G=q.prototype.getUI.call(this);return this.elements.forEach(function(Z){return G.appendChild(Z)}),G},K}(oe),de=function(){function q(K,G){this.horizontal=K,this.vertical=G}return Object.defineProperty(q.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),q.prototype.getVerticalLength=function(K){return K/this.ratio},q.prototype.getHorizontalLength=function(K){return K*this.ratio},q}(),ge=function(){function q(){}return q.getIcon=function(K,G){if(K>0&&G>0){var Z=new de(K,G),te=Z.ratio>=1?20:Z.getHorizontalLength(20),X=Z.ratio<1?20:Z.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 ne=O.createDefs();$.appendChild(ne);var se=O.createElement("clipPath",[["id","text-bg-clip"]]);ne.appendChild(se);var Te=O.createPath(O.getHollowRectanglePath((24-te)/2,(24-X)/2,te,X,(24-te)/2+2,(24-X)/2+2,te-4,X-4));$.appendChild(Te);var Ee=O.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ee.appendChild(O.createTSpan(K+":"+G)),$.appendChild(Ee);var De=Ee.getBBox();O.setAttributes(Ee,[["x",((24-De.width)/2).toString()],["y",((24-De.height)/2-De.y).toString()]]);var Ge=O.createPath(O.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(De.width))/2,(24-Math.ceil(De.height))/2,Math.ceil(De.width),Math.ceil(De.height)));return se.appendChild(Ge),O.setAttributes(Te,[["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>'},q}(),xe=function(q){function K(G,Z,te){var X=q.call(this,G,Z)||this;return X.isDropdownOpen=!1,X.onClick=X.dropdownButtonClicked,X.dropdownButtons=te,X}return Le(K,q),K.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(Z){Z.className=G.className,Z.colorsClassName=G.colorsClassName,G.dropdownBlock.appendChild(Z.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},K.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},K.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},K.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},K.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},K.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},K}(Ae),Me=function(){function q(K,G){this.GRIP_SIZE=10,this.color=K,this.fillColor=G,this.visual=O.createGroup(),this.visual.appendChild(O.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(O.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},q.prototype.setCenter=function(K,G){this.visual.childNodes.forEach(function(Z){return O.setAttributes(Z,[["cx",K.toString()],["cy",G.toString()]])})},q}(),Ue=function(){function q(K,G,Z,te){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=K,this.canvasHeight=G,this.margin=Z,this.container=te,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(K){this._aspectRatio=K,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.gridContainer&&O.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(K){this._zoomFactor=K,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),q.prototype.open=function(){var K=this;this.cropShadeElement=O.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=O.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var G=0;G<this.numberOfGridLines;G++)this.horizontalGridLines.push(O.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(O.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(Z){return K.gridContainer.appendChild(Z)}),this.verticalGridLines.forEach(function(Z){return K.gridContainer.appendChild(Z)}),this.cropRectElement=O.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Me(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Me(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Me(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Me(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},q.prototype.setCropRectangle=function(K){this.cropRect=K;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),O.setAttributes(this.cropRectElement,[["x",G.x.toString()],["y",G.y.toString()],["width",G.width.toString()],["height",G.height.toString()]]);var Z=G.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(X,$){var ne=G.y+Z*($+1);O.setAttributes(X,[["x1",""+G.x],["y1",""+ne],["x2",""+(G.x+G.width)],["y2",""+ne]])});var te=G.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(X,$){var ne=G.x+te*($+1);O.setAttributes(X,[["x1",""+ne],["y1",""+G.y],["x2",""+ne],["y2",""+(G.y+G.height)]])}),O.setAttributes(this.cropShadeElement,[["d",O.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},q.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},q.prototype.clientToLocalCoordinates=function(K,G){var Z=this.container.getBoundingClientRect();return{x:K-Z.left+this.margin,y:G-Z.top+this.margin}},q.prototype.onPointerDown=function(K){this.container.setPointerCapture(K.pointerId),this.previousPoint=this.clientToLocalCoordinates(K.clientX,K.clientY),this.cropRectElement===K.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(K.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(K.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(K.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(K.target)&&(this.activeGrip=this.bottomRightGrip)},q.prototype.onPointerMove=function(K){if(this.isMoving)this.move(this.clientToLocalCoordinates(K.clientX,K.clientY));else if(this.activeGrip){var G=this.clientToLocalCoordinates(K.clientX,K.clientY);this.resize(G)}K.preventDefault()},q.prototype.onPointerUp=function(K){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(K.pointerId)},q.prototype.move=function(K){var G=K.x-this.previousPoint.x,Z=K.y-this.previousPoint.y;this.zoomFactor!==1&&(G=-G/this.zoomFactor,Z=-Z/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+Z),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=K},q.prototype.resize=function(K){var G=Object.assign({},this.cropRect),Z=K.x-this.previousPoint.x,te=K.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:G.x+Z<this.margin&&(Z=this.margin-G.x),G.x+=Z,G.width=this.cropRect.x+this.cropRect.width-G.x;break;case this.bottomRightGrip:case this.topRightGrip:G.width+Z>this.canvasWidth*this.zoomFactor&&(Z=this.canvasWidth*this.zoomFactor-G.width),G.width+=Z}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(Z),G.height=this.aspectRatio.getVerticalLength(G.width)):(G.y+=te,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+=te}G.width<10&&(G.x=this.cropRect.x,G.width=10),G.height<10&&(G.y=this.cropRect.y,G.height=10),this.previousPoint=K,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))},q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var K=this.cropRect.x+this.cropRect.width/2,G=this.cropRect.y+this.cropRect.height/2,Z=this.aspectRatio.getHorizontalLength(this.cropRect.height),te=this.aspectRatio.getVerticalLength(this.cropRect.width);Z/this.canvasWidth<te/this.canvasHeight?this.cropRect.width=Z:this.cropRect.height=te,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=K-this.cropRect.width/2,this.cropRect.y=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)}},q.prototype.getRescaledRect=function(K,G,Z,te,X,$){var ne=Z/K,se=te/G;return{x:(X.x-$)*ne+$,y:(X.y-$)*se+$,width:X.width*ne,height:X.height*se}},q.prototype.scaleCanvas=function(K,G){var Z=this.getRescaledRect(this.canvasWidth,this.canvasHeight,K,G,this.cropRect,this.margin);this.canvasWidth=K,this.canvasHeight=G,this.onCropChange&&this.onCropChange(Z),this.setCropRectangle(Z)},q}(),He=function(){function q(K){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=K,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(q.prototype,"angle",{get:function(){return this._angle},set:function(K){this._angle=K,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),q.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},q.prototype.onPointerDown=function(K){this.controlContainer.setPointerCapture(K.pointerId),this.isDragging=!0,this.previousPoint={x:K.clientX,y:K.clientY}},q.prototype.onPointerMove=function(K){this.isDragging&&(this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.previousPoint.x=K.clientX)},q.prototype.onPointerUp=function(K){this.isDragging&&this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(K.pointerId)},q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var K=this.angleLabelText.getBBox();O.setAttributes(this.angleLabelElement,[["x",((this.width-K.width)/2).toString()],["y",(this.height/2).toString()]])}},q.prototype.positionScaleShape=function(){if(this.scaleShape){var K=this.scaleShape.transform.baseVal.getItem(0);K.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(K,0)}},q.prototype.getVisual=function(){var K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("xmlns","http://www.w3.org/2000/svg"),K.setAttribute("width",this.width+"px"),K.setAttribute("height",this.height+"px"),K.setAttribute("viewBox","0 0 "+this.width+" "+this.height),K.style.flexShrink="0",document.body.appendChild(K);for(var G="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,Z=1;Z<=this.width/5+10;Z++){var te=Z%5==0?this.height/3:this.height/6;G+="h4v"+-te+"h1v"+te}G+="v1H0Z",this.scaleShape=O.createPath(G);var X=O.createTransform();this.scaleShape.transform.baseVal.appendItem(X),K.appendChild(this.scaleShape),this.angleLabelElement=O.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=O.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $=O.createTSpan("");return $.innerHTML="°",this.angleLabelElement.appendChild($),K.appendChild(this.angleLabelElement),document.body.removeChild(K),K},q}(),Be=function(){function q(){this.naturalSize=!1,this.imageType="image/png"}return q.prototype.rasterize=function(K,G,Z,te,X,$,ne){var se=this;return new Promise(function(Te){var Ee=document.createElement("canvas");Ee.width=K.width.baseVal.value-2*te,Ee.height=K.height.baseVal.value-2*te;var De=1,Ge=1;se.naturalSize===!0?(De=G.naturalWidth/(K.width.baseVal.value-2*te)/$,Ge=G.naturalHeight/(K.height.baseVal.value-2*te)/ne,Ee.width=G.naturalWidth/$,Ee.height=G.naturalHeight/ne):se.width!==void 0&&se.height!==void 0&&(De=se.width/Z.width,Ge=se.height/Z.height,Ee.width*=De,Ee.height*=Ge);var Ze=Ee.getContext("2d");Ze.translate(Ee.width/2,Ee.height/2),Ze.rotate(X*Math.PI/180),Ze.scale($,ne),Ze.translate(-Ee.width/2,-Ee.height/2),Ze.drawImage(G,0,0,Ee.width,Ee.height);var Qe=document.createElement("canvas");Qe.width=Z.width*De,Qe.height=Z.height*Ge,Qe.getContext("2d").putImageData(Ze.getImageData((Z.x-te)*De,(Z.y-te)*Ge,Z.width*De,Z.height*Ge),0,0),Te(Qe.toDataURL(se.imageType,se.imageQuality))})},q}(),ze=function(){function q(K){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._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=q.instanceCounter++,this.styles=new C(this.instanceNo),this.target=K,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(K){this._zoomToCropEnabled=K,K?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(K){this._gridLines=K,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(K){this._rotationAngle=K,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"aspectRatio",{get:function(){var K;return(K=this._aspectRatio)!==null&&K!==void 0?K:this.aspectRatios[0]},set:function(K){this._aspectRatio=K},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},q.prototype.show=function(){this.showUI(),this.open()},q.prototype.close=function(K){K===void 0&&(K=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),K||this.closeEventListeners.forEach(function(G){return G()}),this._isOpen=!1)},q.prototype.addRenderEventListener=function(K){this.renderEventListeners.push(K)},q.prototype.removeRenderEventListener=function(K){this.renderEventListeners.indexOf(K)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(K),1)},q.prototype.addCloseEventListener=function(K){this.closeEventListeners.push(K)},q.prototype.removeCloseEventListener=function(K){this.closeEventListeners.indexOf(K)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(K),1)},q.prototype.setupResizeObserver=function(){var K=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){K.resize(K.target.clientWidth,K.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var K=1*this.target.clientWidth/this.target.clientHeight,G=this.contentDiv.clientWidth/K>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*K:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,Z=G+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/K;this.resize(G,Z)}},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",O.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},q.prototype.resize=function(K,G){this.imageWidth=Math.round(K),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()},q.prototype.setEditingTarget=function(){var K=document.createElement("canvas");K.width=this.target.naturalWidth,K.height=this.target.naturalHeight,K.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var G=K.toDataURL();O.setAttributes(this.editingTarget,[["href",G]]),this.setEditingTargetSize()},q.prototype.setTopLeft=function(){var K=this.target.getBoundingClientRect(),G=this.editorCanvas.getBoundingClientRect();this.left=K.left-G.left-this.CANVAS_MARGIN,this.top=K.top-G.top-this.CANVAS_MARGIN},q.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=O.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=O.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=O.createGroup(),this.editingTargetRotationScaleContainer=O.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var K=O.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(K);var G=O.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(G),this.editingTargetContainer=O.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},q.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},q.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=O.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ue(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()},q.prototype.zoomToCrop=function(){if(this.cropRect){var K=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=K+"px "+G+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-K+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-G+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},q.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},q.prototype.cropRectChanged=function(K){this.cropRect=K,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},q.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},q.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.prototype.showUI=function(){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 K=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,G=this.target.offsetTop>K+this.CANVAS_MARGIN?this.target.offsetTop-(K+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},q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},q.prototype.addTopToolbar=function(){var K=this;this.topToolbar=new P,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 we;G.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(G);var Z=[];this.aspectRatios.forEach(function(Ge){var Ze=new Ae(ge.getIcon(Ge.horizontal,Ge.vertical),Ge.horizontal===0&&Ge.vertical===0?"FREE":Ge.horizontal+":"+Ge.vertical);Ze.onClick=function(){return K.ratioButtonClicked(Ge)},Z.push(Ze)}),this.aspectRatioButton=new xe(ge.getIcon(0,0),"Aspect ratio",Z),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 te=new Ae('<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");te.isActive=this.isGridVisible,te.onClick=function(){K.isGridVisible=!K.isGridVisible,te.isActive=K.isGridVisible},G.addButton(te);var X=new Ae('<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(X.isActive=this.zoomToCropEnabled,X.onClick=function(){K.zoomToCropEnabled=!K.zoomToCropEnabled,X.isActive=K.zoomToCropEnabled},G.addButton(X),!N.isLicensed){var $=new ee;this.topToolbar.addElementBlock($);var ne=document.createElement("div");ne.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var se=document.createElement("a");se.style.color="currentColor",se.href="https://markerjs.com/products/cropro",se.target="_blank",se.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>',ne.appendChild(se),$.addElement(ne)}var Te=new we;Te.minWidth=3*this.toolbarHeight+"px",Te.contentAlign="end",this.topToolbar.addButtonBlock(Te);var Ee=new Ae('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ee.onClick=this.startRenderAndClose,Te.addButton(Ee),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ee.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var De=new Ae('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");De.onClick=this.close,Te.addButton(De),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(De.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},q.prototype.addBottomToolbar=function(){var K=this;this.bottomToolbar=new P,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 we;G.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(G);var Z=new Ae('<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");Z.onClick=this.rotateLeftButtonClicked,G.addButton(Z);var te=new Ae('<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");te.onClick=this.rotateRightButtonClicked,G.addButton(te);var X=new ee;X.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(X),this.straightener=new He("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(Te){K.rotateBy(Te),K.straightener.angle=K.rotationAngle},X.addElement(this.straightener.getUI());var $=new we;$.minWidth=2*this.toolbarHeight+"px",$.contentAlign="end",this.bottomToolbar.addButtonBlock($);var ne=new Ae('<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");ne.onClick=this.flipHorizontallyButtonClicked,$.addButton(ne);var se=new Ae('<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");se.onClick=this.flipVerticallyButtonClicked,$.addButton(se)},q.prototype.ratioButtonClicked=function(K){this.aspectRatio=K,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ge.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new de(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},q.prototype.restoreState=function(K){if(K){var G=this.cropLayer.getRescaledRect(K.width,K.height,this.imageWidth,this.imageHeight,K.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(G),this.cropRectChanged(G),this.flippedHorizontally=K.flippedHorizontally,this.flippedVertically=K.flippedVertically,this.applyFlip(),this.rotationAngle=K.rotationAngle,this.applyRotation()}},q.prototype.clientToLocalCoordinates=function(K,G){var Z=this.cropImage.getBoundingClientRect();return{x:K-Z.left,y:G-Z.top}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var K=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=K+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},q.prototype.rotateLeftButtonClicked=function(){var K=this.rotationAngle-90;this.rotationAngle%90!=0&&(K+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(K)},q.prototype.rotateRightButtonClicked=function(){var K=this.rotationAngle+90;this.rotationAngle%90!=0&&(K-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(K)},q.prototype.rotateTo=function(K){K=(K=K>180?K-360:K)<=-180?K+360:K,this.rotationAngle=K,this.applyRotation()},q.prototype.rotateBy=function(K){this.rotateTo((this.rotationAngle+K)%360)},q.prototype.applyRotation=function(){var K=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var 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 Z=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/Z.width,this.imageHeight/Z.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=K},q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},q.prototype.startRenderAndClose=function(){return Pe(this,void 0,void 0,function(){var K,G;return _e(this,function(Z){switch(Z.label){case 0:return[4,this.render()];case 1:return K=Z.sent(),G=this.getState(),this.renderEventListeners.forEach(function(te){return te(K,G)}),this.close(!0),[2]}})})},q.prototype.render=function(){return Pe(this,void 0,void 0,function(){var K;return _e(this,function(G){switch(G.label){case 0:return(K=new Be).naturalSize=this.renderAtNaturalSize,K.imageType=this.renderImageType,K.imageQuality=this.renderImageQuality,K.width=this.renderWidth,K.height=this.renderHeight,this.unzoomFromCrop(),O.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,K.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return G.sent(),[4,K.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,G.sent()]}})})},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new z("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 z("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new z("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var K=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new z("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*K)+`px;
|
|
height: `+(this.toolbarHeight-2*K)+`px;
|
|
padding: `+K+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new z("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new z("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new F("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new F("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new z("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 z("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new z("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 z("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*K)+`px;
|
|
padding: `+K+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new z("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},q.instanceCounter=0,q}(),We=V("8hTe"),Ke=V.n(We),Fe=/<pre[^>]*>/g;function Ye(q){var K=document.createElement("div");return K.innerHTML=q,K.childNodes.length===0?"":K.childNodes[0].nodeValue}var $e=be.a=function(q){var K=q.value,G=K===void 0?"":K,Z=q.edit,te=Z===void 0?!1:Z,X=q.className,$=q.showTextOnly,ne=q.showLines,se=q.replaces,Te=q.zoomImg,Ee=q.hasMask,De=q.style,Ge=De===void 0?{}:De,Ze=q.stylesPrev,Qe=Ze===void 0?{}:Ze,vt=String(G),it=Object(S.useRef)(),Xe=Object(S.useRef)(),Mt=Object(S.useState)(""),Tt=Object(H.a)(Mt,2),kt=Tt[0],Nt=Tt[1],lt=Object(S.useState)("office"),Kt=Object(H.a)(lt,2),Zt=Kt[0],Gt=Kt[1],ai=function(){var wt=new ze(Xe.current);wt.displayMode="popup",wt.addRenderEventListener(function(){var xt=Object(R.a)(e.a.mark(function ut(zt){var Ot;return e.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return it.current.style.display="none",Bt.next=3,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:zt}});case 3:Ot=Bt.sent,Ot!=null&&Ot.id&&se(Xe.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Ot==null?void 0:Ot.id,"?type=").concat(Ot.content_type));case 5:case"end":return Bt.stop()}},ut)}));return function(ut){return xt.apply(this,arguments)}}()),wt.show()},nt=function(){var wt=new Oe.a(Xe.current);wt.settings.displayMode="popup",wt.addEventListener("render",function(){var xt=Object(R.a)(e.a.mark(function ut(zt){var Ot;return e.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(it.current.style.display="none",!Xe.current){Bt.next=6;break}return Bt.next=4,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:zt.dataUrl}});case 4:Ot=Bt.sent,Ot!=null&&Ot.id&&se(Xe.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Ot==null?void 0:Ot.id,"?type=").concat(Ot.content_type));case 6:case"end":return Bt.stop()}},ut)}));return function(ut){return xt.apply(this,arguments)}}()),wt.show(),window.markerArea=wt},rt=Object(S.useMemo)(function(){it.current&&(it.current.style.zIndex=-1);try{var Wt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,wt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;vt=vt.replace(Wt,"("+Q.a.API_SERVER+"/api/attachments/").replace(wt,'"'+Q.a.API_SERVER+"/api/attachments/").replace(xt,'"'+Q.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(oi){}var ut=M(vt),zt=v();if(vt.match(/\[TOC\]/)&&(ut=ut.replace("<p>[TOC]</p>",E()),b()),ut=ut.replace(/(__special_katext_id_\d+__)/g,function(oi,Bt){var ui=zt[Bt],_i=ui.type,Ei=ui.expression;return Object(fe.renderToString)(Ye(Ei)||"",{displayMode:_i==="block",throwOnError:!1,output:"html"})}),ut=ut.replace(/▁/g,"\u2581\u2581\u2581"),p(),$){var Ot=document.createElement("div");return Ot.innerHTML=ut,Ot.innerText}return setTimeout(function(){return qt()},500),ut},[vt]),Et=Object(S.useRef)();m.WebkitLineClamp=ne,ne&&(Ge=Object(w.a)(Object(w.a)({},Ge),m));function Ft(Wt){var wt=Wt.target;if(wt.tagName.toUpperCase()==="IMG"){if(Te){var xt=wt.getAttribute("src");Nt(xt),Gt("image")}}else if(wt.tagName.toUpperCase()==="A"){var ut=wt.getAttribute("href");if(ut.indexOf("office")>-1)Wt.preventDefault(),Nt(ut),Gt("office");else if(ut.indexOf("application/pdf")>-1)Wt.preventDefault(),Nt(ut),Gt("pdf");else if(ut.indexOf("text/html")>-1)Wt.preventDefault(),Nt(ut),Gt("html");else if(ut.startsWith("#")){Wt.preventDefault();var zt=document.getElementById(ut.replace("#",""));zt&&zt.scrollIntoView(!0)}}}var qt=function(){var wt,xt=(wt=Et.current)===null||wt===void 0?void 0:wt.querySelectorAll("video");xt==null||xt.forEach(function(ut){if(ut.oncontextmenu=function(){return!1},ut.src.indexOf(".m3u8")>-1&&!ut.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var zt=new W.a;zt.loadSource(ut.src),zt.attachMedia(ut)}}})};Object(S.useEffect)(function(){if(Et.current&&rt&&(rt.match(Fe)&&window.PR.prettyPrint()),Et.current)return Et.current.addEventListener("click",Ft),function(){Et.current.removeEventListener("click",Ft),p(),b()}},[rt,Et.current,Ft]);var pi=function(wt){if(!te)return;wt.target.nodeName==="IMG"?(it.current.style.zIndex=1,it.current.style.display="flex",it.current.style.width=wt.target.clientWidth+"px",it.current.style.height=wt.target.clientHeight+"px",it.current.style.top=wt.target.offsetTop+"px",it.current.style.left=wt.target.offsetLeft+"px",Xe.current.src=wt.target.getAttribute("src")):it.current.style.display="none"};return f.a.createElement("div",{style:{position:"relative"}},f.a.createElement("div",{ref:Et,style:Object(w.a)({},Ge),className:"".concat(X||""," markdown-body ").concat(Ke.a.mdBody),onMouseOver:pi,dangerouslySetInnerHTML:{__html:rt}}),f.a.createElement("div",{ref:it,className:Ke.a.button},f.a.createElement(B.a,null,f.a.createElement(k.a,{onClick:function(){return ai()}},"\u88C1\u526A"),f.a.createElement(k.a,{onClick:function(){return nt()}},"\u7F16\u8F91"))),f.a.createElement("img",{ref:Xe,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),f.a.createElement(le.a,{close:!0,data:kt,type:kt!=null&&kt.length?Zt:"",style:Object(w.a)({},Qe),onClose:function(){return Nt("")}}))}},BU3w:function(Je,be,V){"use strict";V.d(be,"a",function(){return R});var ae=V("MNnm"),B="rc-util-key";function A(H){if(H.attachTo)return H.attachTo;var U=document.querySelector("head");return U||document.body}function k(H){var U,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ae.a)())return null;var S=document.createElement("style");if((U=e.csp)===null||U===void 0?void 0:U.nonce){var f;S.nonce=(f=e.csp)===null||f===void 0?void 0:f.nonce}S.innerHTML=H;var d=A(e),o=d.firstChild;return e.prepend&&d.prepend?d.prepend(S):e.prepend&&o?d.insertBefore(S,o):d.appendChild(S),S}var w=new Map;function R(H,U){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=A(e);if(!w.has(S)){var f=k("",e),d=f.parentNode;w.set(S,d),d.removeChild(f)}var o=Array.from(w.get(S).children).find(function(n){return n.tagName==="STYLE"&&n[B]===U});if(o){var a,r;if(((a=e.csp)===null||a===void 0?void 0:a.nonce)&&o.nonce!==((r=e.csp)===null||r===void 0?void 0:r.nonce)){var h;o.nonce=(h=e.csp)===null||h===void 0?void 0:h.nonce}return o.innerHTML!==H&&(o.innerHTML=H),o}var s=k(H,e);return s[B]=U,s}},BdwD:function(Je,be,V){"use strict";var ae=V("+L6B"),B=V("2/Rp"),A=V("0Owb"),k=V("k1fw"),w=V("q1tI"),R=V.n(w),H=V("FOrL"),U=V.n(H),e=function(f){var d=f.buttonProps,o=d===void 0?{}:d,a=f.styles,r=a===void 0?{}:a,h=f.imgStyles,s=h===void 0?{}:h,n=f.customText,i=f.ButtonText,t=f.ButtonClick,b=f.Buttonclass,m=f.ButtonTwo;return R.a.createElement("section",{className:"tc animated fadeIn",style:Object(k.a)(Object(k.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),r)},R.a.createElement("img",{src:U.a,style:Object(k.a)(Object(k.a)({},{width:"200px",height:"150px"}),s)}),R.a.createElement("p",{className:"mt10 font14"},n||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&R.a.createElement(B.a,Object(A.a)({className:b,onClick:t},o),i),m&&m)};be.a=e},"C/vA":function(Je,be,V){"use strict";V.d(be,"a",function(){return ae});function ae(B){const A=this;let k=!1,w;return function(){return k||(k=!0,w=B.apply(A,arguments)),w}}},"Cg/j":function(Je,be,V){"use strict";V.d(be,"b",function(){return ae}),V.d(be,"a",function(){return B}),V.d(be,"c",function(){return k}),V.d(be,"d",function(){return w});var ae;(function(R){R.serviceIds=new Map,R.DI_TARGET="$di$target",R.DI_DEPENDENCIES="$di$dependencies";function H(U){return U[R.DI_DEPENDENCIES]||[]}R.getServiceDependencies=H})(ae||(ae={}));const B=k("instantiationService");function A(R,H,U,e){H[ae.DI_TARGET]===H?H[ae.DI_DEPENDENCIES].push({id:R,index:U,optional:e}):(H[ae.DI_DEPENDENCIES]=[{id:R,index:U,optional:e}],H[ae.DI_TARGET]=H)}function k(R){if(ae.serviceIds.has(R))return ae.serviceIds.get(R);const H=function(U,e,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");A(H,U,S,!1)};return H.toString=()=>R,ae.serviceIds.set(R,H),H}function w(R){return function(H,U,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");A(R,H,e,!0)}}},DlQD:function(Je,be,V){(function(ae,B){Je.exports=B()})(this,function(){"use strict";function ae(G,Z){for(var te=0;te<Z.length;te++){var X=Z[te];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(G,X.key,X)}}function B(G,Z,te){return Z&&ae(G.prototype,Z),te&&ae(G,te),G}function A(G,Z){if(!G)return;if(typeof G=="string")return k(G,Z);var te=Object.prototype.toString.call(G).slice(8,-1);if(te==="Object"&&G.constructor&&(te=G.constructor.name),te==="Map"||te==="Set")return Array.from(G);if(te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(te))return k(G,Z)}function k(G,Z){(Z==null||Z>G.length)&&(Z=G.length);for(var te=0,X=new Array(Z);te<Z;te++)X[te]=G[te];return X}function w(G,Z){var te;if(typeof Symbol=="undefined"||G[Symbol.iterator]==null){if(Array.isArray(G)||(te=A(G))||Z&&G&&typeof G.length=="number"){te&&(G=te);var X=0;return function(){return X>=G.length?{done:!0}:{done:!1,value:G[X++]}}}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 te=G[Symbol.iterator](),te.next.bind(te)}function R(G,Z){return Z={exports:{}},G(Z,Z.exports),Z.exports}var H=R(function(G){function Z(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function te(X){G.exports.defaults=X}G.exports={defaults:Z(),getDefaults:Z,changeDefaults:te}}),U=H.defaults,e=H.getDefaults,S=H.changeDefaults,f=/[&<>"']/,d=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,r={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(Z){return r[Z]};function s(G,Z){if(Z){if(f.test(G))return G.replace(d,h)}else if(o.test(G))return G.replace(a,h);return G}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(G){return G.replace(n,function(Z,te){return te=te.toLowerCase(),te==="colon"?":":te.charAt(0)==="#"?te.charAt(1)==="x"?String.fromCharCode(parseInt(te.substring(2),16)):String.fromCharCode(+te.substring(1)):""})}var t=/(^|[^\[])\^/g;function b(G,Z){G=G.source||G,Z=Z||"";var te={replace:function($,ne){return ne=ne.source||ne,ne=ne.replace(t,"$1"),G=G.replace($,ne),te},getRegex:function(){return new RegExp(G,Z)}};return te}var m=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(G,Z,te){if(G){var X;try{X=decodeURIComponent(i(te)).replace(m,"").toLowerCase()}catch($){return null}if(X.indexOf("javascript:")===0||X.indexOf("vbscript:")===0||X.indexOf("data:")===0)return null}Z&&!g.test(te)&&(te=l(Z,te));try{te=encodeURI(te).replace(/%25/g,"%")}catch($){return null}return te}var _={},y=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(G,Z){_[" "+G]||(y.test(G)?_[" "+G]=G+"/":_[" "+G]=L(G,"/",!0)),G=_[" "+G];var te=G.indexOf(":")===-1;return Z.substring(0,2)==="//"?te?Z:G.replace(c,"$1")+Z:Z.charAt(0)==="/"?te?Z:G.replace(u,"$1")+Z:G+Z}var v={exec:function(){}};function p(G){for(var Z=1,te,X;Z<arguments.length;Z++){te=arguments[Z];for(X in te)Object.prototype.hasOwnProperty.call(te,X)&&(G[X]=te[X])}return G}function T(G,Z){var te=G.replace(/\|/g,function(ne,se,Te){for(var Ee=!1,De=se;--De>=0&&Te[De]==="\\";)Ee=!Ee;return Ee?"|":" |"}),X=te.split(/ \|/),$=0;if(X.length>Z)X.splice(Z);else for(;X.length<Z;)X.push("");for(;$<X.length;$++)X[$]=X[$].trim().replace(/\\\|/g,"|");return X}function L(G,Z,te){var X=G.length;if(X===0)return"";for(var $=0;$<X;){var ne=G.charAt(X-$-1);if(ne===Z&&!te)$++;else if(ne!==Z&&te)$++;else break}return G.substr(0,X-$)}function D(G,Z){if(G.indexOf(Z[1])===-1)return-1;for(var te=G.length,X=0,$=0;$<te;$++)if(G[$]==="\\")$++;else if(G[$]===Z[0])X++;else if(G[$]===Z[1]&&(X--,X<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 M={escape:s,unescape:i,edit:b,cleanUrl:E,resolveUrl:l,noopTest:v,merge:p,splitCells:T,rtrim:L,findClosingBracket:D,checkSanitizeDeprecation:x},j=H.defaults,I=M.rtrim,W=M.splitCells,Q=M.escape,fe=M.findClosingBracket;function le(G,Z,te){var X=Z.href,$=Z.title?Q(Z.title):null,ne=G[1].replace(/\\([\[\]])/g,"$1");return G[0].charAt(0)!=="!"?{type:"link",raw:te,href:X,title:$,text:ne}:{type:"image",raw:te,href:X,title:$,text:Q(ne)}}function Ce(G,Z){var te=G.match(/^(\s+)(?:```)/);if(te===null)return Z;var X=te[1];return Z.split(`
|
|
`).map(function($){var ne=$.match(/^\s+/);if(ne===null)return $;var se=ne[0];return se.length>=X.length?$.slice(X.length):$}).join(`
|
|
`)}var Oe=function(){function G(te){this.options=te||j}var Z=G.prototype;return Z.space=function(X){var $=this.rules.block.newline.exec(X);if($)return $[0].length>1?{type:"space",raw:$[0]}:{raw:`
|
|
`}},Z.code=function(X,$){var ne=this.rules.block.code.exec(X);if(ne){var se=$[$.length-1];if(se&&se.type==="paragraph")return{raw:ne[0],text:ne[0].trimRight()};var Te=ne[0].replace(/^ {4}/gm,"");return{type:"code",raw:ne[0],codeBlockStyle:"indented",text:this.options.pedantic?Te:I(Te,`
|
|
`)}}},Z.fences=function(X){var $=this.rules.block.fences.exec(X);if($){var ne=$[0],se=Ce(ne,$[3]||"");return{type:"code",raw:ne,lang:$[2]?$[2].trim():$[2],text:se}}},Z.heading=function(X){var $=this.rules.block.heading.exec(X);if($)return{type:"heading",raw:$[0],depth:$[1].length,text:$[2]}},Z.nptable=function(X){var $=this.rules.block.nptable.exec(X);if($){var ne={type:"table",header:W($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
|
|
`):[],raw:$[0]};if(ne.header.length===ne.align.length){var se=ne.align.length,Te;for(Te=0;Te<se;Te++)/^ *-+: *$/.test(ne.align[Te])?ne.align[Te]="right":/^ *:-+: *$/.test(ne.align[Te])?ne.align[Te]="center":/^ *:-+ *$/.test(ne.align[Te])?ne.align[Te]="left":ne.align[Te]=null;for(se=ne.cells.length,Te=0;Te<se;Te++)ne.cells[Te]=W(ne.cells[Te],ne.header.length);return ne}}},Z.hr=function(X){var $=this.rules.block.hr.exec(X);if($)return{type:"hr",raw:$[0]}},Z.blockquote=function(X){var $=this.rules.block.blockquote.exec(X);if($){var ne=$[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:$[0],text:ne}}},Z.list=function(X){var $=this.rules.block.list.exec(X);if($){for(var ne=$[0],se=$[2],Te=se.length>1,Ee=se[se.length-1]===")",De={type:"list",raw:ne,ordered:Te,start:Te?+se.slice(0,-1):"",loose:!1,items:[]},Ge=$[0].match(this.rules.block.item),Ze=!1,Qe,vt,it,Xe,Mt,Tt,kt,Nt=Ge.length,lt=0;lt<Nt;lt++)Qe=Ge[lt],ne=Qe,vt=Qe.length,Qe=Qe.replace(/^ *([*+-]|\d+[.)]) */,""),~Qe.indexOf(`
|
|
`)&&(vt-=Qe.length,Qe=this.options.pedantic?Qe.replace(/^ {1,4}/gm,""):Qe.replace(new RegExp("^ {1,"+vt+"}","gm"),"")),lt!==Nt-1&&(it=this.rules.block.bullet.exec(Ge[lt+1])[0],(Te?it.length===1||!Ee&&it[it.length-1]===")":it.length>1||this.options.smartLists&&it!==se)&&(Xe=Ge.slice(lt+1).join(`
|
|
`),De.raw=De.raw.substring(0,De.raw.length-Xe.length),lt=Nt-1)),Mt=Ze||/\n\n(?!\s*$)/.test(Qe),lt!==Nt-1&&(Ze=Qe.charAt(Qe.length-1)===`
|
|
`,Mt||(Mt=Ze)),Mt&&(De.loose=!0),Tt=/^\[[ xX]\] /.test(Qe),kt=void 0,Tt&&(kt=Qe[1]!==" ",Qe=Qe.replace(/^\[[ xX]\] +/,"")),De.items.push({type:"list_item",raw:ne,task:Tt,checked:kt,loose:Mt,text:Qe});return De}},Z.html=function(X){var $=this.rules.block.html.exec(X);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]):Q($[0]):$[0]}},Z.def=function(X){var $=this.rules.block.def.exec(X);if($){$[3]&&($[3]=$[3].substring(1,$[3].length-1));var ne=$[1].toLowerCase().replace(/\s+/g," ");return{tag:ne,raw:$[0],href:$[2],title:$[3]}}},Z.table=function(X){var $=this.rules.block.table.exec(X);if($){var ne={type:"table",header:W($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ne.header.length===ne.align.length){ne.raw=$[0];var se=ne.align.length,Te;for(Te=0;Te<se;Te++)/^ *-+: *$/.test(ne.align[Te])?ne.align[Te]="right":/^ *:-+: *$/.test(ne.align[Te])?ne.align[Te]="center":/^ *:-+ *$/.test(ne.align[Te])?ne.align[Te]="left":ne.align[Te]=null;for(se=ne.cells.length,Te=0;Te<se;Te++)ne.cells[Te]=W(ne.cells[Te].replace(/^ *\| *| *\| *$/g,""),ne.header.length);return ne}}},Z.lheading=function(X){var $=this.rules.block.lheading.exec(X);if($)return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:$[1]}},Z.paragraph=function(X){var $=this.rules.block.paragraph.exec(X);if($)return{type:"paragraph",raw:$[0],text:$[1].charAt($[1].length-1)===`
|
|
`?$[1].slice(0,-1):$[1]}},Z.text=function(X,$){var ne=this.rules.block.text.exec(X);if(ne){var se=$[$.length-1];return se&&se.type==="text"?{raw:ne[0],text:ne[0]}:{type:"text",raw:ne[0],text:ne[0]}}},Z.escape=function(X){var $=this.rules.inline.escape.exec(X);if($)return{type:"escape",raw:$[0],text:Q($[1])}},Z.tag=function(X,$,ne){var se=this.rules.inline.tag.exec(X);if(se)return!$&&/^<a /i.test(se[0])?$=!0:$&&/^<\/a>/i.test(se[0])&&($=!1),!ne&&/^<(pre|code|kbd|script)(\s|>)/i.test(se[0])?ne=!0:ne&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(se[0])&&(ne=!1),{type:this.options.sanitize?"text":"html",raw:se[0],inLink:$,inRawBlock:ne,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):Q(se[0]):se[0]}},Z.link=function(X){var $=this.rules.inline.link.exec(X);if($){var ne=fe($[2],"()");if(ne>-1){var se=$[0].indexOf("!")===0?5:4,Te=se+$[1].length+ne;$[2]=$[2].substring(0,ne),$[0]=$[0].substring(0,Te).trim(),$[3]=""}var Ee=$[2],De="";if(this.options.pedantic){var Ge=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ee);Ge?(Ee=Ge[1],De=Ge[3]):De=""}else De=$[3]?$[3].slice(1,-1):"";Ee=Ee.trim().replace(/^<([\s\S]*)>$/,"$1");var Ze=le($,{href:Ee&&Ee.replace(this.rules.inline._escapes,"$1"),title:De&&De.replace(this.rules.inline._escapes,"$1")},$[0]);return Ze}},Z.reflink=function(X,$){var ne;if((ne=this.rules.inline.reflink.exec(X))||(ne=this.rules.inline.nolink.exec(X))){var se=(ne[2]||ne[1]).replace(/\s+/g," ");if(se=$[se.toLowerCase()],!se||!se.href){var Te=ne[0].charAt(0);return{type:"text",raw:Te,text:Te}}var Ee=le(ne,se,ne[0]);return Ee}},Z.strong=function(X,$,ne){ne===void 0&&(ne="");var se=this.rules.inline.strong.start.exec(X);if(se&&(!se[1]||se[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){$=$.slice(-1*X.length);var Te=se[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Te.lastIndex=0;for(var Ee;(se=Te.exec($))!=null;)if(Ee=this.rules.inline.strong.middle.exec($.slice(0,se.index+3)),Ee)return{type:"strong",raw:X.slice(0,Ee[0].length),text:X.slice(2,Ee[0].length-2)}}},Z.em=function(X,$,ne){ne===void 0&&(ne="");var se=this.rules.inline.em.start.exec(X);if(se&&(!se[1]||se[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){$=$.slice(-1*X.length);var Te=se[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Te.lastIndex=0;for(var Ee;(se=Te.exec($))!=null;)if(Ee=this.rules.inline.em.middle.exec($.slice(0,se.index+2)),Ee)return{type:"em",raw:X.slice(0,Ee[0].length),text:X.slice(1,Ee[0].length-1)}}},Z.codespan=function(X){var $=this.rules.inline.code.exec(X);if($){var ne=$[2].replace(/\n/g," "),se=/[^ ]/.test(ne),Te=ne.startsWith(" ")&&ne.endsWith(" ");return se&&Te&&(ne=ne.substring(1,ne.length-1)),ne=Q(ne,!0),{type:"codespan",raw:$[0],text:ne}}},Z.br=function(X){var $=this.rules.inline.br.exec(X);if($)return{type:"br",raw:$[0]}},Z.del=function(X){var $=this.rules.inline.del.exec(X);if($)return{type:"del",raw:$[0],text:$[1]}},Z.autolink=function(X,$){var ne=this.rules.inline.autolink.exec(X);if(ne){var se,Te;return ne[2]==="@"?(se=Q(this.options.mangle?$(ne[1]):ne[1]),Te="mailto:"+se):(se=Q(ne[1]),Te=se),{type:"link",raw:ne[0],text:se,href:Te,tokens:[{type:"text",raw:se,text:se}]}}},Z.url=function(X,$){var ne;if(ne=this.rules.inline.url.exec(X)){var se,Te;if(ne[2]==="@")se=Q(this.options.mangle?$(ne[0]):ne[0]),Te="mailto:"+se;else{var Ee;do Ee=ne[0],ne[0]=this.rules.inline._backpedal.exec(ne[0])[0];while(Ee!==ne[0]);se=Q(ne[0]),ne[1]==="www."?Te="http://"+se:Te=se}return{type:"link",raw:ne[0],text:se,href:Te,tokens:[{type:"text",raw:se,text:se}]}}},Z.inlineText=function(X,$,ne){var se=this.rules.inline.text.exec(X);if(se){var Te;return $?Te=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):Q(se[0]):se[0]:Te=Q(this.options.smartypants?ne(se[0]):se[0]),{type:"text",raw:se[0],text:Te}}},G}(),Re=M.noopTest,Le=M.edit,Pe=M.merge,_e={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:Re,table:Re,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};_e._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_e._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,_e.def=Le(_e.def).replace("label",_e._label).replace("title",_e._title).getRegex(),_e.bullet=/(?:[*+-]|\d{1,9}[.)])/,_e.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,_e.item=Le(_e.item,"gm").replace(/bull/g,_e.bullet).getRegex(),_e.list=Le(_e.list).replace(/bull/g,_e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+_e.def.source+")").getRegex(),_e._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",_e._comment=/<!--(?!-?>)[\s\S]*?-->/,_e.html=Le(_e.html,"i").replace("comment",_e._comment).replace("tag",_e._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e.paragraph=Le(_e._paragraph).replace("hr",_e.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",_e._tag).getRegex(),_e.blockquote=Le(_e.blockquote).replace("paragraph",_e.paragraph).getRegex(),_e.normal=Pe({},_e),_e.gfm=Pe({},_e.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*|$)"}),_e.gfm.nptable=Le(_e.gfm.nptable).replace("hr",_e.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",_e._tag).getRegex(),_e.gfm.table=Le(_e.gfm.table).replace("hr",_e.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",_e._tag).getRegex(),_e.pedantic=Pe({},_e.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_e._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:Re,paragraph:Le(_e.normal._paragraph).replace("hr",_e.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",_e.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var N={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Re,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:Re,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};N._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",N.punctuation=Le(N.punctuation).replace(/punctuation/g,N._punctuation).getRegex(),N._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",N._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",N.em.start=Le(N.em.start).replace(/punctuation/g,N._punctuation).getRegex(),N.em.middle=Le(N.em.middle).replace(/punctuation/g,N._punctuation).replace(/overlapSkip/g,N._overlapSkip).getRegex(),N.em.endAst=Le(N.em.endAst,"g").replace(/punctuation/g,N._punctuation).getRegex(),N.em.endUnd=Le(N.em.endUnd,"g").replace(/punctuation/g,N._punctuation).getRegex(),N.strong.start=Le(N.strong.start).replace(/punctuation/g,N._punctuation).getRegex(),N.strong.middle=Le(N.strong.middle).replace(/punctuation/g,N._punctuation).replace(/blockSkip/g,N._blockSkip).getRegex(),N.strong.endAst=Le(N.strong.endAst,"g").replace(/punctuation/g,N._punctuation).getRegex(),N.strong.endUnd=Le(N.strong.endUnd,"g").replace(/punctuation/g,N._punctuation).getRegex(),N.blockSkip=Le(N._blockSkip,"g").getRegex(),N.overlapSkip=Le(N._overlapSkip,"g").getRegex(),N._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,N._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,N._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])?)+(?![-_])/,N.autolink=Le(N.autolink).replace("scheme",N._scheme).replace("email",N._email).getRegex(),N._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,N.tag=Le(N.tag).replace("comment",_e._comment).replace("attribute",N._attribute).getRegex(),N._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,N._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,N._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,N.link=Le(N.link).replace("label",N._label).replace("href",N._href).replace("title",N._title).getRegex(),N.reflink=Le(N.reflink).replace("label",N._label).getRegex(),N.reflinkSearch=Le(N.reflinkSearch,"g").replace("reflink",N.reflink).replace("nolink",N.nolink).getRegex(),N.normal=Pe({},N),N.pedantic=Pe({},N.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",N._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",N._label).getRegex()}),N.gfm=Pe({},N.normal,{escape:Le(N.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),N.gfm.url=Le(N.gfm.url,"i").replace("email",N.gfm._extended_email).getRegex(),N.breaks=Pe({},N.gfm,{br:Le(N.br).replace("{2,}","*").getRegex(),text:Le(N.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var O={block:_e,inline:N},C=H.defaults,F=O.block,z=O.inline;function P(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 oe(G){var Z="",te,X,$=G.length;for(te=0;te<$;te++)X=G.charCodeAt(te),Math.random()>.5&&(X="x"+X.toString(16)),Z+="&#"+X+";";return Z}var we=function(){function G(te){this.tokens=[],this.tokens.links=Object.create(null),this.options=te||C,this.options.tokenizer=this.options.tokenizer||new Oe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var X={block:F.normal,inline:z.normal};this.options.pedantic?(X.block=F.pedantic,X.inline=z.pedantic):this.options.gfm&&(X.block=F.gfm,this.options.breaks?X.inline=z.breaks:X.inline=z.gfm),this.tokenizer.rules=X}G.lex=function(X,$){var ne=new G($);return ne.lex(X)};var Z=G.prototype;return Z.lex=function(X){return X=X.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(X,this.tokens,!0),this.inline(this.tokens),this.tokens},Z.blockTokens=function(X,$,ne){$===void 0&&($=[]),ne===void 0&&(ne=!0),X=X.replace(/^ +$/gm,"");for(var se,Te,Ee,De;X;){if(se=this.tokenizer.space(X)){X=X.substring(se.raw.length),se.type&&$.push(se);continue}if(se=this.tokenizer.code(X,$)){X=X.substring(se.raw.length),se.type?$.push(se):(De=$[$.length-1],De.raw+=`
|
|
`+se.raw,De.text+=`
|
|
`+se.text);continue}if(se=this.tokenizer.fences(X)){X=X.substring(se.raw.length),$.push(se);continue}if(se=this.tokenizer.heading(X)){X=X.substring(se.raw.length),$.push(se);continue}if(se=this.tokenizer.nptable(X)){X=X.substring(se.raw.length),$.push(se);continue}if(se=this.tokenizer.hr(X)){X=X.substring(se.raw.length),$.push(se);continue}if(se=this.tokenizer.blockquote(X)){X=X.substring(se.raw.length),se.tokens=this.blockTokens(se.text,[],ne),$.push(se);continue}if(se=this.tokenizer.list(X)){for(X=X.substring(se.raw.length),Ee=se.items.length,Te=0;Te<Ee;Te++)se.items[Te].tokens=this.blockTokens(se.items[Te].text,[],!1);$.push(se);continue}if(se=this.tokenizer.html(X)){X=X.substring(se.raw.length),$.push(se);continue}if(ne&&(se=this.tokenizer.def(X))){X=X.substring(se.raw.length),this.tokens.links[se.tag]||(this.tokens.links[se.tag]={href:se.href,title:se.title});continue}if(se=this.tokenizer.table(X)){X=X.substring(se.raw.length),$.push(se);continue}if(se=this.tokenizer.lheading(X)){X=X.substring(se.raw.length),$.push(se);continue}if(ne&&(se=this.tokenizer.paragraph(X))){X=X.substring(se.raw.length),$.push(se);continue}if(se=this.tokenizer.text(X,$)){X=X.substring(se.raw.length),se.type?$.push(se):(De=$[$.length-1],De.raw+=`
|
|
`+se.raw,De.text+=`
|
|
`+se.text);continue}if(X){var Ge="Infinite loop on byte: "+X.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return $},Z.inline=function(X){var $,ne,se,Te,Ee,De,Ge=X.length;for($=0;$<Ge;$++){De=X[$];switch(De.type){case"paragraph":case"text":case"heading":{De.tokens=[],this.inlineTokens(De.text,De.tokens);break}case"table":{for(De.tokens={header:[],cells:[]},Te=De.header.length,ne=0;ne<Te;ne++)De.tokens.header[ne]=[],this.inlineTokens(De.header[ne],De.tokens.header[ne]);for(Te=De.cells.length,ne=0;ne<Te;ne++)for(Ee=De.cells[ne],De.tokens.cells[ne]=[],se=0;se<Ee.length;se++)De.tokens.cells[ne][se]=[],this.inlineTokens(Ee[se],De.tokens.cells[ne][se]);break}case"blockquote":{this.inline(De.tokens);break}case"list":{for(Te=De.items.length,ne=0;ne<Te;ne++)this.inline(De.items[ne].tokens);break}}}return X},Z.inlineTokens=function(X,$,ne,se,Te){$===void 0&&($=[]),ne===void 0&&(ne=!1),se===void 0&&(se=!1),Te===void 0&&(Te="");var Ee,De=X,Ge;if(this.tokens.links){var Ze=Object.keys(this.tokens.links);if(Ze.length>0)for(;(Ge=this.tokenizer.rules.inline.reflinkSearch.exec(De))!=null;)Ze.includes(Ge[0].slice(Ge[0].lastIndexOf("[")+1,-1))&&(De=De.slice(0,Ge.index)+"["+"a".repeat(Ge[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ge=this.tokenizer.rules.inline.blockSkip.exec(De))!=null;)De=De.slice(0,Ge.index)+"["+"a".repeat(Ge[0].length-2)+"]"+De.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;X;){if(Ee=this.tokenizer.escape(X)){X=X.substring(Ee.raw.length),$.push(Ee);continue}if(Ee=this.tokenizer.tag(X,ne,se)){X=X.substring(Ee.raw.length),ne=Ee.inLink,se=Ee.inRawBlock,$.push(Ee);continue}if(Ee=this.tokenizer.link(X)){X=X.substring(Ee.raw.length),Ee.type==="link"&&(Ee.tokens=this.inlineTokens(Ee.text,[],!0,se)),$.push(Ee);continue}if(Ee=this.tokenizer.reflink(X,this.tokens.links)){X=X.substring(Ee.raw.length),Ee.type==="link"&&(Ee.tokens=this.inlineTokens(Ee.text,[],!0,se)),$.push(Ee);continue}if(Ee=this.tokenizer.strong(X,De,Te)){X=X.substring(Ee.raw.length),Ee.tokens=this.inlineTokens(Ee.text,[],ne,se),$.push(Ee);continue}if(Ee=this.tokenizer.em(X,De,Te)){X=X.substring(Ee.raw.length),Ee.tokens=this.inlineTokens(Ee.text,[],ne,se),$.push(Ee);continue}if(Ee=this.tokenizer.codespan(X)){X=X.substring(Ee.raw.length),$.push(Ee);continue}if(Ee=this.tokenizer.br(X)){X=X.substring(Ee.raw.length),$.push(Ee);continue}if(Ee=this.tokenizer.del(X)){X=X.substring(Ee.raw.length),Ee.tokens=this.inlineTokens(Ee.text,[],ne,se),$.push(Ee);continue}if(Ee=this.tokenizer.autolink(X,oe)){X=X.substring(Ee.raw.length),$.push(Ee);continue}if(!ne&&(Ee=this.tokenizer.url(X,oe))){X=X.substring(Ee.raw.length),$.push(Ee);continue}if(Ee=this.tokenizer.inlineText(X,se,P)){X=X.substring(Ee.raw.length),Te=Ee.raw.slice(-1),$.push(Ee);continue}if(X){var Qe="Infinite loop on byte: "+X.charCodeAt(0);if(this.options.silent){console.error(Qe);break}else throw new Error(Qe)}}return $},B(G,null,[{key:"rules",get:function(){return{block:F,inline:z}}}]),G}(),Ae=H.defaults,ee=M.cleanUrl,de=M.escape,ge=function(){function G(te){this.options=te||Ae}var Z=G.prototype;return Z.code=function(X,$,ne){var se=($||"").match(/\S*/)[0];if(this.options.highlight){var Te=this.options.highlight(X,se);Te!=null&&Te!==X&&(ne=!0,X=Te)}return se?'<pre><code class="'+this.options.langPrefix+de(se,!0)+'">'+(ne?X:de(X,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ne?X:de(X,!0))+`</code></pre>
|
|
`},Z.blockquote=function(X){return`<blockquote>
|
|
`+X+`</blockquote>
|
|
`},Z.html=function(X){return X},Z.heading=function(X,$,ne,se){return this.options.headerIds?"<h"+$+' id="'+this.options.headerPrefix+se.slug(ne)+'">'+X+"</h"+$+`>
|
|
`:"<h"+$+">"+X+"</h"+$+`>
|
|
`},Z.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Z.list=function(X,$,ne){var se=$?"ol":"ul",Te=$&&ne!==1?' start="'+ne+'"':"";return"<"+se+Te+`>
|
|
`+X+"</"+se+`>
|
|
`},Z.listitem=function(X){return"<li>"+X+`</li>
|
|
`},Z.checkbox=function(X){return"<input "+(X?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Z.paragraph=function(X){return"<p>"+X+`</p>
|
|
`},Z.table=function(X,$){return $&&($="<tbody>"+$+"</tbody>"),`<table>
|
|
<thead>
|
|
`+X+`</thead>
|
|
`+$+`</table>
|
|
`},Z.tablerow=function(X){return`<tr>
|
|
`+X+`</tr>
|
|
`},Z.tablecell=function(X,$){var ne=$.header?"th":"td",se=$.align?"<"+ne+' align="'+$.align+'">':"<"+ne+">";return se+X+"</"+ne+`>
|
|
`},Z.strong=function(X){return"<strong>"+X+"</strong>"},Z.em=function(X){return"<em>"+X+"</em>"},Z.codespan=function(X){return"<code>"+X+"</code>"},Z.br=function(){return this.options.xhtml?"<br/>":"<br>"},Z.del=function(X){return"<del>"+X+"</del>"},Z.link=function(X,$,ne){if(X=ee(this.options.sanitize,this.options.baseUrl,X),X===null)return ne;var se='<a href="'+de(X)+'"';return $&&(se+=' title="'+$+'"'),se+=">"+ne+"</a>",se},Z.image=function(X,$,ne){if(X=ee(this.options.sanitize,this.options.baseUrl,X),X===null)return ne;var se='<img src="'+X+'" alt="'+ne+'"';return $&&(se+=' title="'+$+'"'),se+=this.options.xhtml?"/>":">",se},Z.text=function(X){return X},G}(),xe=function(){function G(){}var Z=G.prototype;return Z.strong=function(X){return X},Z.em=function(X){return X},Z.codespan=function(X){return X},Z.del=function(X){return X},Z.html=function(X){return X},Z.text=function(X){return X},Z.link=function(X,$,ne){return""+ne},Z.image=function(X,$,ne){return""+ne},Z.br=function(){return""},G}(),Me=function(){function G(){this.seen={}}var Z=G.prototype;return Z.slug=function(X){var $=X.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty($)){var ne=$;do this.seen[ne]++,$=ne+"-"+this.seen[ne];while(this.seen.hasOwnProperty($))}return this.seen[$]=0,$},G}(),Ue=H.defaults,He=M.unescape,Be=function(){function G(te){this.options=te||Ue,this.options.renderer=this.options.renderer||new ge,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new xe,this.slugger=new Me}G.parse=function(X,$){var ne=new G($);return ne.parse(X)};var Z=G.prototype;return Z.parse=function(X,$){$===void 0&&($=!0);var ne="",se,Te,Ee,De,Ge,Ze,Qe,vt,it,Xe,Mt,Tt,kt,Nt,lt,Kt,Zt,Gt,ai=X.length;for(se=0;se<ai;se++){Xe=X[se];switch(Xe.type){case"space":continue;case"hr":{ne+=this.renderer.hr();continue}case"heading":{ne+=this.renderer.heading(this.parseInline(Xe.tokens),Xe.depth,He(this.parseInline(Xe.tokens,this.textRenderer)),this.slugger);continue}case"code":{ne+=this.renderer.code(Xe.text,Xe.lang,Xe.escaped);continue}case"table":{for(vt="",Qe="",De=Xe.header.length,Te=0;Te<De;Te++)Qe+=this.renderer.tablecell(this.parseInline(Xe.tokens.header[Te]),{header:!0,align:Xe.align[Te]});for(vt+=this.renderer.tablerow(Qe),it="",De=Xe.cells.length,Te=0;Te<De;Te++){for(Ze=Xe.tokens.cells[Te],Qe="",Ge=Ze.length,Ee=0;Ee<Ge;Ee++)Qe+=this.renderer.tablecell(this.parseInline(Ze[Ee]),{header:!1,align:Xe.align[Ee]});it+=this.renderer.tablerow(Qe)}ne+=this.renderer.table(vt,it);continue}case"blockquote":{it=this.parse(Xe.tokens),ne+=this.renderer.blockquote(it);continue}case"list":{for(Mt=Xe.ordered,Tt=Xe.start,kt=Xe.loose,De=Xe.items.length,it="",Te=0;Te<De;Te++)lt=Xe.items[Te],Kt=lt.checked,Zt=lt.task,Nt="",lt.task&&(Gt=this.renderer.checkbox(Kt),kt?lt.tokens.length>0&<.tokens[0].type==="text"?(lt.tokens[0].text=Gt+" "+lt.tokens[0].text,lt.tokens[0].tokens&<.tokens[0].tokens.length>0&<.tokens[0].tokens[0].type==="text"&&(lt.tokens[0].tokens[0].text=Gt+" "+lt.tokens[0].tokens[0].text)):lt.tokens.unshift({type:"text",text:Gt}):Nt+=Gt),Nt+=this.parse(lt.tokens,kt),it+=this.renderer.listitem(Nt,Zt,Kt);ne+=this.renderer.list(it,Mt,Tt);continue}case"html":{ne+=this.renderer.html(Xe.text);continue}case"paragraph":{ne+=this.renderer.paragraph(this.parseInline(Xe.tokens));continue}case"text":{for(it=Xe.tokens?this.parseInline(Xe.tokens):Xe.text;se+1<ai&&X[se+1].type==="text";)Xe=X[++se],it+=`
|
|
`+(Xe.tokens?this.parseInline(Xe.tokens):Xe.text);ne+=$?this.renderer.paragraph(it):it;continue}default:{var nt='Token with "'+Xe.type+'" type was not found.';if(this.options.silent){console.error(nt);return}else throw new Error(nt)}}}return ne},Z.parseInline=function(X,$){$=$||this.renderer;var ne="",se,Te,Ee=X.length;for(se=0;se<Ee;se++){Te=X[se];switch(Te.type){case"escape":{ne+=$.text(Te.text);break}case"html":{ne+=$.html(Te.text);break}case"link":{ne+=$.link(Te.href,Te.title,this.parseInline(Te.tokens,$));break}case"image":{ne+=$.image(Te.href,Te.title,Te.text);break}case"strong":{ne+=$.strong(this.parseInline(Te.tokens,$));break}case"em":{ne+=$.em(this.parseInline(Te.tokens,$));break}case"codespan":{ne+=$.codespan(Te.text);break}case"br":{ne+=$.br();break}case"del":{ne+=$.del(this.parseInline(Te.tokens,$));break}case"text":{ne+=$.text(Te.text);break}default:{var De='Token with "'+Te.type+'" type was not found.';if(this.options.silent){console.error(De);return}else throw new Error(De)}}}return ne},G}(),ze=M.merge,We=M.checkSanitizeDeprecation,Ke=M.escape,Fe=H.getDefaults,Ye=H.changeDefaults,$e=H.defaults;function q(G,Z,te){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 Z=="function"&&(te=Z,Z=null),Z=ze({},q.defaults,Z||{}),We(Z),te){var X=Z.highlight,$;try{$=we.lex(G,Z)}catch(Ee){return te(Ee)}var ne=function(De){var Ge;if(!De)try{Ge=Be.parse($,Z)}catch(Ze){De=Ze}return Z.highlight=X,De?te(De):te(null,Ge)};if(!X||X.length<3)return ne();if(delete Z.highlight,!$.length)return ne();var se=0;q.walkTokens($,function(Ee){Ee.type==="code"&&(se++,setTimeout(function(){X(Ee.text,Ee.lang,function(De,Ge){if(De)return ne(De);Ge!=null&&Ge!==Ee.text&&(Ee.text=Ge,Ee.escaped=!0),se--,se===0&&ne()})},0))}),se===0&&ne();return}try{var Te=we.lex(G,Z);return Z.walkTokens&&q.walkTokens(Te,Z.walkTokens),Be.parse(Te,Z)}catch(Ee){if(Ee.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Z.silent)return"<p>An error occurred:</p><pre>"+Ke(Ee.message+"",!0)+"</pre>";throw Ee}}q.options=q.setOptions=function(G){return ze(q.defaults,G),Ye(q.defaults),q},q.getDefaults=Fe,q.defaults=$e,q.use=function(G){var Z=ze({},G);if(G.renderer&&function(){var X=q.defaults.renderer||new ge,$=function(Te){var Ee=X[Te];X[Te]=function(){for(var De=arguments.length,Ge=new Array(De),Ze=0;Ze<De;Ze++)Ge[Ze]=arguments[Ze];var Qe=G.renderer[Te].apply(X,Ge);return Qe===!1&&(Qe=Ee.apply(X,Ge)),Qe}};for(var ne in G.renderer)$(ne);Z.renderer=X}(),G.tokenizer&&function(){var X=q.defaults.tokenizer||new Oe,$=function(Te){var Ee=X[Te];X[Te]=function(){for(var De=arguments.length,Ge=new Array(De),Ze=0;Ze<De;Ze++)Ge[Ze]=arguments[Ze];var Qe=G.tokenizer[Te].apply(X,Ge);return Qe===!1&&(Qe=Ee.apply(X,Ge)),Qe}};for(var ne in G.tokenizer)$(ne);Z.tokenizer=X}(),G.walkTokens){var te=q.defaults.walkTokens;Z.walkTokens=function(X){G.walkTokens(X),te&&te(X)}}q.setOptions(Z)},q.walkTokens=function(G,Z){for(var te=w(G),X;!(X=te()).done;){var $=X.value;Z($);switch($.type){case"table":{for(var ne=w($.tokens.header),se;!(se=ne()).done;){var Te=se.value;q.walkTokens(Te,Z)}for(var Ee=w($.tokens.cells),De;!(De=Ee()).done;)for(var Ge=De.value,Ze=w(Ge),Qe;!(Qe=Ze()).done;){var vt=Qe.value;q.walkTokens(vt,Z)}break}case"list":{q.walkTokens($.items,Z);break}default:$.tokens&&q.walkTokens($.tokens,Z)}}},q.Parser=Be,q.parser=Be.parse,q.Renderer=ge,q.TextRenderer=xe,q.Lexer=we,q.lexer=we.lex,q.Tokenizer=Oe,q.Slugger=Me,q.parse=q;var K=q;return K})},FOrL:function(Je,be,V){Je.exports=V.p+"static/nodata.a6b3f948.png"},FWmy:function(Je,be,V){"use strict";V.d(be,"a",function(){return ae});function ae(B,A){if(!B)throw new Error(A?`Assertion failed (${A})`:"Assertion Failed")}},INg4:function(Je,be,V){Je.exports={flex_box_center:"flex_box_center___2rJad",flex_space_between:"flex_space_between___3xFPg",flex_box_vertical_center:"flex_box_vertical_center___3_RIS",flex_box_center_end:"flex_box_center_end___h0Di5",flex_box_column:"flex_box_column___Q5LEA",right:"right___1Gnba",title:"title___2HvSR",titles:"titles___2UU6k",tips:"tips___1iWOB"}},JYp7:function(Je,be,V){"use strict";V.d(be,"a",function(){return ae});var ae;(function(B){function A(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}B.is=A;const k=Object.freeze([]);function w(){return k}B.empty=w;function*R(t){yield t}B.single=R;function H(t){return t||k}B.from=H;function U(t){return!t||t[Symbol.iterator]().next().done===!0}B.isEmpty=U;function e(t){return t[Symbol.iterator]().next().value}B.first=e;function S(t,b){for(const m of t)if(b(m))return!0;return!1}B.some=S;function f(t,b){for(const m of t)if(b(m))return m;return}B.find=f;function*d(t,b){for(const m of t)b(m)&&(yield m)}B.filter=d;function*o(t,b){let m=0;for(const g of t)yield b(g,m++)}B.map=o;function*a(...t){for(const b of t)for(const m of b)yield m}B.concat=a;function*r(t){for(const b of t)for(const m of b)yield m}B.concatNested=r;function h(t,b,m){let g=m;for(const E of t)g=b(g,E);return g}B.reduce=h;function*s(t,b,m=t.length){for(b<0&&(b+=t.length),m<0?m+=t.length:m>t.length&&(m=t.length);b<m;b++)yield t[b]}B.slice=s;function n(t,b=Number.POSITIVE_INFINITY){const m=[];if(b===0)return[m,t];const g=t[Symbol.iterator]();for(let E=0;E<b;E++){const _=g.next();if(_.done)return[m,B.empty()];m.push(_.value)}return[m,{[Symbol.iterator](){return g}}]}B.consume=n;function i(t,b,m=(g,E)=>g===E){const g=t[Symbol.iterator](),E=b[Symbol.iterator]();for(;;){const _=g.next(),y=E.next();if(_.done!==y.done)return!1;if(_.done)return!0;if(!m(_.value,y.value))return!1}}B.equals=i})(ae||(ae={}))},LdHM:function(Je,be,V){"use strict";V.d(be,"b",function(){return t}),V.d(be,"a",function(){return m});var ae=V("1OyB"),B=V("vuIU"),A=V("Ji7U"),k=V("LK+K"),w=V("q1tI"),R=V("rePB"),H=V("Ff2n"),U=V("ODXe"),e=V("4IlW"),S=V("bX4T"),f=V("YrtM"),d=V("TSYQ"),o=V.n(d),a=V("+nKL"),r=V("8OUc"),h=function(W,Q){var fe=W.prefixCls,le=W.id,Ce=W.flattenOptions,Oe=W.childrenAsData,Re=W.values,Le=W.searchValue,Pe=W.multiple,_e=W.defaultActiveFirstOption,N=W.height,O=W.itemHeight,C=W.notFoundContent,F=W.open,z=W.menuItemSelectedIcon,P=W.virtual,oe=W.onSelect,we=W.onToggleOpen,Ae=W.onActiveValue,ee=W.onScroll,de=W.onMouseEnter,ge="".concat(fe,"-item"),xe=Object(f.a)(function(){return Ce},[F,Ce],function(K,G){return G[0]&&K[1]!==G[1]}),Me=w.useRef(null),Ue=function(G){G.preventDefault()},He=function(G){Me.current&&Me.current.scrollTo({index:G})},Be=function(G){for(var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,te=xe.length,X=0;X<te;X+=1){var $=(G+X*Z+te)%te,ne=xe[$],se=ne.group,Te=ne.data;if(!se&&!Te.disabled)return $}return-1},ze=w.useState(function(){return Be(0)}),We=Object(U.a)(ze,2),Ke=We[0],Fe=We[1],Ye=function(G){Fe(G);var Z=xe[G];if(!Z){Ae(null,-1);return}Ae(Z.data.value,G)};w.useEffect(function(){Ye(_e!==!1?Be(0):-1)},[xe.length,Le]),w.useEffect(function(){var K=setTimeout(function(){if(!Pe&&F&&Re.size===1){var G=Array.from(Re)[0],Z=xe.findIndex(function(te){var X=te.data;return X.value===G});Ye(Z),He(Z)}});return function(){return clearTimeout(K)}},[F]);var $e=function(G){G!==void 0&&oe(G,{selected:!Re.has(G)}),Pe||we(!1)};if(w.useImperativeHandle(Q,function(){return{onKeyDown:function(G){var Z=G.which;switch(Z){case e.a.UP:case e.a.DOWN:{var te=0;if(Z===e.a.UP?te=-1:Z===e.a.DOWN&&(te=1),te!==0){var X=Be(Ke+te,te);He(X),Ye(X)}break}case e.a.ENTER:{var $=xe[Ke];$&&!$.data.disabled?$e($.data.value):$e(void 0),F&&G.preventDefault();break}case e.a.ESC:we(!1)}},onKeyUp:function(){},scrollTo:function(G){He(G)}}}),xe.length===0)return w.createElement("div",{role:"listbox",id:"".concat(le,"_list"),className:"".concat(ge,"-empty"),onMouseDown:Ue},C);function q(K){var G=xe[K];if(!G)return null;var Z=G.data||{},te=Z.value,X=Z.label,$=Z.children,ne=Object(S.a)(Z,!0),se=Oe?$:X;return G?w.createElement("div",Object.assign({"aria-label":typeof se=="string"?se:null},ne,{key:K,role:"option",id:"".concat(le,"_list_").concat(K),"aria-selected":Re.has(te)}),te):null}return w.createElement(w.Fragment,null,w.createElement("div",{role:"listbox",id:"".concat(le,"_list"),style:{height:0,width:0,overflow:"hidden"}},q(Ke-1),q(Ke),q(Ke+1)),w.createElement(a.a,{itemKey:"key",ref:Me,data:xe,height:N,itemHeight:O,fullHeight:!1,onMouseDown:Ue,onScroll:ee,virtual:P,onMouseEnter:de},function(K,G){var Z,te=K.group,X=K.groupOption,$=K.data,ne=$.label,se=$.key;if(te)return w.createElement("div",{className:o()(ge,"".concat(ge,"-group"))},ne!==void 0?ne:se);var Te=$.disabled,Ee=$.value,De=$.title,Ge=$.children,Ze=$.style,Qe=$.className,vt=Object(H.a)($,["disabled","value","title","children","style","className"]),it=Re.has(Ee),Xe="".concat(ge,"-option"),Mt=o()(ge,Xe,Qe,(Z={},Object(R.a)(Z,"".concat(Xe,"-grouped"),X),Object(R.a)(Z,"".concat(Xe,"-active"),Ke===G&&!Te),Object(R.a)(Z,"".concat(Xe,"-disabled"),Te),Object(R.a)(Z,"".concat(Xe,"-selected"),it),Z)),Tt=Oe?Ge:ne,kt=!z||typeof z=="function"||it;return w.createElement("div",Object.assign({},vt,{"aria-selected":it,className:Mt,title:De,onMouseMove:function(){if(Ke===G||Te)return;Ye(G)},onClick:function(){Te||$e(Ee)},style:Ze}),w.createElement("div",{className:"".concat(Xe,"-content")},Tt||Ee),w.isValidElement(z)||it,kt&&w.createElement(r.a,{className:"".concat(ge,"-option-state"),customizeIcon:z,customizeIconProps:{isSelected:it}},it?"\u2713":null))}))},s=w.forwardRef(h);s.displayName="OptionList";var n=s,i=function(){return null};i.isSelectOption=!0;var t=i,b=function(){return null};b.isSelectOptGroup=!0;var m=b,g=V("VTBJ"),E=V("Zm9Q");function _(I){var W=I.key,Q=I.props,fe=Q.children,le=Q.value,Ce=Object(H.a)(Q,["children","value"]);return Object(g.a)({key:W,value:le!==void 0?le:W,children:fe},Ce)}function y(I){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(E.a)(I).map(function(Q,fe){if(!w.isValidElement(Q)||!Q.type)return null;var le=Q.type.isSelectOptGroup,Ce=Q.key,Oe=Q.props,Re=Oe.children,Le=Object(H.a)(Oe,["children"]);return W||!le?_(Q):Object(g.a)(Object(g.a)({key:"__RC_SELECT_GRP__".concat(Ce===null?fe:Ce,"__"),label:Ce},Le),{},{options:y(Re)})}).filter(function(Q){return Q})}var c=V("2Qr1"),u=V("qNPg"),l=V("U8pU"),v=V("Kwbf"),p=V("WKfj");function T(I){var W=I.mode,Q=I.options,fe=I.children,le=I.backfill,Ce=I.allowClear,Oe=I.placeholder,Re=I.getInputElement,Le=I.showSearch,Pe=I.onSearch,_e=I.defaultOpen,N=I.autoFocus,O=I.labelInValue,C=I.value,F=I.inputValue,z=I.optionLabelProp,P=W==="multiple"||W==="tags",oe=Le!==void 0?Le:P||W==="combobox",we=Q||y(fe);if(Object(v.a)(W!=="tags"||we.every(function(ge){return!ge.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Ae=we.some(function(ge){return ge.options?ge.options.some(function(xe){return typeof("value"in xe?xe.value:xe.key)=="number"}):typeof("value"in ge?ge.value:ge.key)=="number"});Object(v.a)(!Ae,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(W!=="combobox"||!z,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(W==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(v.a)(W==="combobox"||!Re,"`getInputElement` only work with `combobox` mode."),Object(v.b)(W!=="combobox"||!Re||!Ce||!Oe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Pe&&!oe&&W!=="combobox"&&W!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!_e||N,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),C!=null){var ee=Object(p.d)(C);Object(v.a)(!O||ee.every(function(ge){return Object(l.a)(ge)==="object"&&("key"in ge||"value"in ge)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!P||Array.isArray(C),"`value` should be array when `mode` is `multiple` or `tags`")}if(fe){var de=null;Object(E.a)(fe).some(function(ge){if(!w.isValidElement(ge)||!ge.type)return!1;var xe=ge.type;if(xe.isSelectOption)return!1;if(xe.isSelectOptGroup){var Me=Object(E.a)(ge.props.children).every(function(Ue){return!w.isValidElement(Ue)||!ge.type||Ue.type.isSelectOption?!0:(de=Ue.type,!1)});return!Me}return de=xe,!0}),de&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(de.displayName||de.name||de,"`.")),Object(v.a)(F===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var L=T,D=Object(u.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:y,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:L,fillOptionsWithMissingValue:c.a}),x=function(I){Object(A.a)(Q,I);var W=Object(k.a)(Q);function Q(){var fe;return Object(ae.a)(this,Q),fe=W.apply(this,arguments),fe.selectRef=w.createRef(),fe.focus=function(){fe.selectRef.current.focus()},fe.blur=function(){fe.selectRef.current.blur()},fe}return Object(B.a)(Q,[{key:"render",value:function(){return w.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),Q}(w.Component);x.Option=t,x.OptGroup=m;var M=x,j=be.c=M},MI8n:function(Je,be,V){"use strict";V.d(be,"c",function(){return w}),V.d(be,"b",function(){return e}),V.d(be,"e",function(){return S}),V.d(be,"a",function(){return f}),V.d(be,"d",function(){return d}),V.d(be,"f",function(){return o});var ae=V("/cxE"),B=V("pmY6"),A=V("24hK"),k=V("5Y4S"),w;(function(a){a.None=()=>B.a.None;function r(T){return(L,D=null,x)=>{let M=!1,j;return j=T(I=>M?void 0:(j?j.dispose():M=!0,L.call(D,I)),null,x),M&&j.dispose(),j}}a.once=r;function h(T,L){return m((D,x=null,M)=>T(j=>D.call(x,L(j)),null,M))}a.map=h;function s(T,L){return m((D,x=null,M)=>T(j=>{L(j),D.call(x,j)},null,M))}a.forEach=s;function n(T,L){return m((D,x=null,M)=>T(j=>L(j)&&D.call(x,j),null,M))}a.filter=n;function i(T){return T}a.signal=i;function t(...T){return(L,D=null,x)=>Object(B.e)(...T.map(M=>M(j=>L.call(D,j),null,x)))}a.any=t;function b(T,L,D){let x=D;return h(T,M=>(x=L(x,M),x))}a.reduce=b;function m(T){let L;const D=new e({onFirstListenerAdd(){L=T(D.fire,D)},onLastListenerRemove(){L.dispose()}});return D.event}function g(T,L,D=100,x=!1,M){let j,I,W,Q=0;const fe=new e({leakWarningThreshold:M,onFirstListenerAdd(){j=T(le=>{Q++,I=L(I,le),x&&!W&&(fe.fire(I),I=void 0),clearTimeout(W),W=setTimeout(()=>{const Ce=I;I=void 0,W=void 0,(!x||Q>1)&&fe.fire(Ce),Q=0},D)})},onLastListenerRemove(){j.dispose()}});return fe.event}a.debounce=g;function E(T,L=(D,x)=>D===x){let D=!0,x;return n(T,M=>{const j=D||!L(M,x);return D=!1,x=M,j})}a.latch=E;function _(T,L){return[a.filter(T,L),a.filter(T,D=>!L(D))]}a.split=_;function y(T,L=!1,D=[]){let x=D.slice(),M=T(W=>{x?x.push(W):I.fire(W)});const j=()=>{x&&x.forEach(W=>I.fire(W)),x=null},I=new e({onFirstListenerAdd(){M||(M=T(W=>I.fire(W)))},onFirstListenerDidAdd(){x&&(L?setTimeout(j):j())},onLastListenerRemove(){M&&M.dispose(),M=null}});return I.event}a.buffer=y;class c{constructor(T){this.event=T}map(T){return new c(h(this.event,T))}forEach(T){return new c(s(this.event,T))}filter(T){return new c(n(this.event,T))}reduce(T,L){return new c(b(this.event,T,L))}latch(){return new c(E(this.event))}debounce(T,L=100,D=!1,x){return new c(g(this.event,T,L,D,x))}on(T,L,D){return this.event(T,L,D)}once(T,L,D){return r(this.event)(T,L,D)}}function u(T){return new c(T)}a.chain=u;function l(T,L,D=x=>x){const x=(...W)=>I.fire(D(...W)),M=()=>T.on(L,x),j=()=>T.removeListener(L,x),I=new e({onFirstListenerAdd:M,onLastListenerRemove:j});return I.event}a.fromNodeEventEmitter=l;function v(T,L,D=x=>x){const x=(...W)=>I.fire(D(...W)),M=()=>T.addEventListener(L,x),j=()=>T.removeEventListener(L,x),I=new e({onFirstListenerAdd:M,onLastListenerRemove:j});return I.event}a.fromDOMEventEmitter=v;function p(T){return new Promise(L=>r(T)(L))}a.toPromise=p})(w||(w={}));class R{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${R._idPool++}`}start(a){this._stopWatch=new k.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}R._idPool=0;let H=-1;class U{constructor(a,r=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=r,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let r=H;if(typeof this.customThreshold=="number"&&(r=this.customThreshold),r<=0||a<r)return;this._stacks||(this._stacks=new Map);const h=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),s=this._stacks.get(h)||0;if(this._stacks.set(h,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let n,i=0;for(const[t,b]of this._stacks)(!n||i<b)&&(n=t,i=b);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${i}):`),console.warn(n)}return()=>{const n=this._stacks.get(h)||0;this._stacks.set(h,n-1)}}}class e{constructor(a){var r;this._disposed=!1,this._options=a,this._leakageMon=H>0?new U(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((r=this._options)===null||r===void 0?void 0:r._profName)?new R(this._options._profName):void 0}get event(){return this._event||(this._event=(a,r,h)=>{var s;this._listeners||(this._listeners=new A.a);const n=this._listeners.isEmpty();n&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(r?[a,r]:a);n&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,r);const t=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),b=Object(B.i)(()=>{if(t&&t(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const m=this._listeners&&!this._listeners.isEmpty();m||this._options.onLastListenerRemove(this)}});return h instanceof B.b?h.add(b):Array.isArray(h)&&h.push(b),b}),this._event}fire(a){var r,h;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new A.a);for(let s of this._listeners)this._deliveryQueue.push([s,a]);for((r=this._perfMon)===null||r===void 0||r.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,n]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,n):s[0].call(s[1],n)}catch(i){Object(ae.f)(i)}}(h=this._perfMon)===null||h===void 0||h.stop()}}dispose(){var a,r,h,s,n;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(r=this._deliveryQueue)===null||r===void 0||r.clear(),(s=(h=this._options)===null||h===void 0?void 0:h.onLastListenerRemove)===null||s===void 0||s.call(h),(n=this._leakageMon)===null||n===void 0||n.dispose())}}class S extends e{constructor(a){super(a);this._isPaused=0,this._eventQueue=new A.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class f extends S{constructor(a){var r;super(a);this._delay=(r=a.delay)!==null&&r!==void 0?r:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class d{constructor(){this.buffers=[]}wrapEvent(a){return(r,h,s)=>a(n=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>r.call(h,n)):r.call(h,n)},void 0,s)}bufferEvents(a){const r=[];this.buffers.push(r);const h=a();return this.buffers.pop(),r.forEach(s=>s()),h}}class o{constructor(){this.listening=!1,this.inputEvent=w.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(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Je,be,V){"use strict";(function(ae,B){V.d(be,"b",function(){return h}),V.d(be,"i",function(){return t}),V.d(be,"f",function(){return b}),V.d(be,"d",function(){return m}),V.d(be,"g",function(){return g}),V.d(be,"h",function(){return E}),V.d(be,"c",function(){return _}),V.d(be,"k",function(){return y}),V.d(be,"j",function(){return c}),V.d(be,"a",function(){return u}),V.d(be,"e",function(){return p});var A;const k="en";let w=!1,R=!1,H=!1,U=!1,e=!1,S=!1,f=!1,d,o=k,a,r;const h=typeof self=="object"?self:typeof ae=="object"?ae:{};let s;typeof h.vscode!="undefined"&&typeof h.vscode.process!="undefined"?s=h.vscode.process:typeof B!="undefined"&&(s=B);const n=typeof((A=s==null?void 0:s.versions)===null||A===void 0?void 0:A.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!n)r=navigator.userAgent,w=r.indexOf("Windows")>=0,R=r.indexOf("Macintosh")>=0,f=(r.indexOf("Macintosh")>=0||r.indexOf("iPad")>=0||r.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,H=r.indexOf("Linux")>=0,S=!0,d=navigator.language,o=d;else if(typeof s=="object"){w=s.platform==="win32",R=s.platform==="darwin",H=s.platform==="linux",U=H&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,d=k,o=k;const T=s.env.VSCODE_NLS_CONFIG;if(T)try{const L=JSON.parse(T),D=L.availableLanguages["*"];d=L.locale,o=D||k,a=L._translationsConfigFile}catch(L){}e=!0}else console.error("Unable to resolve platform.");let i=0;R?i=1:w?i=3:H&&(i=2);const t=w,b=R,m=H,g=e,E=S,_=f,y=r,c=function(){if(h.setImmediate)return h.setImmediate.bind(h);if(typeof h.postMessage=="function"&&!h.importScripts){let D=[];h.addEventListener("message",M=>{if(M.data&&M.data.vscodeSetImmediateId)for(let j=0,I=D.length;j<I;j++){const W=D[j];if(W.id===M.data.vscodeSetImmediateId){D.splice(j,1),W.callback();return}}});let x=0;return M=>{const j=++x;D.push({id:j,callback:M}),h.postMessage({vscodeSetImmediateId:j},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const L=Promise.resolve();return D=>L.then(D)}(),u=R||f?2:w?1:3;let l=!0,v=!1;function p(){if(!v){v=!0;const T=new Uint8Array(2);T[0]=1,T[1]=2;const L=new Uint16Array(T.buffer);l=L[0]===(2<<8)+1}return l}}).call(this,V("IyRk"),V("Q2Ig"))},N0LK:function(Je,be,V){"use strict";V.d(be,"C",function(){return ae}),V.d(be,"v",function(){return A}),V.d(be,"s",function(){return k}),V.d(be,"t",function(){return w}),V.d(be,"U",function(){return R}),V.d(be,"J",function(){return H}),V.d(be,"O",function(){return U}),V.d(be,"p",function(){return e}),V.d(be,"T",function(){return S}),V.d(be,"q",function(){return f}),V.d(be,"N",function(){return d}),V.d(be,"M",function(){return o}),V.d(be,"Q",function(){return a}),V.d(be,"u",function(){return r}),V.d(be,"x",function(){return h}),V.d(be,"I",function(){return s}),V.d(be,"f",function(){return n}),V.d(be,"h",function(){return i}),V.d(be,"g",function(){return t}),V.d(be,"i",function(){return b}),V.d(be,"G",function(){return m}),V.d(be,"H",function(){return g}),V.d(be,"r",function(){return E}),V.d(be,"R",function(){return _}),V.d(be,"d",function(){return y}),V.d(be,"e",function(){return c}),V.d(be,"E",function(){return u}),V.d(be,"F",function(){return l}),V.d(be,"j",function(){return v}),V.d(be,"z",function(){return p}),V.d(be,"K",function(){return L}),V.d(be,"L",function(){return D}),V.d(be,"m",function(){return M}),V.d(be,"k",function(){return I}),V.d(be,"A",function(){return Q}),V.d(be,"a",function(){return fe}),V.d(be,"n",function(){return le}),V.d(be,"l",function(){return Ce}),V.d(be,"D",function(){return Oe}),V.d(be,"B",function(){return Re}),V.d(be,"b",function(){return Le}),V.d(be,"S",function(){return Pe}),V.d(be,"o",function(){return _e}),V.d(be,"P",function(){return N}),V.d(be,"w",function(){return O}),V.d(be,"c",function(){return C}),V.d(be,"y",function(){return P});function ae(ee){return!ee||typeof ee!="string"?!0:ee.trim().length===0}const B=/{(\d+)}/g;function A(ee,...de){return de.length===0?ee:ee.replace(B,function(ge,xe){const Me=parseInt(xe,10);return isNaN(Me)||Me<0||Me>=de.length?ge:de[Me]})}function k(ee){return ee.replace(/[<>&]/g,function(de){switch(de){case"<":return"<";case">":return">";case"&":return"&";default:return de}})}function w(ee){return ee.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function R(ee,de=" "){const ge=H(ee,de);return U(ge,de)}function H(ee,de){if(!ee||!de)return ee;const ge=de.length;if(ge===0||ee.length===0)return ee;let xe=0;for(;ee.indexOf(de,xe)===xe;)xe=xe+ge;return ee.substring(xe)}function U(ee,de){if(!ee||!de)return ee;const ge=de.length,xe=ee.length;if(ge===0||xe===0)return ee;let Me=xe,Ue=-1;for(;!(Ue=ee.lastIndexOf(de,Me-1),Ue===-1||Ue+ge!==Me);){if(Ue===0)return"";Me=Ue}return ee.substring(0,Me)}function e(ee){return ee.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function S(ee){return ee.replace(/\*/g,"")}function f(ee,de,ge={}){if(!ee)throw new Error("Cannot create regex from empty string");de||(ee=w(ee)),ge.wholeWord&&(/\B/.test(ee.charAt(0))||(ee="\\b"+ee),/\B/.test(ee.charAt(ee.length-1))||(ee=ee+"\\b"));let xe="";return ge.global&&(xe+="g"),ge.matchCase||(xe+="i"),ge.multiline&&(xe+="m"),ge.unicode&&(xe+="u"),new RegExp(ee,xe)}function d(ee){if(ee.source==="^"||ee.source==="^$"||ee.source==="$"||ee.source==="^\\s*$")return!1;const de=ee.exec("");return!!(de&&ee.lastIndex===0)}function o(ee){return(ee.global?"g":"")+(ee.ignoreCase?"i":"")+(ee.multiline?"m":"")+(ee.unicode?"u":"")}function a(ee){return ee.split(/\r\n|\r|\n/)}function r(ee){for(let de=0,ge=ee.length;de<ge;de++){const xe=ee.charCodeAt(de);if(xe!==32&&xe!==9)return de}return-1}function h(ee,de=0,ge=ee.length){for(let xe=de;xe<ge;xe++){const Me=ee.charCodeAt(xe);if(Me!==32&&Me!==9)return ee.substring(de,xe)}return ee.substring(de,ge)}function s(ee,de=ee.length-1){for(let ge=de;ge>=0;ge--){const xe=ee.charCodeAt(ge);if(xe!==32&&xe!==9)return ge}return-1}function n(ee,de){return ee<de?-1:ee>de?1:0}function i(ee,de,ge=0,xe=ee.length,Me=0,Ue=de.length){for(;ge<xe&&Me<Ue;ge++,Me++){let ze=ee.charCodeAt(ge),We=de.charCodeAt(Me);if(ze<We)return-1;if(ze>We)return 1}const He=xe-ge,Be=Ue-Me;return He<Be?-1:He>Be?1:0}function t(ee,de){return b(ee,de,0,ee.length,0,de.length)}function b(ee,de,ge=0,xe=ee.length,Me=0,Ue=de.length){for(;ge<xe&&Me<Ue;ge++,Me++){let ze=ee.charCodeAt(ge),We=de.charCodeAt(Me);if(ze===We)continue;if(ze>=128||We>=128)return i(ee.toLowerCase(),de.toLowerCase(),ge,xe,Me,Ue);m(ze)&&(ze-=32),m(We)&&(We-=32);const Ke=ze-We;if(Ke===0)continue;return Ke}const He=xe-ge,Be=Ue-Me;return He<Be?-1:He>Be?1:0}function m(ee){return ee>=97&&ee<=122}function g(ee){return ee>=65&&ee<=90}function E(ee,de){return ee.length===de.length&&b(ee,de)===0}function _(ee,de){const ge=de.length;return de.length>ee.length?!1:b(ee,de,0,ge)===0}function y(ee,de){let ge,xe=Math.min(ee.length,de.length);for(ge=0;ge<xe;ge++)if(ee.charCodeAt(ge)!==de.charCodeAt(ge))return ge;return xe}function c(ee,de){let ge,xe=Math.min(ee.length,de.length);const Me=ee.length-1,Ue=de.length-1;for(ge=0;ge<xe;ge++)if(ee.charCodeAt(Me-ge)!==de.charCodeAt(Ue-ge))return ge;return xe}function u(ee){return 55296<=ee&&ee<=56319}function l(ee){return 56320<=ee&&ee<=57343}function v(ee,de){return(ee-55296<<10)+(de-56320)+65536}function p(ee,de,ge){const xe=ee.charCodeAt(ge);if(u(xe)&&ge+1<de){const Me=ee.charCodeAt(ge+1);if(l(Me))return v(xe,Me)}return xe}function T(ee,de){const ge=ee.charCodeAt(de-1);if(l(ge)&&de>1){const xe=ee.charCodeAt(de-2);if(u(xe))return v(xe,ge)}return ge}function L(ee,de){const ge=F.getInstance(),xe=de,Me=ee.length,Ue=p(ee,Me,de);de+=Ue>=65536?2:1;let He=ge.getGraphemeBreakType(Ue);for(;de<Me;){const Be=p(ee,Me,de),ze=ge.getGraphemeBreakType(Be);if(C(He,ze))break;de+=Be>=65536?2:1,He=ze}return de-xe}function D(ee,de){const ge=F.getInstance(),xe=de,Me=T(ee,de);de-=Me>=65536?2:1;let Ue=ge.getGraphemeBreakType(Me);for(;de>0;){const He=T(ee,de),Be=ge.getGraphemeBreakType(He);if(C(Be,Ue))break;de-=He>=65536?2:1,Ue=Be}return xe-de}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 M(ee){return x.test(ee)}const j=/(?:[\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 I(ee){return j.test(ee)}const W=/^[\t\n\r\x20-\x7E]*$/;function Q(ee){return W.test(ee)}const fe=/[\u2028\u2029]/;function le(ee){return fe.test(ee)}function Ce(ee){for(let de=0,ge=ee.length;de<ge;de++)if(Oe(ee.charCodeAt(de)))return!0;return!1}function Oe(ee){return ee=+ee,ee>=11904&&ee<=55215||ee>=63744&&ee<=64255||ee>=65281&&ee<=65374}function Re(ee){return ee>=127462&&ee<=127487||ee===8986||ee===8987||ee===9200||ee===9203||ee>=9728&&ee<=10175||ee===11088||ee===11093||ee>=127744&&ee<=128591||ee>=128640&&ee<=128764||ee>=128992&&ee<=129003||ee>=129280&&ee<=129535||ee>=129648&&ee<=129750}const Le=String.fromCharCode(65279);function Pe(ee){return!!(ee&&ee.length>0&&ee.charCodeAt(0)===65279)}function _e(ee,de=!1){return ee?(de&&(ee=ee.replace(/\\./g,"")),ee.toLowerCase()!==ee):!1}function N(ee){const de=90-65+1;return ee=ee%(2*de),ee<de?String.fromCharCode(97+ee):String.fromCharCode(65+ee-de)}function O(ee){const de=F.getInstance();return de.getGraphemeBreakType(ee)}function C(ee,de){return ee===0?de!==5&&de!==7:ee===2&&de===3?!1:ee===4||ee===2||ee===3||(de===4||de===2||de===3)?!0:ee===8&&(de===8||de===9||de===11||de===12)||((ee===11||ee===9)&&(de===9||de===10)||((ee===12||ee===10)&&de===10||(de===5||de===13||(de===7||(ee===1||ee===13&&de===14)))))?!1:!(ee===6&&de===6)}class F{constructor(){this._data=z()}static getInstance(){return F._INSTANCE||(F._INSTANCE=new F),F._INSTANCE}getGraphemeBreakType(ee){if(ee<32)return ee===10?3:ee===13?2:4;if(ee<127)return 0;const de=this._data,ge=de.length/3;let xe=1;for(;xe<=ge;)if(ee<de[3*xe])xe=2*xe;else if(ee>de[3*xe+1])xe=2*xe+1;else return de[3*xe+2];return 0}}F._INSTANCE=null;function z(){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 P(ee,de){if(ee===0)return 0;const ge=oe(ee,de);if(ge!==void 0)return ge;const xe=T(de,ee);return ee-=we(xe),ee}function oe(ee,de){let ge=T(de,ee);for(ee-=we(ge);Ae(ge)||ge===65039||ge===8419;){if(ee===0)return;ge=T(de,ee),ee-=we(ge)}if(!Re(ge))return;if(ee>=0){const xe=T(de,ee);xe===8205&&(ee-=we(xe))}return ee}function we(ee){return ee>=65536?2:1}function Ae(ee){return 127995<=ee&&ee<=127999}},SJMd:function(Je,be){/**
|
|
* @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 V,ae,B,A=!1,k,w;window.PR_SHOULD_USE_CONTINUATION=!0;var R,H;(function(){var U=window,e=["break,continue,do,else,for,if,return,while"],S=[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"],f=[S,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],d=[f,"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"],o=[f,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[f,"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"],r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",h=[f,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="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"],i=[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"],b=[d,a,o,h,s,n,i,t],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,g="str",E="kwd",_="com",y="typ",c="lit",u="pun",l="pln",v="tag",p="dec",T="src",L="atn",D="atv",x="nocode",M="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function j(oe){for(var we=0,Ae=!1,ee=!1,de=0,ge=oe.length;de<ge;++de){var xe=oe[de];if(xe.ignoreCase)ee=!0;else if(/[a-z]/i.test(xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ae=!0,ee=!1;break}}var Me={b:8,t:9,n:10,v:11,f:12,r:13};function Ue(Ke){var Fe=Ke.charCodeAt(0);if(Fe!==92)return Fe;var Ye=Ke.charAt(1);return Fe=Me[Ye],Fe||("0"<=Ye&&Ye<="7"?parseInt(Ke.substring(1),8):Ye==="u"||Ye==="x"?parseInt(Ke.substring(2),16):Ke.charCodeAt(1))}function He(Ke){if(Ke<32)return(Ke<16?"\\x0":"\\x")+Ke.toString(16);var Fe=String.fromCharCode(Ke);return Fe==="\\"||Fe==="-"||Fe==="]"||Fe==="^"?"\\"+Fe:Fe}function Be(Ke){var Fe=Ke.substring(1,Ke.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")),Ye=[],$e=Fe[0]==="^",q=["["];$e&&q.push("^");for(var K=$e?1:0,G=Fe.length;K<G;++K){var Z=Fe[K];if(/\\[bdsw]/i.test(Z))q.push(Z);else{var te=Ue(Z),X;K+2<G&&Fe[K+1]==="-"?(X=Ue(Fe[K+2]),K+=2):X=te,Ye.push([te,X]),X<65||te>122||(X<65||te>90||Ye.push([Math.max(65,te)|32,Math.min(X,90)|32]),X<97||te>122||Ye.push([Math.max(97,te)&~32,Math.min(X,122)&~32]))}}Ye.sort(function(Te,Ee){return Te[0]-Ee[0]||Ee[1]-Te[1]});for(var $=[],ne=[],K=0;K<Ye.length;++K){var se=Ye[K];se[0]<=ne[1]+1?ne[1]=Math.max(ne[1],se[1]):$.push(ne=se)}for(var K=0;K<$.length;++K){var se=$[K];q.push(He(se[0])),se[1]>se[0]&&(se[1]+1>se[0]&&q.push("-"),q.push(He(se[1])))}return q.push("]"),q.join("")}function ze(Ke){for(var Fe=Ke.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")),Ye=Fe.length,$e=[],q=0,K=0;q<Ye;++q){var G=Fe[q];if(G==="(")++K;else if(G.charAt(0)==="\\"){var Z=+G.substring(1);Z&&(Z<=K?$e[Z]=-1:Fe[q]=He(Z))}}for(var q=1;q<$e.length;++q)$e[q]===-1&&($e[q]=++we);for(var q=0,K=0;q<Ye;++q){var G=Fe[q];if(G==="(")++K,$e[K]||(Fe[q]="(?:");else if(G.charAt(0)==="\\"){var Z=+G.substring(1);Z&&Z<=K&&(Fe[q]="\\"+$e[Z])}}for(var q=0;q<Ye;++q)Fe[q]==="^"&&Fe[q+1]!=="^"&&(Fe[q]="");if(Ke.ignoreCase&&Ae)for(var q=0;q<Ye;++q){var G=Fe[q],te=G.charAt(0);G.length>=2&&te==="["?Fe[q]=Be(G):te!=="\\"&&(Fe[q]=G.replace(/[a-zA-Z]/g,function(ne){var se=ne.charCodeAt(0);return"["+String.fromCharCode(se&~32,se|32)+"]"}))}return Fe.join("")}for(var We=[],de=0,ge=oe.length;de<ge;++de){var xe=oe[de];if(xe.global||xe.multiline)throw new Error(""+xe);We.push("(?:"+ze(xe)+")")}return new RegExp(We.join("|"),ee?"gi":"g")}function I(oe,we){var Ae=/(?:^|\s)nocode(?:\s|$)/,ee=[],de=0,ge=[],xe=0;function Me(Ue){var He=Ue.nodeType;if(He==1){if(Ae.test(Ue.className))return;for(var Be=Ue.firstChild;Be;Be=Be.nextSibling)Me(Be);var ze=Ue.nodeName.toLowerCase();(ze==="br"||ze==="li")&&(ee[xe]=`
|
|
`,ge[xe<<1]=de++,ge[xe++<<1|1]=Ue)}else if(He==3||He==4){var We=Ue.nodeValue;We.length&&(we?We=We.replace(/\r\n?/g,`
|
|
`):We=We.replace(/[ \t\r\n]+/g," "),ee[xe]=We,ge[xe<<1]=de,de+=We.length,ge[xe++<<1|1]=Ue)}}return Me(oe),{sourceCode:ee.join("").replace(/\n$/,""),spans:ge}}function W(oe,we,Ae,ee,de){if(!Ae)return;var ge={sourceNode:oe,pre:1,langExtension:null,numberLines:null,sourceCode:Ae,spans:null,basePos:we,decorations:null};ee(ge),de.push.apply(de,ge.decorations)}var Q=/\S/;function fe(oe){for(var we=void 0,Ae=oe.firstChild;Ae;Ae=Ae.nextSibling){var ee=Ae.nodeType;we=ee===1?we?oe:Ae:ee===3&&Q.test(Ae.nodeValue)?oe:we}return we===oe?void 0:we}function le(oe,we){var Ae={},ee;(function(){for(var xe=oe.concat(we),Me=[],Ue={},He=0,Be=xe.length;He<Be;++He){var ze=xe[He],We=ze[3];if(We)for(var Ke=We.length;--Ke>=0;)Ae[We.charAt(Ke)]=ze;var Fe=ze[1],Ye=""+Fe;Ue.hasOwnProperty(Ye)||(Me.push(Fe),Ue[Ye]=null)}Me.push(/[\0-\uffff]/),ee=j(Me)})();var de=we.length,ge=function(xe){for(var Me=xe.sourceCode,Ue=xe.basePos,He=xe.sourceNode,Be=[Ue,l],ze=0,We=Me.match(ee)||[],Ke={},Fe=0,Ye=We.length;Fe<Ye;++Fe){var $e=We[Fe],q=Ke[$e],K=void 0,G;if(typeof q=="string")G=!1;else{var Z=Ae[$e.charAt(0)];if(Z)K=$e.match(Z[1]),q=Z[0];else{for(var te=0;te<de;++te)if(Z=we[te],K=$e.match(Z[1]),K){q=Z[0];break}K||(q=l)}G=q.length>=5&&q.substring(0,5)==="lang-",G&&!(K&&typeof K[1]=="string")&&(G=!1,q=T),G||(Ke[$e]=q)}var X=ze;if(ze+=$e.length,!G)Be.push(Ue+X,q);else{var $=K[1],ne=$e.indexOf($),se=ne+$.length;K[2]&&(se=$e.length-K[2].length,ne=se-$.length);var Te=q.substring(5);W(He,Ue+X,$e.substring(0,ne),ge,Be),W(He,Ue+X+ne,$,N(Te,$),Be),W(He,Ue+X+se,$e.substring(se),ge,Be)}}xe.decorations=Be};return ge}function Ce(oe){var we=[],Ae=[];oe.tripleQuotedStrings?we.push([g,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):oe.multiLineStrings?we.push([g,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):we.push([g,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),oe.verbatimStrings&&Ae.push([g,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ee=oe.hashComments;ee&&(oe.cStyleComments?(ee>1?we.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):we.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ae.push([g,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):we.push([_,/^#[^\r\n]*/,null,"#"])),oe.cStyleComments&&(Ae.push([_,/^\/\/[^\r\n]*/,null]),Ae.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var de=oe.regexLiterals;if(de){var ge=de>1?"":`
|
|
\r`,xe=ge?".":"[\\S\\s]",Me="/(?=[^/*"+ge+"])(?:[^/\\x5B\\x5C"+ge+"]|\\x5C"+xe+"|\\x5B(?:[^\\x5C\\x5D"+ge+"]|\\x5C"+xe+")*(?:\\x5D|$))+/";Ae.push(["lang-regex",RegExp("^"+M+"("+Me+")")])}var Ue=oe.types;Ue&&Ae.push([y,Ue]);var He=(""+oe.keywords).replace(/^ | $/g,"");He.length&&Ae.push([E,new RegExp("^(?:"+He.replace(/[\s,]+/g,"|")+")\\b"),null]),we.push([l,/^\s+/,null,` \r
|
|
\xA0`]);var Be="^.[^\\s\\w.$@'\"`/\\\\]*";return oe.regexLiterals&&(Be+="(?!s*/)"),Ae.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[l,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[l,/^\\[\s\S]?/,null],[u,new RegExp(Be),null]),le(we,Ae)}var Oe=Ce({keywords:b,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Re(oe,we,Ae){for(var ee=/(?:^|\s)nocode(?:\s|$)/,de=/\r\n?|\n/,ge=oe.ownerDocument,xe=ge.createElement("li");oe.firstChild;)xe.appendChild(oe.firstChild);var Me=[xe];function Ue(Fe){var Ye=Fe.nodeType;if(Ye==1&&!ee.test(Fe.className))if(Fe.nodeName==="br")He(Fe),Fe.parentNode&&Fe.parentNode.removeChild(Fe);else for(var $e=Fe.firstChild;$e;$e=$e.nextSibling)Ue($e);else if((Ye==3||Ye==4)&&Ae){var q=Fe.nodeValue,K=q.match(de);if(K){var G=q.substring(0,K.index);Fe.nodeValue=G;var Z=q.substring(K.index+K[0].length);if(Z){var te=Fe.parentNode;te.insertBefore(ge.createTextNode(Z),Fe.nextSibling)}He(Fe),G||Fe.parentNode.removeChild(Fe)}}}function He(Fe){for(;!Fe.nextSibling;)if(Fe=Fe.parentNode,!Fe)return;function Ye(K,G){var Z=G?K.cloneNode(!1):K,te=K.parentNode;if(te){var X=Ye(te,1),$=K.nextSibling;X.appendChild(Z);for(var ne=$;ne;ne=$)$=ne.nextSibling,X.appendChild(ne)}return Z}for(var $e=Ye(Fe.nextSibling,0),q;(q=$e.parentNode)&&q.nodeType===1;)$e=q;Me.push($e)}for(var Be=0;Be<Me.length;++Be)Ue(Me[Be]);we===(we|0)&&Me[0].setAttribute("value",we);var ze=ge.createElement("ol");ze.className="linenums";for(var We=Math.max(0,we-1|0)||0,Be=0,Ke=Me.length;Be<Ke;++Be)xe=Me[Be],xe.className="L"+(Be+We)%10,xe.firstChild||xe.appendChild(ge.createTextNode("\xA0")),ze.appendChild(xe);oe.appendChild(ze)}function Le(oe){var we=/\bMSIE\s(\d+)/.exec(navigator.userAgent);we=we&&+we[1]<=8;var Ae=/\n/g,ee=oe.sourceCode,de=ee.length,ge=0,xe=oe.spans,Me=xe.length,Ue=0,He=oe.decorations,Be=He.length,ze=0;He[Be]=de;var We,Ke;for(Ke=We=0;Ke<Be;)He[Ke]!==He[Ke+2]?(He[We++]=He[Ke++],He[We++]=He[Ke++]):Ke+=2;for(Be=We,Ke=We=0;Ke<Be;){for(var Fe=He[Ke],Ye=He[Ke+1],$e=Ke+2;$e+2<=Be&&He[$e+1]===Ye;)$e+=2;He[We++]=Fe,He[We++]=Ye,Ke=$e}Be=He.length=We;var q=oe.sourceNode,K="";q&&(K=q.style.display,q.style.display="none");try{for(var G=null;Ue<Me;){var Z=xe[Ue],te=xe[Ue+2]||de,X=He[ze+2]||de,$e=Math.min(te,X),$=xe[Ue+1],ne;if($.nodeType!==1&&(ne=ee.substring(ge,$e))){we&&(ne=ne.replace(Ae,"\r")),$.nodeValue=ne;var se=$.ownerDocument,Te=se.createElement("span");Te.className=He[ze+1];var Ee=$.parentNode;Ee.replaceChild(Te,$),Te.appendChild($),ge<te&&(xe[Ue+1]=$=se.createTextNode(ee.substring($e,te)),Ee.insertBefore($,Te.nextSibling))}ge=$e,ge>=te&&(Ue+=2),ge>=X&&(ze+=2)}}finally{q&&(q.style.display=K)}}var Pe={};function _e(oe,we){for(var Ae=we.length;--Ae>=0;){var ee=we[Ae];Pe.hasOwnProperty(ee)?U.console&&console.warn("cannot override language handler %s",ee):Pe[ee]=oe}}function N(oe,we){return oe&&Pe.hasOwnProperty(oe)||(oe=/^\s*</.test(we)?"default-markup":"default-code"),Pe[oe]}_e(Oe,["default-code"]),_e(le([],[[l,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["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"]),_e(le([[l,/^[\s]+/,null,` \r
|
|
`],[D,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[L,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["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"]),_e(le([],[[D,/^[\s\S]+/]]),["uq.val"]),_e(Ce({keywords:d,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),_e(Ce({keywords:"null,true,false"}),["json"]),_e(Ce({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),_e(Ce({keywords:o,cStyleComments:!0}),["java"]),_e(Ce({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),_e(Ce({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),_e(Ce({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),_e(Ce({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),_e(Ce({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),_e(Ce({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),_e(le([],[[g,/^[\s\S]+/]]),["regex"]);function O(oe){var we=oe.langExtension;try{var Ae=I(oe.sourceNode,oe.pre),ee=Ae.sourceCode;oe.sourceCode=ee,oe.spans=Ae.spans,oe.basePos=0,N(we,ee)(oe),Le(oe)}catch(de){U.console&&console.log(de&&de.stack||de)}}function C(oe,we,Ae){var ee=Ae||!1,de=we||null,ge=document.createElement("div");ge.innerHTML="<pre>"+oe+"</pre>",ge=ge.firstChild,ee&&Re(ge,ee,!0);var xe={langExtension:de,numberLines:ee,sourceNode:ge,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return O(xe),ge.innerHTML}function F(oe,we){var Ae=we||document.body,ee=Ae.ownerDocument||document;function de(Z){return Ae.getElementsByTagName(Z)}for(var ge=[de("pre"),de("code"),de("xmp")],xe=[],Me=0;Me<ge.length;++Me)for(var Ue=0,He=ge[Me].length;Ue<He;++Ue)xe.push(ge[Me][Ue]);ge=null;var Be=Date;Be.now||(Be={now:function(){return+new Date}});var ze=0,We=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ke=/\bprettyprint\b/,Fe=/\bprettyprinted\b/,Ye=/pre|xmp/i,$e=/^code$/i,q=/^(?:pre|code|xmp)$/i,K={};function G(){for(var Z=U.PR_SHOULD_USE_CONTINUATION?Be.now()+250:Infinity;ze<xe.length&&Be.now()<Z;ze++){for(var te=xe[ze],X=K,$=te;$=$.previousSibling;){var ne=$.nodeType,se=(ne===7||ne===8)&&$.nodeValue;if(se?!/^\??prettify\b/.test(se):ne!==3||/\S/.test($.nodeValue))break;if(se){X={},se.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Nt,lt,Kt){X[lt]=Kt});break}}var Te=te.className;if((X!==K||Ke.test(Te))&&!Fe.test(Te)){for(var Ee=!1,De=te.parentNode;De;De=De.parentNode){var Ge=De.tagName;if(q.test(Ge)&&De.className&&Ke.test(De.className)){Ee=!0;break}}if(!Ee){te.className+=" prettyprinted";var Ze=X.lang;if(!Ze){Ze=Te.match(We);var Qe;!Ze&&(Qe=fe(te))&&$e.test(Qe.tagName)&&(Ze=Qe.className.match(We)),Ze&&(Ze=Ze[1])}var vt;if(Ye.test(te.tagName))vt=1;else{var it=te.currentStyle,Xe=ee.defaultView,Mt=it?it.whiteSpace:Xe&&Xe.getComputedStyle?Xe.getComputedStyle(te,null).getPropertyValue("white-space"):0;vt=Mt&&Mt.substring(0,3)==="pre"}var Tt=X.linenums;(Tt=Tt==="true"||+Tt)||(Tt=Te.match(/\blinenums\b(?::(\d+))?/),Tt=Tt?Tt[1]&&Tt[1].length?+Tt[1]:!0:!1),Tt&&Re(te,Tt,vt);var kt={langExtension:Ze,sourceNode:te,numberLines:Tt,pre:vt,sourceCode:null,basePos:null,spans:null,decorations:null};O(kt)}}}ze<xe.length?U.setTimeout(G,250):typeof oe=="function"&&oe()}G()}var z=U.PR={createSimpleLexer:le,registerLangHandler:_e,sourceDecorator:Ce,PR_ATTRIB_NAME:L,PR_ATTRIB_VALUE:D,PR_COMMENT:_,PR_DECLARATION:p,PR_KEYWORD:E,PR_LITERAL:c,PR_NOCODE:x,PR_PLAIN:l,PR_PUNCTUATION:u,PR_SOURCE:T,PR_STRING:g,PR_TAG:v,PR_TYPE:y,prettyPrintOne:A?U.prettyPrintOne=C:R=C,prettyPrint:H=A?U.prettyPrint=F:H=F},P=U.define;typeof P=="function"&&P.amd&&P("google-code-prettify",[],function(){return z})})()},STEk:function(Je,be,V){"use strict";V.d(be,"a",function(){return _e});/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var ae=function(N,O){return(ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,F){C.__proto__=F}||function(C,F){for(var z in F)Object.prototype.hasOwnProperty.call(F,z)&&(C[z]=F[z])})(N,O)};function B(N,O){function C(){this.constructor=N}ae(N,O),N.prototype=O===null?Object.create(O):(C.prototype=O.prototype,new C)}function A(N,O,C,F){return new(C||(C=Promise))(function(z,P){function oe(ee){try{Ae(F.next(ee))}catch(de){P(de)}}function we(ee){try{Ae(F.throw(ee))}catch(de){P(de)}}function Ae(ee){var de;ee.done?z(ee.value):(de=ee.value,de instanceof C?de:new C(function(ge){ge(de)})).then(oe,we)}Ae((F=F.apply(N,O||[])).next())})}function k(N,O){var C,F,z,P,oe={label:0,sent:function(){if(1&z[0])throw z[1];return z[1]},trys:[],ops:[]};return P={next:we(0),throw:we(1),return:we(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function we(Ae){return function(ee){return function(de){if(C)throw new TypeError("Generator is already executing.");for(;oe;)try{if(C=1,F&&(z=2&de[0]?F.return:de[0]?F.throw||((z=F.return)&&z.call(F),0):F.next)&&!(z=z.call(F,de[1])).done)return z;switch(F=0,z&&(de=[2&de[0],z.value]),de[0]){case 0:case 1:z=de;break;case 4:return oe.label++,{value:de[1],done:!1};case 5:oe.label++,F=de[1],de=[0];continue;case 7:de=oe.ops.pop(),oe.trys.pop();continue;default:if(!(z=oe.trys,(z=z.length>0&&z[z.length-1])||de[0]!==6&&de[0]!==2)){oe=0;continue}if(de[0]===3&&(!z||de[1]>z[0]&&de[1]<z[3])){oe.label=de[1];break}if(de[0]===6&&oe.label<z[1]){oe.label=z[1],z=de;break}if(z&&oe.label<z[2]){oe.label=z[2],oe.ops.push(de);break}z[2]&&oe.ops.pop(),oe.trys.pop();continue}de=O.call(N,oe)}catch(ge){de=[6,ge],F=0}finally{C=z=0}if(5&de[0])throw de[1];return{value:de[0]?de[1]:void 0,done:!0}}([Ae,ee])}}}function w(){for(var N=0,O=0,C=arguments.length;O<C;O++)N+=arguments[O].length;var F=Array(N),z=0;for(O=0;O<C;O++)for(var P=arguments[O],oe=0,we=P.length;oe<we;oe++,z++)F[z]=P[oe];return F}var R=function(){function N(){}return N.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},N.setAttributes=function(O,C){for(var F=0,z=C;F<z.length;F++){var P=z[F],oe=P[0],we=P[1];O.setAttribute(oe,we)}},N.createRect=function(O,C,F){var z=document.createElementNS("http://www.w3.org/2000/svg","rect");return z.setAttribute("width",O.toString()),z.setAttribute("height",C.toString()),F&&N.setAttributes(z,F),z},N.createLine=function(O,C,F,z,P){var oe=document.createElementNS("http://www.w3.org/2000/svg","line");return oe.setAttribute("x1",O.toString()),oe.setAttribute("y1",C.toString()),oe.setAttribute("x2",F.toString()),oe.setAttribute("y2",z.toString()),P&&N.setAttributes(oe,P),oe},N.createPolygon=function(O,C){var F=document.createElementNS("http://www.w3.org/2000/svg","polygon");return F.setAttribute("points",O),C&&N.setAttributes(F,C),F},N.createCircle=function(O,C){var F=document.createElementNS("http://www.w3.org/2000/svg","circle");return F.setAttribute("cx",(O/2).toString()),F.setAttribute("cy",(O/2).toString()),F.setAttribute("r",O.toString()),C&&N.setAttributes(F,C),F},N.createEllipse=function(O,C,F){var z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return z.setAttribute("cx",(O/2).toString()),z.setAttribute("cy",(C/2).toString()),z.setAttribute("rx",(O/2).toString()),z.setAttribute("ry",(C/2).toString()),F&&N.setAttributes(z,F),z},N.createGroup=function(O){var C=document.createElementNS("http://www.w3.org/2000/svg","g");return O&&N.setAttributes(C,O),C},N.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},N.createMarker=function(O,C,F,z,P,oe,we){var Ae=document.createElementNS("http://www.w3.org/2000/svg","marker");return N.setAttributes(Ae,[["id",O],["orient",C],["markerWidth",F.toString()],["markerHeight",z.toString()],["refX",P.toString()],["refY",oe.toString()]]),Ae.appendChild(we),Ae},N.createText=function(O){var C=document.createElementNS("http://www.w3.org/2000/svg","text");return C.setAttribute("x","0"),C.setAttribute("y","0"),O&&N.setAttributes(C,O),C},N.createTSpan=function(O,C){var F=document.createElementNS("http://www.w3.org/2000/svg","tspan");return F.textContent=O,C&&N.setAttributes(F,C),F},N.createImage=function(O){var C=document.createElementNS("http://www.w3.org/2000/svg","image");return O&&N.setAttributes(C,O),C},N.createPoint=function(O,C){var F=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return F.x=O,F.y=C,F},N.createPath=function(O,C){var F=document.createElementNS("http://www.w3.org/2000/svg","path");return F.setAttribute("d",O),C&&N.setAttributes(F,C),F},N}(),H=function(){function N(){}return N.addKey=function(O){N.key=O},Object.defineProperty(N,"isLicensed",{get:function(){return!!N.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(N.key)},enumerable:!1,configurable:!0}),N}(),U=function(){function N(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return N.prototype.rasterize=function(O,C,F){var z=this;return new Promise(function(P){var oe=F!==void 0?F:document.createElement("canvas");O===null&&(z.markersOnly=!0,z.naturalSize=!1);var we=document.createElementNS("http://www.w3.org/2000/svg","svg");we.setAttribute("xmlns","http://www.w3.org/2000/svg"),we.setAttribute("width",C.width.baseVal.valueAsString),we.setAttribute("height",C.height.baseVal.valueAsString),we.setAttribute("viewBox","0 0 "+C.viewBox.baseVal.width.toString()+" "+C.viewBox.baseVal.height.toString()),we.innerHTML=C.innerHTML,z.naturalSize===!0?(we.width.baseVal.value=O.naturalWidth,we.height.baseVal.value=O.naturalHeight):z.width!==void 0&&z.height!==void 0&&(we.width.baseVal.value=z.width,we.height.baseVal.value=z.height),oe.width=we.width.baseVal.value,oe.height=we.height.baseVal.value;var Ae=we.outerHTML,ee=oe.getContext("2d");z.markersOnly!==!0&&ee.drawImage(O,0,0,oe.width,oe.height);var de=window.URL,ge=new Image(oe.width,oe.height);ge.setAttribute("crossOrigin","anonymous");var xe=new Blob([Ae],{type:"image/svg+xml"}),Me=de.createObjectURL(xe);ge.onload=function(){ee.drawImage(ge,0,0),de.revokeObjectURL(Me);var Ue=oe.toDataURL(z.imageType,z.imageQuality);P(Ue)},ge.src=Me})},N}(),e=function(){},S=function(){function N(O){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+O+"_"}return Object.defineProperty(N.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(N.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(N.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),N.prototype.addClass=function(O){return this.styleSheet===void 0&&this.addStyleSheet(),O.name=""+this.classNamePrefix+O.localName,this.classes.push(O),this.styleSheet.sheet.insertRule("."+O.name+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length),O},N.prototype.addRule=function(O){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(O),this.styleSheet.sheet.insertRule(O.selector+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length)},N.prototype.addStyleSheet=function(){var O;this.styleSheet=document.createElement("style"),((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).appendChild(this.styleSheet),this.addRule(new f("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new f("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new f("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new d("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new d("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},N.prototype.removeStyleSheet=function(){var O;this.styleSheet&&(((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},N}(),f=function(N,O){this.selector=N,this.style=O},d=function(N,O){this.localName=N,this.style=O},o=function(){function N(O,C,F,z,P){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=O,this.displayMode=C,this.markerItems=F,this.uiStyleSettings=z,this.styles=P,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return N.prototype.show=function(O){var C=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var F=document.createElement("div");F.className=this.toolbarBlockStyleClass.name,F.style.whiteSpace="nowrap",this.uiContainer.appendChild(F),this.addActionButton(F,'<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(F,'<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(F,'<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(F,'<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(F,'<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(F,'<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(F,'<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(F,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(P){var oe=document.createElement("div");oe.className=""+C.toolbarButtonStyleClass.name,oe.setAttribute("data-type-name",P.typeName),oe.innerHTML=P.icon,oe.addEventListener("click",function(){C.markerToolbarButtonClicked(oe,P)}),C.buttons.push(oe),C.markerButtons.push(oe)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(z),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},N.prototype.addButtonClickListener=function(O){this.buttonClickListeners.push(O)},N.prototype.removeButtonClickListener=function(O){this.buttonClickListeners.indexOf(O)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(O),1)},N.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},N.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var O=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var C=0;C<this.markerButtons.length;C++)C<O||C===O&&this.markerButtons.length-1===O?this.markerButtonBlock.appendChild(this.markerButtons[C]):(C===O&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[C]))}},N.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")},N.prototype.resetButtonStyles=function(){var O=this;this.buttons.forEach(function(C){C.className=C.className.replace(O.uiStyleSettings.toolbarButtonStyleColorsClassName?O.uiStyleSettings.toolbarButtonStyleColorsClassName:O.toolbarButtonStyleColorsClass.name,"").trim(),C.className=C.className.replace(O.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?O.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:O.toolbarActiveButtonStyleColorsClass.name,"").trim(),C.className+=" "+(O.uiStyleSettings.toolbarButtonStyleColorsClassName?O.uiStyleSettings.toolbarButtonStyleColorsClassName:O.toolbarButtonStyleColorsClass.name)})},N.prototype.addActionButton=function(O,C,F){var z=this,P=document.createElement("div");switch(P.className=""+this.toolbarButtonStyleClass.name,P.innerHTML=C,P.setAttribute("data-action",F),P.addEventListener("click",function(){z.actionToolbarButtonClicked(P,F)}),F){case"select":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":P.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":P.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":P.style.fill=this.uiStyleSettings.closeButtonColor}O.appendChild(P),this.buttons.push(P)},N.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new d("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 d("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new d("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new d("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 d("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var O=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new d("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*O)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*O)+`px;
|
|
padding: `+O+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new d("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new d("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new f("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new f("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},N.prototype.markerToolbarButtonClicked=function(O,C){this.setActiveButton(O),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("marker",C)}),this.markerButtonOverflowBlock.style.display="none"},N.prototype.actionToolbarButtonClicked=function(O,C){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("action",C)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},N.prototype.setActiveButton=function(O){this.resetButtonStyles(),O.className=O.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),O.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},N.prototype.setActiveMarkerButton=function(O){var C=this.markerButtons.find(function(F){return F.getAttribute("data-type-name")===O});C&&this.setActiveButton(C)},N.prototype.setCurrentMarker=function(O){var C=this;this.currentMarker=O,this.buttons.filter(function(F){return/delete|notes/.test(F.getAttribute("data-action"))}).forEach(function(F){C.currentMarker===void 0?(F.style.fillOpacity="0.4",F.style.pointerEvents="none"):(F.style.fillOpacity="1",F.style.pointerEvents="all")})},N}(),a=function(){function N(O,C,F,z){this.panels=[],this.panelButtons=[],this.markerjsContainer=O,this.displayMode=C,this.uiStyleSettings=F,this.styles=z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return N.prototype.addStyles=function(){var O;this.toolboxStyleClass=this.styles.addClass(new d("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 d("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new d("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new d("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new d("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 d("toolbox-panel-row_colors",`
|
|
background-color: `+((O=this.uiStyleSettings.toolboxBackgroundColor)!==null&&O!==void 0?O:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new d("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
|
|
padding: `+C+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new d("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new d("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new f("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new f("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},N.prototype.show=function(O){var C;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolboxStyleClass.name+" "+((C=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},N.prototype.setPanelButtons=function(O){var C,F,z=this;this.panels=O,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((C=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((F=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(P){var oe;P.uiStyleSettings=z.uiStyleSettings;var we=document.createElement("div");we.className=z.toolboxButtonStyleClass.name+" "+((oe=z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&oe!==void 0?oe:z.toolboxButtonStyleColorsClass.name),we.innerHTML=P.icon,we.title=P.title,we.addEventListener("click",function(){z.panelButtonClick(P)}),z.panelButtons.push(we),z.buttonRow.appendChild(we)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},N.prototype.panelButtonClick=function(O){var C=this,F=-1;if(O!==this.activePanel){F=this.panels.indexOf(O),this.panelRow.innerHTML="";var z=O.getUi();z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(z),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=O}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){C.displayMode==="inline"?C.panelRow.style.display="none":C.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(P,oe){var we,Ae;P.className=C.toolboxButtonStyleClass.name+" "+(oe===F?""+((we=C.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&we!==void 0?we:C.toolboxActiveButtonStyleColorsClass.name):""+((Ae=C.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:C.toolboxButtonStyleColorsClass.name))})},N}(),r=function(N,O){this.title=N,this.icon=O},h=function(N){function O(C,F,z,P){var oe=N.call(this,C,P||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return oe.colors=[],oe.addTransparent=!1,oe.colorBoxes=[],oe.colors=F,oe.currentColor=z,oe.setCurrentColor=oe.setCurrentColor.bind(oe),oe.getColorBox=oe.getColorBox.bind(oe),oe}return B(O,N),O.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.whiteSpace="nowrap",this.colors.forEach(function(z){var P=C.getColorBox(z);F.appendChild(P),C.colorBoxes.push(P)}),F},O.prototype.getColorBox=function(C){var F=this,z=this.uiStyleSettings.toolbarHeight/4,P=this.uiStyleSettings.toolbarHeight-z,oe=document.createElement("div");oe.style.display="inline-block",oe.style.boxSizing="content-box",oe.style.width=P-2+"px",oe.style.height=P-2+"px",oe.style.padding="1px",oe.style.marginRight="2px",oe.style.marginBottom="2px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderRadius=(P+2)/2+"px",oe.style.borderColor=C===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){F.setCurrentColor(C,oe)});var we=document.createElement("div");return we.style.display="inline-block",we.style.width=P-2+"px",we.style.height=P-2+"px",we.style.backgroundColor=C,we.style.borderRadius=P/2+"px",C==="transparent"&&(we.style.fill=this.uiStyleSettings.toolboxAccentColor,we.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),oe.appendChild(we),oe},O.prototype.setCurrentColor=function(C,F){var z=this;this.currentColor=C,this.colorBoxes.forEach(function(P){P.style.borderColor=P===F?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(C)},O}(r),s=function(){function N(O,C,F){this._state="new",this._isSelected=!1,this._container=O,this._overlayContainer=C,this.globalSettings=F,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(N.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(O){return!1},Object.defineProperty(N.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),N.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},N.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},N.prototype.pointerDown=function(O,C){},N.prototype.dblClick=function(O,C){},N.prototype.manipulate=function(O){},N.prototype.pointerUp=function(O){this.stateChanged()},N.prototype.dispose=function(){},N.prototype.addMarkerVisualToContainer=function(O){this.container.childNodes.length>0?this.container.insertBefore(O,this.container.childNodes[0]):this.container.appendChild(O)},N.prototype.getState=function(){return{typeName:N.typeName,state:this.state,notes:this.notes}},N.prototype.restoreState=function(O){this._state=O.state,this.notes=O.notes},N.prototype.scale=function(O,C){},N.prototype.colorChanged=function(O){this.onColorChanged&&this.onColorChanged(O),this.stateChanged()},N.prototype.fillColorChanged=function(O){this.onFillColorChanged&&this.onFillColorChanged(O),this.stateChanged()},N.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var O=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),O.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(O)&&this.onStateChanged(this)}},N.typeName="MarkerBase",N}(),n=function(){function N(){this.findGripByVisual=this.findGripByVisual.bind(this)}return N.prototype.findGripByVisual=function(O){return this.topLeft.ownsTarget(O)?this.topLeft:this.topCenter.ownsTarget(O)?this.topCenter:this.topRight.ownsTarget(O)?this.topRight:this.centerLeft.ownsTarget(O)?this.centerLeft:this.centerRight.ownsTarget(O)?this.centerRight:this.bottomLeft.ownsTarget(O)?this.bottomLeft:this.bottomCenter.ownsTarget(O)?this.bottomCenter:this.bottomRight.ownsTarget(O)?this.bottomRight:void 0},N}(),i=function(){function N(){this.GRIP_SIZE=10,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","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return N.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},N}(),t=function(){function N(){}return N.toITransformMatrix=function(O){return{a:O.a,b:O.b,c:O.c,d:O.d,e:O.e,f:O.f}},N.toSVGMatrix=function(O,C){return O.a=C.a,O.b=C.b,O.c=C.c,O.d=C.d,O.e=C.e,O.f=C.f,O},N}(),b=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.left=0,P.top=0,P.width=0,P.height=0,P.defaultSize={x:50,y:20},P.offsetX=0,P.offsetY=0,P.rotationAngle=0,P.CB_DISTANCE=10,P._suppressMarkerCreateEvent=!1,P.container.transform.baseVal.appendItem(R.createTransform()),P.setupControlBox(),P}return B(O,N),Object.defineProperty(O.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"visual",{get:function(){return this._visual},set:function(C){this._visual=C;var F=R.createTransform();this._visual.transform.baseVal.appendItem(F)},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(C){return!!N.prototype.ownsTarget.call(this,C)||!!(this.controlGrips.findGripByVisual(C)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(C))},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.state==="new"&&(this.left=C.x,this.top=C.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var z=this.unrotatePoint(C);if(this.manipulationStartX=z.x,this.manipulationStartY=z.y,this.offsetX=z.x-this.left,this.offsetY=z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(F),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F)){this.activeGrip=this.rotatorGrip;var P=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=P.x-this.width/2,this.top=P.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var oe=this.container.transform.baseVal.getItem(0);oe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(oe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},O.prototype.pointerUp=function(C){var F=this.state;N.prototype.pointerUp.call(this,C),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(C),this._state="select",F==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},O.prototype.moveVisual=function(C){this.visual.style.transform="translate("+C.x+"px, "+C.y+"px)"},O.prototype.manipulate=function(C){var F=this.unrotatePoint(C);this.state==="creating"?this.resize(C):this.state==="move"?(this.left=this.manipulationStartLeft+(F.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(F.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(F):this.state==="rotate"&&this.rotate(C)},O.prototype.resize=function(C){var F=this.manipulationStartLeft,z=this.manipulationStartWidth,P=this.manipulationStartTop,oe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:F=this.manipulationStartLeft+C.x-this.manipulationStartX,z=this.manipulationStartWidth+this.manipulationStartLeft-F;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:z=this.manipulationStartWidth+C.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:P=this.manipulationStartTop+C.y-this.manipulationStartY,oe=this.manipulationStartHeight+this.manipulationStartTop-P;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:oe=this.manipulationStartHeight+C.y-this.manipulationStartY}z>=0?(this.left=F,this.width=z):(this.left=F+z,this.width=-z),oe>=0?(this.top=P,this.height=oe):(this.top=P+oe,this.height=-oe),this.setSize()},O.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},O.prototype.rotate=function(C){if(Math.abs(C.x-this.centerX)>.1){var F=Math.sign(C.x-this.centerX);this.rotationAngle=180*Math.atan((C.y-this.centerY)/(C.x-this.centerX))/Math.PI+90*F,this.applyRotation()}},O.prototype.applyRotation=function(){var C=this.container.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(C,0)},O.prototype.rotatePoint=function(C){if(this.rotationAngle===0)return C;var F=this.container.getCTM(),z=R.createPoint(C.x,C.y);return{x:(z=z.matrixTransform(F)).x,y:z.y}},O.prototype.unrotatePoint=function(C){if(this.rotationAngle===0)return C;var F=this.container.getCTM();F=F.inverse();var z=R.createPoint(C.x,C.y);return{x:(z=z.matrixTransform(F)).x,y:z.y}},O.prototype.select=function(){N.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){N.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=R.createGroup();var C=R.createTransform();C.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(C),this.container.appendChild(this.controlBox),this.controlRect=R.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=R.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"},O.prototype.adjustControlBox=function(){var C=this.controlBox.transform.baseVal.getItem(0);C.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(C,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()},O.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()},O.prototype.createGrip=function(){var C=new i;return C.visual.transform.baseVal.appendItem(R.createTransform()),this.controlBox.appendChild(C.visual),C},O.prototype.positionGrips=function(){var C=this.controlGrips.topLeft.GRIP_SIZE,F=-C/2,z=F,P=(this.width+this.CB_DISTANCE)/2-C/2,oe=(this.height+this.CB_DISTANCE)/2-C/2,we=this.height+this.CB_DISTANCE-C/2,Ae=this.width+this.CB_DISTANCE-C/2;this.positionGrip(this.controlGrips.topLeft.visual,F,z),this.positionGrip(this.controlGrips.topCenter.visual,P,z),this.positionGrip(this.controlGrips.topRight.visual,Ae,z),this.positionGrip(this.controlGrips.centerLeft.visual,F,oe),this.positionGrip(this.controlGrips.centerRight.visual,Ae,oe),this.positionGrip(this.controlGrips.bottomLeft.visual,F,we),this.positionGrip(this.controlGrips.bottomCenter.visual,P,we),this.positionGrip(this.controlGrips.bottomRight.visual,Ae,we),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,P,z-3*this.CB_DISTANCE)},O.prototype.positionGrip=function(C,F,z){var P=C.transform.baseVal.getItem(0);P.setTranslate(F,z),C.transform.baseVal.replaceItem(P,0)},O.prototype.hideControlBox=function(){this.controlBox.style.display="none"},O.prototype.showControlBox=function(){this.controlBox.style.display=""},O.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)},N.prototype.getState.call(this))},O.prototype.restoreState=function(C){N.prototype.restoreState.call(this,C);var F=C;this.left=F.left,this.top=F.top,this.width=F.width,this.height=F.height,this.rotationAngle=F.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,F.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,F.containerTransformMatrix))},O.prototype.scale=function(C,F){N.prototype.scale.call(this,C,F);var z=this.rotatePoint({x:this.left,y:this.top}),P=this.unrotatePoint({x:z.x*C,y:z.y*F});this.left=P.x,this.top=P.y,this.width=this.width*C,this.height=this.height*F,this.adjustControlBox()},O}(s),m=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.createVisual=P.createVisual.bind(P),P}return B(O,N),O.prototype.ownsTarget=function(C){return!(!N.prototype.ownsTarget.call(this,C)&&C!==this.visual)},O.prototype.createVisual=function(){this.visual=R.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)},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},O.prototype.manipulate=function(C){N.prototype.manipulate.call(this,C)},O.prototype.resize=function(C){N.prototype.resize.call(this,C),this.setSize()},O.prototype.setSize=function(){N.prototype.setSize.call(this),R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(C){N.prototype.pointerUp.call(this,C),this.setSize()},O.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},O.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},O.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&R.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},N.prototype.getState.call(this))},O.prototype.restoreState=function(C){var F=C;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),N.prototype.restoreState.call(this,C),this.setSize()},O.prototype.scale=function(C,F){N.prototype.scale.call(this,C,F),this.setSize()},O.title="Rectangle marker",O}(b),g=function(N){function O(C,F,z,P){var oe=N.call(this,C,P||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return oe.widths=[],oe.widthBoxes=[],oe.widths=F,oe.currentWidth=z,oe.setCurrentWidth=oe.setCurrentWidth.bind(oe),oe}return B(O,N),O.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.widths.forEach(function(z){var P=document.createElement("div");P.style.display="flex",P.style.flexGrow="2",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=z===C.currentWidth?C.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){C.setCurrentWidth(z,P)}),F.appendChild(P);var oe=document.createElement("div");oe.innerText=z.toString(),oe.style.marginRight="5px",P.appendChild(oe);var we=document.createElement("div");we.style.minHeight="20px",we.style.flexGrow="2",we.style.display="flex",we.style.alignItems="center";var Ae=document.createElement("hr");Ae.style.minWidth="20px",Ae.style.border="0px",Ae.style.borderTop=z+"px solid "+C.uiStyleSettings.toolboxColor,Ae.style.flexGrow="2",we.appendChild(Ae),P.appendChild(we),C.widthBoxes.push(P)}),F},O.prototype.setCurrentWidth=function(C,F){var z=this;this.currentWidth=C,this.widthBoxes.forEach(function(P){P.style.borderColor=P===F?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},O}(r),E=function(N){function O(C,F,z,P){var oe=N.call(this,C,P||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return oe.styles=[],oe.styleBoxes=[],oe.styles=F,oe.currentStyle=z,oe.setCurrentStyle=oe.setCurrentStyle.bind(oe),oe}return B(O,N),O.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.styles.forEach(function(z){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/C.styles.length-5+"%",P.style.borderColor=z===C.currentStyle?C.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){C.setCurrentStyle(z,P)}),F.appendChild(P);var oe=document.createElement("div");oe.style.minHeight="20px",oe.style.flexGrow="2",oe.style.overflow="hidden";var we=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+C.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(z!==""?'stroke-dasharray="'+z+'"':"")+` />
|
|
</svg>`;oe.innerHTML=we,P.appendChild(oe),C.styleBoxes.push(P)}),F},O.prototype.setCurrentStyle=function(C,F){var z=this;this.currentStyle=C,this.styleBoxes.forEach(function(P){P.style.borderColor=P===F?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},O}(r),_=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.strokePanel=new h("Line color",z.defaultColorSet,z.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new g("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new E("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return B(O,N),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=N.prototype.getState.call(this);return C.typeName=O.typeName,C},O.typeName="FrameMarker",O.title="Frame marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',O}(m),y=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},c=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.x1=0,P.y1=0,P.x2=0,P.y2=0,P.defaultLength=50,P.manipulationStartX=0,P.manipulationStartY=0,P.manipulationStartX1=0,P.manipulationStartY1=0,P.manipulationStartX2=0,P.manipulationStartY2=0,P.setupControlBox(),P}return B(O,N),O.prototype.ownsTarget=function(C){return!!N.prototype.ownsTarget.call(this,C)||!(!this.grip1.ownsTarget(C)&&!this.grip2.ownsTarget(C))},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.manipulationStartX=C.x,this.manipulationStartY=C.y,this.state==="new"&&(this.x1=C.x,this.y1=C.y,this.x2=C.x,this.y2=C.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(F)?this.activeGrip=this.grip1:this.grip2.ownsTarget(F)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},O.prototype.pointerUp=function(C){var F=this.state;N.prototype.pointerUp.call(this,C),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(C),this._state="select",F==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},O.prototype.adjustVisual=function(){},O.prototype.manipulate=function(C){this.state==="creating"?this.resize(C):this.state==="move"?(this.x1=this.manipulationStartX1+C.x-this.manipulationStartX,this.y1=this.manipulationStartY1+C.y-this.manipulationStartY,this.x2=this.manipulationStartX2+C.x-this.manipulationStartX,this.y2=this.manipulationStartY2+C.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(C)},O.prototype.resize=function(C){switch(this.activeGrip){case this.grip1:this.x1=C.x,this.y1=C.y;break;case this.grip2:case void 0:this.x2=C.x,this.y2=C.y}this.adjustVisual(),this.adjustControlBox()},O.prototype.select=function(){N.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){N.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=R.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){this.positionGrips()},O.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},O.prototype.createGrip=function(){var C=new i;return C.visual.transform.baseVal.appendItem(R.createTransform()),this.controlBox.appendChild(C.visual),C},O.prototype.positionGrips=function(){var C=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-C/2,this.y1-C/2),this.positionGrip(this.grip2.visual,this.x2-C/2,this.y2-C/2)},O.prototype.positionGrip=function(C,F,z){var P=C.transform.baseVal.getItem(0);P.setTranslate(F,z),C.transform.baseVal.replaceItem(P,0)},O.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},N.prototype.getState.call(this))},O.prototype.restoreState=function(C){N.prototype.restoreState.call(this,C);var F=C;this.x1=F.x1,this.y1=F.y1,this.x2=F.x2,this.y2=F.y2},O.prototype.scale=function(C,F){N.prototype.scale.call(this,C,F),this.x1=this.x1*C,this.y1=this.y1*F,this.x2=this.x2*C,this.y2=this.y2*F,this.adjustVisual(),this.adjustControlBox()},O}(s),u=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.strokePanel=new h("Line color",z.defaultColorSet,z.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new g("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new E("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return B(O,N),O.prototype.ownsTarget=function(C){return!(!N.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorLine&&C!==this.visibleLine)},O.prototype.createVisual=function(){this.visual=R.createGroup(),this.selectorLine=R.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=R.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)},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},O.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()),R.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),R.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},O.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},O.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},N.prototype.getState.call(this));return C.typeName=O.typeName,C},O.prototype.restoreState=function(C){N.prototype.restoreState.call(this,C);var F=C;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.createVisual(),this.adjustVisual()},O.typeName="LineMarker",O.title="Line marker",O.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',O}(c),l=function(N){function O(C,F,z,P){var oe=N.call(this,C,P||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return oe.fonts=[],oe.fontBoxes=[],oe.fonts=F,oe.currentFont=z,oe.setCurrentFont=oe.setCurrentFont.bind(oe),oe}return B(O,N),O.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.flexGrow="2",this.fonts.forEach(function(z){var P=document.createElement("div");P.style.display="inline-block",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/C.fonts.length-5+"%",P.style.borderColor=z===C.currentFont?C.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){C.setCurrentFont(z,P)}),F.appendChild(P);var oe=document.createElement("div");oe.style.display="flex",oe.style.minHeight="20px",oe.style.flexGrow="2",oe.style.fontFamily=z,oe.style.overflow="hidden";var we=document.createElement("div");we.style.whiteSpace="nowrap",we.style.overflow="hidden",we.style.textOverflow="ellipsis",we.innerHTML="The quick brown fox jumps over the lazy dog",oe.appendChild(we),P.appendChild(oe),C.fontBoxes.push(P)}),F},O.prototype.setCurrentFont=function(C,F){var z=this;this.currentFont=C,this.fontBoxes.forEach(function(P){P.style.borderColor=P===F?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},O}(r),v=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.color="transparent",P.padding=5,P.DEFAULT_TEXT="your text here",P.text=P.DEFAULT_TEXT,P.isMoved=!1,P.color=z.defaultColor,P.fontFamily=z.defaultFontFamily,P.defaultSize={x:100,y:30},P.setColor=P.setColor.bind(P),P.setFont=P.setFont.bind(P),P.renderText=P.renderText.bind(P),P.sizeText=P.sizeText.bind(P),P.textEditDivClicked=P.textEditDivClicked.bind(P),P.showTextEditor=P.showTextEditor.bind(P),P.setSize=P.setSize.bind(P),P.positionTextEditor=P.positionTextEditor.bind(P),P.colorPanel=new h("Color",z.defaultColorSet,z.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.fontFamilyPanel=new l("Font",z.defaultFontFamilies,z.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P}return B(O,N),O.prototype.ownsTarget=function(C){if(N.prototype.ownsTarget.call(this,C)||C===this.visual||C===this.textElement||C===this.bgRectangle)return!0;var F=!1;return this.textElement.childNodes.forEach(function(z){z===C&&(F=!0)}),F},O.prototype.createVisual=function(){this.visual=R.createGroup(),this.bgRectangle=R.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=R.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(R.createTransform()),this.textElement.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.isMoved=!1,this.pointerDownPoint=C,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},O.prototype.renderText=function(){var C=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(F){C.textElement.appendChild(R.createTSpan(F.trim()===""?" ":F.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},O.prototype.getTextScale=function(){var C=this.textElement.getBBox(),F=1;if(C.width>0&&C.height>0){var z=(1*this.width-this.width*this.padding*2/100)/C.width,P=(1*this.height-this.height*this.padding*2/100)/C.height;F=Math.min(z,P)}return F},O.prototype.getTextPosition=function(C){var F=this.textElement.getBBox(),z=0,P=0;return F.width>0&&F.height>0&&(z=(this.width-F.width*C)/2,P=this.height/2-F.height*C/2),{x:z,y:P}},O.prototype.sizeText=function(){var C=this.textElement.getBBox(),F=this.getTextScale(),z=this.getTextPosition(F);z.y-=C.y*F,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+z.x+"px, "+z.y+"px) scale("+F+", "+F+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(z.x,z.y),this.textElement.transform.baseVal.getItem(1).setScale(F,F))},O.prototype.manipulate=function(C){N.prototype.manipulate.call(this,C),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(C.x-this.pointerDownPoint.x)>5||Math.abs(C.y-this.pointerDownPoint.y)>5)},O.prototype.resize=function(C){N.prototype.resize.call(this,C),this.isMoved=!0,this.setSize(),this.sizeText()},O.prototype.setSize=function(){N.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},O.prototype.pointerUp=function(C){var F=this.state;F==="creating"&&(this._suppressMarkerCreateEvent=!0),N.prototype.pointerUp.call(this,C),this.setSize(),(F==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},O.prototype.showTextEditor=function(){var C=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(F){F.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var F=Number.parseFloat(C.textEditor.style.fontSize);C.textEditor.clientWidth>=Number.parseInt(C.textEditor.style.maxWidth)&&F>.9;)F-=.1,C.textEditor.style.fontSize=Math.max(F,.9)+"em"}),this.textEditor.addEventListener("keyup",function(F){F.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(F){if(F.clipboardData){var z=F.clipboardData.getData("text"),P=window.getSelection();if(!P.rangeCount)return!1;P.deleteFromDocument(),P.getRangeAt(0).insertNode(document.createTextNode(z)),F.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){C.textEditDivClicked(C.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},O.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var C=this.getTextScale(),F=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),z=this.textElement.getBBox(),P={x:z.width*C,y:z.height*C};F.x-=P.x/2,F.y-=P.y/2,this.textEditor.style.top=F.y+"px",this.textEditor.style.left=F.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-F.x+"px",this.textEditor.style.fontSize=Math.max(16*C,12)+"px",this.textElement.style.display="none"}},O.prototype.textEditDivClicked=function(C){this.text=C.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},O.prototype.select=function(){N.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},O.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),N.prototype.deselect.call(this)},O.prototype.dblClick=function(C,F){N.prototype.dblClick.call(this,C,F),this.showTextEditor()},O.prototype.setColor=function(C){this.textElement&&R.setAttributes(this.textElement,[["fill",C]]),this.color=C,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(C)},O.prototype.setFont=function(C){this.textElement&&R.setAttributes(this.textElement,[["font-family",C]]),this.fontFamily=C,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},O.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},O.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},N.prototype.getState.call(this));return C.typeName=O.typeName,C},O.prototype.restoreState=function(C){var F=C;this.color=F.color,this.fontFamily=F.fontFamily,this.padding=F.padding,this.text=F.text,this.createVisual(),N.prototype.restoreState.call(this,C),this.setSize()},O.prototype.scale=function(C,F){N.prototype.scale.call(this,C,F),this.setSize(),this.sizeText(),this.positionTextEditor()},O.typeName="TextMarker",O.title="Text marker",O.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>',O}(b),p=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.color="transparent",P.lineWidth=3,P.drawing=!1,P.pixelRatio=1,P.color=z.defaultColor,P.lineWidth=z.defaultStrokeWidth,P.pixelRatio=z.freehandPixelRatio,P.setColor=P.setColor.bind(P),P.addCanvas=P.addCanvas.bind(P),P.finishCreation=P.finishCreation.bind(P),P.setLineWidth=P.setLineWidth.bind(P),P.colorPanel=new h("Color",z.defaultColorSet,z.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.lineWidthPanel=new g("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.lineWidthPanel.onWidthChanged=P.setLineWidth,P}return B(O,N),O.prototype.ownsTarget=function(C){return!(!N.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.drawingImage)},O.prototype.createVisual=function(){this.visual=R.createGroup(),this.drawingImage=R.createImage(),this.visual.appendChild(this.drawingImage);var C=R.createTransform();this.visual.transform.baseVal.appendItem(C),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(C,F){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(C.x,C.y),this.drawing=!0):N.prototype.pointerDown.call(this,C,F)},O.prototype.manipulate=function(C){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(C.x,C.y),this.canvasContext.stroke()):N.prototype.manipulate.call(this,C)},O.prototype.resize=function(C){N.prototype.resize.call(this,C),R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(C){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):N.prototype.pointerUp.call(this,C)},O.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)},O.prototype.select=function(){this.state==="creating"&&this.finishCreation(),N.prototype.select.call(this)},O.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),N.prototype.deselect.call(this)},O.prototype.finishCreation=function(){for(var C=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),F=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],z=F[0],P=F[1],oe=F[2],we=F[3],Ae=!1,ee=0;ee<this.canvasElement.height;ee++)for(var de=0;de<this.canvasElement.width;de++)C.data[ee*this.canvasElement.width*4+4*de+3]>0&&(Ae=!0,ee<P&&(P=ee),de<z&&(z=de),ee>we&&(we=ee),de>oe&&(oe=de));if(Ae){this.left=z/this.pixelRatio,this.top=P/this.pixelRatio,this.width=(oe-z)/this.pixelRatio,this.height=(we-P)/this.pixelRatio;var ge=document.createElement("canvas");ge.width=oe-z,ge.height=we-P,ge.getContext("2d").putImageData(this.canvasContext.getImageData(z,P,oe-z,we-P),0,0),this.drawingImgUrl=ge.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},O.prototype.setDrawingImage=function(){R.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),R.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},O.prototype.setColor=function(C){this.color=C,this.colorChanged(C)},O.prototype.setLineWidth=function(C){this.lineWidth=C},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=Object.assign({drawingImgUrl:this.drawingImgUrl},N.prototype.getState.call(this));return C.typeName=O.typeName,C},O.prototype.restoreState=function(C){this.createVisual(),N.prototype.restoreState.call(this,C),this.drawingImgUrl=C.drawingImgUrl,this.setDrawingImage()},O.prototype.scale=function(C,F){N.prototype.scale.call(this,C,F),this.setDrawingImage()},O.typeName="FreehandMarker",O.title="Freehand marker",O.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>',O}(b),T=function(N){function O(C,F,z){var P=N.call(this,C,z||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return P.typeBoxes=[],P.currentType=F,P.setCurrentType=P.setCurrentType.bind(P),P}return B(O,N),O.prototype.getUi=function(){var C=this,F=document.createElement("div");F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2";for(var z=function(we){var Ae="both";switch(we){case 0:Ae="both";break;case 1:Ae="start";break;case 2:Ae="end";break;case 3:Ae="none"}var ee=document.createElement("div");if(ee.style.display="flex",ee.style.flexGrow="2",ee.style.alignItems="center",ee.style.justifyContent="space-between",ee.style.padding="5px",ee.style.borderWidth="2px",ee.style.borderStyle="solid",ee.style.borderColor=Ae===P.currentType?P.uiStyleSettings.toolboxAccentColor:"transparent",ee.addEventListener("click",function(){C.setCurrentType(Ae,ee)}),F.appendChild(ee),Ae==="both"||Ae==="start"){var de=document.createElement("div");de.style.display="flex",de.style.alignItems="center",de.style.minHeight="20px",de.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,de.style.marginLeft="5px",ee.appendChild(de)}var ge=document.createElement("div");ge.style.display="flex",ge.style.alignItems="center",ge.style.minHeight="20px",ge.style.flexGrow="2";var xe=document.createElement("hr");if(xe.style.minWidth="20px",xe.style.border="0px",xe.style.borderTop="3px solid "+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee"),xe.style.flexGrow="2",ge.appendChild(xe),ee.appendChild(ge),Ae==="both"||Ae==="end"){var Me=document.createElement("div");Me.style.display="flex",Me.style.alignItems="center",Me.style.minHeight="20px",Me.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Me.style.marginRight="5px",ee.appendChild(Me)}P.typeBoxes.push(ee)},P=this,oe=0;oe<4;oe++)z(oe);return F},O.prototype.setCurrentType=function(C,F){var z=this;this.currentType=C,this.typeBoxes.forEach(function(P){P.style.borderColor=P===F?z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},O}(r),L=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.arrowType="end",P.arrowBaseHeight=10,P.arrowBaseWidth=10,P.getArrowPoints=P.getArrowPoints.bind(P),P.setArrowType=P.setArrowType.bind(P),P.arrowTypePanel=new T("Arrow type","end"),P.arrowTypePanel.onArrowTypeChanged=P.setArrowType,P}return B(O,N),O.prototype.ownsTarget=function(C){return!(!N.prototype.ownsTarget.call(this,C)&&C!==this.arrow1&&C!==this.arrow2)},O.prototype.getArrowPoints=function(C,F){var z=this.arrowBaseWidth+2*this.strokeWidth,P=this.arrowBaseHeight+2*this.strokeWidth;return C-z/2+","+(F+P/2)+" "+C+","+(F-P/2)+" "+(C+z/2)+","+(F+P/2)},O.prototype.createTips=function(){this.arrow1=R.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=R.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.arrow2)},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if(N.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",R.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),R.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.arrow1.transform.baseVal.getItem(0);F.setRotate(C,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(F,0);var z=this.arrow2.transform.baseVal.getItem(0);z.setRotate(C+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(z,0)}},O.prototype.setArrowType=function(C){this.arrowType=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=Object.assign({arrowType:this.arrowType},N.prototype.getState.call(this));return C.typeName=O.typeName,C},O.prototype.restoreState=function(C){N.prototype.restoreState.call(this,C);var F=C;this.arrowType=F.arrowType,this.createTips(),this.adjustVisual()},O.typeName="ArrowMarker",O.title="Arrow marker",O.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',O}(u),D=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.fillColor=z.defaultFillColor,P.strokeWidth=0,P.fillPanel=new h("Color",z.defaultColorSet,z.defaultFillColor),P.fillPanel.onColorChanged=P.setFillColor,P}return B(O,N),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=N.prototype.getState.call(this);return C.typeName=O.typeName,C},O.typeName="CoverMarker",O.title="Cover marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',O}(m),x=function(N){function O(C,F,z,P){var oe=N.call(this,C,P||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return oe.opacities=[],oe.opacityBoxes=[],oe.opacities=F,oe.currentOpacity=z,oe.setCurrentOpacity=oe.setCurrentOpacity.bind(oe),oe}return B(O,N),O.prototype.getUi=function(){var C=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",F.style.justifyContent="space-between",this.opacities.forEach(function(z){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="center",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=z===C.currentOpacity?C.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){C.setCurrentOpacity(z,P)}),F.appendChild(P);var oe=document.createElement("div");oe.innerText=100*z+"%",P.appendChild(oe),C.opacityBoxes.push(P)}),F},O.prototype.setCurrentOpacity=function(C,F){var z=this;this.currentOpacity=C,this.opacityBoxes.forEach(function(P){P.style.borderColor=P===F?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},O}(r),M=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.setOpacity=P.setOpacity.bind(P),P.fillColor=z.defaultHighlightColor,P.strokeWidth=0,P.opacity=z.defaultHighlightOpacity,P.fillPanel=new h("Color",z.defaultColorSet,P.fillColor),P.fillPanel.onColorChanged=P.setFillColor,P.opacityPanel=new x("Opacity",z.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return B(O,N),O.prototype.setOpacity=function(C){this.opacity=C,this.visual&&R.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=N.prototype.getState.call(this);return C.typeName=O.typeName,C},O.typeName="HighlightMarker",O.title="Highlight marker",O.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>',O}(D),j='<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>',I=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.bgColor="transparent",P.tipPosition={x:0,y:0},P.tipBase1Position={x:0,y:0},P.tipBase2Position={x:0,y:0},P.tipMoving=!1,P.color=z.defaultStrokeColor,P.bgColor=z.defaultFillColor,P.fontFamily=z.defaultFontFamily,P.defaultSize={x:100,y:30},P.setBgColor=P.setBgColor.bind(P),P.getTipPoints=P.getTipPoints.bind(P),P.positionTip=P.positionTip.bind(P),P.setTipPoints=P.setTipPoints.bind(P),P.colorPanel=new h("Text color",z.defaultColorSet,P.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),P.colorPanel.onColorChanged=P.setColor,P.bgColorPanel=new h("Fill color",z.defaultColorSet,P.bgColor,j),P.bgColorPanel.onColorChanged=P.setBgColor,P.fontFamilyPanel=new l("Font",z.defaultFontFamilies,z.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P.tipGrip=new i,P.tipGrip.visual.transform.baseVal.appendItem(R.createTransform()),P.controlBox.appendChild(P.tipGrip.visual),P}return B(O,N),O.prototype.ownsTarget=function(C){return N.prototype.ownsTarget.call(this,C)||this.tipGrip.ownsTarget(C)||this.tip===C},O.prototype.createTip=function(){R.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=R.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},O.prototype.pointerDown=function(C,F){this.state==="new"&&N.prototype.pointerDown.call(this,C,F),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(F)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):N.prototype.pointerDown.call(this,C,F)},O.prototype.pointerUp=function(C){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,N.prototype.pointerUp.call(this,C);else{var F=this.state==="creating";N.prototype.pointerUp.call(this,C),this.setTipPoints(F),this.positionTip()}},O.prototype.manipulate=function(C){if(this.tipMoving){var F=this.unrotatePoint(C);this.tipPosition={x:F.x-this.manipulationStartLeft,y:F.y-this.manipulationStartTop},this.positionTip()}else N.prototype.manipulate.call(this,C)},O.prototype.setBgColor=function(C){this.bgRectangle&&this.tip&&(R.setAttributes(this.bgRectangle,[["fill",C]]),R.setAttributes(this.tip,[["fill",C]])),this.bgColor=C,this.fillColorChanged(C)},O.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},O.prototype.setTipPoints=function(C){C===void 0&&(C=!1);var F=Math.min(this.height/2,15),z=this.height/5;C&&(this.tipPosition={x:F+z/2,y:this.height+20});var P=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(z=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:F,y:0},this.tipBase2Position={x:F+z,y:0}):(this.tipBase1Position={x:0,y:F},this.tipBase2Position={x:0,y:F+z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(z=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-F-z,y:0},this.tipBase2Position={x:this.width-F,y:0}):(this.tipBase1Position={x:this.width,y:F},this.tipBase2Position={x:this.width,y:F+z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?P<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(z=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-F-z,y:this.height},this.tipBase2Position={x:this.width-F,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-F-z},this.tipBase2Position={x:this.width,y:this.height-F}):P<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(z=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:F,y:this.height},this.tipBase2Position={x:F+z,y:this.height}):(this.tipBase1Position={x:0,y:this.height-F},this.tipBase2Position={x:0,y:this.height-F-z})},O.prototype.resize=function(C){N.prototype.resize.call(this,C),this.positionTip()},O.prototype.positionTip=function(){R.setAttributes(this.tip,[["points",this.getTipPoints()]]);var C=this.tipGrip.visual.transform.baseVal.getItem(0);C.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(C,0)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.select=function(){this.positionTip(),N.prototype.select.call(this)},O.prototype.getState=function(){var C=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},N.prototype.getState.call(this));return C.typeName=O.typeName,C},O.prototype.restoreState=function(C){var F=C;this.bgColor=F.bgColor,this.tipPosition=F.tipPosition,N.prototype.restoreState.call(this,C),this.createTip(),this.setTipPoints()},O.prototype.scale=function(C,F){N.prototype.scale.call(this,C,F),this.tipPosition={x:this.tipPosition.x*C,y:this.tipPosition.y*F},this.positionTip()},O.typeName="CalloutMarker",O.title="Callout marker",O.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>',O}(v),W=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.fillColor=z.defaultFillColor,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.setOpacity=P.setOpacity.bind(P),P.createVisual=P.createVisual.bind(P),P.strokePanel=new h("Line color",w(z.defaultColorSet,["transparent"]),z.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.fillPanel=new h("Fill color",w(z.defaultColorSet,["transparent"]),P.fillColor,j),P.fillPanel.onColorChanged=P.setFillColor,P.strokeWidthPanel=new g("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new E("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P.opacityPanel=new x("Opacity",z.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return B(O,N),O.prototype.ownsTarget=function(C){return!(!N.prototype.ownsTarget.call(this,C)&&C!==this.visual)},O.prototype.createVisual=function(){this.visual=R.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)},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},O.prototype.manipulate=function(C){N.prototype.manipulate.call(this,C)},O.prototype.resize=function(C){N.prototype.resize.call(this,C),this.setSize()},O.prototype.setSize=function(){N.prototype.setSize.call(this),R.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},O.prototype.pointerUp=function(C){N.prototype.pointerUp.call(this,C),this.setSize()},O.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},O.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(C),this.stateChanged()},O.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&R.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.setOpacity=function(C){this.opacity=C,this.visual&&R.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},N.prototype.getState.call(this));return C.typeName=O.typeName,C},O.prototype.restoreState=function(C){var F=C;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),N.prototype.restoreState.call(this,C),this.setSize()},O.prototype.scale=function(C,F){N.prototype.scale.call(this,C,F),this.setSize()},O.typeName="EllipseMarker",O.title="Ellipse marker",O.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>',O}(b),Q=function(N){function O(C,F,z){return N.call(this,C,F,z)||this}return B(O,N),Object.defineProperty(O.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(C){return!(!N.prototype.ownsTarget.call(this,C)&&C!==this.tip1&&C!==this.tip2)},O.prototype.createTips=function(){this.tip1=R.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(R.createTransform()),this.visual.appendChild(this.tip1),this.tip2=R.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(R.createTransform()),this.visual.appendChild(this.tip2)},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if(N.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(R.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()]]),R.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 C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.tip1.transform.baseVal.getItem(0);F.setRotate(C,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(F,0);var z=this.tip2.transform.baseVal.getItem(0);z.setRotate(C+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(z,0)}},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=N.prototype.getState.call(this);return C.typeName=O.typeName,C},O.prototype.restoreState=function(C){N.prototype.restoreState.call(this,C),this.createTips(),this.adjustVisual()},O.typeName="MeasurementMarker",O.title="Measurement marker",O.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>',O}(u),fe=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.strokePanel.colors=z.defaultColorSet,P.fillColor="transparent",P}return B(O,N),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=N.prototype.getState.call(this);return C.typeName=O.typeName,C},O.typeName="EllipseFrameMarker",O.title="Ellipse frame marker",O.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>',O}(W),le=function(){function N(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(N.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),N.prototype.addUndoStep=function(O){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(O)||(this.undoStack.push(O),JSON.stringify(this.lastRedoStep)!==JSON.stringify(O)&&this.redoStack.splice(0,this.redoStack.length))},N.prototype.replaceLastUndoStep=function(O){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=O)},N.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},N.prototype.undo=function(){if(this.undoStack.length>1){var O=this.undoStack.pop();return O!==void 0&&this.redoStack.push(O),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},N.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},N}(),Ce=function(N){function O(C,F,z){var P=N.call(this,C,F,z)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.curveX=0,P.curveY=0,P.manipulationStartCurveX=0,P.manipulationStartCurveY=0,P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.positionGrips=P.positionGrips.bind(P),P.addControlGrips=P.addControlGrips.bind(P),P.adjustVisual=P.adjustVisual.bind(P),P.setupControlBox=P.setupControlBox.bind(P),P.resize=P.resize.bind(P),P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.strokePanel=new h("Line color",z.defaultColorSet,z.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new g("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new E("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return B(O,N),O.prototype.ownsTarget=function(C){return!(!N.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorCurve&&C!==this.visibleCurve&&!this.curveGrip.ownsTarget(C))},O.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},O.prototype.createVisual=function(){this.visual=R.createGroup(),this.selectorCurve=R.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=R.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)},O.prototype.pointerDown=function(C,F){N.prototype.pointerDown.call(this,C,F),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=C.x,this.curveY=C.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(F)&&(this.activeGrip=this.curveGrip,this._state="resize")},O.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),R.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),R.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setupControlBox=function(){N.prototype.setupControlBox.call(this),this.curveControlLine1=R.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=R.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)},O.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,N.prototype.addControlGrips.call(this)},O.prototype.positionGrips=function(){N.prototype.positionGrips.call(this);var C=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-C/2,this.curveY-C/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()))},O.prototype.manipulate=function(C){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+C.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+C.y-this.manipulationStartY),N.prototype.manipulate.call(this,C)},O.prototype.resize=function(C){this.activeGrip===this.curveGrip&&(this.curveX=C.x,this.curveY=C.y),N.prototype.resize.call(this,C),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},O.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},O.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},O.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual()},O.prototype.scale=function(C,F){this.curveX=this.curveX*C,this.curveY=this.curveY*F,N.prototype.scale.call(this,C,F)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},N.prototype.getState.call(this));return C.typeName=O.typeName,C},O.prototype.restoreState=function(C){N.prototype.restoreState.call(this,C);var F=C;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.curveX=F.curveX,this.curveY=F.curveY,this.createVisual(),this.adjustVisual()},O.typeName="CurveMarker",O.title="Curve marker",O.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>',O}(c),Oe=function(){function N(O,C){C===void 0&&(C=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=O,this.cancelable=C}return Object.defineProperty(N.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),N.prototype.preventDefault=function(){this._defaultPrevented=!0},N}(),Re=function(N){function O(C,F,z){var P=N.call(this,C,!1)||this;return P.dataUrl=F,P.state=z,P}return B(O,N),O}(Oe),Le=function(N){function O(C,F,z){z===void 0&&(z=!1);var P=N.call(this,C,z)||this;return P.marker=F,P}return B(O,N),O}(Oe),Pe=function(){function N(){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 N.prototype.addEventListener=function(O,C){this[O].push(C)},N.prototype.removeEventListener=function(O,C){var F=this[O].indexOf(C);F>-1&&this[O].splice(F,1)},N}(),_e=function(){function N(O){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new y,this._isOpen=!1,this.undoRedoManager=new le,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 Pe,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=N.instanceCounter++,this.styles=new S(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=O,this.targetRoot=document.body,this.width=O.clientWidth,this.height=O.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(N.prototype,"ALL_MARKER_TYPES",{get:function(){return[_,p,L,v,fe,W,M,I,Q,D,u,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[_,p,L,v,W,M,I]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"BASIC_MARKER_TYPES",{get:function(){return[_,p,L,v,M]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(O){var C=this;this._availableMarkerTypes.splice(0),O.forEach(function(F){if(typeof F=="string"){var z=C.ALL_MARKER_TYPES.find(function(P){return P.typeName===F});z!==void 0&&C._availableMarkerTypes.push(z)}else C._availableMarkerTypes.push(F)})},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(O){this._zoomLevel=O,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(N.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),N.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),H.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},N.prototype.show=function(){var O=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(C){return C(new Oe(O))})},N.prototype.render=function(){return A(this,void 0,void 0,function(){var O;return k(this,function(C){switch(C.label){case 0:return this.setCurrentMarker(),(O=new U).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.markersOnly=this.renderMarkersOnly,O.width=this.renderWidth,O.height=this.renderHeight,[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return C.sent(),[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,C.sent()]}})})},N.prototype.close=function(O){var C=this;if(O===void 0&&(O=!1),this.isOpen){var F=!1;O||this.eventListeners.beforeclose.forEach(function(z){var P=new Oe(C,!0);z(P),P.defaultPrevented&&(F=!0)}),F||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(z){return z(new Oe(C))}),this.detachEvents(),this._isOpen=!1)}},N.prototype.addMarkersToToolbar=function(){for(var O,C=[],F=0;F<arguments.length;F++)C[F]=arguments[F];(O=this._availableMarkerTypes).push.apply(O,C)},N.prototype.addRenderEventListener=function(O){this.addEventListener("render",function(C){O(C.dataUrl,C.state)})},N.prototype.removeRenderEventListener=function(O){},N.prototype.addCloseEventListener=function(O){this.addEventListener("close",function(){O()})},N.prototype.removeCloseEventListener=function(O){},N.prototype.setupResizeObserver=function(){var O=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){O.resize(O.target.clientWidth,O.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return O.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},N.prototype.onPopupTargetResize=function(){var O=1*this.target.clientWidth/this.target.clientHeight,C=this.editorCanvas.clientWidth/O>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*O:this.editorCanvas.clientWidth,F=C<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/O;this.resize(C,F)},N.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},N.prototype.resize=function(O,C){this._isResizing=!0;var F=O/this.imageWidth,z=C/this.imageHeight;this.imageWidth=Math.round(O),this.imageHeight=Math.round(C),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(F,z),this._isResizing=!1},N.prototype.scaleMarkers=function(O,C){var F,z=this;this._currentMarker&&this._currentMarker instanceof v?this._currentMarker.scale(O,C):(F=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(P){P!==z._currentMarker&&P.scale(O,C)}),F!==void 0&&this.setCurrentMarker(F)},N.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"},N.prototype.setTopLeft=function(){var O=this.editingTarget.getBoundingClientRect(),C=this.editorCanvas.getBoundingClientRect();this.left=O.left-C.left,this.top=O.top-C.top},N.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)},N.prototype.addDefs=function(){for(var O,C=[],F=0;F<arguments.length;F++)C[F]=arguments[F];this.defs=R.createDefs(),this.addDefsToImage(),(O=this.defs).append.apply(O,C)},N.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},N.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)},N.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},N.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},N.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)},N.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},N.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)},N.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 O=document.createElement("a");O.href="https://markerjs.com/",O.target="_blank",O.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>',O.title="Powered by marker.js",O.style.display="grid",O.style.alignItems="center",O.style.justifyItems="center",O.style.padding="3px",O.style.width="20px",O.style.height="20px",this.logoUI.appendChild(O),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},N.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")},N.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"},N.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},N.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 O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"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 o(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 a(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},N.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},N.prototype.removeMarker=function(O){this.markerImage.removeChild(O.container),this.markers.indexOf(O)>-1&&this.markers.splice(this.markers.indexOf(O),1),O.dispose()},N.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())},N.prototype.toolbarButtonClicked=function(O,C){if(O==="marker"&&C!==void 0)this.createNewMarker(C);else if(O==="action")switch(C){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()}},N.prototype.deleteSelectedMarker=function(){var O=this;if(this._currentMarker!==void 0){var C=!1;if(this.eventListeners.markerbeforedelete.forEach(function(z){var P=new Le(O,O._currentMarker,!0);z(P),P.defaultPrevented&&(C=!0)}),!C){var F=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(z){return z(new Le(O,F))})}}},N.prototype.clear=function(){var O=this,C=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(oe){var we=new Le(O,void 0,!0);oe(we),we.defaultPrevented&&(C=!0)}),!C)){this.setCurrentMarker();for(var F=function(oe){var we=z.markers[oe];z.setCurrentMarker(z.markers[oe]),z._currentMarker.dispose(),z.markerImage.removeChild(z._currentMarker.container),z.markers.splice(z.markers.indexOf(z._currentMarker),1),z.eventListeners.markerdelete.forEach(function(Ae){return Ae(new Le(O,we))})},z=this,P=this.markers.length-1;P>=0;P--)F(P);this.addUndoStep()}},Object.defineProperty(N.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),N.prototype.showNotesEditor=function(){var O;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=(O=this._currentMarker.notes)!==null&&O!==void 0?O:"",this.overlayContainer.appendChild(this.notesArea))},N.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)},N.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},N.prototype.addUndoStep=function(){var O=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var C=this.getState(),F=this.undoRedoManager.getLastUndoStep();if(!F||F.width===C.width&&F.height===C.height){var z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(C),z<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(P){return P(new Oe(O))})}else this.undoRedoManager.replaceLastUndoStep(C),this.eventListeners.statechange.forEach(function(P){return P(new Oe(O))})}},N.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},N.prototype.undoStep=function(){var O=this,C=this.undoRedoManager.undo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(F){return F(new Oe(O))}))},N.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},N.prototype.redoStep=function(){var O=this,C=this.undoRedoManager.redo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(F){return F(new Oe(O))}))},N.prototype.stepZoom=function(){var O=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=O<this.zoomSteps.length-1?this.zoomSteps[O+1]:this.zoomSteps[0]},N.prototype.panTo=function(O){this.contentDiv.scrollBy({left:this.prevPanPoint.x-O.x,top:this.prevPanPoint.y-O.y}),this.prevPanPoint=O},N.prototype.startRenderAndClose=function(){return A(this,void 0,void 0,function(){var O,C,F=this;return k(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return O=z.sent(),C=this.getState(),this.eventListeners.render.forEach(function(P){return P(new Re(F,O,C))}),this.close(!0),[2]}})})},N.prototype.getState=function(O){O===!0&&this.setCurrentMarker();var C={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(F){return C.markers.push(F.getState())}),C},N.prototype.restoreState=function(O){var C=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);O.markers.forEach(function(F){var z=C._availableMarkerTypes.find(function(oe){return oe.typeName===F.typeName});if(z!==void 0){var P=C.addNewMarker(z);P.restoreState(F),C.markers.push(P)}}),O.width&&O.height&&(O.width!==this.imageWidth||O.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/O.width,this.imageHeight/O.height),this.eventListeners.restorestate.forEach(function(F){return F(new Oe(C))})},N.prototype.addNewMarker=function(O){var C=R.createGroup();return this.markerImage.appendChild(C),new O(C,this.overlayContainer,this.settings)},N.prototype.createNewMarker=function(O){var C,F=this;(C=typeof O=="string"?this._availableMarkerTypes.find(function(z){return z.typeName===O}):O)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(C),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(C.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(z){return z(new Le(F,F._currentMarker))}))},N.prototype.markerCreated=function(O){var C=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(O),this.setCurrentMarker(O),O instanceof p&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(p):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(F){return F(new Le(C,C._currentMarker))})},N.prototype.colorChanged=function(O){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=O,this.settings.defaultStrokeColor=O)},N.prototype.fillColorChanged=function(O){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=O)},N.prototype.markerStateChanged=function(O){var C=this;this.eventListeners.markerchange.forEach(function(F){return F(new Le(C,O))})},N.prototype.setCurrentMarker=function(O){var C=this;this._currentMarker!==O&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(F){return F(new Le(C,C._currentMarker))})),this._currentMarker=O,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(F){return F(new Le(C,C._currentMarker))}))},N.prototype.onPointerDown=function(O){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||O.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var C=this.markers.find(function(F){return F.ownsTarget(O.target)});C!==void 0?(this.setCurrentMarker(C),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(O.clientX,O.clientY),O.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:O.clientX,y:O.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(O.clientX,O.clientY))},N.prototype.onDblClick=function(O){if(this._isFocused||this.focus(),this.mode==="select"){var C=this.markers.find(function(F){return F.ownsTarget(O.target)});C!==void 0&&C!==this._currentMarker&&this.setCurrentMarker(C),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(O.clientX,O.clientY),O.target):this.setCurrentMarker()}},N.prototype.onPointerMove=function(O){this.touchPoints!==1&&O.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||O.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(O.clientX,O.clientY)):this.zoomLevel>1&&this.panTo({x:O.clientX,y:O.clientY}))},N.prototype.onPointerUp=function(O){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(O.clientX,O.clientY)),this.isDragging=!1,this.addUndoStep()},N.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},N.prototype.onKeyUp=function(O){this._currentMarker===void 0||this.notesArea!==void 0||O.key!=="Delete"&&O.key!=="Backspace"||this.deleteSelectedMarker()},N.prototype.clientToLocalCoordinates=function(O,C){var F=this.markerImage.getBoundingClientRect();return{x:(O-F.left)/this.zoomLevel,y:(C-F.top)/this.zoomLevel}},N.prototype.onWindowResize=function(){this.positionUI()},N.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"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()},N.prototype.addLicenseKey=function(O){H.addKey(O)},N.prototype.addEventListener=function(O,C){this.eventListeners.addEventListener(O,C)},N.prototype.removeEventListener=function(O,C){this.eventListeners.removeEventListener(O,C)},N.prototype.renderState=function(O){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(O),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(N.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),N.prototype.focus=function(){var O=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(C){return C(new Oe(O))}))},N.prototype.blur=function(){var O=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(C){return C(new Oe(O))}))},N.instanceCounter=0,N}()},T8No:function(Je,be,V){"use strict";V.d(be,"a",function(){return H}),V.d(be,"e",function(){return U}),V.d(be,"c",function(){return u}),V.d(be,"b",function(){return l}),V.d(be,"d",function(){return v}),V.d(be,"f",function(){return L});var ae=V("MNsG"),B=V("N0LK"),A=V("Cg/j");let k=ae.k||"";const w=new Map;w.set("false",!1),w.set("true",!0),w.set("isMac",ae.f),w.set("isLinux",ae.d),w.set("isWindows",ae.i),w.set("isWeb",ae.h),w.set("isMacNative",ae.f&&!ae.h),w.set("isEdge",k.indexOf("Edg/")>=0),w.set("isFirefox",k.indexOf("Firefox")>=0),w.set("isChrome",k.indexOf("Chrome")>=0),w.set("isSafari",k.indexOf("Safari")>=0);const R=Object.prototype.hasOwnProperty;class H{static has(x){return d.create(x)}static equals(x,M){return o.create(x,M)}static regex(x,M){return g.create(x,M)}static not(x){return s.create(x)}static and(...x){return y.create(x,null)}static or(...x){return c.create(x,null,!0)}static deserialize(x,M=!1){return x?this._deserializeOrExpression(x,M):void 0}static _deserializeOrExpression(x,M){let j=x.split("||");return c.create(j.map(I=>this._deserializeAndExpression(I,M)),null,!0)}static _deserializeAndExpression(x,M){let j=x.split("&&");return y.create(j.map(I=>this._deserializeOne(I,M)),null)}static _deserializeOne(x,M){if(x=x.trim(),x.indexOf("!=")>=0){let j=x.split("!=");return h.create(j[0].trim(),this._deserializeValue(j[1],M))}if(x.indexOf("==")>=0){let j=x.split("==");return o.create(j[0].trim(),this._deserializeValue(j[1],M))}if(x.indexOf("=~")>=0){let j=x.split("=~");return g.create(j[0].trim(),this._deserializeRegexValue(j[1],M))}if(x.indexOf(" in ")>=0){let j=x.split(" in ");return a.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const j=x.split(">=");return t.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const j=x.split(">");return i.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const j=x.split("<=");return m.create(j[0].trim(),j[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const j=x.split("<");return b.create(j[0].trim(),j[1].trim())}return/^\!\s*/.test(x)?s.create(x.substr(1).trim()):d.create(x)}static _deserializeValue(x,M){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let j=/^'([^']*)'$/.exec(x);return j?j[1].trim():x}static _deserializeRegexValue(x,M){if(Object(B.C)(x)){if(M)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let j=x.indexOf("/"),I=x.lastIndexOf("/");if(j===I||j<0){if(M)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let W=x.slice(j+1,I),Q=x[I+1]==="i"?"i":"";try{return new RegExp(W,Q)}catch(fe){if(M)throw new Error(`bad regexp-value '${x}', parse error: ${fe}`);return console.warn(`bad regexp-value '${x}', parse error: ${fe}`),null}}}function U(x,M){const j=x?x.substituteConstants():void 0,I=M?M.substituteConstants():void 0;return!j&&!I?!0:!j||!I?!1:j.equals(I)}function e(x,M){return x.cmp(M)}class S{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 f.INSTANCE}}S.INSTANCE=new S;class f{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 S.INSTANCE}}f.INSTANCE=new f;class d{constructor(x,M){this.key=x,this.negated=M,this.type=2}static create(x,M=null){const j=w.get(x);return typeof j=="boolean"?j?f.INSTANCE:S.INSTANCE:new d(x,M)}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=w.get(this.key);return typeof x=="boolean"?x?f.INSTANCE:S.INSTANCE:this}evaluate(x){return!!x.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this)),this.negated}}class o{constructor(x,M,j){this.key=x,this.value=M,this.negated=j,this.type=4}static create(x,M,j=null){if(typeof M=="boolean")return M?d.create(x,j):s.create(x,j);const I=w.get(x);if(typeof I=="boolean"){const W=I?"true":"false";return M===W?f.INSTANCE:S.INSTANCE}return new o(x,M,j)}cmp(x){return x.type!==this.type?this.type-x.type:T(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=w.get(this.key);if(typeof x=="boolean"){const M=x?"true":"false";return this.value===M?f.INSTANCE:S.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=h.create(this.key,this.value,this)),this.negated}}class a{constructor(x,M){this.key=x,this.valueKey=M,this.type=10,this.negated=null}static create(x,M){return new a(x,M)}cmp(x){return x.type!==this.type?this.type-x.type:T(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 M=x.getValue(this.valueKey),j=x.getValue(this.key);return Array.isArray(M)?M.indexOf(j)>=0:typeof j=="string"&&typeof M=="object"&&M!==null?R.call(M,j):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=r.create(this)),this.negated}}class r{constructor(x){this._actual=x,this.type=11}static create(x){return new r(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 h{constructor(x,M,j){this.key=x,this.value=M,this.negated=j,this.type=5}static create(x,M,j=null){if(typeof M=="boolean")return M?s.create(x,j):d.create(x,j);const I=w.get(x);if(typeof I=="boolean"){const W=I?"true":"false";return M===W?S.INSTANCE:f.INSTANCE}return new h(x,M,j)}cmp(x){return x.type!==this.type?this.type-x.type:T(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=w.get(this.key);if(typeof x=="boolean"){const M=x?"true":"false";return this.value===M?S.INSTANCE:f.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=o.create(this.key,this.value,this)),this.negated}}class s{constructor(x,M){this.key=x,this.negated=M,this.type=3}static create(x,M=null){const j=w.get(x);return typeof j=="boolean"?j?S.INSTANCE:f.INSTANCE:new s(x,M)}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=w.get(this.key);return typeof x=="boolean"?x?S.INSTANCE:f.INSTANCE:this}evaluate(x){return!x.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this)),this.negated}}function n(x,M){if(typeof x=="string"){const j=parseFloat(x);isNaN(j)||(x=j)}return typeof x=="string"||typeof x=="number"?M(x):S.INSTANCE}class i{constructor(x,M,j){this.key=x,this.value=M,this.negated=j,this.type=12}static create(x,M,j=null){return n(M,I=>new i(x,I,j))}cmp(x){return x.type!==this.type?this.type-x.type:T(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=m.create(this.key,this.value,this)),this.negated}}class t{constructor(x,M,j){this.key=x,this.value=M,this.negated=j,this.type=13}static create(x,M,j=null){return n(M,I=>new t(x,I,j))}cmp(x){return x.type!==this.type?this.type-x.type:T(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=b.create(this.key,this.value,this)),this.negated}}class b{constructor(x,M,j){this.key=x,this.value=M,this.negated=j,this.type=14}static create(x,M,j=null){return n(M,I=>new b(x,I,j))}cmp(x){return x.type!==this.type?this.type-x.type:T(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 m{constructor(x,M,j){this.key=x,this.value=M,this.negated=j,this.type=15}static create(x,M,j=null){return n(M,I=>new m(x,I,j))}cmp(x){return x.type!==this.type?this.type-x.type:T(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=i.create(this.key,this.value,this)),this.negated}}class g{constructor(x,M){this.key=x,this.regexp=M,this.type=7,this.negated=null}static create(x,M){return new g(x,M)}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 M=this.regexp?this.regexp.source:"",j=x.regexp?x.regexp.source:"";return M<j?-1:M>j?1:0}equals(x){if(x.type===this.type){const M=this.regexp?this.regexp.source:"",j=x.regexp?x.regexp.source:"";return this.key===x.key&&M===j}return!1}substituteConstants(){return this}evaluate(x){let M=x.getValue(this.key);return this.regexp?this.regexp.test(M):!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=E.create(this)),this.negated}}class E{constructor(x){this._actual=x,this.type=8}static create(x){return new E(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 M=null;for(let j=0,I=x.length;j<I;j++){const W=x[j].substituteConstants();if(x[j]!==W&&M===null){M=[];for(let Q=0;Q<j;Q++)M[Q]=x[Q]}M!==null&&(M[j]=W)}return M===null?x:M}class y{constructor(x,M){this.expr=x,this.negated=M,this.type=6}static create(x,M){return y._normalizeArr(x,M)}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 M=0,j=this.expr.length;M<j;M++){const I=e(this.expr[M],x.expr[M]);if(I!==0)return I}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let M=0,j=this.expr.length;M<j;M++)if(!this.expr[M].equals(x.expr[M]))return!1;return!0}return!1}substituteConstants(){const x=_(this.expr);return x===this.expr?this:y.create(x,this.negated)}evaluate(x){for(let M=0,j=this.expr.length;M<j;M++)if(!this.expr[M].evaluate(x))return!1;return!0}static _normalizeArr(x,M){const j=[];let I=!1;for(const W of x){if(!W)continue;if(W.type===1){I=!0;continue}if(W.type===0)return S.INSTANCE;if(W.type===6){j.push(...W.expr);continue}j.push(W)}if(j.length===0&&I)return f.INSTANCE;if(j.length===0)return;if(j.length===1)return j[0];j.sort(e);for(let W=1;W<j.length;W++)j[W-1].equals(j[W])&&(j.splice(W,1),W--);if(j.length===1)return j[0];for(;j.length>1;){const W=j[j.length-1];if(W.type!==9)break;j.pop();const Q=j.pop(),fe=j.length===0,le=c.create(W.expr.map(Ce=>y.create([Ce,Q],null)),null,fe);le&&(j.push(le),j.sort(e))}return j.length===1?j[0]:new y(j,M)}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let M of this.expr)x.push(...M.keys());return x}negate(){if(!this.negated){const x=[];for(let M of this.expr)x.push(M.negate());this.negated=c.create(x,this,!0)}return this.negated}}class c{constructor(x,M){this.expr=x,this.negated=M,this.type=9}static create(x,M,j){return c._normalizeArr(x,M,j)}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 M=0,j=this.expr.length;M<j;M++){const I=e(this.expr[M],x.expr[M]);if(I!==0)return I}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let M=0,j=this.expr.length;M<j;M++)if(!this.expr[M].equals(x.expr[M]))return!1;return!0}return!1}substituteConstants(){const x=_(this.expr);return x===this.expr?this:c.create(x,this.negated,!1)}evaluate(x){for(let M=0,j=this.expr.length;M<j;M++)if(this.expr[M].evaluate(x))return!0;return!1}static _normalizeArr(x,M,j){let I=[],W=!1;if(x){for(let Q=0,fe=x.length;Q<fe;Q++){const le=x[Q];if(!le)continue;if(le.type===0){W=!0;continue}if(le.type===1)return f.INSTANCE;if(le.type===9){I=I.concat(le.expr);continue}I.push(le)}if(I.length===0&&W)return S.INSTANCE;I.sort(e)}if(I.length===0)return;if(I.length===1)return I[0];for(let Q=1;Q<I.length;Q++)I[Q-1].equals(I[Q])&&(I.splice(Q,1),Q--);if(I.length===1)return I[0];if(j){for(let Q=0;Q<I.length;Q++)for(let fe=Q+1;fe<I.length;fe++)L(I[Q],I[fe])&&(I.splice(fe,1),fe--);if(I.length===1)return I[0]}return new c(I,M)}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let M of this.expr)x.push(...M.keys());return x}negate(){if(!this.negated){let x=[];for(let M of this.expr)x.push(M.negate());for(;x.length>1;){const M=x.shift(),j=x.shift(),I=[];for(const Q of D(M))for(const fe of D(j))I.push(y.create([Q,fe],null));const W=x.length===0;x.unshift(c.create(I,null,W))}this.negated=x[0]}return this.negated}}class u extends d{constructor(x,M,j){super(x,null);this._defaultValue=M,typeof j=="object"?u._info.push(Object.assign(Object.assign({},j),{key:x})):j!==!0&&u._info.push({key:x,description:j,type:M!=null?typeof M:void 0})}static all(){return u._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 o.create(this.key,x)}}u._info=[];const l=Object(A.c)("contextKeyService"),v="setContext";function p(x,M){return x<M?-1:x>M?1:0}function T(x,M,j,I){return x<j?-1:x>j?1:M<I?-1:M>I?1:0}function L(x,M){if(M.type===6&&x.type!==9&&x.type!==6){for(const W of M.expr)if(x.equals(W))return!0}const j=x.negate(),I=D(j).concat(D(M));I.sort(e);for(let W=0;W<I.length;W++){const Q=I[W],fe=Q.negate();for(let le=W+1;le<I.length;le++){const Ce=I[le];if(fe.equals(Ce))return!0}}return!1}function D(x){return x.type===9?x.expr:[x]}},TXwP:function(Je,be,V){var ae,B;(function(){var A;(function(){"use strict";var w=[,,function(e){function S(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}S.prototype.clone_empty=function(){var o=new S(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},S.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},S.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},S.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},S.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)},S.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},S.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},S.prototype.is_empty=function(){return this.__items.length===0},S.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},S.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},S.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},S.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},S.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},S.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},S.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function f(o,a){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}f.prototype.get_indent_size=function(o,a){var r=this.__base_string_length;return a=a||0,o<0&&(r=0),r+=o*this.__indent_size,r+=a,r},f.prototype.get_indent_string=function(o,a){var r=this.__base_string;return a=a||0,o<0&&(o=0,r=""),a+=o*this.__indent_size,this.__ensure_cache(a),r+=this.__cache[a],r},f.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var o=this.__cache.length,a=0,r="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,r=new Array(a+1).join(this.__indent_string)),o&&(r+=new Array(o+1).join(" ")),this.__cache.push(r)};function d(o,a){this.__indent_cache=new f(o,a),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new S(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(o,a){return this.__indent_cache.get_indent_string(o,a)},d.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(r=r.replace(/[\n]/g,o)),r},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.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(" "))},d.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(o,a){for(var r=this.__lines.length-2;r>=0;){var h=this.__lines[r];if(h.is_empty())break;if(h.item(0).indexOf(o)!==0&&h.item(-1)!==a){this.__lines.splice(r+1,0,new S(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},e.exports.Output=d},,,,function(e){function S(o,a){this.raw_options=f(o,a),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"])}S.prototype._get_array=function(o,a){var r=this.raw_options[o],h=a||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(h=r.concat()):typeof r=="string"&&(h=r.split(/[^a-zA-Z0-9_\/\-]+/)),h},S.prototype._get_boolean=function(o,a){var r=this.raw_options[o],h=r===void 0?!!a:!!r;return h},S.prototype._get_characters=function(o,a){var r=this.raw_options[o],h=a||"";return typeof r=="string"&&(h=r.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},S.prototype._get_number=function(o,a){var r=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var h=parseInt(r,10);return isNaN(h)&&(h=a),h},S.prototype._get_selection=function(o,a,r){var h=this._get_selection_list(o,a,r);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h[0]},S.prototype._get_selection_list=function(o,a,r){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[a[0]],!this._is_valid_selection(r,a))throw new Error("Invalid Default Value!");var h=this._get_array(o,r);if(!this._is_valid_selection(h,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h},S.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(r){return a.indexOf(r)===-1})};function f(o,a){var r={};o=d(o);var h;for(h in o)h!==a&&(r[h]=o[h]);if(a&&o[a])for(h in o[a])r[h]=o[a][h];return r}function d(o){var a={},r;for(r in o){var h=r.replace(/-/g,"_");a[h]=o[r]}return a}e.exports.Options=S,e.exports.normalizeOpts=d,e.exports.mergeOpts=f},,function(e){var S=RegExp.prototype.hasOwnProperty("sticky");function f(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},f.prototype.peek=function(d){var o=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(o=this.__input.charAt(d)),o},f.prototype.__match=function(d,o){d.lastIndex=o;var a=d.exec(this.__input);return a&&!(S&&d.sticky)&&(a.index!==o&&(a=null)),a},f.prototype.test=function(d,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(d,o):!1},f.prototype.testChar=function(d,o){var a=this.peek(o);return d.lastIndex=0,a!==null&&d.test(a)},f.prototype.match=function(d){var o=this.__match(d,this.__position);return o?this.__position+=o[0].length:o=null,o},f.prototype.read=function(d,o,a){var r="",h;return d&&(h=this.match(d),h&&(r+=h[0])),o&&(h||!d)&&(r+=this.readUntil(o,a)),r},f.prototype.readUntil=function(d,o){var a="",r=this.__position;d.lastIndex=this.__position;var h=d.exec(this.__input);return h?(r=h.index,o&&(r+=h[0].length)):r=this.__input_length,a=this.__input.substring(this.__position,r),this.__position=r,a},f.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},f.prototype.get_regexp=function(d,o){var a=null,r="g";return o&&S&&(r="y"),typeof d=="string"&&d!==""?a=new RegExp(d,r):d&&(a=new RegExp(d.source,r)),a},f.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(d){var o=this.__position,a=this.readUntilAfter(d);return this.__position=o,a},f.prototype.lookBack=function(d){var o=this.__position-1;return o>=d.length&&this.__input.substring(o-d.length,o).toLowerCase()===d},e.exports.InputScanner=f},,,,,function(e){function S(f,d){f=typeof f=="string"?f:f.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+d,"g")}S.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(f);o;)d[o[1]]=o[2],o=this.__directive_pattern.exec(f);return d},S.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=S},,function(e,S,f){var d=f(16).Beautifier,o=f(17).Options;function a(r,h){var s=new d(r,h);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new o}},function(e,S,f){var d=f(17).Options,o=f(2).Output,a=f(8).InputScanner,r=f(13).Directives,h=new r(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,i=/\s/,t=/(?:\s|\n)+/g,b=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function g(E,_){this._source_text=E||"",this._options=new d(_),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"]}g.prototype.eatString=function(E){var _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(E.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return _},g.prototype.eatWhitespace=function(E){for(var _=i.test(this._input.peek()),y=0;i.test(this._input.peek());)this._ch=this._input.next(),E&&this._ch===`
|
|
`&&((y===0||y<this._options.max_preserve_newlines)&&(y++,this._output.add_new_line(!0)));return _},g.prototype.foundNestedPseudoClass=function(){for(var E=0,_=1,y=this._input.peek(_);y;){if(y==="{")return!0;if(y==="(")E+=1;else if(y===")"){if(E===0)return!1;E-=1}else if(y===";"||y==="}")return!1;_++,y=this._input.peek(_)}return!1},g.prototype.print_string=function(E){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(E)},g.prototype.preserveSingleSpace=function(E){E&&(this._output.space_before_token=!0)},g.prototype.indent=function(){this._indentLevel++},g.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},g.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,_=this._options.eol;_==="auto"&&(_=`
|
|
`,E&&s.test(E||"")&&(_=E.match(s)[0])),E=E.replace(n,`
|
|
`);var y=E.match(/^[\t ]*/)[0];this._output=new o(this._options,y),this._input=new a(E),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var c=0,u=!1,l=!1,v=!1,p=!1,T=!1,L=!1,D=this._ch,x=!1,M,j,I;M=this._input.read(t),j=M!=="",I=D,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),D=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(b),Q=h.get_directives(W);Q&&Q.ignore==="start"&&(W+=h.readIgnored(this._input)),this.print_string(W),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(m)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(j),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var fe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);fe.match(/[ :]$/)&&(fe=this.eatString(": ").replace(/\s$/,""),this.print_string(fe),this._output.space_before_token=!0),fe=fe.replace(/\s$/,""),fe==="extend"?p=!0:fe==="import"&&(T=!0),fe in this.NESTED_AT_RULE?(this._nestedLevel+=1,fe in this.CONDITIONAL_GROUP_RULE&&(v=!0)):!u&&c===0&&fe.indexOf(":")!==-1&&(l=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(j),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")l&&(l=!1,this.outdent()),v?(v=!1,u=this._indentLevel>=this._nestedLevel):u=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&u&&(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)):(I==="("?this._output.space_before_token=!1:I!==","&&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(),I==="{"&&this._output.trim(!0),T=!1,p=!1,l&&(this.outdent(),l=!1),this.print_string(this._ch),u=!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 le=0;le<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;le++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[le])){x=!0;break}(u||v)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!p&&c===0?(this.print_string(":"),l||(l=!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 Ce=I==='"'||I==="'";this.preserveSingleSpace(Ce||j),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")x=!1,c===0?(l&&(this.outdent(),l=!1),p=!1,T=!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(),c++,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(")")),c&&(c--,this.outdent()));else{var Oe=!1;this._input.lookBack("with")&&(Oe=!0),this.preserveSingleSpace(j||Oe),this.print_string(this._ch),l&&I==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),L=!0):(this.eatWhitespace(),c++,this.indent())}else if(this._ch===")")c&&(c--,this.outdent()),L&&this._input.peek()===";"&&this._options.selector_separator_newline&&(L=!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&&(!l||L)&&c===0&&!T&&!p?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!l&&c===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(j),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Re=I==='"'||I==="'";this.preserveSingleSpace(Re||j),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&x&&this._output.add_new_line()}var Le=this._output.get_code(_);return Le},e.exports.Beautifier=g},function(e,S,f){var d=f(6).Options;function o(a){d.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var h=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<h.length;s++)h[s]!=="expand"?this.brace_style="collapse":this.brace_style=h[s]}o.prototype=new d,e.exports.Options=o}],R={};function H(e){var S=R[e];if(S!==void 0)return S.exports;var f=R[e]={exports:{}};return w[e](f,f.exports,H),f.exports}var U=H(15);A=U})();var k=A;!(ae=[],B=function(){return{css_beautify:k}}.apply(be,ae),B!==void 0&&(Je.exports=B))})()},Vhoy:function(Je,be,V){"use strict";V.d(be,"d",function(){return k}),V.d(be,"e",function(){return w}),V.d(be,"c",function(){return R}),V.d(be,"b",function(){return H}),V.d(be,"a",function(){return U});var ae=V("MI8n");class B{constructor(){this._icons=new Map,this._onDidRegister=new ae.b}add(e){const S=this._icons.get(e.id);S?e.description?S.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,k=A;function w(e,S){return new H(e,S)}function R(e){return e?e.replace(/\$\((.*?)\)/g,(S,f)=>` ${f} `).trim():""}class H{constructor(e,S,f){this.id=e,this.definition=S,this.description=f,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 U;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const S=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function f(a){if(a instanceof H)return["codicon","codicon-"+a.id];const r=S.exec(a.id);if(!r)return f(H.error);let[,h,s]=r;const n=["codicon","codicon-"+h];return s&&n.push("codicon-modifier-"+s.substr(1)),n}e.asClassNameArray=f;function d(a){return f(a).join(" ")}e.asClassName=d;function o(a){return"."+f(a).join(".")}e.asCSSSelector=o})(U||(U={})),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"})}(H||(H={}))},ZW9T:function(Je,be,V){"use strict";V.d(be,"a",function(){return j});var ae=V("k1fw"),B=V("oBTY"),A=V("miYZ"),k=V("tsqr"),w=V("rAM+"),R=V("tJVT"),H=V("PpiC"),U=V("q1tI"),e=V.n(U),S=V("bdgK"),f=V("9og8"),d=V("WmNS"),o=V.n(d),a={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"]},r={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},h={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},s={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=V("5VLF"),i=V.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"]}},b=function(W,Q){return Q.map(function(fe){return{label:fe,kind:W.languages.CompletionItemKind.Keyword,insertText:fe}})},m=function(W){return Object.keys(t.tables).map(function(Q){return{label:Q,kind:W.languages.CompletionItemKind.Variable,insertText:Q}})},g=function(W,Q){var fe=t.tables[W];return fe?fe.map(function(le){return{label:le,kind:Q.languages.CompletionItemKind.Field,insertText:le}}):[]};function E(I,W,Q,fe,le){var Ce=W.getWordUntilPosition(Q),Oe={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:Ce.startColumn,endColumn:Ce.endColumn},Re=fe.map(function(Le){return{label:Le,kind:I.languages.CompletionItemKind.Keyword,insertText:Le,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Oe}});return le.map(function(Le){Re.push(Object(ae.a)(Object(ae.a)({},Le),{},{range:Oe}))}),Re}var _=function(I){t.languages.map(function(le){return I.languages.registerDocumentFormattingEditProvider(le,{provideDocumentFormattingEdits:function(Oe,Re,Le){return Object(f.a)(o.a.mark(function Pe(){var _e;return o.a.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return _e=i()(Oe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),O.abrupt("return",[{range:Oe.getFullModelRange(),text:_e}]);case 2:case"end":return O.stop()}},Pe)}))()}}),le});var W=h.quickKey.map(function(le){return{label:le.label,kind:I.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=s.quickKey.map(function(le){return{label:le.label,kind:I.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),fe=r.quickKey.map(function(le){return{label:le.label,kind:I.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}});I.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ce,Oe){var Re=Ce.getWordUntilPosition(Oe),Le={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Pe=Ce.getLineContent(Oe.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(B.a)(h.keywords.map(function(_e){return{label:_e,kind:I.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})),Object(B.a)(h.quickKey.map(function(_e){return{label:_e.label,kind:I.languages.CompletionItemKind.Function,documentation:_e.content,insertText:Pe.startsWith("#")?_e.content.replace(/#/,""):_e.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})))}}}),I.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ce,Oe){var Re=Ce.getWordUntilPosition(Oe),Le={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn};return{suggestions:Object(B.a)(a.keywords.map(function(Pe){return{label:Pe,kind:I.languages.CompletionItemKind.Function,documentation:Pe,insertText:Pe,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}}))}}}),I.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ce,Oe){var Re=Ce.getWordUntilPosition(Oe),Le={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Pe=Ce.getLineContent(Oe.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(B.a)(r.keywords.map(function(_e){return{label:_e,kind:I.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})),Object(B.a)(r.quickKey.map(function(_e){return{label:_e.label,kind:I.languages.CompletionItemKind.Function,documentation:_e.content,insertText:Pe.startsWith("#")?_e.content.replace(/#/,""):_e.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})))}}}),I.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ce,Oe){var Re=Ce.getWordUntilPosition(Oe),Le={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:Re.startColumn,endColumn:Re.endColumn},Pe=Ce.getLineContent(Oe.lineNumber).substring(Re.startColumn-2,Re.endColumn);return{suggestions:[].concat(Object(B.a)(s.keywords.map(function(_e){return{label:_e,kind:I.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})),Object(B.a)(s.quickKey.map(function(_e){return{label:_e.label,kind:I.languages.CompletionItemKind.Function,documentation:_e.content,insertText:Pe.startsWith("#")?_e.content.replace(/#/,""):_e.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Le}})))}}})},y="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",c=V("fjLI"),u=V("LvDl"),l=V("+ua5");function v(I){return/^\d+$/.test(I)?"".concat(I,"px"):I}function p(){}var T=!1,L={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function D(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],W=I;if(Array.isArray(I)){for(var Q=0;Q<I.length;Q++){var fe=L[I[Q]];if(fe)return fe}return W[0]}return L[W]||W}var x=null,M=be.b=function(I){var W=I.width,Q=W===void 0?"100%":W,fe=I.height,le=fe===void 0?"100%":fe,Ce=I.value,Oe=I.language,Re=Oe===void 0?"javascript":Oe,Le=I.style,Pe=Le===void 0?{}:Le,_e=I.options,N=_e===void 0?{}:_e,O=I.overrideServices,C=O===void 0?{}:O,F=I.theme,z=F===void 0?"vs-dark":F,P=I.onEditBlur,oe=I.onSave,we=I.autoHeight,Ae=we===void 0?!1:we,ee=I.forbidCopy,de=ee===void 0?!1:ee,ge=I.onChange,xe=ge===void 0?p:ge,Me=I.editorDidMount,Ue=Me===void 0?p:Me,He=I.onFocus,Be=He===void 0?p:He,ze=I.filename,We=ze===void 0?"educoder.txt":ze,Ke=I.errorLine,Fe=I.errorContent,Ye=Fe===void 0?"":Fe,$e=Object(H.a)(I,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),q=Object(U.useRef)(),K=Object(U.useRef)({}),G=Object(U.useRef)(),Z=Object(U.useRef)(),te=Object(U.useRef)(!1),X=Object(U.useRef)(),$=Object(U.useState)(!1),ne=Object(R.a)($,2),se=ne[0],Te=ne[1];function Ee(){var nt;return q.current&&(nt=new S.default(function(rt){var Et=Object(w.a)(rt),Ft;try{for(Et.s();!(Ft=Et.n()).done;){var qt=Ft.value;(qt.target.offsetHeight>0||qt.target.offsetWidth>0)&&K.current.instance.layout()}}catch(pi){Et.e(pi)}finally{Et.f()}}),nt.observe(q.current)),nt}function De(){k.b.warn(decodeURIComponent(y))}var Ge=function(){var rt=K.current.instance;if(Ce!=null&&rt&&se){var Et=rt.getModel();Et&&Ce!==Et.getValue()&&(T=!0,Et.setValue(Ce),rt.layout(),T=!1)}};Object(U.useEffect)(function(){Z.current&&clearTimeout(Z.current),Z.current=setTimeout(function(){Ge()},500)},[Ce,se,K.current]),Object(U.useEffect)(function(){if(Ke&&K.current&&K.current.instance){var nt=K.current.instance;nt.changeViewZones(function(Et){var Ft=document.createElement("div");Ft.style.padding="10px 20px",Ft.style.width="calc(100% - 20px)",Ft.className="my-error-line-wrp",Ft.innerHTML=Ye,Et.addZone({afterLineNumber:Ke||11,heightInLines:3,domNode:Ft})});var rt={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}};nt.addOverlayWidget(rt),nt.revealPositionInCenter({lineNumber:20,column:1})}},[Ke,K.current,se]);function Ze(){var nt=K.current.instance;if(nt){var rt=nt.getSelection(),Et=K.current.pastePos||{},Ft=new x.Range(Et.startLineNumber||rt.endLineNumber,Et.startColumn||rt.endColumn,Et.endLineNumber||rt.endLineNumber,Et.endColumn||rt.endColumn);setTimeout(function(){nt.executeEdits("",[{range:Ft,text:""}])},300)}}function Qe(nt){(window.navigator.platform.match("Mac")?nt.metaKey:nt.ctrlKey)&&nt.keyCode==83&&(nt.preventDefault(),oe())}var vt=function(){if(Ae&&K.current.instance){var rt=K.current.instance.getContentHeight();Gt(rt<le?le:rt)}else Gt(le)};function it(nt){var rt=document.createEvent("MouseEvents");rt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),nt.dispatchEvent(rt)}function Xe(nt,rt){var Et=window.URL||window.webkitURL||window,Ft=new Blob([rt]),qt=document.createElementNS("http://www.w3.org/1999/xhtml","a");qt.href=Et.createObjectURL(Ft),qt.download=nt,it(qt)}Object(U.useEffect)(function(){vt()},[vt]),Object(U.useEffect)(function(){q.current&&!se&&Promise.all([V.e(18),V.e(29)]).then(V.t.bind(null,"M/lh",7)).then(function(nt){try{x=nt,K.current.instance=x.editor.create(q.current,{value:Ce,language:D(Re),theme:z,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},C);var rt=K.current.instance,Et=c.d._menuItems,Ft=Object(B.a)(Et).find(function(xt){return xt[0]._debugName=="EditorContext"}),qt=Ft[1],pi=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Wt=function(ut,zt){var Ot=ut._first;do{var oi,Bt,ui=zt.includes((oi=Ot.element)===null||oi===void 0||((Bt=oi.command)===null||Bt===void 0)?void 0:Bt.id);ui&&ut._remove(Ot)}while(Ot=Ot.next)};if(Ue(rt,x),setTimeout(function(){vt(),K.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Xe(We||"educoder.txt",rt.getValue())}}),rt.getDomNode().addEventListener("input",function(){G.current.autoFormat&&rt.getAction("editor.action.formatDocument").run()})},500),K.current.subscription=rt.onDidChangeModelContent(function(xt){te.current?clearTimeout(X.current):(vt(),xe(rt.getValue(),xt)),X.current=setTimeout(function(){te.current=!1},500)}),window.Monaco||_(x,D(Re)),de&&(Wt(qt,pi),q.current.classList.add("noCopyPaste"),rt.onKeyDown(function(xt){var ut=xt.keyCode,zt=xt.ctrlKey,Ot=xt.metaKey;(ut===33||ut===52)&&(Ot||zt)&&(De(),xt.preventDefault())})),window.Monaco=x,P&&rt.onDidBlurEditorWidget(function(){P(rt.getValue())}),Be&&rt.onDidFocusEditorText(function(){Be(rt.getValue())}),de){rt.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_V,function(){return De(),null}),rt.onDidPaste(function(xt){K.current.pastePos=xt});try{window.addEventListener("paste",Ze)}catch(xt){}}var wt=Ee();return Te(!0),function(){var xt=K.current.instance;xt.dispose();var ut=xt.getModel();ut&&ut.dispose(),K.current.subscription&&K.current.subscription.dispose(),de&&window.removeEventListener("paste",Ze),wt.unobserve(q.current)}}catch(xt){}})},[]),Object(U.useEffect)(function(){var nt=K.current.instance;if(nt&&se)return document.addEventListener("keydown",Qe,!1),function(){document.removeEventListener("keydown",Qe)}},[oe,se]),Object(U.useEffect)(function(){var nt=K.current.instance;if(nt&&se){var rt=D(Re);x.editor.setModelLanguage(nt.getModel(),rt),console.log("language:",Re,nt.getModel(),rt)}},[Re,se]),Object(U.useEffect)(function(){var nt=K.current.instance;nt&&se&&x.editor.setTheme(z)},[z,se]),Object(U.useEffect)(function(){var nt=K.current.instance;G.current=N,nt&&se&&(nt.updateOptions(Object(ae.a)({},N)),setTimeout(function(){nt.getModel().updateOptions(Object(ae.a)({},N))},200))},[JSON.stringify(N),se]),Object(U.useEffect)(function(){var nt=K.current.instance;nt&&se&&nt.layout()},[Q,le,se]);var Mt=Object(U.useState)(v(Q)),Tt=Object(R.a)(Mt,2),kt=Tt[0],Nt=Tt[1],lt=Object(U.useState)(v(le)),Kt=Object(R.a)(lt,2),Zt=Kt[0],Gt=Kt[1],ai=Object(ae.a)(Object(ae.a)({},Pe),{},{width:kt,height:Zt});return e.a.createElement("div",{className:"my-monaco-editor",ref:q,style:ai})};function j(I){var W=I.width,Q=W===void 0?"100%":W,fe=I.height,le=fe===void 0?"100%":fe,Ce=I.original,Oe=I.modified,Re=I.language,Le=I.options,Pe=Le===void 0?{}:Le,_e=Object(U.useRef)(),N=Object(U.useState)(null),O=Object(R.a)(N,2),C=O[0],F=O[1];function z(Ae){var ee;return _e.current&&(ee=new S.default(function(de){var ge=Object(w.a)(de),xe;try{for(ge.s();!(xe=ge.n()).done;){var Me=xe.value;(Me.target.offsetHeight>0||Me.target.offsetWidth>0)&&Ae.layout()}}catch(Ue){ge.e(Ue)}finally{ge.f()}}),ee.observe(_e.current)),ee}Object(U.useEffect)(function(){_e.current&&Promise.all([V.e(18),V.e(29)]).then(V.t.bind(null,"M/lh",7)).then(function(Ae){x=Ae;var ee=x.editor.createDiffEditor(_e.current,Object(ae.a)(Object(ae.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},Pe),{},{wordWrap:!0}));F(ee);var de=z(ee);return function(){ee.dispose();var ge=ee.getModel();ge&&ge.dispose(),de.unobserve(_e.current)}})},[]),Object(U.useEffect)(function(){C&&C.setModel({original:x.editor.createModel(Ce,Re),modified:x.editor.createModel(Oe,Re)})},[Ce,Oe,Re,C]);var P=v(Q),oe=v(le),we={width:P,height:oe};return e.a.createElement("div",{className:"my-diff-editor",ref:_e,style:we})}},bT9E:function(Je,be,V){"use strict";V.d(be,"a",function(){return B});var ae=V("VTBJ");function B(A,k){var w=Object(ae.a)({},A);return Array.isArray(k)&&k.forEach(function(R){delete w[R]}),w}},fjLI:function(Je,be,V){"use strict";V.d(be,"f",function(){return o}),V.d(be,"b",function(){return a}),V.d(be,"a",function(){return r}),V.d(be,"d",function(){return h}),V.d(be,"e",function(){return s}),V.d(be,"c",function(){return n});var ae=V("8HAY"),B=V("Vhoy"),A=V("MI8n"),k=V("JYp7"),w=V("pmY6"),R=V("24hK"),H=V("nnTU"),U=V("T8No"),e=V("Cg/j"),S=V("t9D7"),f=function(i,t,b,m){var g=arguments.length,E=g<3?t:m===null?m=Object.getOwnPropertyDescriptor(t,b):m,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(i,t,b,m);else for(var y=i.length-1;y>=0;y--)(_=i[y])&&(E=(g<3?_(E):g>3?_(t,b,E):_(t,b))||E);return g>3&&E&&Object.defineProperty(t,b,E),E},d=function(i,t){return function(b,m){t(b,m,i)}};function o(i){return i.command!==void 0}class a{constructor(i){this.id=a._idPool++,this._debugName=i}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const r=Object(e.c)("menuService"),h=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new A.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===a.CommandPalette}}addCommand(i){return this.addCommands(k.a.single(i))}addCommands(i){for(const t of i)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(w.i)(()=>{let t=!1;for(const b of i)t=this._commands.delete(b.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((t,b)=>i.set(b,t)),i}appendMenuItem(i,t){return this.appendMenuItems(k.a.single({id:i,item:t}))}appendMenuItems(i){const t=new Set,b=new R.a;for(const{id:m,item:g}of i){let E=this._menuItems.get(m);E||(E=new R.a,this._menuItems.set(m,E)),b.push(E.push(g)),t.add(m)}return this._onDidChangeMenu.fire(t),Object(w.i)(()=>{if(b.size>0){for(let m of b)m();this._onDidChangeMenu.fire(t),b.clear()}})}getMenuItems(i){let t;return this._menuItems.has(i)?t=[...this._menuItems.get(i)]:t=[],i===a.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(i){const t=new Set;for(const b of i)o(b)&&(t.add(b.command.id),b.alt&&t.add(b.alt.id));this._commands.forEach((b,m)=>{t.has(m)||i.push({command:b})})}};class s extends ae.e{constructor(i,t,b,m){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=t,this._contextKeyService=b,this._options=m}get actions(){const i=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),b=t.getActions(this._options);t.dispose();for(const[,m]of b)m.length>0&&(i.push(...m),i.push(new ae.d));return i.length&&i.pop(),i}}let n=class i{constructor(t,b,m,g,E){var _,y;if(this._commandService=E,this.id=t.id,this.label=(m==null?void 0:m.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(y=typeof t.tooltip=="string"?t.tooltip:(_=t.tooltip)===null||_===void 0?void 0:_.value)!==null&&y!==void 0?y:"",this.enabled=!t.precondition||g.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const c=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=g.contextMatchesRules(c.condition),this.checked&&c.tooltip&&(this.tooltip=typeof c.tooltip=="string"?c.tooltip:c.tooltip.value),c.title&&(this.label=typeof c.title=="string"?c.title:c.title.value)}this.item=t,this.alt=b?new i(b,void 0,m,g,E):void 0,this._options=m,S.d.isThemeIcon(t.icon)&&(this.class=B.a.asClassName(t.icon))}dispose(){}run(...t){var b,m;let g=[];return((b=this._options)===null||b===void 0?void 0:b.arg)&&(g=[...g,this._options.arg]),((m=this._options)===null||m===void 0?void 0:m.shouldForwardArgs)&&(g=[...g,...t]),this._commandService.executeCommand(this.id,...g)}};n=f([d(3,U.b),d(4,H.b)],n)},ic2d:function(Je,be,V){"use strict";V.d(be,"a",function(){return k});var ae=V("FWmy"),B=V("746U");class A{constructor(){this.data=new Map}add(w,R){ae.a(B.l(w)),ae.a(B.k(R)),ae.a(!this.data.has(w),"There is already an extension with this id"),this.data.set(w,R)}as(w){return this.data.get(w)||null}}const k=new A},k3GJ:function(Je,be,V){"use strict";V.d(be,"a",function(){return En});var ae=V("rePB"),B=V("ODXe"),A=V("Ff2n"),k=V("VTBJ"),w=V("q1tI"),R=V("TSYQ"),H=V.n(R),U=V("Zm9Q"),e=V("6cGi"),S=V("KQm4"),f=V("xEkU"),d=V.n(f),o=V("t23M");function a(re){var pe=Object(w.useRef)(),ve=Object(w.useRef)(!1);function he(){for(var Y=arguments.length,ie=new Array(Y),J=0;J<Y;J++)ie[J]=arguments[J];ve.current||(d.a.cancel(pe.current),pe.current=d()(function(){re.apply(void 0,ie)}))}return Object(w.useEffect)(function(){return function(){ve.current=!0,d.a.cancel(pe.current)}},[]),he}function r(re){var pe=Object(w.useRef)([]),ve=Object(w.useState)({}),he=Object(B.a)(ve,2),Y=he[1],ie=Object(w.useRef)(typeof re=="function"?re():re),J=a(function(){var ce=ie.current;pe.current.forEach(function(ye){ce=ye(ce)}),pe.current=[],ie.current=ce,Y({})});function ue(ce){pe.current.push(ce),J()}return[ie.current,ue]}var h=V("4IlW");function s(re,pe){var ve,he=re.prefixCls,Y=re.id,ie=re.active,J=re.rtl,ue=re.tab,ce=ue.key,ye=ue.tab,me=ue.disabled,Se=ue.closeIcon,Ie=re.tabBarGutter,Ne=re.tabPosition,ke=re.closable,je=re.renderWrapper,tt=re.removeAriaLabel,ht=re.editable,at=re.onClick,dt=re.onRemove,ct=re.onFocus,st="".concat(he,"-tab");w.useEffect(function(){return dt},[]);var ot={};Ne==="top"||Ne==="bottom"?ot[J?"marginLeft":"marginRight"]=Ie:ot.marginBottom=Ie;var yt=ht&&ke!==!1&&!me;function ft(et){if(me)return;at(et)}function Ut(et){et.preventDefault(),et.stopPropagation(),ht.onEdit("remove",{key:ce,event:et})}var Ct=w.createElement("div",{key:ce,ref:pe,className:H()(st,(ve={},Object(ae.a)(ve,"".concat(st,"-with-remove"),yt),Object(ae.a)(ve,"".concat(st,"-active"),ie),Object(ae.a)(ve,"".concat(st,"-disabled"),me),ve)),style:ot,onClick:ft},w.createElement("div",{role:"tab","aria-selected":ie,id:Y&&"".concat(Y,"-tab-").concat(ce),className:"".concat(st,"-btn"),"aria-controls":Y&&"".concat(Y,"-panel-").concat(ce),"aria-disabled":me,tabIndex:me?null:0,onClick:function(qe){qe.stopPropagation(),ft(qe)},onKeyDown:function(qe){[h.a.SPACE,h.a.ENTER].includes(qe.which)&&(qe.preventDefault(),ft(qe))},onFocus:ct},ye),yt&&w.createElement("button",{type:"button","aria-label":tt||"remove",tabIndex:0,className:"".concat(st,"-remove"),onClick:function(qe){qe.stopPropagation(),Ut(qe)}},Se||ht.removeIcon||"\xD7"));return je&&(Ct=je(Ct)),Ct}var n=w.forwardRef(s),i={width:0,height:0,left:0,top:0};function t(re,pe,ve){return Object(w.useMemo)(function(){for(var he,Y=new Map,ie=pe.get((he=re[0])===null||he===void 0?void 0:he.key)||i,J=ie.left+ie.width,ue=0;ue<re.length;ue+=1){var ce=re[ue].key,ye=pe.get(ce);if(!ye){var me;ye=pe.get((me=re[ue-1])===null||me===void 0?void 0:me.key)||i}var Se=Y.get(ce)||Object(k.a)({},ye);Se.right=J-Se.left-Se.width,Y.set(ce,Se)}return Y},[re.map(function(he){return he.key}).join("_"),pe,ve])}var b={width:0,height:0,left:0,top:0,right:0};function m(re,pe,ve,he,Y){var ie=Y.tabs,J=Y.tabPosition,ue=Y.rtl,ce,ye,me;["top","bottom"].includes(J)?(ce="width",ye=ue?"right":"left",me=Math.abs(pe.left)):(ce="height",ye="top",me=-pe.top);var Se=pe[ce],Ie=ve[ce],Ne=he[ce],ke=Se;return Ie+Ne>Se&&(ke=Se-Ne),Object(w.useMemo)(function(){if(!ie.length)return[0,0];for(var je=ie.length,tt=je,ht=0;ht<je;ht+=1){var at=re.get(ie[ht].key)||b;if(at[ye]+at[ce]>me+ke){tt=ht-1;break}}for(var dt=0,ct=je-1;ct>=0;ct-=1){var st=re.get(ie[ct].key)||b;if(st[ye]<me){dt=ct+1;break}}return[dt,tt]},[re,me,ke,J,ie.map(function(je){return je.key}).join("_"),ue])}var g=V("wx14"),E=V("1OyB"),_=V("vuIU"),y=V("JX7q"),c=V("Ji7U"),u=V("LK+K"),l=V("I8Z2"),v=V("bT9E"),p=V("2GS6"),T=V("Gytx"),L=V.n(T),D=V("U8pU"),x=/iPhone/i,M=/iPod/i,j=/iPad/i,I=/\bAndroid(?:.+)Mobile\b/i,W=/Android/i,Q=/\bAndroid(?:.+)SD4930UR\b/i,fe=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,le=/Windows Phone/i,Ce=/\bWindows(?:.+)ARM\b/i,Oe=/BlackBerry/i,Re=/BB10/i,Le=/Opera Mini/i,Pe=/\b(CriOS|Chrome)(?:.+)Mobile/i,_e=/Mobile(?:.+)Firefox\b/i;function N(re,pe){return re.test(pe)}function O(re){var pe=re||(typeof navigator!="undefined"?navigator.userAgent:""),ve=(pe||"").split("[FBAN");if(typeof ve[1]!="undefined"){var he=ve,Y=Object(B.a)(he,1);pe=Y[0]}if(ve=pe.split("Twitter"),typeof ve[1]!="undefined"){var ie=ve,J=Object(B.a)(ie,1);pe=J[0]}var ue={apple:{phone:N(x,pe)&&!N(le,pe),ipod:N(M,pe),tablet:!N(x,pe)&&N(j,pe)&&!N(le,pe),device:(N(x,pe)||N(M,pe)||N(j,pe))&&!N(le,pe)},amazon:{phone:N(Q,pe),tablet:!N(Q,pe)&&N(fe,pe),device:N(Q,pe)||N(fe,pe)},android:{phone:!N(le,pe)&&N(Q,pe)||!N(le,pe)&&N(I,pe),tablet:!N(le,pe)&&!N(Q,pe)&&!N(I,pe)&&(N(fe,pe)||N(W,pe)),device:!N(le,pe)&&(N(Q,pe)||N(fe,pe)||N(I,pe)||N(W,pe))||N(/\bokhttp\b/i,pe)},windows:{phone:N(le,pe),tablet:N(Ce,pe),device:N(le,pe)||N(Ce,pe)},other:{blackberry:N(Oe,pe),blackberry10:N(Re,pe),opera:N(Le,pe),firefox:N(_e,pe),chrome:N(Pe,pe),device:N(Oe,pe)||N(Re,pe)||N(Le,pe)||N(_e,pe)||N(Pe,pe)},any:null,phone:null,tablet:null};return ue.any=ue.apple.device||ue.android.device||ue.windows.device||ue.other.device,ue.phone=ue.apple.phone||ue.android.phone||ue.windows.phone,ue.tablet=ue.apple.tablet||ue.android.tablet||ue.windows.tablet,ue}var C=Object(k.a)(Object(k.a)({},O()),{},{isMobile:O}),F=C;function z(){}function P(re,pe,ve){var he=pe||"";return re.key||"".concat(he,"item_").concat(ve)}function oe(re){return"".concat(re,"-menu-")}function we(re,pe){var ve=-1;w.Children.forEach(re,function(he){ve+=1,he&&he.type&&he.type.isMenuItemGroup?w.Children.forEach(he.props.children,function(Y){ve+=1,pe(Y,ve)}):pe(he,ve)})}function Ae(re,pe,ve){if(!re||ve.find)return;w.Children.forEach(re,function(he){if(he){var Y=he.type;if(!Y||!(Y.isSubMenu||Y.isMenuItem||Y.isMenuItemGroup))return;pe.indexOf(he.key)!==-1?ve.find=!0:he.props.children&&Ae(he.props.children,pe,ve)}})}var ee=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],de=function(pe){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=pe&&typeof pe.getBoundingClientRect=="function"&&pe.getBoundingClientRect().width;if(he){if(ve){var Y=getComputedStyle(pe),ie=Y.marginLeft,J=Y.marginRight;he+=+ie.replace("px","")+ +J.replace("px","")}he=+he.toFixed(6)}return he||0},ge=function(pe,ve,he){pe&&Object(D.a)(pe.style)==="object"&&(pe.style[ve]=he)},xe=function(){return F.any},Me=V("bdgK"),Ue=V("i8i4"),He=V.n(Ue),Be=V("wgJM"),ze=V("l4aY"),We=V("m+aA"),Ke=V("c+Xe"),Fe=V("zT1h"),Ye=V("QC+M");function $e(re,pe,ve){return ve?re[0]===pe[0]:re[0]===pe[0]&&re[1]===pe[1]}function q(re,pe,ve){var he=re[pe]||{};return Object(k.a)(Object(k.a)({},he),ve)}function K(re,pe,ve,he){for(var Y=ve.points,ie=Object.keys(re),J=0;J<ie.length;J+=1){var ue=ie[J];if($e(re[ue].points,Y,he))return"".concat(pe,"-placement-").concat(ue)}return""}var G=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var re=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(re)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(re==null?void 0:re.substr(0,4)))},Z=V("MNnm");function te(re,pe){var ve={};return ve[re.toLowerCase()]=pe.toLowerCase(),ve["Webkit".concat(re)]="webkit".concat(pe),ve["Moz".concat(re)]="moz".concat(pe),ve["ms".concat(re)]="MS".concat(pe),ve["O".concat(re)]="o".concat(pe.toLowerCase()),ve}function X(re,pe){var ve={animationend:te("Animation","AnimationEnd"),transitionend:te("Transition","TransitionEnd")};return re&&("AnimationEvent"in pe||delete ve.animationend.animation,"TransitionEvent"in pe||delete ve.transitionend.transition),ve}var $=X(Object(Z.a)(),typeof window!="undefined"?window:{}),ne={};if(Object(Z.a)()){var se=document.createElement("div");ne=se.style}var Te={};function Ee(re){if(Te[re])return Te[re];var pe=$[re];if(pe)for(var ve=Object.keys(pe),he=ve.length,Y=0;Y<he;Y+=1){var ie=ve[Y];if(Object.prototype.hasOwnProperty.call(pe,ie)&&ie in ne)return Te[re]=pe[ie],Te[re]}return""}var De=Ee("animationend"),Ge=Ee("transitionend"),Ze=!!(De&&Ge),Qe=De||"animationend",vt=Ge||"transitionend";function it(re,pe){if(!re)return null;if(Object(D.a)(re)==="object"){var ve=pe.replace(/-\w/g,function(he){return he[1].toUpperCase()});return re[ve]}return"".concat(re,"-").concat(pe)}var Xe="none",Mt="appear",Tt="enter",kt="leave",Nt="none",lt="prepare",Kt="start",Zt="active",Gt="end";function ai(re){var pe=Object(w.useRef)(!1),ve=Object(w.useState)(re),he=Object(B.a)(ve,2),Y=he[0],ie=he[1];function J(ue){pe.current||ie(ue)}return Object(w.useEffect)(function(){return function(){pe.current=!0}},[]),[Y,J]}var nt=Object(Z.a)()?w.useLayoutEffect:w.useEffect,rt=nt,Et=function(){var re=w.useRef(null);function pe(){Be.a.cancel(re.current)}function ve(he){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;pe();var ie=Object(Be.a)(function(){Y<=1?he({isCanceled:function(){return ie!==re.current}}):ve(he,Y-1)});re.current=ie}return w.useEffect(function(){return function(){pe()}},[]),[ve,pe]},Ft=[lt,Kt,Zt,Gt],qt=!1,pi=!0;function Wt(re){return re===Zt||re===Gt}var wt=function(re,pe){var ve=w.useState(Nt),he=Object(B.a)(ve,2),Y=he[0],ie=he[1],J=Et(),ue=Object(B.a)(J,2),ce=ue[0],ye=ue[1];function me(){ie(lt)}return rt(function(){if(Y!==Nt&&Y!==Gt){var Se=Ft.indexOf(Y),Ie=Ft[Se+1],Ne=pe(Y);Ne===qt?ie(Ie):ce(function(ke){function je(){if(ke.isCanceled())return;ie(Ie)}Ne===!0?je():Promise.resolve(Ne).then(je)})}},[re,Y]),w.useEffect(function(){return function(){ye()}},[]),[me,Y]},xt=function(re){var pe=Object(w.useRef)(),ve=Object(w.useRef)(re);ve.current=re;var he=w.useCallback(function(J){ve.current(J)},[]);function Y(J){J&&(J.removeEventListener(vt,he),J.removeEventListener(Qe,he))}function ie(J){pe.current&&pe.current!==J&&Y(pe.current),J&&J!==pe.current&&(J.addEventListener(vt,he),J.addEventListener(Qe,he),pe.current=J)}return w.useEffect(function(){return function(){Y(pe.current)}},[]),[ie,Y]};function ut(re,pe,ve,he){var Y=he.motionEnter,ie=Y===void 0?!0:Y,J=he.motionAppear,ue=J===void 0?!0:J,ce=he.motionLeave,ye=ce===void 0?!0:ce,me=he.motionDeadline,Se=he.motionLeaveImmediately,Ie=he.onAppearPrepare,Ne=he.onEnterPrepare,ke=he.onLeavePrepare,je=he.onAppearStart,tt=he.onEnterStart,ht=he.onLeaveStart,at=he.onAppearActive,dt=he.onEnterActive,ct=he.onLeaveActive,st=he.onAppearEnd,ot=he.onEnterEnd,yt=he.onLeaveEnd,ft=he.onVisibleChanged,Ut=ai(),Ct=Object(B.a)(Ut,2),et=Ct[0],qe=Ct[1],pt=ai(Xe),gt=Object(B.a)(pt,2),Ve=gt[0],bt=gt[1],Lt=ai(null),_t=Object(B.a)(Lt,2),Rt=_t[0],Pt=_t[1],Xt=Object(w.useRef)(!1),ei=Object(w.useRef)(null),jt=Object(w.useRef)(!1),ti=Object(w.useRef)(null);function si(){var Dt=ve();return Dt||ti.current}var ii=Object(w.useRef)(!1);function ni(Dt){var St=si();if(Dt&&!Dt.deadline&&Dt.target!==St)return;var Jt;Ve===Mt&&ii.current?Jt=st==null?void 0:st(St,Dt):Ve===Tt&&ii.current?Jt=ot==null?void 0:ot(St,Dt):Ve===kt&&ii.current&&(Jt=yt==null?void 0:yt(St,Dt)),Jt!==!1&&!jt.current&&(bt(Xe),Pt(null))}var Ht=xt(ni),Qt=Object(B.a)(Ht,1),$t=Qt[0],Vt=w.useMemo(function(){var Dt,St,Jt;switch(Ve){case"appear":return Dt={},Object(ae.a)(Dt,lt,Ie),Object(ae.a)(Dt,Kt,je),Object(ae.a)(Dt,Zt,at),Dt;case"enter":return St={},Object(ae.a)(St,lt,Ne),Object(ae.a)(St,Kt,tt),Object(ae.a)(St,Zt,dt),St;case"leave":return Jt={},Object(ae.a)(Jt,lt,ke),Object(ae.a)(Jt,Kt,ht),Object(ae.a)(Jt,Zt,ct),Jt;default:return{}}},[Ve]),ci=wt(Ve,function(Dt){if(Dt===lt){var St=Vt[lt];return St?St(si()):qt}if(It in Vt){var Jt;Pt(((Jt=Vt[It])===null||Jt===void 0?void 0:Jt.call(Vt,si(),null))||null)}return It===Zt&&($t(si()),me>0&&(clearTimeout(ei.current),ei.current=setTimeout(function(){ni({deadline:!0})},me))),pi}),di=Object(B.a)(ci,2),mi=di[0],It=di[1],li=Wt(It);ii.current=li,rt(function(){qe(pe);var Dt=Xt.current;if(Xt.current=!0,!re)return;var St;!Dt&&pe&&ue&&(St=Mt),Dt&&pe&&ie&&(St=Tt),(Dt&&!pe&&ye||!Dt&&Se&&!pe&&ye)&&(St=kt),St&&(bt(St),mi())},[pe]),Object(w.useEffect)(function(){(Ve===Mt&&!ue||Ve===Tt&&!ie||Ve===kt&&!ye)&&bt(Xe)},[ue,ie,ye]),Object(w.useEffect)(function(){return function(){clearTimeout(ei.current),jt.current=!0}},[]),Object(w.useEffect)(function(){et!==void 0&&Ve===Xe&&(ft==null||ft(et))},[et,Ve]);var gi=Rt;return Vt[lt]&&It===Kt&&(gi=Object(k.a)({transition:"none"},gi)),[Ve,It,gi,et!=null?et:pe]}var zt=function(re){Object(c.a)(ve,re);var pe=Object(u.a)(ve);function ve(){return Object(E.a)(this,ve),pe.apply(this,arguments)}return Object(_.a)(ve,[{key:"render",value:function(){return this.props.children}}]),ve}(w.Component),Ot=zt;function oi(re){var pe=re;Object(D.a)(re)==="object"&&(pe=re.transitionSupport);function ve(Y){return!!(Y.motionName&&pe)}var he=w.forwardRef(function(Y,ie){var J=Y.visible,ue=J===void 0?!0:J,ce=Y.removeOnLeave,ye=ce===void 0?!0:ce,me=Y.forceRender,Se=Y.children,Ie=Y.motionName,Ne=Y.leavedClassName,ke=Y.eventProps,je=ve(Y),tt=Object(w.useRef)(),ht=Object(w.useRef)();function at(){try{return Object(We.a)(tt.current||ht.current)}catch(bt){return null}}var dt=ut(je,ue,at,Y),ct=Object(B.a)(dt,4),st=ct[0],ot=ct[1],yt=ct[2],ft=ct[3],Ut=w.useRef(ft);ft&&(Ut.current=!0);var Ct=Object(w.useRef)(ie);Ct.current=ie;var et=w.useCallback(function(bt){tt.current=bt,Object(Ke.b)(Ct.current,bt)},[]),qe,pt=Object(k.a)(Object(k.a)({},ke),{},{visible:ue});if(!Se)qe=null;else if(st===Xe||!ve(Y))ft?qe=Se(Object(k.a)({},pt),et):!ye&&Ut.current?qe=Se(Object(k.a)(Object(k.a)({},pt),{},{className:Ne}),et):me?qe=Se(Object(k.a)(Object(k.a)({},pt),{},{style:{display:"none"}}),et):qe=null;else{var gt,Ve;ot===lt?Ve="prepare":Wt(ot)?Ve="active":ot===Kt&&(Ve="start"),qe=Se(Object(k.a)(Object(k.a)({},pt),{},{className:H()(it(Ie,st),(gt={},Object(ae.a)(gt,it(Ie,"".concat(st,"-").concat(Ve)),Ve),Object(ae.a)(gt,Ie,typeof Ie=="string"),gt)),style:yt}),et)}return w.createElement(Ot,{ref:ht},qe)});return he.displayName="CSSMotion",he}var Bt=oi(Ze),ui="add",_i="keep",Ei="remove",Ji="removed";function Xn(re){var pe;return re&&Object(D.a)(re)==="object"&&"key"in re?pe=re:pe={key:re},Object(k.a)(Object(k.a)({},pe),{},{key:String(pe.key)})}function Ni(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return re.map(Xn)}function $n(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ve=[],he=0,Y=pe.length,ie=Ni(re),J=Ni(pe);ie.forEach(function(ye){for(var me=!1,Se=he;Se<Y;Se+=1){var Ie=J[Se];if(Ie.key===ye.key){he<Se&&(ve=ve.concat(J.slice(he,Se).map(function(Ne){return Object(k.a)(Object(k.a)({},Ne),{},{status:ui})})),he=Se),ve.push(Object(k.a)(Object(k.a)({},Ie),{},{status:_i})),he+=1,me=!0;break}}me||ve.push(Object(k.a)(Object(k.a)({},ye),{},{status:Ei}))}),he<Y&&(ve=ve.concat(J.slice(he).map(function(ye){return Object(k.a)(Object(k.a)({},ye),{},{status:ui})})));var ue={};ve.forEach(function(ye){var me=ye.key;ue[me]=(ue[me]||0)+1});var ce=Object.keys(ue).filter(function(ye){return ue[ye]>1});return ce.forEach(function(ye){ve=ve.filter(function(me){var Se=me.key,Ie=me.status;return Se!==ye||Ie!==Ei}),ve.forEach(function(me){me.key===ye&&(me.status=_i)})}),ve}var Jn=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Qn(re){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bt,ve=function(he){Object(c.a)(ie,he);var Y=Object(u.a)(ie);function ie(){var J;return Object(E.a)(this,ie),J=Y.apply(this,arguments),J.state={keyEntities:[]},J.removeKey=function(ue){J.setState(function(ce){var ye=ce.keyEntities;return{keyEntities:ye.map(function(me){return me.key!==ue?me:Object(k.a)(Object(k.a)({},me),{},{status:Ji})})}})},J}return Object(_.a)(ie,[{key:"render",value:function(){var ue=this,ce=this.state.keyEntities,ye=this.props,me=ye.component,Se=ye.children,Ie=ye.onVisibleChanged,Ne=Object(A.a)(ye,["component","children","onVisibleChanged"]),ke=me||w.Fragment,je={};return Jn.forEach(function(tt){je[tt]=Ne[tt],delete Ne[tt]}),delete Ne.keys,w.createElement(ke,Ne,ce.map(function(tt){var ht=tt.status,at=Object(A.a)(tt,["status"]),dt=ht===ui||ht===_i;return w.createElement(pe,Object(g.a)({},je,{key:at.key,visible:dt,eventProps:at,onVisibleChanged:function(st){Ie==null||Ie(st,{key:at.key}),st||ue.removeKey(at.key)}}),Se)}))}}],[{key:"getDerivedStateFromProps",value:function(ue,ce){var ye=ue.keys,me=ce.keyEntities,Se=Ni(ye),Ie=$n(me,Se);return{keyEntities:Ie.filter(function(Ne){var ke=me.find(function(je){var tt=je.key;return Ne.key===tt});return!(ke&&ke.status===Ji&&Ne.status===Ei)})}}}]),ie}(w.Component);return ve.defaultProps={component:"div"},ve}var ca=Qn(Ze),Li=Bt;function Qi(re){var pe=re.prefixCls,ve=re.motion,he=re.animation,Y=re.transitionName;return ve||(he?{motionName:"".concat(pe,"-").concat(he)}:Y?{motionName:Y}:null)}function Zn(re){var pe=re.prefixCls,ve=re.visible,he=re.zIndex,Y=re.mask,ie=re.maskMotion,J=re.maskAnimation,ue=re.maskTransitionName;if(!Y)return null;var ce={};return(ie||ue||J)&&(ce=Object(k.a)({motionAppear:!0},Qi({motion:ie,prefixCls:pe,transitionName:ue,animation:J}))),w.createElement(Li,Object(g.a)({},ce,{visible:ve,removeOnLeave:!0}),function(ye){var me=ye.className;return w.createElement("div",{style:{zIndex:he},className:H()("".concat(pe,"-mask"),me)})})}var qn=V("9mu1"),er=V("o0o1"),Zi=V.n(er),tr=V("HaE+"),qi=["measure","align",null,"motion"],ir=function(re,pe){var ve=Object(w.useState)(null),he=Object(B.a)(ve,2),Y=he[0],ie=he[1],J=Object(w.useRef)(),ue=Object(w.useRef)(!1);function ce(Se){ue.current||ie(Se)}function ye(){Be.a.cancel(J.current)}function me(Se){ye(),J.current=Object(Be.a)(function(){ce(function(Ie){switch(Y){case"align":return"motion";case"motion":return"stable";default:}return Ie}),Se==null||Se()})}return Object(w.useEffect)(function(){ce("measure")},[re]),Object(w.useEffect)(function(){switch(Y){case"measure":pe();break;default:}Y&&(J.current=Object(Be.a)(Object(tr.a)(Zi.a.mark(function Se(){var Ie,Ne;return Zi.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:Ie=qi.indexOf(Y),Ne=qi[Ie+1],Ne&&Ie!==-1&&ce(Ne);case 3:case"end":return je.stop()}},Se)}))))},[Y]),Object(w.useEffect)(function(){return function(){ue.current=!0,ye()}},[]),[Y,me]},nr=function(re){var pe=w.useState({width:0,height:0}),ve=Object(B.a)(pe,2),he=ve[0],Y=ve[1];function ie(ue){Y({width:ue.offsetWidth,height:ue.offsetHeight})}var J=w.useMemo(function(){var ue={};if(re){var ce=he.width,ye=he.height;re.indexOf("height")!==-1&&ye?ue.height=ye:re.indexOf("minHeight")!==-1&&ye&&(ue.minHeight=ye),re.indexOf("width")!==-1&&ce?ue.width=ce:re.indexOf("minWidth")!==-1&&ce&&(ue.minWidth=ce)}return ue},[re,he]);return[J,ie]},en=w.forwardRef(function(re,pe){var ve=re.visible,he=re.prefixCls,Y=re.className,ie=re.style,J=re.children,ue=re.zIndex,ce=re.stretch,ye=re.destroyPopupOnHide,me=re.forceRender,Se=re.align,Ie=re.point,Ne=re.getRootDomNode,ke=re.getClassNameFromAlign,je=re.onAlign,tt=re.onMouseEnter,ht=re.onMouseLeave,at=re.onMouseDown,dt=re.onTouchStart,ct=Object(w.useRef)(),st=Object(w.useRef)(),ot=Object(w.useState)(),yt=Object(B.a)(ot,2),ft=yt[0],Ut=yt[1],Ct=nr(ce),et=Object(B.a)(Ct,2),qe=et[0],pt=et[1];function gt(){ce&&pt(Ne())}var Ve=ir(ve,gt),bt=Object(B.a)(Ve,2),Lt=bt[0],_t=bt[1],Rt=Object(w.useRef)();function Pt(){return Ie||Ne}function Xt(){var Ht;(Ht=ct.current)===null||Ht===void 0||Ht.forceAlign()}function ei(Ht,Qt){var $t=ke(Qt);ft!==$t&&Ut($t),Lt==="align"&&(ft!==$t?Promise.resolve().then(function(){Xt()}):_t(function(){var Vt;(Vt=Rt.current)===null||Vt===void 0||Vt.call(Rt)}),je==null||je(Ht,Qt))}var jt=Object(k.a)({},Qi(re));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Ht){var Qt=jt[Ht];jt[Ht]=function($t,Vt){return _t(),Qt==null?void 0:Qt($t,Vt)}});function ti(){return new Promise(function(Ht){Rt.current=Ht})}w.useEffect(function(){!jt.motionName&&Lt==="motion"&&_t()},[jt.motionName,Lt]),w.useImperativeHandle(pe,function(){return{forceAlign:Xt,getElement:function(){return st.current}}});var si=Object(k.a)(Object(k.a)({},qe),{},{zIndex:ue,opacity:Lt==="motion"||Lt==="stable"||!ve?void 0:0,pointerEvents:Lt==="stable"?void 0:"none"},ie),ii=!0;(Se==null?void 0:Se.points)&&(Lt==="align"||Lt==="stable")&&(ii=!1);var ni=J;return w.Children.count(J)>1&&(ni=w.createElement("div",{className:"".concat(he,"-content")},J)),w.createElement(Li,Object(g.a)({visible:ve,ref:st,leavedClassName:"".concat(he,"-hidden")},jt,{onAppearPrepare:ti,onEnterPrepare:ti,removeOnLeave:ye,forceRender:me}),function(Ht,Qt){var $t=Ht.className,Vt=Ht.style,ci=H()(he,Y,ft,$t);return w.createElement(qn.a,{target:Pt(),key:"popup",ref:ct,monitorWindowResize:!0,disabled:ii,align:Se,onAlign:ei},w.createElement("div",{ref:Qt,className:ci,onMouseEnter:tt,onMouseLeave:ht,onMouseDownCapture:at,onTouchStartCapture:dt,style:Object(k.a)(Object(k.a)({},Vt),si)},ni))})});en.displayName="PopupInner";var rr=en,tn=w.forwardRef(function(re,pe){var ve=re.prefixCls,he=re.visible,Y=re.zIndex,ie=re.children,J=re.mobile;J=J===void 0?{}:J;var ue=J.popupClassName,ce=J.popupStyle,ye=J.popupMotion,me=ye===void 0?{}:ye,Se=J.popupRender,Ie=w.useRef();w.useImperativeHandle(pe,function(){return{forceAlign:function(){},getElement:function(){return Ie.current}}});var Ne=Object(k.a)({zIndex:Y},ce),ke=ie;return w.Children.count(ie)>1&&(ke=w.createElement("div",{className:"".concat(ve,"-content")},ie)),Se&&(ke=Se(ke)),w.createElement(Li,Object(g.a)({visible:he,ref:Ie,removeOnLeave:!0},me),function(je,tt){var ht=je.className,at=je.style,dt=H()(ve,ue,ht);return w.createElement("div",{ref:tt,className:dt,style:Object(k.a)(Object(k.a)({},at),Ne)},ke)})});tn.displayName="MobilePopupInner";var ar=tn,sr=["visible","mobile"],nn=w.forwardRef(function(re,pe){var ve=re.visible,he=re.mobile,Y=Object(A.a)(re,sr),ie=Object(w.useState)(ve),J=Object(B.a)(ie,2),ue=J[0],ce=J[1],ye=Object(w.useState)(!1),me=Object(B.a)(ye,2),Se=me[0],Ie=me[1],Ne=Object(k.a)(Object(k.a)({},Y),{},{visible:ue});Object(w.useEffect)(function(){ce(ve),ve&&he&&Ie(G())},[ve,he]);var ke=Se?w.createElement(ar,Object(g.a)({},Ne,{mobile:he,ref:pe})):w.createElement(rr,Object(g.a)({},Ne,{ref:pe}));return w.createElement("div",null,w.createElement(Zn,Ne),ke)});nn.displayName="Popup";var or=nn,lr=w.createContext(null),rn=lr;function Ui(){}function ur(){return""}function hr(re){return re?re.ownerDocument:window.document}var cr=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function dr(re){var pe=function(ve){Object(c.a)(Y,ve);var he=Object(u.a)(Y);function Y(ie){var J;Object(E.a)(this,Y),J=he.call(this,ie),J.popupRef=w.createRef(),J.triggerRef=w.createRef(),J.attachId=void 0,J.clickOutsideHandler=void 0,J.touchOutsideHandler=void 0,J.contextMenuOutsideHandler1=void 0,J.contextMenuOutsideHandler2=void 0,J.mouseDownTimeout=void 0,J.focusTime=void 0,J.preClickTime=void 0,J.preTouchTime=void 0,J.delayTimer=void 0,J.hasPopupMouseDown=void 0,J.onMouseEnter=function(ce){var ye=J.props.mouseEnterDelay;J.fireEvents("onMouseEnter",ce),J.delaySetPopupVisible(!0,ye,ye?null:ce)},J.onMouseMove=function(ce){J.fireEvents("onMouseMove",ce),J.setPoint(ce)},J.onMouseLeave=function(ce){J.fireEvents("onMouseLeave",ce),J.delaySetPopupVisible(!1,J.props.mouseLeaveDelay)},J.onPopupMouseEnter=function(){J.clearDelayTimer()},J.onPopupMouseLeave=function(ce){var ye;if(ce.relatedTarget&&!ce.relatedTarget.setTimeout&&Object(ze.a)((ye=J.popupRef.current)===null||ye===void 0?void 0:ye.getElement(),ce.relatedTarget))return;J.delaySetPopupVisible(!1,J.props.mouseLeaveDelay)},J.onFocus=function(ce){J.fireEvents("onFocus",ce),J.clearDelayTimer(),J.isFocusToShow()&&(J.focusTime=Date.now(),J.delaySetPopupVisible(!0,J.props.focusDelay))},J.onMouseDown=function(ce){J.fireEvents("onMouseDown",ce),J.preClickTime=Date.now()},J.onTouchStart=function(ce){J.fireEvents("onTouchStart",ce),J.preTouchTime=Date.now()},J.onBlur=function(ce){J.fireEvents("onBlur",ce),J.clearDelayTimer(),J.isBlurToHide()&&J.delaySetPopupVisible(!1,J.props.blurDelay)},J.onContextMenu=function(ce){ce.preventDefault(),J.fireEvents("onContextMenu",ce),J.setPopupVisible(!0,ce)},J.onContextMenuClose=function(){J.isContextMenuToShow()&&J.close()},J.onClick=function(ce){if(J.fireEvents("onClick",ce),J.focusTime){var ye;if(J.preClickTime&&J.preTouchTime?ye=Math.min(J.preClickTime,J.preTouchTime):J.preClickTime?ye=J.preClickTime:J.preTouchTime&&(ye=J.preTouchTime),Math.abs(ye-J.focusTime)<20)return;J.focusTime=0}J.preClickTime=0,J.preTouchTime=0,J.isClickToShow()&&(J.isClickToHide()||J.isBlurToHide())&&ce&&ce.preventDefault&&ce.preventDefault();var me=!J.state.popupVisible;(J.isClickToHide()&&!me||me&&J.isClickToShow())&&J.setPopupVisible(!J.state.popupVisible,ce)},J.onPopupMouseDown=function(){if(J.hasPopupMouseDown=!0,clearTimeout(J.mouseDownTimeout),J.mouseDownTimeout=window.setTimeout(function(){J.hasPopupMouseDown=!1},0),J.context){var ce;(ce=J.context).onPopupMouseDown.apply(ce,arguments)}},J.onDocumentClick=function(ce){if(J.props.mask&&!J.props.maskClosable)return;var ye=ce.target,me=J.getRootDomNode(),Se=J.getPopupDomNode();(!Object(ze.a)(me,ye)||J.isContextMenuOnly())&&!Object(ze.a)(Se,ye)&&!J.hasPopupMouseDown&&J.close()},J.getRootDomNode=function(){var ce=J.props.getTriggerDOMNode;if(ce)return ce(J.triggerRef.current);try{var ye=Object(We.a)(J.triggerRef.current);if(ye)return ye}catch(me){}return He.a.findDOMNode(Object(y.a)(J))},J.getPopupClassNameFromAlign=function(ce){var ye=[],me=J.props,Se=me.popupPlacement,Ie=me.builtinPlacements,Ne=me.prefixCls,ke=me.alignPoint,je=me.getPopupClassNameFromAlign;return Se&&Ie&&ye.push(K(Ie,Ne,ce,ke)),je&&ye.push(je(ce)),ye.join(" ")},J.getComponent=function(){var ce=J.props,ye=ce.prefixCls,me=ce.destroyPopupOnHide,Se=ce.popupClassName,Ie=ce.onPopupAlign,Ne=ce.popupMotion,ke=ce.popupAnimation,je=ce.popupTransitionName,tt=ce.popupStyle,ht=ce.mask,at=ce.maskAnimation,dt=ce.maskTransitionName,ct=ce.maskMotion,st=ce.zIndex,ot=ce.popup,yt=ce.stretch,ft=ce.alignPoint,Ut=ce.mobile,Ct=ce.forceRender,et=J.state,qe=et.popupVisible,pt=et.point,gt=J.getPopupAlign(),Ve={};return J.isMouseEnterToShow()&&(Ve.onMouseEnter=J.onPopupMouseEnter),J.isMouseLeaveToHide()&&(Ve.onMouseLeave=J.onPopupMouseLeave),Ve.onMouseDown=J.onPopupMouseDown,Ve.onTouchStart=J.onPopupMouseDown,w.createElement(or,Object(g.a)({prefixCls:ye,destroyPopupOnHide:me,visible:qe,point:ft&&pt,className:Se,align:gt,onAlign:Ie,animation:ke,getClassNameFromAlign:J.getPopupClassNameFromAlign},Ve,{stretch:yt,getRootDomNode:J.getRootDomNode,style:tt,mask:ht,zIndex:st,transitionName:je,maskAnimation:at,maskTransitionName:dt,maskMotion:ct,ref:J.popupRef,motion:Ne,mobile:Ut,forceRender:Ct}),typeof ot=="function"?ot():ot)},J.attachParent=function(ce){Be.a.cancel(J.attachId);var ye=J.props,me=ye.getPopupContainer,Se=ye.getDocument,Ie=J.getRootDomNode(),Ne;me?(Ie||me.length===0)&&(Ne=me(Ie)):Ne=Se(J.getRootDomNode()).body,Ne?Ne.appendChild(ce):J.attachId=Object(Be.a)(function(){J.attachParent(ce)})},J.getContainer=function(){var ce=J.props.getDocument,ye=ce(J.getRootDomNode()).createElement("div");return ye.style.position="absolute",ye.style.top="0",ye.style.left="0",ye.style.width="100%",J.attachParent(ye),ye},J.setPoint=function(ce){var ye=J.props.alignPoint;if(!ye||!ce)return;J.setState({point:{pageX:ce.pageX,pageY:ce.pageY}})},J.handlePortalUpdate=function(){J.state.prevPopupVisible!==J.state.popupVisible&&J.props.afterPopupVisibleChange(J.state.popupVisible)},J.triggerContextValue={onPopupMouseDown:J.onPopupMouseDown};var ue;return"popupVisible"in ie?ue=!!ie.popupVisible:ue=!!ie.defaultPopupVisible,J.state={prevPopupVisible:ue,popupVisible:ue},cr.forEach(function(ce){J["fire".concat(ce)]=function(ye){J.fireEvents(ce,ye)}}),J}return Object(_.a)(Y,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var J=this.props,ue=this.state;if(ue.popupVisible){var ce;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ce=J.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Fe.a)(ce,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ce=ce||J.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Fe.a)(ce,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ce=ce||J.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Fe.a)(ce,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Fe.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Be.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var J;return((J=this.popupRef.current)===null||J===void 0?void 0:J.getElement())||null}},{key:"getPopupAlign",value:function(){var J=this.props,ue=J.popupPlacement,ce=J.popupAlign,ye=J.builtinPlacements;return ue&&ye?q(ye,ue,ce):ce}},{key:"setPopupVisible",value:function(J,ue){var ce=this.props.alignPoint,ye=this.state.popupVisible;this.clearDelayTimer(),ye!==J&&("popupVisible"in this.props||this.setState({popupVisible:J,prevPopupVisible:ye}),this.props.onPopupVisibleChange(J)),ce&&ue&&J&&this.setPoint(ue)}},{key:"delaySetPopupVisible",value:function(J,ue,ce){var ye=this,me=ue*1e3;if(this.clearDelayTimer(),me){var Se=ce?{pageX:ce.pageX,pageY:ce.pageY}:null;this.delayTimer=window.setTimeout(function(){ye.setPopupVisible(J,Se),ye.clearDelayTimer()},me)}else this.setPopupVisible(J,ce)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(J){var ue=this.props.children.props,ce=this.props;return ue[J]&&ce[J]?this["fire".concat(J)]:ue[J]||ce[J]}},{key:"isClickToShow",value:function(){var J=this.props,ue=J.action,ce=J.showAction;return ue.indexOf("click")!==-1||ce.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var J=this.props.action;return J==="contextMenu"||J.length===1&&J[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var J=this.props,ue=J.action,ce=J.showAction;return ue.indexOf("contextMenu")!==-1||ce.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var J=this.props,ue=J.action,ce=J.hideAction;return ue.indexOf("click")!==-1||ce.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var J=this.props,ue=J.action,ce=J.showAction;return ue.indexOf("hover")!==-1||ce.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var J=this.props,ue=J.action,ce=J.hideAction;return ue.indexOf("hover")!==-1||ce.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var J=this.props,ue=J.action,ce=J.showAction;return ue.indexOf("focus")!==-1||ce.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var J=this.props,ue=J.action,ce=J.hideAction;return ue.indexOf("focus")!==-1||ce.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var J;(J=this.popupRef.current)===null||J===void 0||J.forceAlign()}}},{key:"fireEvents",value:function(J,ue){var ce=this.props.children.props[J];ce&&ce(ue);var ye=this.props[J];ye&&ye(ue)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var J=this.state.popupVisible,ue=this.props,ce=ue.children,ye=ue.forceRender,me=ue.alignPoint,Se=ue.className,Ie=ue.autoDestroy,Ne=w.Children.only(ce),ke={key:"trigger"};this.isContextMenuToShow()?ke.onContextMenu=this.onContextMenu:ke.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(ke.onClick=this.onClick,ke.onMouseDown=this.onMouseDown,ke.onTouchStart=this.onTouchStart):(ke.onClick=this.createTwoChains("onClick"),ke.onMouseDown=this.createTwoChains("onMouseDown"),ke.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(ke.onMouseEnter=this.onMouseEnter,me&&(ke.onMouseMove=this.onMouseMove)):ke.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?ke.onMouseLeave=this.onMouseLeave:ke.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(ke.onFocus=this.onFocus,ke.onBlur=this.onBlur):(ke.onFocus=this.createTwoChains("onFocus"),ke.onBlur=this.createTwoChains("onBlur"));var je=H()(Ne&&Ne.props&&Ne.props.className,Se);je&&(ke.className=je);var tt=Object(k.a)({},ke);Object(Ke.c)(Ne)&&(tt.ref=Object(Ke.a)(this.triggerRef,Ne.ref));var ht=w.cloneElement(Ne,tt),at;return(J||this.popupRef.current||ye)&&(at=w.createElement(re,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!J&&Ie&&(at=null),w.createElement(rn.Provider,{value:this.triggerContextValue},ht,at)}}],[{key:"getDerivedStateFromProps",value:function(J,ue){var ce=J.popupVisible,ye={};return ce!==void 0&&ue.popupVisible!==ce&&(ye.popupVisible=ce,ye.prevPopupVisible=ue.popupVisible),ye}}]),Y}(w.Component);return pe.contextType=rn,pe.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:ur,getDocument:hr,onPopupVisibleChange:Ui,afterPopupVisibleChange:Ui,onPopupAlign:Ui,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},pe}var fr=dr(Ye.a),hi={adjustX:1,adjustY:1},an={topLeft:{points:["bl","tl"],overflow:hi,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:hi,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:hi,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:hi,offset:[4,0]}},pr={topLeft:{points:["bl","tl"],overflow:hi,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:hi,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:hi,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:hi,offset:[4,0]}},da=an,sn=0,mr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ti=function(pe,ve,he){var Y=oe(ve),ie=pe.getState();pe.setState({defaultActiveFirst:Object(k.a)(Object(k.a)({},ie.defaultActiveFirst),{},Object(ae.a)({},Y,he))})},on=function(re){Object(c.a)(ve,re);var pe=Object(u.a)(ve);function ve(he){var Y;Object(E.a)(this,ve),Y=pe.call(this,he),Y.onDestroy=function(me){Y.props.onDestroy(me)},Y.onKeyDown=function(me){var Se=me.keyCode,Ie=Y.menuInstance,Ne=Y.props.store,ke=Y.getVisible();if(Se===h.a.ENTER)return Y.onTitleClick(me),Ti(Ne,Y.props.eventKey,!0),!0;if(Se===h.a.RIGHT)return ke?Ie.onKeyDown(me):(Y.triggerOpenChange(!0),Ti(Ne,Y.props.eventKey,!0)),!0;if(Se===h.a.LEFT){var je;if(ke)je=Ie.onKeyDown(me);else return;return je||(Y.triggerOpenChange(!1),je=!0),je}return ke&&(Se===h.a.UP||Se===h.a.DOWN)?Ie.onKeyDown(me):void 0},Y.onOpenChange=function(me){Y.props.onOpenChange(me)},Y.onPopupVisibleChange=function(me){Y.triggerOpenChange(me,me?"mouseenter":"mouseleave")},Y.onMouseEnter=function(me){var Se=Y.props,Ie=Se.eventKey,Ne=Se.onMouseEnter,ke=Se.store;Ti(ke,Y.props.eventKey,!1),Ne({key:Ie,domEvent:me})},Y.onMouseLeave=function(me){var Se=Y.props,Ie=Se.parentMenu,Ne=Se.eventKey,ke=Se.onMouseLeave;Ie.subMenuInstance=Object(y.a)(Y),ke({key:Ne,domEvent:me})},Y.onTitleMouseEnter=function(me){var Se=Y.props,Ie=Se.eventKey,Ne=Se.onItemHover,ke=Se.onTitleMouseEnter;Ne({key:Ie,hover:!0}),ke({key:Ie,domEvent:me})},Y.onTitleMouseLeave=function(me){var Se=Y.props,Ie=Se.parentMenu,Ne=Se.eventKey,ke=Se.onItemHover,je=Se.onTitleMouseLeave;Ie.subMenuInstance=Object(y.a)(Y),ke({key:Ne,hover:!1}),je({key:Ne,domEvent:me})},Y.onTitleClick=function(me){var Se=Object(y.a)(Y),Ie=Se.props;if(Ie.onTitleClick({key:Ie.eventKey,domEvent:me}),Ie.triggerSubMenuAction==="hover")return;Y.triggerOpenChange(!Y.getVisible(),"click"),Ti(Ie.store,Y.props.eventKey,!1)},Y.onSubMenuClick=function(me){typeof Y.props.onClick=="function"&&Y.props.onClick(Y.addKeyPath(me))},Y.onSelect=function(me){Y.props.onSelect(me)},Y.onDeselect=function(me){Y.props.onDeselect(me)},Y.getPrefixCls=function(){return"".concat(Y.props.rootPrefixCls,"-submenu")},Y.getActiveClassName=function(){return"".concat(Y.getPrefixCls(),"-active")},Y.getDisabledClassName=function(){return"".concat(Y.getPrefixCls(),"-disabled")},Y.getSelectedClassName=function(){return"".concat(Y.getPrefixCls(),"-selected")},Y.getOpenClassName=function(){return"".concat(Y.props.rootPrefixCls,"-submenu-open")},Y.getVisible=function(){return Y.state.isOpen},Y.getMode=function(){return Y.state.mode},Y.saveMenuInstance=function(me){Y.menuInstance=me},Y.addKeyPath=function(me){return Object(k.a)(Object(k.a)({},me),{},{keyPath:(me.keyPath||[]).concat(Y.props.eventKey)})},Y.triggerOpenChange=function(me,Se){var Ie=Y.props.eventKey,Ne=function(){Y.onOpenChange({key:Ie,item:Object(y.a)(Y),trigger:Se,open:me})};Se==="mouseenter"?Y.mouseenterTimeout=setTimeout(function(){Ne()},0):Ne()},Y.isChildrenSelected=function(){var me={find:!1};return Ae(Y.props.children,Y.props.selectedKeys,me),me.find},Y.isInlineMode=function(){return Y.getMode()==="inline"},Y.adjustWidth=function(){if(!Y.subMenuTitle||!Y.menuInstance)return;var me=Ue.findDOMNode(Y.menuInstance);if(me.offsetWidth>=Y.subMenuTitle.offsetWidth)return;me.style.minWidth="".concat(Y.subMenuTitle.offsetWidth,"px")},Y.saveSubMenuTitle=function(me){Y.subMenuTitle=me},Y.getBaseProps=function(){var me=Object(y.a)(Y),Se=me.props,Ie=Y.getMode();return{mode:Ie==="horizontal"?"vertical":Ie,visible:Y.getVisible(),level:Se.level+1,inlineIndent:Se.inlineIndent,focusable:!1,onClick:Y.onSubMenuClick,onSelect:Y.onSelect,onDeselect:Y.onDeselect,onDestroy:Y.onDestroy,selectedKeys:Se.selectedKeys,eventKey:"".concat(Se.eventKey,"-menu-"),openKeys:Se.openKeys,motion:Se.motion,onOpenChange:Y.onOpenChange,subMenuOpenDelay:Se.subMenuOpenDelay,parentMenu:Object(y.a)(Y),subMenuCloseDelay:Se.subMenuCloseDelay,forceSubMenuRender:Se.forceSubMenuRender,triggerSubMenuAction:Se.triggerSubMenuAction,builtinPlacements:Se.builtinPlacements,defaultActiveFirst:Se.store.getState().defaultActiveFirst[oe(Se.eventKey)],multiple:Se.multiple,prefixCls:Se.rootPrefixCls,id:Y.internalMenuId,manualRef:Y.saveMenuInstance,itemIcon:Se.itemIcon,expandIcon:Se.expandIcon,direction:Se.direction}},Y.getMotion=function(me,Se){var Ie=Object(y.a)(Y),Ne=Ie.haveRendered,ke=Y.props,je=ke.motion,tt=ke.rootPrefixCls,ht=Object(k.a)(Object(k.a)({},je),{},{leavedClassName:"".concat(tt,"-hidden"),removeOnLeave:!1,motionAppear:Ne||!Se||me!=="inline"});return ht};var ie=he.store,J=he.eventKey,ue=ie.getState(),ce=ue.defaultActiveFirst;Y.isRootMenu=!1;var ye=!1;return ce&&(ye=ce[J]),Ti(ie,J,ye),Y.state={mode:he.mode,isOpen:he.isOpen},Y}return Object(_.a)(ve,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Y=this,ie=this.props,J=ie.mode,ue=ie.parentMenu,ce=ie.manualRef,ye=ie.isOpen,me=function(){Y.setState({mode:J,isOpen:ye})},Se=ye!==this.state.isOpen,Ie=J!==this.state.mode;if((Ie||Se)&&(Be.a.cancel(this.updateStateRaf),Ie?this.updateStateRaf=Object(Be.a)(me):me()),ce&&ce(this),J!=="horizontal"||!(ue==null?void 0:ue.isRootMenu)||!ye)return;this.minWidthTimeout=setTimeout(function(){return Y.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Y=this.props,ie=Y.onDestroy,J=Y.eventKey;ie&&ie(J),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Be.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(Y,ie){var J=this.getBaseProps();return w.createElement(dn,Object(g.a)({},J,{id:this.internalMenuId,className:Y,style:ie}),this.props.children)}},{key:"renderChildren",value:function(){var Y=this,ie=this.getBaseProps(),J=ie.mode,ue=ie.visible,ce=ie.forceSubMenuRender,ye=ie.direction,me=this.getMotion(J,ue);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ue||ce,!this.haveOpened)return w.createElement("div",null);var Se=H()("".concat(ie.prefixCls,"-sub"),Object(ae.a)({},"".concat(ie.prefixCls,"-rtl"),ye==="rtl"));return this.isInlineMode()?w.createElement(Li,Object(g.a)({visible:ie.visible,forceRender:ce},me),function(Ie){var Ne=Ie.className,ke=Ie.style,je=H()(Se,Ne);return Y.renderPopupMenu(je,ke)}):this.renderPopupMenu(Se)}},{key:"render",value:function(){var Y,ie,J,ue=Object(k.a)({},this.props),ce=this.getVisible(),ye=this.getPrefixCls(),me=this.isInlineMode(),Se=this.getMode(),Ie=H()(ye,"".concat(ye,"-").concat(Se),(Y={},Object(ae.a)(Y,ue.className,!!ue.className),Object(ae.a)(Y,this.getOpenClassName(),ce),Object(ae.a)(Y,this.getActiveClassName(),ue.active||ce&&!me),Object(ae.a)(Y,this.getDisabledClassName(),ue.disabled),Object(ae.a)(Y,this.getSelectedClassName(),this.isChildrenSelected()),Y));this.internalMenuId||(ue.eventKey?this.internalMenuId="".concat(ue.eventKey,"$Menu"):(sn+=1,this.internalMenuId="$__$".concat(sn,"$Menu")));var Ne={},ke={},je={};ue.disabled||(Ne={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ke={onClick:this.onTitleClick},je={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var tt={},ht=ue.direction,at=ht==="rtl";me&&(at?tt.paddingRight=ue.inlineIndent*ue.level:tt.paddingLeft=ue.inlineIndent*ue.level);var dt={};this.getVisible()&&(dt={"aria-owns":this.internalMenuId});var ct=null;Se!=="horizontal"&&(ct=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ct=w.createElement(this.props.expandIcon,Object(k.a)({},this.props))));var st=w.createElement("div",Object(g.a)({ref:this.saveSubMenuTitle,style:tt,className:"".concat(ye,"-title"),role:"button"},je,ke,{"aria-expanded":ce},dt,{"aria-haspopup":"true",title:typeof ue.title=="string"?ue.title:void 0}),ue.title,ct||w.createElement("i",{className:"".concat(ye,"-arrow")})),ot=this.renderChildren(),yt=((ie=ue.parentMenu)===null||ie===void 0?void 0:ie.isRootMenu)?ue.parentMenu.props.getPopupContainer:function(Pt){return Pt.parentNode},ft=mr[Se],Ut=ue.popupOffset?{offset:ue.popupOffset}:{},Ct=H()((J={},Object(ae.a)(J,ue.popupClassName,ue.popupClassName&&!me),Object(ae.a)(J,"".concat(ye,"-rtl"),at),J)),et=ue.disabled,qe=ue.triggerSubMenuAction,pt=ue.subMenuOpenDelay,gt=ue.forceSubMenuRender,Ve=ue.subMenuCloseDelay,bt=ue.builtinPlacements;ee.forEach(function(Pt){return delete ue[Pt]}),delete ue.onClick;var Lt=at?Object(k.a)(Object(k.a)({},pr),bt):Object(k.a)(Object(k.a)({},an),bt);delete ue.direction;var _t=this.getBaseProps(),Rt=me?null:this.getMotion(_t.mode,_t.visible);return w.createElement("li",Object(g.a)({},ue,Ne,{className:Ie,role:"menuitem"}),w.createElement(fr,{prefixCls:ye,popupClassName:H()("".concat(ye,"-popup"),Ct),getPopupContainer:yt,builtinPlacements:Lt,popupPlacement:ft,popupVisible:me?!1:ce,popupAlign:Ut,popup:me?null:ot,action:et||me?[]:[qe],mouseEnterDelay:pt,mouseLeaveDelay:Ve,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:gt,popupMotion:Rt},st),me?ot:null)}}]),ve}(w.Component);on.defaultProps={onMouseEnter:z,onMouseLeave:z,onTitleMouseEnter:z,onTitleMouseLeave:z,onTitleClick:z,manualRef:z,mode:"vertical",title:""};var ln=Object(l.b)(function(re,pe){var ve=re.openKeys,he=re.activeKey,Y=re.selectedKeys,ie=pe.eventKey,J=pe.subMenuKey;return{isOpen:ve.indexOf(ie)>-1,active:he[J]===ie,selectedKeys:Y}})(on);ln.isSubMenu=!0;var gr=ln,un="menuitem-overflowed",vr=.5,hn=function(re){Object(c.a)(ve,re);var pe=Object(u.a)(ve);function ve(){var he;return Object(E.a)(this,ve),he=pe.apply(this,arguments),he.resizeObserver=null,he.mutationObserver=null,he.originalTotalWidth=0,he.overflowedItems=[],he.menuItemSizes=[],he.cancelFrameId=null,he.state={lastVisibleIndex:void 0},he.childRef=w.createRef(),he.getMenuItemNodes=function(){var Y=he.props.prefixCls,ie=he.childRef.current;return ie?[].slice.call(ie.children).filter(function(J){return J.className.split(" ").indexOf("".concat(Y,"-overflowed-submenu"))<0}):[]},he.getOverflowedSubMenuItem=function(Y,ie,J){var ue=he.props,ce=ue.overflowedIndicator,ye=ue.level,me=ue.mode,Se=ue.prefixCls,Ie=ue.theme;if(ye!==1||me!=="horizontal")return null;var Ne=he.props.children[0],ke=Ne.props,je=ke.children,tt=ke.title,ht=ke.style,at=Object(A.a)(ke,["children","title","style"]),dt=Object(k.a)({},ht),ct="".concat(Y,"-overflowed-indicator"),st="".concat(Y,"-overflowed-indicator");ie.length===0&&J!==!0?dt=Object(k.a)(Object(k.a)({},dt),{},{display:"none"}):J&&(dt=Object(k.a)(Object(k.a)({},dt),{},{visibility:"hidden",position:"absolute"}),ct="".concat(ct,"-placeholder"),st="".concat(st,"-placeholder"));var ot=Ie?"".concat(Se,"-").concat(Ie):"",yt={};return ee.forEach(function(ft){at[ft]!==void 0&&(yt[ft]=at[ft])}),w.createElement(gr,Object(g.a)({title:ce,className:"".concat(Se,"-overflowed-submenu"),popupClassName:ot},yt,{key:ct,eventKey:st,disabled:!1,style:dt}),ie)},he.setChildrenWidthAndResize=function(){if(he.props.mode!=="horizontal")return;var Y=he.childRef.current;if(!Y)return;var ie=Y.children;if(!ie||ie.length===0)return;var J=Y.children[ie.length-1];ge(J,"display","inline-block");var ue=he.getMenuItemNodes(),ce=ue.filter(function(ye){return ye.className.split(" ").indexOf(un)>=0});ce.forEach(function(ye){ge(ye,"display","inline-block")}),he.menuItemSizes=ue.map(function(ye){return de(ye,!0)}),ce.forEach(function(ye){ge(ye,"display","none")}),he.overflowedIndicatorWidth=de(Y.children[Y.children.length-1],!0),he.originalTotalWidth=he.menuItemSizes.reduce(function(ye,me){return ye+me},0),he.handleResize(),ge(J,"display","none")},he.handleResize=function(){if(he.props.mode!=="horizontal")return;var Y=he.childRef.current;if(!Y)return;var ie=de(Y);he.overflowedItems=[];var J=0,ue;he.originalTotalWidth>ie+vr&&(ue=-1,he.menuItemSizes.forEach(function(ce){J+=ce,J+he.overflowedIndicatorWidth<=ie&&(ue+=1)})),he.setState({lastVisibleIndex:ue})},he}return Object(_.a)(ve,[{key:"componentDidMount",value:function(){var Y=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ie=this.childRef.current;if(!ie)return;this.resizeObserver=new Me.default(function(J){J.forEach(function(){var ue=Y.cancelFrameId;cancelAnimationFrame(ue),Y.cancelFrameId=requestAnimationFrame(Y.setChildrenWidthAndResize)})}),[].slice.call(ie.children).concat(ie).forEach(function(J){Y.resizeObserver.observe(J)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Y.resizeObserver.disconnect(),[].slice.call(ie.children).concat(ie).forEach(function(J){Y.resizeObserver.observe(J)}),Y.setChildrenWidthAndResize()}),this.mutationObserver.observe(ie,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(Y){var ie=this,J=this.state.lastVisibleIndex;return(Y||[]).reduce(function(ue,ce,ye){var me=ce;if(ie.props.mode==="horizontal"){var Se=ie.getOverflowedSubMenuItem(ce.props.eventKey,[]);J!==void 0&&ie.props.className.indexOf("".concat(ie.props.prefixCls,"-root"))!==-1&&(ye>J&&(me=w.cloneElement(ce,{style:{display:"none"},eventKey:"".concat(ce.props.eventKey,"-hidden"),className:"".concat(un)})),ye===J+1&&(ie.overflowedItems=Y.slice(J+1).map(function(Ne){return w.cloneElement(Ne,{key:Ne.props.eventKey,mode:"vertical-left"})}),Se=ie.getOverflowedSubMenuItem(ce.props.eventKey,ie.overflowedItems)));var Ie=[].concat(Object(S.a)(ue),[Se,me]);return ye===Y.length-1&&Ie.push(ie.getOverflowedSubMenuItem(ce.props.eventKey,[],!0)),Ie}return[].concat(Object(S.a)(ue),[me])},[])}},{key:"render",value:function(){var Y=this.props,ie=Y.visible,J=Y.prefixCls,ue=Y.overflowedIndicator,ce=Y.mode,ye=Y.level,me=Y.tag,Se=Y.children,Ie=Y.theme,Ne=Object(A.a)(Y,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ke=me;return w.createElement(ke,Object(g.a)({ref:this.childRef},Ne),this.renderChildren(Se))}}]),ve}(w.Component);hn.defaultProps={tag:"div",className:""};var yr=hn;function br(re){return re.length?re.every(function(pe){return!!pe.props.disabled}):!0}function Di(re,pe,ve){var he=re.getState();re.setState({activeKey:Object(k.a)(Object(k.a)({},he.activeKey),{},Object(ae.a)({},pe,ve))})}function vi(re){return re.eventKey||"0-menu-"}function Mi(re,pe){var ve=pe,he=re.children,Y=re.eventKey;if(ve){var ie;if(we(he,function(J,ue){J&&J.props&&!J.props.disabled&&ve===P(J,Y,ue)&&(ie=!0)}),ie)return ve}return ve=null,re.defaultActiveFirst&&we(he,function(J,ue){!ve&&J&&!J.props.disabled&&(ve=P(J,Y,ue))}),ve}function _r(re){if(!re)return;var pe=this.instanceArray.indexOf(re);pe!==-1?this.instanceArray[pe]=re:this.instanceArray.push(re)}var cn=function(re){Object(c.a)(ve,re);var pe=Object(u.a)(ve);function ve(he){var Y;return Object(E.a)(this,ve),Y=pe.call(this,he),Y.onKeyDown=function(ie,J){var ue=ie.keyCode,ce;if(Y.getFlatInstanceArray().forEach(function(me){me&&me.props.active&&me.onKeyDown&&(ce=me.onKeyDown(ie))}),ce)return 1;var ye=null;return(ue===h.a.UP||ue===h.a.DOWN)&&(ye=Y.step(ue===h.a.UP?-1:1)),ye?(ie.preventDefault(),Di(Y.props.store,vi(Y.props),ye.props.eventKey),typeof J=="function"&&J(ye),1):void 0},Y.onItemHover=function(ie){var J=ie.key,ue=ie.hover;Di(Y.props.store,vi(Y.props),ue?J:null)},Y.onDeselect=function(ie){Y.props.onDeselect(ie)},Y.onSelect=function(ie){Y.props.onSelect(ie)},Y.onClick=function(ie){Y.props.onClick(ie)},Y.onOpenChange=function(ie){Y.props.onOpenChange(ie)},Y.onDestroy=function(ie){Y.props.onDestroy(ie)},Y.getFlatInstanceArray=function(){return Y.instanceArray},Y.step=function(ie){var J=Y.getFlatInstanceArray(),ue=Y.props.store.getState().activeKey[vi(Y.props)],ce=J.length;if(!ce)return null;ie<0&&(J=J.concat().reverse());var ye=-1;if(J.every(function(Ne,ke){return Ne&&Ne.props.eventKey===ue?(ye=ke,!1):!0}),!Y.props.defaultActiveFirst&&ye!==-1&&br(J.slice(ye,ce-1)))return;var me=(ye+1)%ce,Se=me;do{var Ie=J[Se];if(!Ie||Ie.props.disabled)Se=(Se+1)%ce;else return Ie}while(Se!==me);return null},Y.renderCommonMenuItem=function(ie,J,ue){var ce=Y.props.store.getState(),ye=Object(y.a)(Y),me=ye.props,Se=P(ie,me.eventKey,J),Ie=ie.props;if(!Ie||typeof ie.type=="string")return ie;var Ne=Se===ce.activeKey,ke=Object(k.a)(Object(k.a)({mode:Ie.mode||me.mode,level:me.level,inlineIndent:me.inlineIndent,renderMenuItem:Y.renderMenuItem,rootPrefixCls:me.prefixCls,index:J,parentMenu:me.parentMenu,manualRef:Ie.disabled?void 0:Object(p.a)(ie.ref,_r.bind(Object(y.a)(Y))),eventKey:Se,active:!Ie.disabled&&Ne,multiple:me.multiple,onClick:function(tt){(Ie.onClick||z)(tt),Y.onClick(tt)},onItemHover:Y.onItemHover,motion:me.motion,subMenuOpenDelay:me.subMenuOpenDelay,subMenuCloseDelay:me.subMenuCloseDelay,forceSubMenuRender:me.forceSubMenuRender,onOpenChange:Y.onOpenChange,onDeselect:Y.onDeselect,onSelect:Y.onSelect,builtinPlacements:me.builtinPlacements,itemIcon:Ie.itemIcon||Y.props.itemIcon,expandIcon:Ie.expandIcon||Y.props.expandIcon},ue),{},{direction:me.direction});return(me.mode==="inline"||xe())&&(ke.triggerSubMenuAction="click"),w.cloneElement(ie,Object(k.a)(Object(k.a)({},ke),{},{key:Se||J}))},Y.renderMenuItem=function(ie,J,ue){if(!ie)return null;var ce=Y.props.store.getState(),ye={openKeys:ce.openKeys,selectedKeys:ce.selectedKeys,triggerSubMenuAction:Y.props.triggerSubMenuAction,subMenuKey:ue};return Y.renderCommonMenuItem(ie,J,ye)},he.store.setState({activeKey:Object(k.a)(Object(k.a)({},he.store.getState().activeKey),{},Object(ae.a)({},he.eventKey,Mi(he,he.activeKey)))}),Y.instanceArray=[],Y}return Object(_.a)(ve,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Y){return this.props.visible||Y.visible||this.props.className!==Y.className||!L()(this.props.style,Y.style)}},{key:"componentDidUpdate",value:function(Y){var ie=this.props,J="activeKey"in ie?ie.activeKey:ie.store.getState().activeKey[vi(ie)],ue=Mi(ie,J);if(ue!==J)Di(ie.store,vi(ie),ue);else if("activeKey"in Y){var ce=Mi(Y,Y.activeKey);ue!==ce&&Di(ie.store,vi(ie),ue)}}},{key:"render",value:function(){var Y=this,ie=Object(g.a)({},this.props);this.instanceArray=[];var J=H()(ie.prefixCls,ie.className,"".concat(ie.prefixCls,"-").concat(ie.mode)),ue={className:J,role:ie.role||"menu"};ie.id&&(ue.id=ie.id),ie.focusable&&(ue.tabIndex=0,ue.onKeyDown=this.onKeyDown);var ce=ie.prefixCls,ye=ie.eventKey,me=ie.visible,Se=ie.level,Ie=ie.mode,Ne=ie.overflowedIndicator,ke=ie.theme;return ee.forEach(function(je){return delete ie[je]}),delete ie.onClick,w.createElement(yr,Object(g.a)({},ie,{prefixCls:ce,mode:Ie,tag:"ul",level:Se,theme:ke,visible:me,overflowedIndicator:Ne},ue),Object(U.a)(ie.children).map(function(je,tt){return Y.renderMenuItem(je,tt,ye||"0-menu-")}))}}]),ve}(w.Component);cn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:z};var Er=Object(l.b)()(cn),dn=Er,Tr=V("Kwbf");function xr(re,pe,ve){var he=re.prefixCls,Y=re.motion,ie=re.defaultMotions,J=ie===void 0?{}:ie,ue=re.openAnimation,ce=re.openTransitionName,ye=pe.switchingModeFromInline;if(Y)return Y;if(Object(D.a)(ue)==="object"&&ue)Object(Tr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ue=="string")return{motionName:"".concat(he,"-open-").concat(ue)};if(ce)return{motionName:ce};var me=J[ve];return me||(ye?null:J.other)}var fn=function(re){Object(c.a)(ve,re);var pe=Object(u.a)(ve);function ve(he){var Y;Object(E.a)(this,ve),Y=pe.call(this,he),Y.onSelect=function(ue){var ce=Object(y.a)(Y),ye=ce.props;if(ye.selectable){var me=Y.store.getState(),Se=me.selectedKeys,Ie=ue.key;ye.multiple?Se=Se.concat([Ie]):Se=[Ie],"selectedKeys"in ye||Y.store.setState({selectedKeys:Se}),ye.onSelect(Object(k.a)(Object(k.a)({},ue),{},{selectedKeys:Se}))}},Y.onClick=function(ue){var ce=Y.getRealMenuMode(),ye=Object(y.a)(Y),me=ye.store,Se=ye.props.onOpenChange;ce!=="inline"&&!("openKeys"in Y.props)&&(me.setState({openKeys:[]}),Se([])),Y.props.onClick(ue)},Y.onKeyDown=function(ue,ce){Y.innerMenu.getWrappedInstance().onKeyDown(ue,ce)},Y.onOpenChange=function(ue){var ce=Object(y.a)(Y),ye=ce.props,me=Y.store.getState().openKeys.concat(),Se=!1,Ie=function(ke){var je=!1;if(ke.open)je=me.indexOf(ke.key)===-1,je&&me.push(ke.key);else{var tt=me.indexOf(ke.key);je=tt!==-1,je&&me.splice(tt,1)}Se=Se||je};Array.isArray(ue)?ue.forEach(Ie):Ie(ue),Se&&("openKeys"in Y.props||Y.store.setState({openKeys:me}),ye.onOpenChange(me))},Y.onDeselect=function(ue){var ce=Object(y.a)(Y),ye=ce.props;if(ye.selectable){var me=Y.store.getState().selectedKeys.concat(),Se=ue.key,Ie=me.indexOf(Se);Ie!==-1&&me.splice(Ie,1),"selectedKeys"in ye||Y.store.setState({selectedKeys:me}),ye.onDeselect(Object(k.a)(Object(k.a)({},ue),{},{selectedKeys:me}))}},Y.onMouseEnter=function(ue){Y.restoreModeVerticalFromInline();var ce=Y.props.onMouseEnter;ce&&ce(ue)},Y.onTransitionEnd=function(ue){var ce=ue.propertyName==="width"&&ue.target===ue.currentTarget,ye=ue.target.className,me=Object.prototype.toString.call(ye)==="[object SVGAnimatedString]"?ye.animVal:ye,Se=ue.propertyName==="font-size"&&me.indexOf("anticon")>=0;(ce||Se)&&Y.restoreModeVerticalFromInline()},Y.setInnerMenu=function(ue){Y.innerMenu=ue},Y.isRootMenu=!0;var ie=he.defaultSelectedKeys,J=he.defaultOpenKeys;return"selectedKeys"in he&&(ie=he.selectedKeys||[]),"openKeys"in he&&(J=he.openKeys||[]),Y.store=Object(l.c)({selectedKeys:ie,openKeys:J,activeKey:{"0-menu-":Mi(he,he.activeKey)}}),Y.state={switchingModeFromInline:!1,prevProps:he,inlineOpenKeys:[],store:Y.store},Y}return Object(_.a)(ve,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Y){var ie=this.props,J=ie.siderCollapsed,ue=ie.inlineCollapsed,ce=ie.onOpenChange;(!Y.inlineCollapsed&&ue||!Y.siderCollapsed&&J)&&ce([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var Y=this.props.collapsedWidth,ie=this.store,J=this.prevOpenKeys,ue=this.getInlineCollapsed()&&(Y===0||Y==="0"||Y==="0px");ue?(this.prevOpenKeys=ie.getState().openKeys.concat(),this.store.setState({openKeys:[]})):J&&(this.store.setState({openKeys:J}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Y=this.props.mode,ie=this.state.switchingModeFromInline,J=this.getInlineCollapsed();return ie&&J?"inline":J?"vertical":Y}},{key:"getInlineCollapsed",value:function(){var Y=this.props,ie=Y.inlineCollapsed,J=Y.siderCollapsed;return J!==void 0?J:ie}},{key:"restoreModeVerticalFromInline",value:function(){var Y=this.state.switchingModeFromInline;Y&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var Y=Object(k.a)({},Object(v.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ie=this.getRealMenuMode();return Y.className+=" ".concat(Y.prefixCls,"-root"),Y.direction==="rtl"&&(Y.className+=" ".concat(Y.prefixCls,"-rtl")),Y=Object(k.a)(Object(k.a)({},Y),{},{mode:ie,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:xr(this.props,this.state,ie)}),delete Y.openAnimation,delete Y.openTransitionName,w.createElement(l.a,{store:this.store},w.createElement(dn,Object(g.a)({},Y,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(Y,ie){var J=ie.prevProps,ue=ie.store,ce=ue.getState(),ye={},me={prevProps:Y};return J.mode==="inline"&&Y.mode!=="inline"&&(me.switchingModeFromInline=!0),"openKeys"in Y?ye.openKeys=Y.openKeys||[]:((Y.inlineCollapsed&&!J.inlineCollapsed||Y.siderCollapsed&&!J.siderCollapsed)&&(me.switchingModeFromInline=!0,me.inlineOpenKeys=ce.openKeys,ye.openKeys=[]),(!Y.inlineCollapsed&&J.inlineCollapsed||!Y.siderCollapsed&&J.siderCollapsed)&&(ye.openKeys=ie.inlineOpenKeys,me.inlineOpenKeys=[])),Object.keys(ye).length&&ue.setState(ye),me}}]),ve}(w.Component);fn.defaultProps={selectable:!0,onClick:z,onSelect:z,onOpenChange:z,onDeselect:z,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:w.createElement("span",null,"\xB7\xB7\xB7")};var wr=fn,Fi=function(re){Object(c.a)(ve,re);var pe=Object(u.a)(ve);function ve(){var he;return Object(E.a)(this,ve),he=pe.apply(this,arguments),he.onKeyDown=function(Y){var ie=Y.keyCode;return ie===h.a.ENTER?(he.onClick(Y),!0):void 0},he.onMouseLeave=function(Y){var ie=he.props,J=ie.eventKey,ue=ie.onItemHover,ce=ie.onMouseLeave;ue({key:J,hover:!1}),ce({key:J,domEvent:Y})},he.onMouseEnter=function(Y){var ie=he.props,J=ie.eventKey,ue=ie.onItemHover,ce=ie.onMouseEnter;ue({key:J,hover:!0}),ce({key:J,domEvent:Y})},he.onClick=function(Y){var ie=he.props,J=ie.eventKey,ue=ie.multiple,ce=ie.onClick,ye=ie.onSelect,me=ie.onDeselect,Se=ie.isSelected,Ie={key:J,keyPath:[J],item:Object(y.a)(he),domEvent:Y};ce(Ie),ue?Se?me(Ie):ye(Ie):Se||ye(Ie)},he.saveNode=function(Y){he.node=Y},he}return Object(_.a)(ve,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Y=this.props;Y.onDestroy&&Y.onDestroy(Y.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var Y,ie=Object(k.a)({},this.props),J=H()(this.getPrefixCls(),ie.className,(Y={},Object(ae.a)(Y,this.getActiveClassName(),!ie.disabled&&ie.active),Object(ae.a)(Y,this.getSelectedClassName(),ie.isSelected),Object(ae.a)(Y,this.getDisabledClassName(),ie.disabled),Y)),ue=Object(k.a)(Object(k.a)({},ie.attribute),{},{title:typeof ie.title=="string"?ie.title:void 0,className:J,role:ie.role||"menuitem","aria-disabled":ie.disabled});ie.role==="option"?ue=Object(k.a)(Object(k.a)({},ue),{},{role:"option","aria-selected":ie.isSelected}):(ie.role===null||ie.role==="none")&&(ue.role="none");var ce={onClick:ie.disabled?null:this.onClick,onMouseLeave:ie.disabled?null:this.onMouseLeave,onMouseEnter:ie.disabled?null:this.onMouseEnter},ye=Object(k.a)({},ie.style);ie.mode==="inline"&&(ie.direction==="rtl"?ye.paddingRight=ie.inlineIndent*ie.level:ye.paddingLeft=ie.inlineIndent*ie.level),ee.forEach(function(Se){return delete ie[Se]}),delete ie.direction;var me=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(me=w.createElement(this.props.itemIcon,this.props)),w.createElement("li",Object(g.a)({},Object(v.a)(ie,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ue,ce,{style:ye,ref:this.saveNode}),ie.children,me)}}]),ve}(w.Component);Fi.isMenuItem=!0,Fi.defaultProps={onSelect:z,onMouseEnter:z,onMouseLeave:z,manualRef:z};var Sr=Object(l.b)(function(re,pe){var ve=re.activeKey,he=re.selectedKeys,Y=pe.eventKey,ie=pe.subMenuKey;return{active:ve[ie]===Y,isSelected:Array.isArray(he)?he.indexOf(Y)!==-1:he===Y}})(Fi),Or=Sr,Bi=function(re){Object(c.a)(ve,re);var pe=Object(u.a)(ve);function ve(){var he;return Object(E.a)(this,ve),he=pe.apply(this,arguments),he.renderInnerMenuItem=function(Y){var ie=he.props,J=ie.renderMenuItem,ue=ie.index;return J(Y,ue,he.props.subMenuKey)},he}return Object(_.a)(ve,[{key:"render",value:function(){var Y=Object(g.a)({},this.props),ie=Y.className,J=ie===void 0?"":ie,ue=Y.rootPrefixCls,ce="".concat(ue,"-item-group-title"),ye="".concat(ue,"-item-group-list"),me=Y.title,Se=Y.children;return ee.forEach(function(Ie){return delete Y[Ie]}),delete Y.direction,w.createElement("li",Object(g.a)({},Y,{onClick:function(Ne){return Ne.stopPropagation()},className:"".concat(J," ").concat(ue,"-item-group")}),w.createElement("div",{className:ce,title:typeof me=="string"?me:void 0},me),w.createElement("ul",{className:ye},w.Children.map(Se,this.renderInnerMenuItem)))}}]),ve}(w.Component);Bi.isMenuItemGroup=!0,Bi.defaultProps={disabled:!0};var fa=Bi,pn=function(pe){var ve=pe.className,he=pe.rootPrefixCls,Y=pe.style;return w.createElement("li",{className:"".concat(ve," ").concat(he,"-item-divider"),style:Y})};pn.defaultProps={disabled:!0,className:"",style:{}};var pa=pn,Cr=wr,Ar=V("eDIo");function Rr(re,pe){var ve=re.prefixCls,he=re.editable,Y=re.locale,ie=re.style;return!he||he.showAdd===!1?null:w.createElement("button",{ref:pe,type:"button",className:"".concat(ve,"-nav-add"),style:ie,"aria-label":(Y==null?void 0:Y.addAriaLabel)||"Add tab",onClick:function(ue){he.onEdit("add",{event:ue})}},he.addIcon||"+")}var mn=w.forwardRef(Rr);function Ir(re,pe){var ve=re.prefixCls,he=re.id,Y=re.tabs,ie=re.locale,J=re.mobile,ue=re.moreIcon,ce=ue===void 0?"More":ue,ye=re.moreTransitionName,me=re.style,Se=re.className,Ie=re.editable,Ne=re.tabBarGutter,ke=re.rtl,je=re.onTabClick,tt=Object(w.useState)(!1),ht=Object(B.a)(tt,2),at=ht[0],dt=ht[1],ct=Object(w.useState)(null),st=Object(B.a)(ct,2),ot=st[0],yt=st[1],ft="".concat(he,"-more-popup"),Ut="".concat(ve,"-dropdown"),Ct=ot!==null?"".concat(ft,"-").concat(ot):null,et=ie==null?void 0:ie.dropdownAriaLabel,qe=w.createElement(Cr,{onClick:function(Rt){var Pt=Rt.key,Xt=Rt.domEvent;je(Pt,Xt),dt(!1)},id:ft,tabIndex:-1,role:"listbox","aria-activedescendant":Ct,selectedKeys:[ot],"aria-label":et!==void 0?et:"expanded dropdown"},Y.map(function(_t){return w.createElement(Or,{key:_t.key,id:"".concat(ft,"-").concat(_t.key),role:"option","aria-controls":he&&"".concat(he,"-panel-").concat(_t.key),disabled:_t.disabled},_t.tab)}));function pt(_t){for(var Rt=Y.filter(function(ti){return!ti.disabled}),Pt=Rt.findIndex(function(ti){return ti.key===ot})||0,Xt=Rt.length,ei=0;ei<Xt;ei+=1){Pt=(Pt+_t+Xt)%Xt;var jt=Rt[Pt];if(!jt.disabled){yt(jt.key);return}}}function gt(_t){var Rt=_t.which;if(!at){[h.a.DOWN,h.a.SPACE,h.a.ENTER].includes(Rt)&&(dt(!0),_t.preventDefault());return}switch(Rt){case h.a.UP:pt(-1),_t.preventDefault();break;case h.a.DOWN:pt(1),_t.preventDefault();break;case h.a.ESC:dt(!1);break;case h.a.SPACE:case h.a.ENTER:ot!==null&&je(ot,_t);break}}Object(w.useEffect)(function(){var _t=document.getElementById(Ct);_t&&_t.scrollIntoView&&_t.scrollIntoView(!1)},[ot]),Object(w.useEffect)(function(){at||yt(null)},[at]);var Ve=Object(ae.a)({},ke?"marginLeft":"marginRight",Ne);Y.length||(Ve.visibility="hidden",Ve.order=1);var bt=H()(Object(ae.a)({},"".concat(Ut,"-rtl"),ke)),Lt=J?null:w.createElement(Ar.a,{prefixCls:Ut,overlay:qe,trigger:["hover"],visible:at,transitionName:ye,onVisibleChange:dt,overlayClassName:bt,mouseEnterDelay:.1,mouseLeaveDelay:.1},w.createElement("button",{type:"button",className:"".concat(ve,"-nav-more"),style:Ve,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":ft,id:"".concat(he,"-more"),"aria-expanded":at,onKeyDown:gt},ce));return w.createElement("div",{className:H()("".concat(ve,"-nav-operations"),Se),style:me,ref:pe},Lt,w.createElement(mn,{prefixCls:ve,locale:ie,editable:Ie}))}var Lr=w.forwardRef(Ir),ji=Object(w.createContext)(null),Dr=.1,gn=.01,Pi=20,vn=Math.pow(.995,Pi);function Mr(){var re=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(re)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(re.substr(0,4)))}function Pr(re,pe){var ve=Object(w.useState)(),he=Object(B.a)(ve,2),Y=he[0],ie=he[1],J=Object(w.useState)(0),ue=Object(B.a)(J,2),ce=ue[0],ye=ue[1],me=Object(w.useState)(0),Se=Object(B.a)(me,2),Ie=Se[0],Ne=Se[1],ke=Object(w.useState)(),je=Object(B.a)(ke,2),tt=je[0],ht=je[1],at=Object(w.useRef)();function dt(et){var qe=et.touches[0],pt=qe.screenX,gt=qe.screenY;ie({x:pt,y:gt}),window.clearInterval(at.current)}function ct(et){if(!Y)return;et.preventDefault();var qe=et.touches[0],pt=qe.screenX,gt=qe.screenY;ie({x:pt,y:gt});var Ve=pt-Y.x,bt=gt-Y.y;pe(Ve,bt);var Lt=Date.now();ye(Lt),Ne(Lt-ce),ht({x:Ve,y:bt})}function st(){if(!Y)return;if(ie(null),ht(null),tt){var et=tt.x/Ie,qe=tt.y/Ie,pt=Math.abs(et),gt=Math.abs(qe);if(Math.max(pt,gt)<Dr)return;var Ve=et,bt=qe;at.current=window.setInterval(function(){if(Math.abs(Ve)<gn&&Math.abs(bt)<gn){window.clearInterval(at.current);return}Ve*=vn,bt*=vn,pe(Ve*Pi,bt*Pi)},Pi)}}var ot=Object(w.useRef)(0),yt=Object(w.useRef)(!1),ft=Object(w.useRef)();function Ut(et){var qe=et.deltaX,pt=et.deltaY,gt=0,Ve=Math.abs(qe),bt=Math.abs(pt);Ve===bt?gt=ft.current==="x"?qe:pt:Ve>bt?(gt=qe,ft.current="x"):(gt=pt,ft.current="y");var Lt=Date.now();Lt-ot.current>100&&(yt.current=!1),(pe(-gt,-gt)||yt.current)&&(et.preventDefault(),yt.current=!0),ot.current=Lt}var Ct=Object(w.useRef)(null);Ct.current={onTouchStart:dt,onTouchMove:ct,onTouchEnd:st,onWheel:Ut},w.useEffect(function(){function et(Ve){Ct.current.onTouchStart(Ve)}function qe(Ve){Ct.current.onTouchMove(Ve)}function pt(Ve){Ct.current.onTouchEnd(Ve)}function gt(Ve){Ct.current.onWheel(Ve)}return document.addEventListener("touchmove",qe,{passive:!1}),document.addEventListener("touchend",pt,{passive:!1}),re.current.addEventListener("touchstart",et,{passive:!1}),re.current.addEventListener("wheel",gt),function(){document.removeEventListener("touchmove",qe),document.removeEventListener("touchend",pt)}},[])}function kr(){var re=Object(w.useRef)(new Map);function pe(he){return re.current.has(he)||re.current.set(he,w.createRef()),re.current.get(he)}function ve(he){re.current.delete(he)}return[pe,ve]}function yn(re,pe){var ve=w.useRef(re),he=w.useState({}),Y=Object(B.a)(he,2),ie=Y[1];function J(ue){var ce=typeof ue=="function"?ue(ve.current):ue;ce!==ve.current&&pe(ce,ve.current),ve.current=ce,ie({})}return[ve.current,J]}var bn=function(pe){var ve=pe.position,he=pe.prefixCls,Y=pe.extra;if(!Y)return null;var ie,J=Y;return ve==="right"&&(ie=J.right||!J.left&&J||null),ve==="left"&&(ie=J.left||null),ie?w.createElement("div",{className:"".concat(he,"-extra-content")},ie):null};function Nr(re,pe){var ve,he=w.useContext(ji),Y=he.prefixCls,ie=he.tabs,J=re.className,ue=re.style,ce=re.id,ye=re.animated,me=re.activeKey,Se=re.rtl,Ie=re.extra,Ne=re.editable,ke=re.locale,je=re.tabPosition,tt=re.tabBarGutter,ht=re.children,at=re.onTabClick,dt=re.onTabScroll,ct=Object(w.useRef)(),st=Object(w.useRef)(),ot=Object(w.useRef)(),yt=Object(w.useRef)(),ft=kr(),Ut=Object(B.a)(ft,2),Ct=Ut[0],et=Ut[1],qe=je==="top"||je==="bottom",pt=yn(0,function(At,mt){qe&&dt&&dt({direction:At>mt?"left":"right"})}),gt=Object(B.a)(pt,2),Ve=gt[0],bt=gt[1],Lt=yn(0,function(At,mt){!qe&&dt&&dt({direction:At>mt?"top":"bottom"})}),_t=Object(B.a)(Lt,2),Rt=_t[0],Pt=_t[1],Xt=Object(w.useState)(0),ei=Object(B.a)(Xt,2),jt=ei[0],ti=ei[1],si=Object(w.useState)(0),ii=Object(B.a)(si,2),ni=ii[0],Ht=ii[1],Qt=Object(w.useState)(0),$t=Object(B.a)(Qt,2),Vt=$t[0],ci=$t[1],di=Object(w.useState)(0),mi=Object(B.a)(di,2),It=mi[0],li=mi[1],gi=Object(w.useState)(null),Dt=Object(B.a)(gi,2),St=Dt[0],Jt=Dt[1],Hr=Object(w.useState)(null),wn=Object(B.a)(Hr,2),yi=wn[0],Wr=wn[1],Kr=Object(w.useState)(0),Sn=Object(B.a)(Kr,2),Gr=Sn[0],zr=Sn[1],Vr=Object(w.useState)(0),On=Object(B.a)(Vr,2),Yr=On[0],Xr=On[1],$r=r(new Map),Cn=Object(B.a)($r,2),Jr=Cn[0],Qr=Cn[1],ki=t(ie,Jr,jt),An="".concat(Y,"-nav-operations-hidden"),xi=0,wi=0;qe?Se?(xi=0,wi=Math.max(0,jt-St)):(xi=Math.min(0,St-jt),wi=0):(xi=Math.min(0,yi-ni),wi=0);function Hi(At){return At<xi?[xi,!1]:At>wi?[wi,!1]:[At,!0]}var Rn=Object(w.useRef)(),Zr=Object(w.useState)(),In=Object(B.a)(Zr,2),Wi=In[0],Ln=In[1];function Ki(){Ln(Date.now())}function Gi(){window.clearTimeout(Rn.current)}Pr(ct,function(At,mt){var Yt=!1;function ri(Oi,Ci){Oi(function(Ai){var Ri=Hi(Ai+Ci),bi=Object(B.a)(Ri,2),Xi=bi[0],$i=bi[1];return Yt=$i,Xi})}if(qe){if(St>=jt)return Yt;ri(bt,At)}else{if(yi>=ni)return Yt;ri(Pt,mt)}return Gi(),Ki(),Yt}),Object(w.useEffect)(function(){return Gi(),Wi&&(Rn.current=window.setTimeout(function(){Ln(0)},100)),Gi},[Wi]);function Dn(){var At=arguments.length>0&&arguments[0]!==void 0?arguments[0]:me,mt=ki.get(At);if(!mt)return;if(qe){var Yt=Ve;Se?mt.right<Ve?Yt=mt.right:mt.right+mt.width>Ve+St&&(Yt=mt.right+mt.width-St):mt.left<-Ve?Yt=-mt.left:mt.left+mt.width>-Ve+St&&(Yt=-(mt.left+mt.width-St)),Pt(0),bt(Hi(Yt)[0])}else{var ri=Rt;mt.top<-Rt?ri=-mt.top:mt.top+mt.height>-Rt+yi&&(ri=-(mt.top+mt.height-yi)),bt(0),Pt(Hi(ri)[0])}}var qr=m(ki,{width:St,height:yi,left:Ve,top:Rt},{width:Vt,height:It},{width:Gr,height:Yr},Object(k.a)(Object(k.a)({},re),{},{tabs:ie})),Mn=Object(B.a)(qr,2),ea=Mn[0],ta=Mn[1],ia=ie.map(function(At){var mt=At.key;return w.createElement(n,{id:ce,prefixCls:Y,key:mt,rtl:Se,tab:At,closable:At.closable,editable:Ne,active:mt===me,tabPosition:je,tabBarGutter:tt,renderWrapper:ht,removeAriaLabel:ke==null?void 0:ke.removeAriaLabel,ref:Ct(mt),onClick:function(ri){at(mt,ri)},onRemove:function(){et(mt)},onFocus:function(){Dn(mt),Ki(),Se||(ct.current.scrollLeft=0),ct.current.scrollTop=0}})}),zi=a(function(){var At,mt,Yt,ri,Oi,Ci,Ai,Ri,bi,Xi=((At=ct.current)===null||At===void 0?void 0:At.offsetWidth)||0,$i=((mt=ct.current)===null||mt===void 0?void 0:mt.offsetHeight)||0,Hn=((Yt=yt.current)===null||Yt===void 0?void 0:Yt.offsetWidth)||0,Wn=((ri=yt.current)===null||ri===void 0?void 0:ri.offsetHeight)||0,la=((Oi=ot.current)===null||Oi===void 0?void 0:Oi.offsetWidth)||0,ua=((Ci=ot.current)===null||Ci===void 0?void 0:Ci.offsetHeight)||0;Jt(Xi),Wr($i),zr(Hn),Xr(Wn);var Kn=(((Ai=st.current)===null||Ai===void 0?void 0:Ai.offsetWidth)||0)-Hn,Gn=(((Ri=st.current)===null||Ri===void 0?void 0:Ri.offsetHeight)||0)-Wn;ti(Kn),Ht(Gn);var zn=(bi=ot.current)===null||bi===void 0?void 0:bi.className.includes(An);ci(Kn-(zn?0:la)),li(Gn-(zn?0:ua)),Qr(function(){var Vn=new Map;return ie.forEach(function(ha){var Yn=ha.key,Ii=Ct(Yn).current;Ii&&Vn.set(Yn,{width:Ii.offsetWidth,height:Ii.offsetHeight,left:Ii.offsetLeft,top:Ii.offsetTop})}),Vn})}),na=ie.slice(0,ea),ra=ie.slice(ta+1),Pn=[].concat(Object(S.a)(na),Object(S.a)(ra)),aa=Object(w.useState)(),kn=Object(B.a)(aa,2),sa=kn[0],oa=kn[1],fi=ki.get(me),Nn=Object(w.useRef)();function Un(){d.a.cancel(Nn.current)}Object(w.useEffect)(function(){var At={};return fi&&(qe?(Se?At.right=fi.right:At.left=fi.left,At.width=fi.width):(At.top=fi.top,At.height=fi.height)),Un(),Nn.current=d()(function(){oa(At)}),Un},[fi,qe,Se]),Object(w.useEffect)(function(){Dn()},[me,fi,ki,qe]),Object(w.useEffect)(function(){zi()},[Se,tt,me,ie.map(function(At){return At.key}).join("_")]);var Fn=!!Pn.length,Si="".concat(Y,"-nav-wrap"),Vi,Yi,Bn,jn;return qe?Se?(Yi=Ve>0,Vi=Ve+St<jt):(Vi=Ve<0,Yi=-Ve+St<jt):(Bn=Rt<0,jn=-Rt+yi<ni),w.createElement("div",{ref:pe,role:"tablist",className:H()("".concat(Y,"-nav"),J),style:ue,onKeyDown:function(){Ki()}},w.createElement(bn,{position:"left",extra:Ie,prefixCls:Y}),w.createElement(o.a,{onResize:zi},w.createElement("div",{className:H()(Si,(ve={},Object(ae.a)(ve,"".concat(Si,"-ping-left"),Vi),Object(ae.a)(ve,"".concat(Si,"-ping-right"),Yi),Object(ae.a)(ve,"".concat(Si,"-ping-top"),Bn),Object(ae.a)(ve,"".concat(Si,"-ping-bottom"),jn),ve)),ref:ct},w.createElement(o.a,{onResize:zi},w.createElement("div",{ref:st,className:"".concat(Y,"-nav-list"),style:{transform:"translate(".concat(Ve,"px, ").concat(Rt,"px)"),transition:Wi?"none":void 0}},ia,w.createElement(mn,{ref:yt,prefixCls:Y,locale:ke,editable:Ne,style:{visibility:Fn?"hidden":null}}),w.createElement("div",{className:H()("".concat(Y,"-ink-bar"),Object(ae.a)({},"".concat(Y,"-ink-bar-animated"),ye.inkBar)),style:sa}))))),w.createElement(Lr,Object.assign({},re,{ref:ot,prefixCls:Y,tabs:Pn,className:!Fn&&An})),w.createElement(bn,{position:"right",extra:Ie,prefixCls:Y}))}var _n=w.forwardRef(Nr);function Ur(re){var pe=re.id,ve=re.activeKey,he=re.animated,Y=re.tabPosition,ie=re.rtl,J=re.destroyInactiveTabPane,ue=w.useContext(ji),ce=ue.prefixCls,ye=ue.tabs,me=he.tabPane,Se=ye.findIndex(function(Ie){return Ie.key===ve});return w.createElement("div",{className:H()("".concat(ce,"-content-holder"))},w.createElement("div",{className:H()("".concat(ce,"-content"),"".concat(ce,"-content-").concat(Y),Object(ae.a)({},"".concat(ce,"-content-animated"),me)),style:Se&&me?Object(ae.a)({},ie?"marginRight":"marginLeft","-".concat(Se,"00%")):null},ye.map(function(Ie){return w.cloneElement(Ie.node,{key:Ie.key,prefixCls:ce,tabKey:Ie.key,id:pe,animated:me,active:Ie.key===ve,destroyInactiveTabPane:J})})))}function En(re){var pe=re.prefixCls,ve=re.forceRender,he=re.className,Y=re.style,ie=re.id,J=re.active,ue=re.animated,ce=re.destroyInactiveTabPane,ye=re.tabKey,me=re.children,Se=w.useState(ve),Ie=Object(B.a)(Se,2),Ne=Ie[0],ke=Ie[1];w.useEffect(function(){J?ke(!0):ce&&ke(!1)},[J,ce]);var je={};return J||(ue?(je.visibility="hidden",je.height=0,je.overflowY="hidden"):je.display="none"),w.createElement("div",{id:ie&&"".concat(ie,"-panel-").concat(ye),role:"tabpanel",tabIndex:J?0:-1,"aria-labelledby":ie&&"".concat(ie,"-tab-").concat(ye),"aria-hidden":!J,style:Object(k.a)(Object(k.a)({},je),Y),className:H()("".concat(pe,"-tabpane"),J&&"".concat(pe,"-tabpane-active"),he)},(J||Ne||ve)&&me)}var Tn=0;function Fr(re){return Object(U.a)(re).map(function(pe){if(w.isValidElement(pe)){var ve=pe.key!==void 0?String(pe.key):void 0;return Object(k.a)(Object(k.a)({key:ve},pe.props),{},{node:pe})}return null}).filter(function(pe){return pe})}function Br(re,pe){var ve,he=re.id,Y=re.prefixCls,ie=Y===void 0?"rc-tabs":Y,J=re.className,ue=re.children,ce=re.direction,ye=re.activeKey,me=re.defaultActiveKey,Se=re.editable,Ie=re.animated,Ne=re.tabPosition,ke=Ne===void 0?"top":Ne,je=re.tabBarGutter,tt=re.tabBarStyle,ht=re.tabBarExtraContent,at=re.locale,dt=re.moreIcon,ct=re.moreTransitionName,st=re.destroyInactiveTabPane,ot=re.renderTabBar,yt=re.onChange,ft=re.onTabClick,Ut=re.onTabScroll,Ct=Object(A.a)(re,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),et=Fr(ue),qe=ce==="rtl",pt;Ie===!1?pt={inkBar:!1,tabPane:!1}:pt=Object(k.a)({inkBar:!0,tabPane:!1},Ie!==!0?Ie:null);var gt=Object(w.useState)(!1),Ve=Object(B.a)(gt,2),bt=Ve[0],Lt=Ve[1];Object(w.useEffect)(function(){Lt(Mr())},[]);var _t=Object(e.a)(function(){var It;return(It=et[0])===null||It===void 0?void 0:It.key},{value:ye,defaultValue:me}),Rt=Object(B.a)(_t,2),Pt=Rt[0],Xt=Rt[1],ei=Object(w.useState)(function(){return et.findIndex(function(It){return It.key===Pt})}),jt=Object(B.a)(ei,2),ti=jt[0],si=jt[1];Object(w.useEffect)(function(){var It=et.findIndex(function(gi){return gi.key===Pt});if(It===-1){var li;It=Math.max(0,Math.min(ti,et.length-1)),Xt((li=et[It])===null||li===void 0?void 0:li.key)}si(It)},[et.map(function(It){return It.key}).join("_"),Pt,ti]);var ii=Object(e.a)(null,{value:he}),ni=Object(B.a)(ii,2),Ht=ni[0],Qt=ni[1],$t=ke;bt&&!["left","right"].includes(ke)&&($t="top"),Object(w.useEffect)(function(){he||(Qt("rc-tabs-".concat(Tn)),Tn+=1)},[]);function Vt(It,li){ft==null||ft(It,li),Xt(It),yt==null||yt(It)}var ci={id:Ht,activeKey:Pt,animated:pt,tabPosition:$t,rtl:qe,mobile:bt},di,mi=Object(k.a)(Object(k.a)({},ci),{},{editable:Se,locale:at,moreIcon:dt,moreTransitionName:ct,tabBarGutter:je,onTabClick:Vt,onTabScroll:Ut,extra:ht,style:tt,panes:ue});return ot?di=ot(mi,_n):di=w.createElement(_n,Object.assign({},mi)),w.createElement(ji.Provider,{value:{tabs:et,prefixCls:ie}},w.createElement("div",Object.assign({ref:pe,id:he,className:H()(ie,"".concat(ie,"-").concat($t),(ve={},Object(ae.a)(ve,"".concat(ie,"-mobile"),bt),Object(ae.a)(ve,"".concat(ie,"-editable"),Se),Object(ae.a)(ve,"".concat(ie,"-rtl"),qe),ve),J)},Ct),di,w.createElement(Ur,Object.assign({destroyInactiveTabPane:st},ci,{animated:pt}))))}var xn=w.forwardRef(Br);xn.TabPane=En;var jr=xn,ma=be.b=jr},kUb9:function(Je,be,V){"use strict";V.r(be);var ae=V("DjyN"),B=V("NUBc"),A=V("Znn+"),k=V("ZTPi"),w=V("+L6B"),R=V("2/Rp"),H=V("sPJy"),U=V("bE4q"),e=V("9og8"),S=V("k1fw"),f=V("tJVT"),d=V("WmNS"),o=V.n(d),a=V("q1tI"),r=V.n(a),h=V("Ty5D"),s=V("55Ip"),n=V("9kvl"),i=V("xKgJ"),t=V("ErOA"),b=V("BdwD"),m=V("INg4"),g=V.n(m),E=V("479L"),_=V.n(E),y=V("/zsF"),c=V("PArb"),u=V("rAM+"),l=V("9Bee"),v=V("m3rI"),p=function(M){var j,I=M.user,W=M.item,Q=M.getdata,fe=M.params,le=Object(a.useRef)(),Ce=Object(a.useState)(),Oe=Object(f.a)(Ce,2),Re=Oe[0],Le=Oe[1],Pe=Object(a.useState)(!0),_e=Object(f.a)(Pe,2),N=_e[0],O=_e[1];return Object(a.useEffect)(function(){if(!le.current)return;function C(){var z,P=new ResizeObserver(function(oe){var we=Object(u.a)(oe),Ae;try{for(we.s();!(Ae=we.n()).done;){var ee=Ae.value;console.log("----",ee,oe),Le(ee.target.offsetHeight>=52)}}catch(de){we.e(de)}finally{we.f()}});return P.observe((z=le.current)===null||z===void 0?void 0:z.firstElementChild),P}var F=C();return function(){var z,P;((z=le.current)===null||z===void 0?void 0:z.firstElementChild)&&F.unobserve((P=le.current)===null||P===void 0?void 0:P.firstElementChild)}},[le.current]),r.a.createElement("div",{onClick:function(){n.d.push("/classrooms/".concat(fe.coursesId,"/program_homework/").concat(fe.categoryId,"/answer/").concat(W.id,"/detail"))},style:{marginTop:30,padding:"0px 20px",cursor:"pointer"}},r.a.createElement("div",{className:g.a.titles,style:{fontWeight:600,fontSize:18,color:"#000000"}},W.name),r.a.createElement("div",{style:{display:"flex",marginTop:10}},r.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",color:"#5F6368"}},r.a.createElement("img",{style:{width:24,borderRadius:50},src:"".concat(v.a.IMG_SERVER,"/images/").concat(W.author.image_url)}),r.a.createElement("span",{style:{margin:"0px 12px 0px 8px"}},W==null||((j=W.author)===null||j===void 0)?void 0:j.name),r.a.createElement("span",null,"\u53D1\u8868\u4E8E",W.created_at)),r.a.createElement("div",null,r.a.createElement("span",{style:{color:"#5F6368",cursor:"pointer"},onClick:function(){}},"\u56DE\u590D\uFF08",(W==null?void 0:W.descendants_count)||0,"\uFF09"),Object(i.j)()&&r.a.createElement("span",{onClick:function(){var C=Object(e.a)(o.a.mark(function F(z){var P;return o.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return z.stopPropagation(),we.next=3,Object(t.a)("/api/hack_messages/".concat(W.id,"/update_public"),{method:"post"});case 3:P=we.sent,P.status===0&&Q();case 5:case"end":return we.stop()}},F)}));return function(F){return C.apply(this,arguments)}}(),style:{color:"#44D7B6",cursor:"pointer",marginLeft:20}},W.is_public?"\u53D6\u6D88\u516C\u5F00":"\u516C\u5F00"))),r.a.createElement("div",{ref:le,style:{margin:"15px 0px",maxHeight:N?52:"",overflow:"hidden"}},r.a.createElement(l.a,{style:{color:"#434D6C",fontSize:14},value:W.content})),(W==null?void 0:W.hack_identifier)&&r.a.createElement("span",{onClick:function(){var C=Object(e.a)(o.a.mark(function F(z){var P,oe;return o.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:if(z.stopPropagation(),!Object(i.t)()){Ae.next=3;break}return Ae.abrupt("return");case 3:return Ae.next=5,Object(t.a)("/api/problems/".concat(W==null?void 0:W.hack_identifier,"/start.json"),{method:"get",params:{hack_user_id:W==null||((P=W.author)===null||P===void 0)?void 0:P.id}});case 5:oe=Ae.sent,oe&&(window.open("/myproblems/".concat(oe==null?void 0:oe.identifier,"?type=1")),localStorage.setItem("program_homework",[fe.coursesId,fe.categoryId]));case 7:case"end":return Ae.stop()}},F)}));return function(F){return C.apply(this,arguments)}}(),className:g.a.tips},W==null?void 0:W.hack_name),Re&&r.a.createElement("div",{onClick:function(F){F.stopPropagation(),O(!N)}},r.a.createElement(c.a,{dashed:!1,className:"",style:{cursor:"pointer"}},r.a.createElement("a",{className:"font14 ".concat(g.a.color999)},N?"\u9605\u8BFB\u5168\u6587 ":"\u6536\u8D77\u5168\u6587 ",r.a.createElement("i",{className:"iconfont font14 ".concat(N?"icon-jiantou9":"icon-changyongtubiao-xianxingdaochu-zhuanqu-")})))))},T=Object(n.a)(function(x){var M=x.user;return{user:M}})(p),L=function(M){var j,I,W,Q,fe=M.user,le=Object(a.useState)(Object(S.a)(Object(S.a)({},Object(h.i)()),{},{page:1,per_page:10,type:1,sort_by:"",course_group:Object(i.t)()?[fe.userInfo.course.course_group_id]:[]})),Ce=Object(f.a)(le,2),Oe=Ce[0],Re=Ce[1],Le=Object(a.useState)([]),Pe=Object(f.a)(Le,2),_e=Pe[0],N=Pe[1];Object(a.useEffect)(function(){O()},[]);function O(){return C.apply(this,arguments)}function C(){return C=Object(e.a)(o.a.mark(function F(){var z;return o.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(t.a)("/api/homework_commons/".concat(Oe.categoryId,"/hack_messages"),{method:"get",params:Object(S.a)(Object(S.a)({},Oe),{},{type:1})});case 2:z=oe.sent,N(z);case 4:case"end":return oe.stop()}},F)})),C.apply(this,arguments)}return r.a.createElement("div",{style:{width:1200,margin:"0px auto"}},r.a.createElement(U.a,{separator:">",style:{marginTop:20}},r.a.createElement(U.a.Item,null,r.a.createElement(s.a,{to:"/classrooms/".concat(_e==null?void 0:_e.course_id,"/program_homework")},_e==null?void 0:_e.course_name)),r.a.createElement(U.a.Item,null,r.a.createElement(s.a,{to:"/classrooms/".concat(_e==null?void 0:_e.course_id,"/program_homework/").concat(_e==null?void 0:_e.homework_id,"/detail")},_e==null?void 0:_e.homework_name)),r.a.createElement(U.a.Item,null,"\u9898\u89E3&\u95EE\u7B54")),r.a.createElement("div",{style:{marginTop:10,display:"flex"}},r.a.createElement("div",{style:{width:"860px",marginRight:30,background:"#fff"}},r.a.createElement(k.a,{tabBarStyle:{padding:"0px 10px"},style:{width:"850px"},tabBarExtraContent:Object(i.t)()&&r.a.createElement(R.a,{type:"primary",style:{width:88},onClick:function(){n.d.push("/classrooms/".concat(Oe.coursesId,"/program_homework/").concat(Oe.categoryId,"/answer/add"))}},"\u53D1\u8868\u7B54\u7591"," "),onChange:function(z){z==="1"?Oe.sort_by="":Oe.sort_by="created_at",Re(Object(S.a)({},Oe)),O()}},r.a.createElement(k.a.TabPane,{key:"1",tab:"\u6700\u65B0\u56DE\u590D"}),r.a.createElement(k.a.TabPane,{key:"2",tab:"\u6700\u65B0\u53D1\u8868"})),(_e==null||((j=_e.data)===null||j===void 0)?void 0:j.length)<=0&&r.a.createElement(b.a,{customText:"\u6682\u65E0\u8BA8\u8BBA"}),_e==null||((I=_e.data)===null||I===void 0)?void 0:I.map(function(F){return r.a.createElement(T,{item:F,params:Oe,getdata:O})}),r.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},r.a.createElement(B.a,{current:Oe.page,pageSize:Oe.per_page,total:_e==null?void 0:_e.count,hideOnSinglePage:!0,onChange:function(z,P){Oe.page=z,Oe.per_page=P,Re(Object(S.a)({},Oe)),O()}}))),r.a.createElement("div",{className:g.a.right,style:{width:300,height:"100%"}},r.a.createElement("div",{style:{display:"flex"}},r.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},r.a.createElement("span",{style:{marginRight:3,fontSize:20,fontWeight:600,color:"#000"}},"\u5E7F\u64AD"),r.a.createElement("img",{width:21,src:_.a})," "),Object(i.c)()&&r.a.createElement(R.a,{type:"primary",onClick:function(){n.d.push("/classrooms/".concat(Oe.coursesId,"/program_homework/").concat(Oe.categoryId,"/answer/add"))}},"\u53D1\u5E03\u5E7F\u64AD")),(_e==null||((W=_e.radio_messages)===null||W===void 0)?void 0:W.length)<=0&&r.a.createElement(b.a,null),_e==null||((Q=_e.radio_messages)===null||Q===void 0)?void 0:Q.map(function(F){return r.a.createElement("div",{onClick:function(){n.d.push("/classrooms/".concat(Oe.coursesId,"/program_homework/").concat(Oe.categoryId,"/answer/").concat(F.id,"/detail"))},style:{marginTop:30,cursor:"pointer"}},r.a.createElement("div",{className:g.a.title,style:{fontSize:"16px",fontWeight:600}},r.a.createElement("span",{style:{color:(F==null?void 0:F.message_type)===2?"#4C7BE6":"#E17E7E"}},(F==null?void 0:F.message_type)===2?"\u3010\u9898\u89E3\u3011":"\u3010\u901A\u77E5\u3011"),r.a.createElement("span",{title:F.name},F.name)),r.a.createElement("div",{style:{marginTop:15,color:"#5F6368"}},"\u53D1\u8868\u4E8E",F.created_at))}))))},D=be.default=Object(n.a)(function(x){var M=x.user;return{user:M}})(L)},nEHx:function(Je,be,V){"use strict";V.d(be,"a",function(){return ae});var ae;(function(B){B.DARK="dark",B.LIGHT="light",B.HIGH_CONTRAST="hc"})(ae||(ae={}))},nnTU:function(Je,be,V){"use strict";V.d(be,"b",function(){return H}),V.d(be,"a",function(){return U});var ae=V("MI8n"),B=V("JYp7"),A=V("pmY6"),k=V("24hK"),w=V("746U"),R=V("Cg/j");const H=Object(R.c)("commandService"),U=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ae.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,S){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!S)throw new Error("invalid command");return this.registerCommand({id:e,handler:S})}if(e.description){const r=[];for(let s of e.description.args)r.push(s.constraint);const h=e.handler;e.handler=function(s,...n){return Object(w.o)(n,r),h(s,...n)}}const{id:f}=e;let d=this._commands.get(f);d||(d=new k.a,this._commands.set(f,d));let o=d.unshift(e),a=Object(A.i)(()=>{o();const r=this._commands.get(f);(r==null?void 0:r.isEmpty())&&this._commands.delete(f)});return this._onDidRegisterCommand.fire(f),a}registerCommandAlias(e,S){return U.registerCommand(e,(f,...d)=>f.get(H).executeCommand(S,...d))}getCommand(e){const S=this._commands.get(e);return!S||S.isEmpty()?void 0:B.a.first(S)}getCommands(){const e=new Map;for(const S of this._commands.keys()){const f=this.getCommand(S);f&&e.set(S,f)}return e}};U.registerCommand("noop",()=>{})},p5ED:function(Je,be,V){"use strict";var ae=V("+L6B"),B=V("2/Rp"),A=V("5Dmo"),k=V("3S7+"),w=V("k1fw"),R=V("9og8"),H=V("tJVT"),U=V("WmNS"),e=V.n(U),S=V("q1tI"),f=V.n(S),d=V("vHTk"),o=V.n(d),a=V("yEEn"),r=V("ZW9T"),h=V("1vsH"),s=V("V0Rq"),n=V("m3rI");be.a=function(i){var t,b,m,g,E,_,y,c=i.editOffice,u=c===void 0?"view":c,l=i.data,v=i.theme,p=i.type,T=i.filename,L=i.monacoEditor,D=i.className,x=i.style,M=i.close,j=i.onClose,I=i.hasMask,W=i.disabledDownload,Q=Object(S.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),fe=Object(H.a)(Q,2),le=fe[0],Ce=fe[1],Oe=Object(S.useState)(""),Re=Object(H.a)(Oe,2),Le=Re[0],Pe=Re[1],_e=Object(S.useState)(),N=Object(H.a)(_e,2),O=N[0],C=N[1],F=window.ENV==="build"?"/react/build":"",z=n.a.PROXY_SERVER||location.origin,P,oe=1024*1024,we=10*oe,Ae=Object(S.useRef)();(t=l)!==null&&t!==void 0&&t.startsWith("/api")&&p!=="txt"&&(l=(n.a.API_SERVER||location.origin)+l),p==="office"&&(P=Object(h.T)(l).filesize,P>we&&(p="other")),T&&L&&(L.filename=T),Object(S.useEffect)(function(){var xe,Me,Ue=(xe=document.cookie)===null||xe===void 0||((Me=xe.replace(/\s/g,""))===null||Me===void 0)?void 0:Me.split(";");Ue==null||Ue.map(function(He){var Be=He.split("=");Be[0]==="_educoder_session"&&Pe(Be[1])})},[]),Object(S.useEffect)(function(){p==="office"&&ee()},[p,l]);var ee=function(){var xe=Object(R.a)(e.a.mark(function Me(){var Ue,He,Be;return e.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:return console.log("data:",l),Ue=l,l.startsWith("http")||(Ue=location.origin+Ue),He=new URL(Ue).pathname.split("/").pop(),We.next=6,Object(s.V)({attachment_id:He});case 6:Be=We.sent,C(Be);case 8:case"end":return We.stop()}},Me)}));return function(){return xe.apply(this,arguments)}}(),de=function(){if(l.startsWith("http")||l.startsWith("blob:")){ge();return}Object(h.z)(T||"educoder",l,T)},ge=function(){Object(h.x)(T||"educoder",decodeURIComponent(l))};return f.a.createElement("div",{style:Object(w.a)({},x||{}),className:"".concat(I&&o.a.bgBlack," ").concat(p?o.a.wrp:"hide")},M&&f.a.createElement("div",{className:o.a.close,ref:Ae},!W&&f.a.createElement(k.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ae.current}},f.a.createElement("span",{onClick:ge},f.a.createElement("i",{className:"icon-quxiaozhiding"}))),f.a.createElement(k.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ae.current}},f.a.createElement("span",{className:"",onClick:j},f.a.createElement("i",{className:"icon-guanbi1"})))),f.a.createElement("div",{className:"".concat(o.a[D]," ").concat(D," ").concat(o.a.monaco," ").concat(p==="txt"?"show":"hide")},p==="txt"&&f.a.createElement(r.b,L)),p==="audio"&&f.a.createElement("audio",{src:"".concat(((b=l)===null||b===void 0?void 0:b.indexOf("http://"))>-1||((m=l)===null||m===void 0?void 0:m.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(l),autoPlay:!0}),p==="video"&&f.a.createElement(f.a.Fragment,null,((g=l)===null||g===void 0?void 0:g.indexOf("http"))>-1?f.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):f.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),p==="office"&&O&&f.a.createElement("iframe",{src:"".concat(F,"/office.html?key=").concat(O.key,"&url=").concat(z+O.url,"&callbackUrl=").concat(z+O.callbackUrl,"&fileType=").concat(O.fileType,"&title=").concat(O.title,"&model=").concat(u,"&officeServer=").concat(n.a.OFFICE_SERVER,"&disabledDownload=").concat(!!W)}),p==="html"&&f.a.createElement("iframe",{src:l+"&disposition=inline"}),p==="pdf"&&f.a.createElement("iframe",{src:"".concat(F,"/js/pdfview/index.html?url=").concat(l,"&disabledDownload=").concat(!!W)}),p==="image"&&f.a.createElement("img",{src:"".concat(((E=l)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((_=l)===null||_===void 0?void 0:_.indexOf("https://"))>-1||(y=l)!==null&&y!==void 0&&y.startsWith("/api")?"":"data:image/png;base64,").concat(l)}),p==="other"&&f.a.createElement("div",null,f.a.createElement(B.a,{type:"primary",size:"large",onClick:de},f.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),p==="download"&&f.a.createElement(B.a,{type:"primary",size:"large",onClick:de},f.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Je,be,V){"use strict";V.d(be,"h",function(){return S}),V.d(be,"g",function(){return d}),V.d(be,"f",function(){return o}),V.d(be,"e",function(){return a}),V.d(be,"i",function(){return r}),V.d(be,"b",function(){return h}),V.d(be,"a",function(){return s}),V.d(be,"d",function(){return n}),V.d(be,"c",function(){return i});var ae=V("C/vA"),B=V("JYp7");const A=!1;let k=null;function w(t){k=t}if(A){const t="__is_disposable_tracked__";w(new class{trackDisposable(b){const m=new Error("Potentially leaked disposable").stack;setTimeout(()=>{b[t]||console.log(m)},3e3)}setParent(b,m){if(b&&b!==s.None)try{b[t]=!0}catch(g){}}markAsDisposed(b){if(b&&b!==s.None)try{b[t]=!0}catch(m){}}markAsSingleton(b){}})}function R(t){return k==null||k.trackDisposable(t),t}function H(t){k==null||k.markAsDisposed(t)}function U(t,b){k==null||k.setParent(t,b)}function e(t,b){if(!k)return;for(const m of t)k.setParent(m,b)}function S(t){return k==null||k.markAsSingleton(t),t}class f extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function d(t){return typeof t.dispose=="function"&&t.dispose.length===0}function o(t){if(B.a.is(t)){let b=[];for(const m of t)if(m)try{m.dispose()}catch(g){b.push(g)}if(b.length===1)throw b[0];if(b.length>1)throw new f(b);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function a(...t){const b=r(()=>o(t));return e(t,b),b}function r(t){const b=R({dispose:Object(ae.a)(()=>{H(b),t()})});return b}class h{constructor(){this._toDispose=new Set,this._isDisposed=!1,R(this)}dispose(){if(this._isDisposed)return;H(this),this._isDisposed=!0,this.clear()}clear(){try{o(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 U(t,this),this._isDisposed?h.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}h.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new h,R(this),U(this._store,this)}dispose(){H(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}s.None=Object.freeze({dispose(){}});class n{constructor(){this._isDisposed=!1,R(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var b;if(this._isDisposed||t===this._value)return;(b=this._value)===null||b===void 0||b.dispose(),t&&U(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,H(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&&U(t,null),t}}class i{constructor(t){this.object=t}dispose(){}}},psGv:function(Je,be,V){var ae,B;(function(){var A;(function(){"use strict";var H=[,,function(f){function d(r){this.__parent=r,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=[]}d.prototype.clone_empty=function(){var r=new d(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},d.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},d.prototype.has_match=function(r){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(r))return!0;return!1},d.prototype.set_indent=function(r,h){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.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)},d.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},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(r){this.__items.push(r);var h=r.lastIndexOf(`
|
|
`);h!==-1?this.__character_count=r.length-h:this.__character_count+=r.length},d.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function o(r,h){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),h=h||"",r.indent_level>0&&(h=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}o.prototype.get_indent_size=function(r,h){var s=this.__base_string_length;return h=h||0,r<0&&(s=0),s+=r*this.__indent_size,s+=h,s},o.prototype.get_indent_string=function(r,h){var s=this.__base_string;return h=h||0,r<0&&(r=0,s=""),h+=r*this.__indent_size,this.__ensure_cache(h),s+=this.__cache[h],s},o.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var r=this.__cache.length,h=0,s="";this.__indent_size&&r>=this.__indent_size&&(h=Math.floor(r/this.__indent_size),r-=h*this.__indent_size,s=new Array(h+1).join(this.__indent_string)),r&&(s+=new Array(r+1).join(" ")),this.__cache.push(s)};function a(r,h){this.__indent_cache=new o(r,h),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(r,h){return this.__indent_cache.get_indent_string(r,h)},a.prototype.get_indent_size=function(r,h){return this.__indent_cache.get_indent_size(r,h)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(r){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
|
|
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return r!==`
|
|
`&&(s=s.replace(/[\n]/g,r)),s},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(r,h){return r=r||0,h=h||0,this.next_line.set_indent(r,h),this.__lines.length>1?(this.current_line.set_indent(r,h),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(r){for(var h=0;h<r.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(r.whitespace_before),this.current_line.push(r.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(r){this.__add_space_before_token(),this.current_line.push(r),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.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(" "))},a.prototype.remove_indent=function(r){for(var h=this.__lines.length;r<h;)this.__lines[r]._remove_indent(),r++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(r){for(r=r===void 0?!1:r,this.current_line.trim();r&&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},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(r,h){for(var s=this.__lines.length-2;s>=0;){var n=this.__lines[s];if(n.is_empty())break;if(n.item(0).indexOf(r)!==0&&n.item(-1)!==h){this.__lines.splice(s+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},f.exports.Output=a},function(f){function d(o,a,r,h){this.type=o,this.text=a,this.comments_before=null,this.newlines=r||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}f.exports.Token=d},,,function(f){function d(r,h){this.raw_options=o(r,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}d.prototype._get_array=function(r,h){var s=this.raw_options[r],n=h||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(n=s.concat()):typeof s=="string"&&(n=s.split(/[^a-zA-Z0-9_\/\-]+/)),n},d.prototype._get_boolean=function(r,h){var s=this.raw_options[r],n=s===void 0?!!h:!!s;return n},d.prototype._get_characters=function(r,h){var s=this.raw_options[r],n=h||"";return typeof s=="string"&&(n=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),n},d.prototype._get_number=function(r,h){var s=this.raw_options[r];h=parseInt(h,10),isNaN(h)&&(h=0);var n=parseInt(s,10);return isNaN(n)&&(n=h),n},d.prototype._get_selection=function(r,h,s){var n=this._get_selection_list(r,h,s);if(n.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[r]+"'");return n[0]},d.prototype._get_selection_list=function(r,h,s){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[h[0]],!this._is_valid_selection(s,h))throw new Error("Invalid Default Value!");var n=this._get_array(r,s);if(!this._is_valid_selection(n,h))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[r]+"'");return n},d.prototype._is_valid_selection=function(r,h){return r.length&&h.length&&!r.some(function(s){return h.indexOf(s)===-1})};function o(r,h){var s={};r=a(r);var n;for(n in r)n!==h&&(s[n]=r[n]);if(h&&r[h])for(n in r[h])s[n]=r[h][n];return s}function a(r){var h={},s;for(s in r){var n=s.replace(/-/g,"_");h[n]=r[s]}return h}f.exports.Options=d,f.exports.normalizeOpts=a,f.exports.mergeOpts=o},,function(f){var d=RegExp.prototype.hasOwnProperty("sticky");function o(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position<this.__input_length},o.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},o.prototype.peek=function(a){var r=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(r=this.__input.charAt(a)),r},o.prototype.__match=function(a,r){a.lastIndex=r;var h=a.exec(this.__input);return h&&!(d&&a.sticky)&&(h.index!==r&&(h=null)),h},o.prototype.test=function(a,r){return r=r||0,r+=this.__position,r>=0&&r<this.__input_length?!!this.__match(a,r):!1},o.prototype.testChar=function(a,r){var h=this.peek(r);return a.lastIndex=0,h!==null&&a.test(h)},o.prototype.match=function(a){var r=this.__match(a,this.__position);return r?this.__position+=r[0].length:r=null,r},o.prototype.read=function(a,r,h){var s="",n;return a&&(n=this.match(a),n&&(s+=n[0])),r&&(n||!a)&&(s+=this.readUntil(r,h)),s},o.prototype.readUntil=function(a,r){var h="",s=this.__position;a.lastIndex=this.__position;var n=a.exec(this.__input);return n?(s=n.index,r&&(s+=n[0].length)):s=this.__input_length,h=this.__input.substring(this.__position,s),this.__position=s,h},o.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},o.prototype.get_regexp=function(a,r){var h=null,s="g";return r&&d&&(s="y"),typeof a=="string"&&a!==""?h=new RegExp(a,s):a&&(h=new RegExp(a.source,s)),h},o.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(a){var r=this.__position,h=this.readUntilAfter(a);return this.__position=r,h},o.prototype.lookBack=function(a){var r=this.__position-1;return r>=a.length&&this.__input.substring(r-a.length,r).toLowerCase()===a},f.exports.InputScanner=o},function(f,d,o){var a=o(8).InputScanner,r=o(3).Token,h=o(10).TokenStream,s=o(11).WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,b){this._input=new a(t),this._options=b||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var t,b=new r(n.START,""),m=null,g=[],E=new h;b.type!==n.EOF;){for(t=this._get_next_token(b,m);this._is_comment(t);)E.add(t),t=this._get_next_token(b,m);E.isEmpty()||(t.comments_before=E,E=new h),t.parent=m,this._is_opening(t)?(g.push(m),m=t):m&&this._is_closing(t,m)&&(t.opened=m,m.closed=t,m=g.pop(),t.parent=m),t.previous=b,b.next=t,this.__tokens.add(t),b=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,b){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(n.RAW,m):this._create_token(n.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,b){return!1},i.prototype._create_token=function(t,b){var m=new r(t,b,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},f.exports.Tokenizer=i,f.exports.TOKEN=n},function(f){function d(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position<this.__tokens_length},d.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},d.prototype.peek=function(o){var a=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(a=this.__tokens[o]),a},d.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},f.exports.TokenStream=d},function(f,d,o){var a=o(12).Pattern;function r(h,s){a.call(this,h,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}r.prototype=new a,r.prototype.__set_whitespace_patterns=function(h,s){h+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},r.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var s=this.__split(this._newline_regexp,h);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return h},r.prototype.matching=function(h,s){var n=this._create();return n.__set_whitespace_patterns(h,s),n._update(),n},r.prototype._create=function(){return new r(this._input,this)},r.prototype.__split=function(h,s){h.lastIndex=0;for(var n=0,i=[],t=h.exec(s);t;)i.push(s.substring(n,t.index)),n=t.index+t[0].length,t=h.exec(s);return n<s.length?i.push(s.substring(n,s.length)):i.push(""),i},f.exports.WhitespacePattern=r},function(f){function d(o,a){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}d.prototype.read=function(){var o=this._input.read(this._starting_pattern);return(!this._starting_pattern||o)&&(o+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),o},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(o){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(o),a._update(),a},d.prototype.until=function(o){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(o),a._update(),a},d.prototype.starting_with=function(o){var a=this._create();return a._starting_pattern=this._input.get_regexp(o,!0),a._update(),a},d.prototype.matching=function(o){var a=this._create();return a._match_pattern=this._input.get_regexp(o,!0),a._update(),a},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},f.exports.Pattern=d},function(f){function d(o,a){o=typeof o=="string"?o:o.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+a,"g")}d.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var r=this.__directive_pattern.exec(o);r;)a[r[1]]=r[2],r=this.__directive_pattern.exec(o);return a},d.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},f.exports.Directives=d},function(f,d,o){var a=o(12).Pattern,r={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(s,n){a.call(this,s,n),this.__template_pattern=null,this._disabled=Object.assign({},r),this._excluded=Object.assign({},r),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 i=new a(s);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new a,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(s){var n=this._create();return n._disabled[s]=!0,n._update(),n},h.prototype.read_options=function(s){var n=this._create();for(var i in r)n._disabled[i]=s.templating.indexOf(i)===-1;return n._update(),n},h.prototype.exclude=function(s){var n=this._create();return n._excluded[s]=!0,n._update(),n},h.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var n=this._read_template();n;)this._match_pattern?n+=this._input.read(this._match_pattern):n+=this._input.readUntil(this.__template_pattern),s+=n,n=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},h.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},h.prototype._read_template=function(){var s="",n=this._input.peek();if(n==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else n==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},f.exports.TemplatablePattern=h},,,,function(f,d,o){var a=o(19).Beautifier,r=o(20).Options;function h(s,n,i,t){var b=new a(s,n,i,t);return b.beautify()}f.exports=h,f.exports.defaultOptions=function(){return new r}},function(f,d,o){var a=o(20).Options,r=o(2).Output,h=o(21).Tokenizer,s=o(21).TOKEN,n=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,t=function(v,p){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=v.max_preserve_newlines,this.preserve_newlines=v.preserve_newlines,this._output=new r(v,p)};t.prototype.current_line_has_match=function(v){return this._output.current_line.has_match(v)},t.prototype.set_space_before_token=function(v,p){this._output.space_before_token=v,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(v){this._output.add_raw_token(v)},t.prototype.print_preserved_newlines=function(v){var p=0;v.type!==s.TEXT&&v.previous.type!==s.TEXT&&(p=v.newlines?1:0),this.preserve_newlines&&(p=v.newlines<this.max_preserve_newlines+1?v.newlines:this.max_preserve_newlines+1);for(var T=0;T<p;T++)this.print_newline(T>0);return p!==0},t.prototype.traverse_whitespace=function(v){return v.whitespace_before||v.newlines?(this.print_preserved_newlines(v)||(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(v){this._output.add_new_line(v)},t.prototype.print_token=function(v){v.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(v.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(v){return v=this.indent_level+(v||0),v<1?"":this._output.get_indent_string(v)};var b=function(v){for(var p=null,T=v.next;T.type!==s.EOF&&v.closed!==T;){if(T.type===s.ATTRIBUTE&&T.text==="type"){T.next&&T.next.type===s.EQUALS&&T.next.next&&T.next.next.type===s.VALUE&&(p=T.next.next.text);break}T=T.next}return p},m=function(v,p){var T=null,L=null;return p.closed?(v==="script"?T="text/javascript":v==="style"&&(T="text/css"),T=b(p)||T,T.search("text/css")>-1?L="css":T.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?L="javascript":T.search(/(text|application|dojo)\/(x-)?(html)/)>-1?L="html":T.search(/test\/null/)>-1&&(L="null"),L):null};function g(v,p){return p.indexOf(v)!==-1}function E(v,p,T){this.parent=v||null,this.tag=p?p.tag_name:"",this.indent_level=T||0,this.parser_token=p||null}function _(v){this._printer=v,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(v){var p=new E(this._current_frame,v,this._printer.indent_level);this._current_frame=p},_.prototype._try_pop_frame=function(v){var p=null;return v&&(p=v.parser_token,this._printer.indent_level=v.indent_level,this._current_frame=v.parent),p},_.prototype._get_frame=function(v,p){for(var T=this._current_frame;T&&!(v.indexOf(T.tag)!==-1);){if(p&&p.indexOf(T.tag)!==-1){T=null;break}T=T.parent}return T},_.prototype.try_pop=function(v,p){var T=this._get_frame([v],p);return this._try_pop_frame(T)},_.prototype.indent_to_tag=function(v){var p=this._get_frame(v);p&&(this._printer.indent_level=p.indent_level)};function y(v,p,T,L){this._source_text=v||"",p=p||{},this._js_beautify=T,this._css_beautify=L,this._tag_stack=null;var D=new a(p,"html");this._options=D,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}y.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,p=this._options.eol;this._options.eol==="auto"&&(p=`
|
|
`,v&&n.test(v)&&(p=v.match(n)[0])),v=v.replace(i,`
|
|
`);var T=v.match(/^[\t ]*/)[0],L={text:"",type:""},D=new c,x=new t(this._options,T),M=new h(v,this._options).tokenize();this._tag_stack=new _(x);for(var j=null,I=M.next();I.type!==s.EOF;)I.type===s.TAG_OPEN||I.type===s.COMMENT?(j=this._handle_tag_open(x,I,D,L),D=j):I.type===s.ATTRIBUTE||I.type===s.EQUALS||I.type===s.VALUE||I.type===s.TEXT&&!D.tag_complete?j=this._handle_inside_tag(x,I,D,M):I.type===s.TAG_CLOSE?j=this._handle_tag_close(x,I,D):I.type===s.TEXT?j=this._handle_text(x,I,D):x.add_raw_token(I),L=j,I=M.next();var W=x._output.get_code(p);return W},y.prototype._handle_tag_close=function(v,p,T){var L={text:p.text,type:p.type};return v.alignment_size=0,T.tag_complete=!0,v.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),T.is_unformatted?v.add_raw_token(p):(T.tag_start_char==="<"&&(v.set_space_before_token(p.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&T.has_wrapped_attrs&&v.print_newline(!1)),v.print_token(p)),T.indent_content&&!(T.is_unformatted||T.is_content_unformatted)&&(v.indent(),T.indent_content=!1),!T.is_inline_element&&!(T.is_unformatted||T.is_content_unformatted)&&v.set_wrap_point(),L},y.prototype._handle_inside_tag=function(v,p,T,L){var D=T.has_wrapped_attrs,x={text:p.text,type:p.type};if(v.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),T.is_unformatted)v.add_raw_token(p);else if(T.tag_start_char==="{"&&p.type===s.TEXT)v.print_preserved_newlines(p)?(p.newlines=0,v.add_raw_token(p)):v.print_token(p);else{if(p.type===s.ATTRIBUTE?(v.set_space_before_token(!0),T.attr_count+=1):(p.type===s.EQUALS||p.type===s.VALUE&&p.previous.type===s.EQUALS)&&v.set_space_before_token(!1),p.type===s.ATTRIBUTE&&T.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(v.traverse_whitespace(p),D=D||p.newlines!==0),this._is_wrap_attributes_force)){var M=T.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&T.attr_count===1){var j=!0,I=0,W;do{if(W=L.peek(I),W.type===s.ATTRIBUTE){j=!1;break}I+=1}while(I<4&&W.type!==s.EOF&&W.type!==s.TAG_CLOSE);M=!j}M&&(v.print_newline(!1),D=!0)}v.print_token(p),D=D||v.previous_token_wrapped(),T.has_wrapped_attrs=D}return x},y.prototype._handle_text=function(v,p,T){var L={text:p.text,type:"TK_CONTENT"};return T.custom_beautifier_name?this._print_custom_beatifier_text(v,p,T):T.is_unformatted||T.is_content_unformatted?v.add_raw_token(p):(v.traverse_whitespace(p),v.print_token(p)),L},y.prototype._print_custom_beatifier_text=function(v,p,T){var L=this;if(p.text!==""){var D=p.text,x,M=1,j="",I="";T.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?x=this._js_beautify:T.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?x=this._css_beautify:T.custom_beautifier_name==="html"&&(x=function(Oe,Re){var Le=new y(Oe,Re,L._js_beautify,L._css_beautify);return Le.beautify()}),this._options.indent_scripts==="keep"?M=0:this._options.indent_scripts==="separate"&&(M=-v.indent_level);var W=v.get_full_indent(M);if(D=D.replace(/\n[ \t]*$/,""),T.custom_beautifier_name!=="html"&&D[0]==="<"&&D.match(/^(<!--|<!\[CDATA\[)/)){var Q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(D);if(!Q){v.add_raw_token(p);return}j=W+Q[1]+`
|
|
`,D=Q[4],Q[5]&&(I=W+Q[5]),D=D.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(`
|
|
`)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(p.whitespace_before=Q[0]))}if(D)if(x){var fe=function(){this.eol=`
|
|
`};fe.prototype=this._options.raw_options;var le=new fe;D=x(W+D,le)}else{var Ce=p.whitespace_before;Ce&&(D=D.replace(new RegExp(`
|
|
(`+Ce+")?","g"),`
|
|
`)),D=W+D.replace(/\n/g,`
|
|
`+W)}j&&(D?D=j+D+`
|
|
`+I:D=j+I),v.print_newline(!1),D&&(p.text=D,p.whitespace_before="",p.newlines=0,v.add_raw_token(p),v.print_newline(!0))}},y.prototype._handle_tag_open=function(v,p,T,L){var D=this._get_tag_open_token(p);return(T.is_unformatted||T.is_content_unformatted)&&!T.is_empty_element&&p.type===s.TAG_OPEN&&p.text.indexOf("</")===0?(v.add_raw_token(p),D.start_tag_token=this._tag_stack.try_pop(D.tag_name)):(v.traverse_whitespace(p),this._set_tag_position(v,p,D,T,L),D.is_inline_element||v.set_wrap_point(),v.print_token(p)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(D.alignment_size=p.text.length+1),!D.tag_complete&&!D.is_unformatted&&(v.alignment_size=D.alignment_size),D};var c=function(v,p){if(this.parent=v||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 T;this.tag_start_char=p.text[0],this.text=p.text,this.tag_start_char==="<"?(T=p.text.match(/^<([^\s>]*)/),this.tag_check=T?T[1]:""):(T=p.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=T?T[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===s.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 L=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(L=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(L)))}};y.prototype._get_tag_open_token=function(v){var p=new c(this._tag_stack.get_parser_token(),v);return p.alignment_size=this._options.wrap_attributes_indent_size,p.is_end_tag=p.is_end_tag||g(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&&g(p.tag_check,this._options.unformatted),p.is_content_unformatted=!p.is_empty_element&&g(p.tag_check,this._options.content_unformatted),p.is_inline_element=g(p.tag_name,this._options.inline)||p.tag_name.includes("-")||p.tag_start_char==="{",p},y.prototype._set_tag_position=function(v,p,T,L,D){if(T.is_empty_element||(T.is_end_tag?T.start_tag_token=this._tag_stack.try_pop(T.tag_name):(this._do_optional_end_element(T)&&(T.is_inline_element||v.print_newline(!1)),this._tag_stack.record_tag(T),(T.tag_name==="script"||T.tag_name==="style")&&!(T.is_unformatted||T.is_content_unformatted)&&(T.custom_beautifier_name=m(T.tag_check,p)))),g(T.tag_check,this._options.extra_liners)&&(v.print_newline(!1),v._output.just_added_blankline()||v.print_newline(!0)),T.is_empty_element){if(T.tag_start_char==="{"&&T.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),T.indent_content=!0;var x=v.current_line_has_match(/{{#if/);x||v.print_newline(!1)}T.tag_name==="!--"&&D.type===s.TAG_CLOSE&&L.is_end_tag&&T.text.indexOf(`
|
|
`)===-1||(T.is_inline_element||T.is_unformatted||v.print_newline(!1),this._calcluate_parent_multiline(v,T))}else if(T.is_end_tag){var M=!1;M=T.start_tag_token&&T.start_tag_token.multiline_content,M=M||!T.is_inline_element&&!(L.is_inline_element||L.is_unformatted)&&!(D.type===s.TAG_CLOSE&&T.start_tag_token===L)&&D.type!=="TK_CONTENT",(T.is_content_unformatted||T.is_unformatted)&&(M=!1),M&&v.print_newline(!1)}else T.indent_content=!T.custom_beautifier_name,T.tag_start_char==="<"&&(T.tag_name==="html"?T.indent_content=this._options.indent_inner_html:T.tag_name==="head"?T.indent_content=this._options.indent_head_inner_html:T.tag_name==="body"&&(T.indent_content=this._options.indent_body_inner_html)),!(T.is_inline_element||T.is_unformatted)&&(D.type!=="TK_CONTENT"||T.is_content_unformatted)&&v.print_newline(!1),this._calcluate_parent_multiline(v,T)},y.prototype._calcluate_parent_multiline=function(v,p){p.parent&&v._output.just_added_newline()&&!((p.is_inline_element||p.is_unformatted)&&p.parent.is_inline_element)&&(p.parent.multiline_content=!0)};var u=["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"],l=["a","audio","del","ins","map","noscript","video"];y.prototype._do_optional_end_element=function(v){var p=null;if(v.is_empty_element||!v.is_start_tag||!v.parent)return;if(v.tag_name==="body")p=p||this._tag_stack.try_pop("head");else if(v.tag_name==="li")p=p||this._tag_stack.try_pop("li",["ol","ul"]);else if(v.tag_name==="dd"||v.tag_name==="dt")p=p||this._tag_stack.try_pop("dt",["dl"]),p=p||this._tag_stack.try_pop("dd",["dl"]);else if(v.parent.tag_name==="p"&&u.indexOf(v.tag_name)!==-1){var T=v.parent.parent;(!T||l.indexOf(T.tag_name)===-1)&&(p=p||this._tag_stack.try_pop("p"))}else v.tag_name==="rp"||v.tag_name==="rt"?(p=p||this._tag_stack.try_pop("rt",["ruby","rtc"]),p=p||this._tag_stack.try_pop("rp",["ruby","rtc"])):v.tag_name==="optgroup"?p=p||this._tag_stack.try_pop("optgroup",["select"]):v.tag_name==="option"?p=p||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):v.tag_name==="colgroup"?p=p||this._tag_stack.try_pop("caption",["table"]):v.tag_name==="thead"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"])):v.tag_name==="tbody"||v.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"])):v.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"])):(v.tag_name==="th"||v.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 v.parent=this._tag_stack.get_parser_token(),p},f.exports.Beautifier=y},function(f,d,o){var a=o(6).Options;function r(h){a.call(this,h,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}r.prototype=new a,f.exports.Options=r},function(f,d,o){var a=o(9).Tokenizer,r=o(9).TOKEN,h=o(13).Directives,s=o(14).TemplatablePattern,n=o(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},t=new h(/<\!--/,/-->/),b=function(m,g){a.call(this,m,g),this._current_tag_name="";var E=new s(this._input).read_options(this._options),_=new n(this._input);if(this.__patterns={word:E.until(/[\n\r\t <]/),single_quote:E.until_after(/'/),double_quote:E.until_after(/"/),attribute:E.until(/[\n\r\t =>]|\/>/),element_name:E.until(/[\n\r\t >\/]/),handlebars_comment:_.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 y=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=_.matching(y).until_after(y)}};b.prototype=new a,b.prototype._is_comment=function(m){return!1},b.prototype._is_opening=function(m){return m.type===i.TAG_OPEN},b.prototype._is_closing=function(m,g){return m.type===i.TAG_CLOSE&&g&&((m.text===">"||m.text==="/>")&&g.text[0]==="<"||m.text==="}}"&&g.text[0]==="{"&&g.text[1]==="{")},b.prototype._reset=function(){this._current_tag_name=""},b.prototype._get_next_token=function(m,g){var E=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(i.EOF,""):(E=E||this._read_open_handlebars(_,g),E=E||this._read_attribute(_,m,g),E=E||this._read_close(_,g),E=E||this._read_raw_content(_,m,g),E=E||this._read_content_word(_),E=E||this._read_comment_or_cdata(_),E=E||this._read_processing(_),E=E||this._read_open(_,g),E=E||this._create_token(i.UNKNOWN,this._input.next()),E)},b.prototype._read_comment_or_cdata=function(m){var g=null,E=null,_=null;if(m==="<"){var y=this._input.peek(1);y==="!"&&(E=this.__patterns.comment.read(),E?(_=t.get_directives(E),_&&_.ignore==="start"&&(E+=t.readIgnored(this._input))):E=this.__patterns.cdata.read()),E&&(g=this._create_token(i.COMMENT,E),g.directives=_)}return g},b.prototype._read_processing=function(m){var g=null,E=null,_=null;if(m==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(E=this.__patterns.conditional_comment.read(),E=E||this.__patterns.processing.read()),E&&(g=this._create_token(i.COMMENT,E),g.directives=_)}return g},b.prototype._read_open=function(m,g){var E=null,_=null;return g||m==="<"&&(E=this._input.next(),this._input.peek()==="/"&&(E+=this._input.next()),E+=this.__patterns.element_name.read(),_=this._create_token(i.TAG_OPEN,E)),_},b.prototype._read_open_handlebars=function(m,g){var E=null,_=null;return g||this._options.indent_handlebars&&m==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(E=this.__patterns.handlebars_comment.read(),E=E||this.__patterns.handlebars.read(),_=this._create_token(i.COMMENT,E)):(E=this.__patterns.handlebars_open.read(),_=this._create_token(i.TAG_OPEN,E))),_},b.prototype._read_close=function(m,g){var E=null,_=null;return g&&(g.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(E=this._input.next(),m==="/"&&(E+=this._input.next()),_=this._create_token(i.TAG_CLOSE,E)):g.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(i.TAG_CLOSE,"}}"))),_},b.prototype._read_attribute=function(m,g,E){var _=null,y="";if(E&&E.text[0]==="<")if(m==="=")_=this._create_token(i.EQUALS,this._input.next());else if(m==='"'||m==="'"){var c=this._input.next();m==='"'?c+=this.__patterns.double_quote.read():c+=this.__patterns.single_quote.read(),_=this._create_token(i.VALUE,c)}else y=this.__patterns.attribute.read(),y&&(g.type===i.EQUALS?_=this._create_token(i.VALUE,y):_=this._create_token(i.ATTRIBUTE,y));return _},b.prototype._is_content_unformatted=function(m){return this._options.void_elements.indexOf(m)===-1&&(this._options.content_unformatted.indexOf(m)!==-1||this._options.unformatted.indexOf(m)!==-1)},b.prototype._read_raw_content=function(m,g,E){var _="";if(E&&E.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(g.type===i.TAG_CLOSE&&g.opened.text[0]==="<"&&g.text[0]!=="/"){var y=g.opened.text.substr(1).toLowerCase();if(y==="script"||y==="style"){var c=this._read_comment_or_cdata(m);if(c)return c.type=i.TEXT,c;_=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(y)&&(_=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(i.TEXT,_):null},b.prototype._read_content_word=function(m){var g="";if(this._options.unformatted_content_delimiter&&(m===this._options.unformatted_content_delimiter[0]&&(g=this.__patterns.unformatted_content_delimiter.read())),g||(g=this.__patterns.word.read()),g)return this._create_token(i.TEXT,g)},f.exports.Tokenizer=b,f.exports.TOKEN=i}],U={};function e(f){var d=U[f];if(d!==void 0)return d.exports;var o=U[f]={exports:{}};return H[f](o,o.exports,e),o.exports}var S=e(18);A=S})();var k=A;if(!0)!(ae=[V,V("6UM0"),V("TXwP")],B=function(H){var U=V("6UM0"),e=V("TXwP");return{html_beautify:function(S,f){return k(S,f,U.js_beautify,e.css_beautify)}}}.apply(be,ae),B!==void 0&&(Je.exports=B));else var w,R})()},"rAM+":function(Je,be,V){"use strict";V.d(be,"a",function(){return B});var ae=V("Qw5x");function B(A,k){var w;if(typeof Symbol=="undefined"||A[Symbol.iterator]==null){if(Array.isArray(A)||(w=Object(ae.a)(A))||k&&A&&typeof A.length=="number"){w&&(A=w);var R=0,H=function(){};return{s:H,n:function(){return R>=A.length?{done:!0}:{done:!1,value:A[R++]}},e:function(d){throw d},f:H}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,e=!1,S;return{s:function(){w=A[Symbol.iterator]()},n:function(){var d=w.next();return U=d.done,d},e:function(d){e=!0,S=d},f:function(){try{!U&&w.return!=null&&w.return()}finally{if(e)throw S}}}}},rUJ1:function(Je,be){const V=/[&<>"']/,ae=/[&<>"']/g,B=/[<>"']|&(?!#?\w+;)/,A=/[<>"']|&(?!#?\w+;)/g,k={"&":"&","<":"<",">":">",'"':""","'":"'"},w=_=>k[_];function R(_,y){if(y){if(V.test(_))return _.replace(ae,w)}else if(B.test(_))return _.replace(A,w);return _}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(_){return _.replace(H,(y,c)=>(c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""))}const e=/(^|[^\[])\^/g;function S(_,y){_=_.source||_,y=y||"";const c={replace:(u,l)=>(l=l.source||l,l=l.replace(e,"$1"),_=_.replace(u,l),c),getRegex:()=>new RegExp(_,y)};return c}const f=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function o(_,y,c){if(_){let u;try{u=decodeURIComponent(U(c)).replace(f,"").toLowerCase()}catch(l){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}y&&!d.test(c)&&(c=n(y,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(u){return null}return c}const a={},r=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(_,y){a[" "+_]||(r.test(_)?a[" "+_]=_+"/":a[" "+_]=m(_,"/",!0)),_=a[" "+_];const c=_.indexOf(":")===-1;return y.substring(0,2)==="//"?c?y:_.replace(h,"$1")+y:y.charAt(0)==="/"?c?y:_.replace(s,"$1")+y:_+y}const i={exec:function(){}};function t(_){let y=1,c,u;for(;y<arguments.length;y++){c=arguments[y];for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(_[u]=c[u])}return _}function b(_,y){const c=_.replace(/\|/g,(v,p,T)=>{let L=!1,D=p;for(;--D>=0&&T[D]==="\\";)L=!L;return L?"|":" |"}),u=c.split(/ \|/);let l=0;if(u.length>y)u.splice(y);else for(;u.length<y;)u.push("");for(;l<u.length;l++)u[l]=u[l].trim().replace(/\\\|/g,"|");return u}function m(_,y,c){const u=_.length;if(u===0)return"";let l=0;for(;l<u;){const v=_.charAt(u-l-1);if(v===y&&!c)l++;else if(v!==y&&c)l++;else break}return _.substr(0,u-l)}function g(_,y){if(_.indexOf(y[1])===-1)return-1;const c=_.length;let u=0,l=0;for(;l<c;l++)if(_[l]==="\\")l++;else if(_[l]===y[0])u++;else if(_[l]===y[1]&&(u--,u<0))return l;return-1}function E(_){_&&_.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")}Je.exports={escape:R,unescape:U,edit:S,cleanUrl:o,resolveUrl:n,noopTest:i,merge:t,splitCells:b,rtrim:m,findClosingBracket:g,checkSanitizeDeprecation:E}},t23M:function(Je,be,V){"use strict";var ae=V("VTBJ"),B=V("1OyB"),A=V("vuIU"),k=V("Ji7U"),w=V("LK+K"),R=V("q1tI"),H=V.n(R),U=V("m+aA"),e=V("Zm9Q"),S=V("Kwbf"),f=V("c+Xe"),d=V("bdgK"),o="rc-observer-key",a=function(r){Object(k.a)(s,r);var h=Object(w.a)(s);function s(){var n;return Object(B.a)(this,s),n=h.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(i){var t=n.props.onResize,b=i[0].target,m=b.getBoundingClientRect(),g=m.width,E=m.height,_=b.offsetWidth,y=b.offsetHeight,c=Math.floor(g),u=Math.floor(E);if(n.state.width!==c||n.state.height!==u||n.state.offsetWidth!==_||n.state.offsetHeight!==y){var l={width:c,height:u,offsetWidth:_,offsetHeight:y};n.setState(l),t&&Promise.resolve().then(function(){t(Object(ae.a)(Object(ae.a)({},l),{},{offsetWidth:_,offsetHeight:y}))})}},n.setChildNode=function(i){n.childNode=i},n}return Object(A.a)(s,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var t=Object(U.a)(this.childNode||this),b=t!==this.currentElement;b&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new d.default(this.onResize),this.resizeObserver.observe(t))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,t=Object(e.a)(i);if(t.length>1)Object(S.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(t.length===0)return Object(S.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var b=t[0];if(R.isValidElement(b)&&Object(f.c)(b)){var m=b.ref;t[0]=R.cloneElement(b,{ref:Object(f.a)(m,this.setChildNode)})}return t.length===1?t[0]:t.map(function(g,E){return!R.isValidElement(g)||"key"in g&&g.key!==null?g:R.cloneElement(g,{key:"".concat(o,"-").concat(E)})})}}]),s}(R.Component);a.displayName="ResizeObserver",be.a=a},t9D7:function(Je,be,V){"use strict";V.d(be,"b",function(){return H}),V.d(be,"g",function(){return e}),V.d(be,"d",function(){return S}),V.d(be,"e",function(){return f}),V.d(be,"a",function(){return d}),V.d(be,"f",function(){return r}),V.d(be,"c",function(){return h});var ae=V("Vhoy"),B=V("MI8n"),A=V("pmY6"),k=V("Cg/j"),w=V("ic2d"),R=V("nEHx");const H=Object(k.c)("themeService");var U;(function(s){function n(i){return i&&typeof i=="object"&&typeof i.id=="string"}s.isThemeColor=n})(U||(U={}));function e(s){return{id:s}}var S;(function(s){function n(E){return E&&typeof E=="object"&&typeof E.id=="string"&&(typeof E.color=="undefined"||U.isThemeColor(E.color))}s.isThemeIcon=n;const i=new RegExp(`^\\$\\((${ae.a.iconNameExpression}(?:${ae.a.iconModifierExpression})?)\\)$`);function t(E){const _=i.exec(E);if(!_)return;let[,y]=_;return{id:y}}s.fromString=t;function b(E,_){let y=E.id;const c=y.lastIndexOf("~");return c!==-1&&(y=y.substring(0,c)),_&&(y=`${y}~${_}`),{id:y}}s.modify=b;function m(E,_){var y,c;return E.id===_.id&&((y=E.color)===null||y===void 0?void 0:y.id)===((c=_.color)===null||c===void 0?void 0:c.id)}s.isEqual=m;function g(E,_){return{id:E.id,color:_?e(_):void 0}}s.asThemeIcon=g,s.asClassNameArray=ae.a.asClassNameArray,s.asClassName=ae.a.asClassName,s.asCSSSelector=ae.a.asCSSSelector})(S||(S={}));function f(s){switch(s){case R.a.DARK:return"vs-dark";case R.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const d={ThemingContribution:"base.contributions.theming"};class o{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(A.i)(()=>{const n=this.themingParticipants.indexOf(s);this.themingParticipants.splice(n,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new o;w.a.add(d.ThemingContribution,a);function r(s){return a.onColorThemeChange(s)}class h extends A.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(n=>this.onThemeChange(n)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(Je,be,V){typeof window!="undefined"&&function(B,A){Je.exports=A()}(this,function(){return function(ae){var B={};function A(k){if(B[k])return B[k].exports;var w=B[k]={i:k,l:!1,exports:{}};return ae[k].call(w.exports,w,w.exports,A),w.l=!0,w.exports}return A.m=ae,A.c=B,A.d=function(k,w,R){A.o(k,w)||Object.defineProperty(k,w,{enumerable:!0,get:R})},A.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},A.t=function(k,w){if(w&1&&(k=A(k)),w&8)return k;if(w&4&&typeof k=="object"&&k&&k.__esModule)return k;var R=Object.create(null);if(A.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:k}),w&2&&typeof k!="string")for(var H in k)A.d(R,H,function(U){return k[U]}.bind(null,H));return R},A.n=function(k){var w=k&&k.__esModule?function(){return k.default}:function(){return k};return A.d(w,"a",w),w},A.o=function(k,w){return Object.prototype.hasOwnProperty.call(k,w)},A.p="/dist/",A(A.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ae,B,A){"use strict";var k=Object.prototype.hasOwnProperty,w="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(w=!1));function H(f,d,o){this.fn=f,this.context=d,this.once=o||!1}function U(f,d,o,a,r){if(typeof o!="function")throw new TypeError("The listener must be a function");var h=new H(o,a||f,r),s=w?w+d:d;return f._events[s]?f._events[s].fn?f._events[s]=[f._events[s],h]:f._events[s].push(h):(f._events[s]=h,f._eventsCount++),f}function e(f,d){--f._eventsCount===0?f._events=new R:delete f._events[d]}function S(){this._events=new R,this._eventsCount=0}S.prototype.eventNames=function(){var d=[],o,a;if(this._eventsCount===0)return d;for(a in o=this._events)k.call(o,a)&&d.push(w?a.slice(1):a);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(o)):d},S.prototype.listeners=function(d){var o=w?w+d:d,a=this._events[o];if(!a)return[];if(a.fn)return[a.fn];for(var r=0,h=a.length,s=new Array(h);r<h;r++)s[r]=a[r].fn;return s},S.prototype.listenerCount=function(d){var o=w?w+d:d,a=this._events[o];return a?a.fn?1:a.length:0},S.prototype.emit=function(d,o,a,r,h,s){var n=w?w+d:d;if(!this._events[n])return!1;var i=this._events[n],t=arguments.length,b,m;if(i.fn){i.once&&this.removeListener(d,i.fn,void 0,!0);switch(t){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,o),!0;case 3:return i.fn.call(i.context,o,a),!0;case 4:return i.fn.call(i.context,o,a,r),!0;case 5:return i.fn.call(i.context,o,a,r,h),!0;case 6:return i.fn.call(i.context,o,a,r,h,s),!0}for(m=1,b=new Array(t-1);m<t;m++)b[m-1]=arguments[m];i.fn.apply(i.context,b)}else{var g=i.length,E;for(m=0;m<g;m++){i[m].once&&this.removeListener(d,i[m].fn,void 0,!0);switch(t){case 1:i[m].fn.call(i[m].context);break;case 2:i[m].fn.call(i[m].context,o);break;case 3:i[m].fn.call(i[m].context,o,a);break;case 4:i[m].fn.call(i[m].context,o,a,r);break;default:if(!b)for(E=1,b=new Array(t-1);E<t;E++)b[E-1]=arguments[E];i[m].fn.apply(i[m].context,b)}}}return!0},S.prototype.on=function(d,o,a){return U(this,d,o,a,!1)},S.prototype.once=function(d,o,a){return U(this,d,o,a,!0)},S.prototype.removeListener=function(d,o,a,r){var h=w?w+d:d;if(!this._events[h])return this;if(!o)return e(this,h),this;var s=this._events[h];if(s.fn)s.fn===o&&(!r||s.once)&&(!a||s.context===a)&&e(this,h);else{for(var n=0,i=[],t=s.length;n<t;n++)(s[n].fn!==o||r&&!s[n].once||a&&s[n].context!==a)&&i.push(s[n]);i.length?this._events[h]=i.length===1?i[0]:i:e(this,h)}return this},S.prototype.removeAllListeners=function(d){var o;return d?(o=w?w+d:d,this._events[o]&&e(this,o)):(this._events=new R,this._eventsCount=0),this},S.prototype.off=S.prototype.removeListener,S.prototype.addListener=S.prototype.on,S.prefixed=w,S.EventEmitter=S,ae.exports=S},"./node_modules/url-toolkit/src/url-toolkit.js":function(ae,B,A){(function(k){var w=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(S,f,d){if(d=d||{},S=S.trim(),f=f.trim(),!f){if(!d.alwaysNormalize)return S;var o=e.parseURL(S);if(!o)throw new Error("Error trying to parse base URL.");return o.path=e.normalizePath(o.path),e.buildURLFromParts(o)}var a=e.parseURL(f);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return d.alwaysNormalize?(a.path=e.normalizePath(a.path),e.buildURLFromParts(a)):f;var r=e.parseURL(S);if(!r)throw new Error("Error trying to parse base URL.");if(!r.netLoc&&r.path&&r.path[0]!=="/"){var h=R.exec(r.path);r.netLoc=h[1],r.path=h[2]}r.netLoc&&!r.path&&(r.path="/");var s={scheme:r.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(s.netLoc=r.netLoc,a.path[0]!=="/"))if(!a.path)s.path=r.path,a.params||(s.params=r.params,a.query||(s.query=r.query));else{var n=r.path,i=n.substring(0,n.lastIndexOf("/")+1)+a.path;s.path=e.normalizePath(i)}return s.path===null&&(s.path=d.alwaysNormalize?e.normalizePath(a.path):a.path),e.buildURLFromParts(s)},parseURL:function(S){var f=w.exec(S);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(S){for(S=S.split("").reverse().join("").replace(H,"");S.length!==(S=S.replace(U,"")).length;);return S.split("").reverse().join("")},buildURLFromParts:function(S){return S.scheme+S.netLoc+S.path+S.params+S.query+S.fragment}};ae.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(ae,B,A){function k(d){var o={};function a(h){if(o[h])return o[h].exports;var s=o[h]={i:h,l:!1,exports:{}};return d[h].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=d,a.c=o,a.i=function(h){return h},a.d=function(h,s,n){a.o(h,s)||Object.defineProperty(h,s,{configurable:!1,enumerable:!0,get:n})},a.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},a.n=function(h){var s=h&&h.__esModule?function(){return h.default}:function(){return h};return a.d(s,"a",s),s},a.o=function(h,s){return Object.prototype.hasOwnProperty.call(h,s)},a.p="/",a.oe=function(h){throw console.error(h),h};var r=a(a.s=ENTRY_MODULE);return r.default||r}var w="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+w+").*?\\)";function H(d){return(d+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(d){return!isNaN(1*d)}function e(d,o,a){var r={};r[a]=[];var h=o.toString(),s=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return r;for(var n=s[1],i=new RegExp("(\\\\n|\\W)"+H(n)+R,"g"),t;t=i.exec(h);){if(t[3]==="dll-reference")continue;r[a].push(t[3])}for(i=new RegExp("\\("+H(n)+'\\("(dll-reference\\s('+w+'))"\\)\\)'+R,"g");t=i.exec(h);)d[t[2]]||(r[a].push(t[1]),d[t[2]]=A(t[1]).m),r[t[2]]=r[t[2]]||[],r[t[2]].push(t[4]);for(var b=Object.keys(r),m=0;m<b.length;m++)for(var g=0;g<r[b[m]].length;g++)U(r[b[m]][g])&&(r[b[m]][g]=1*r[b[m]][g]);return r}function S(d){var o=Object.keys(d);return o.reduce(function(a,r){return a||d[r].length>0},!1)}function f(d,o){for(var a={main:[o]},r={main:[]},h={main:{}};S(a);)for(var s=Object.keys(a),n=0;n<s.length;n++){var i=s[n],t=a[i],b=t.pop();if(h[i]=h[i]||{},h[i][b]||!d[i][b])continue;h[i][b]=!0,r[i]=r[i]||[],r[i].push(b);for(var m=e(d,d[i][b],i),g=Object.keys(m),E=0;E<g.length;E++)a[g[E]]=a[g[E]]||[],a[g[E]]=a[g[E]].concat(m[g[E]])}return r}ae.exports=function(d,o){o=o||{};var a={main:A.m},r=o.all?{main:Object.keys(a.main)}:f(a,d),h="";Object.keys(r).filter(function(b){return b!=="main"}).forEach(function(b){for(var m=0;r[b][m];)m++;r[b].push(m),a[b][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",h=h+"var "+b+" = ("+k.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+r[b].map(function(g){return""+JSON.stringify(g)+": "+a[b][g].toString()}).join(",")+`});
|
|
`}),h=h+"new (("+k.toString().replace("ENTRY_MODULE",JSON.stringify(d))+")({"+r.main.map(function(b){return""+JSON.stringify(b)+": "+a.main[b].toString()}).join(",")+"}))(self);";var s=new window.Blob([h],{type:"text/javascript"});if(o.bare)return s;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,i=n.createObjectURL(s),t=new window.Worker(i);return t.objectURL=i,t}},"./src/config.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"hlsDefaultConfig",function(){return E}),A.d(B,"mergeConfig",function(){return y}),A.d(B,"enableStreamingMode",function(){return c});var k=A("./src/controller/abr-controller.ts"),w=A("./src/controller/audio-stream-controller.ts"),R=A("./src/controller/audio-track-controller.ts"),H=A("./src/controller/subtitle-stream-controller.ts"),U=A("./src/controller/subtitle-track-controller.ts"),e=A("./src/controller/buffer-controller.ts"),S=A("./src/controller/timeline-controller.ts"),f=A("./src/controller/cap-level-controller.ts"),d=A("./src/controller/fps-controller.ts"),o=A("./src/controller/eme-controller.ts"),a=A("./src/controller/cmcd-controller.ts"),r=A("./src/utils/xhr-loader.ts"),h=A("./src/utils/fetch-loader.ts"),s=A("./src/utils/cues.ts"),n=A("./src/utils/mediakeys-helper.ts"),i=A("./src/utils/logger.ts");function t(){return t=Object.assign||function(u){for(var l=1;l<arguments.length;l++){var v=arguments[l];for(var p in v)Object.prototype.hasOwnProperty.call(v,p)&&(u[p]=v[p])}return u},t.apply(this,arguments)}function b(u,l){var v=Object.keys(u);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(u);l&&(p=p.filter(function(T){return Object.getOwnPropertyDescriptor(u,T).enumerable})),v.push.apply(v,p)}return v}function m(u){for(var l=1;l<arguments.length;l++){var v=arguments[l]!=null?arguments[l]:{};l%2?b(Object(v),!0).forEach(function(p){g(u,p,v[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(v)):b(Object(v)).forEach(function(p){Object.defineProperty(u,p,Object.getOwnPropertyDescriptor(v,p))})}return u}function g(u,l,v){return l in u?Object.defineProperty(u,l,{value:v,enumerable:!0,configurable:!0,writable:!0}):u[l]=v,u}var E=m(m({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:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:k.default,bufferController:e.default,capLevelController:f.default,fpsController:d.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:H.SubtitleStreamController,subtitleTrackController:U.default,timelineController:S.TimelineController,audioStreamController:w.default,audioTrackController:R.default,emeController:o.default,cmcdController:a.default});function _(){return{cueHandler:s.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 y(u,l){if((l.liveSyncDurationCount||l.liveMaxLatencyDurationCount)&&(l.liveSyncDuration||l.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(l.liveMaxLatencyDurationCount!==void 0&&(l.liveSyncDurationCount===void 0||l.liveMaxLatencyDurationCount<=l.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(l.liveMaxLatencyDuration!==void 0&&(l.liveSyncDuration===void 0||l.liveMaxLatencyDuration<=l.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},u,l)}function c(u){var l=u.loader;if(l!==h.default&&l!==r.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var v=Object(h.fetchSupported)();v&&(u.loader=h.default,u.progressive=!0,u.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/polyfills/number.ts"),w=A("./src/utils/ewma-bandwidth-estimator.ts"),R=A("./src/events.ts"),H=A("./src/utils/buffer-helper.ts"),U=A("./src/errors.ts"),e=A("./src/types/loader.ts"),S=A("./src/utils/logger.ts");function f(a,r){for(var h=0;h<r.length;h++){var s=r[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function d(a,r,h){return r&&f(a.prototype,r),h&&f(a,h),a}var o=function(){function a(h){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=h;var s=h.config;this.bwEstimator=new w.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var r=a.prototype;return r.registerListeners=function(){var s=this.hls;s.on(R.Events.FRAG_LOADING,this.onFragLoading,this),s.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(R.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var s=this.hls;s.off(R.Events.FRAG_LOADING,this.onFragLoading,this),s.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(R.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},r.onFragLoading=function(s,n){var i=n.frag;if(i.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=i,this.partCurrent=(t=n.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},r.onLevelLoaded=function(s,n){var i=this.hls.config;n.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},r._abandonRulesCheck=function(){var s=this.fragCurrent,n=this.partCurrent,i=this.hls,t=i.autoLevelEnabled,b=i.config,m=i.media;if(!s||!m)return;var g=n?n.stats:s.stats,E=n?n.duration:s.duration;if(g.aborted){S.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||m.paused||!m.playbackRate||!m.readyState)return;var _=performance.now()-g.loading.start,y=Math.abs(m.playbackRate);if(_<=500*E/y)return;var c=i.levels,u=i.minAutoLevel,l=c[s.level],v=g.total||Math.max(g.loaded,Math.round(E*l.maxBitrate/8)),p=Math.max(1,g.bwEstimate?g.bwEstimate/8:g.loaded*1e3/_),T=(v-g.loaded)/p,L=m.currentTime,D=(H.BufferHelper.bufferInfo(m,L,b.maxBufferHole).end-L)/y;if(D>=2*E/y||T<=D)return;var x=Number.POSITIVE_INFINITY,M;for(M=s.level-1;M>u;M--){var j=c[M].maxBitrate;if(x=E*j/(8*.8*p),x<D)break}if(x>=T)return;var I=this.bwEstimator.getEstimate();S.logger.warn("Fragment "+s.sn+(n?" part "+n.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+M+`
|
|
Current BW estimate: `+(Object(k.isFiniteNumber)(I)?(I/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+T.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+x.toFixed(3)+` s
|
|
Time to underbuffer: `+D.toFixed(3)+" s"),i.nextLoadLevel=M,this.bwEstimator.sample(_,g.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),i.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:n,stats:g})},r.onFragLoaded=function(s,n){var i=n.frag,t=n.part;if(i.type===e.PlaylistLevelType.MAIN&&Object(k.isFiniteNumber)(i.sn)){var b=t?t.stats:i.stats,m=t?t.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var g=this.hls.levels[i.level],E=(g.loaded?g.loaded.bytes:0)+b.loaded,_=(g.loaded?g.loaded.duration:0)+m;g.loaded={bytes:E,duration:_},g.realBitrate=Math.round(8*E/_)}if(i.bitrateTest){var y={stats:b,frag:i,part:t,id:i.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,y),i.bitrateTest=!1}}},r.onFragBuffered=function(s,n){var i=n.frag,t=n.part,b=t?t.stats:i.stats;if(b.aborted)return;if(i.type!==e.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var m=b.parsing.end-b.loading.start;this.bwEstimator.sample(m,b.loaded),b.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},r.onError=function(s,n){switch(n.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var s=this.fragCurrent,n=this.partCurrent,i=this.hls,t=i.maxAutoLevel,b=i.config,m=i.minAutoLevel,g=i.media,E=n?n.duration:s?s.duration:0,_=g?g.currentTime:0,y=g&&g.playbackRate!==0?Math.abs(g.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():b.abrEwmaDefaultEstimate,u=(H.BufferHelper.bufferInfo(g,_,b.maxBufferHole).end-_)/y,l=this.findBestLevel(c,m,t,u,b.abrBandWidthFactor,b.abrBandWidthUpFactor);if(l>=0)return l;S.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=E?Math.min(E,b.maxStarvationDelay):b.maxStarvationDelay,p=b.abrBandWidthFactor,T=b.abrBandWidthUpFactor;if(!u){var L=this.bitrateTestDelay;if(L){var D=E?Math.min(E,b.maxLoadingDelay):b.maxLoadingDelay;v=D-L,S.logger.trace("bitrate test took "+Math.round(1e3*L)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),p=T=1}}return l=this.findBestLevel(c,m,t,u+v,p,T),Math.max(l,0)},r.findBestLevel=function(s,n,i,t,b,m){for(var g,E=this.fragCurrent,_=this.partCurrent,y=this.lastLoadedFragLevel,c=this.hls.levels,u=c[y],l=!!(u!=null&&(g=u.details)!==null&&g!==void 0&&g.live),v=u==null?void 0:u.codecSet,p=_?_.duration:E?E.duration:0,T=i;T>=n;T--){var L=c[T];if(!L||v&&L.codecSet!==v)continue;var D=L.details,x=(_?D==null?void 0:D.partTarget:D==null?void 0:D.averagetargetduration)||p,M=void 0;T<=y?M=b*s:M=m*s;var j=c[T].maxBitrate,I=j*x/M;if(S.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+T+"/"+Math.round(M)+"/"+j+"/"+x+"/"+t+"/"+I),M>j&&(!I||l&&!this.bitrateTestDelay||I<t))return T}return-1},d(a,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,n=this.bwEstimator;if(s!==-1&&(!n||!n.canEstimate()))return s;var i=this.getNextABRAutoLevel();return s!==-1&&(i=Math.min(s,i)),i},set:function(s){this._nextAutoLevel=s}}]),a}();B.default=o},"./src/controller/audio-stream-controller.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/polyfills/number.ts"),w=A("./src/controller/base-stream-controller.ts"),R=A("./src/events.ts"),H=A("./src/utils/buffer-helper.ts"),U=A("./src/controller/fragment-tracker.ts"),e=A("./src/types/level.ts"),S=A("./src/types/loader.ts"),f=A("./src/loader/fragment.ts"),d=A("./src/demux/chunk-cache.ts"),o=A("./src/demux/transmuxer-interface.ts"),a=A("./src/types/transmuxer.ts"),r=A("./src/controller/fragment-finders.ts"),h=A("./src/utils/discontinuities.ts"),s=A("./src/errors.ts"),n=A("./src/utils/logger.ts");function i(){return i=Object.assign||function(E){for(var _=1;_<arguments.length;_++){var y=arguments[_];for(var c in y)Object.prototype.hasOwnProperty.call(y,c)&&(E[c]=y[c])}return E},i.apply(this,arguments)}function t(E,_){E.prototype=Object.create(_.prototype),E.prototype.constructor=E,b(E,_)}function b(E,_){return b=Object.setPrototypeOf||function(c,u){return c.__proto__=u,c},b(E,_)}var m=100,g=function(E){t(_,E);function _(c,u){var l;return l=E.call(this,c,u,"[audio-stream-controller]")||this,l.videoBuffer=null,l.videoTrackCC=-1,l.waitingVideoCC=-1,l.audioSwitch=!1,l.trackId=-1,l.waitingData=null,l.mainDetails=null,l.bufferFlushed=!1,l._registerListeners(),l}var y=_.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var u=this.hls;u.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(R.Events.ERROR,this.onError,this),u.on(R.Events.BUFFER_RESET,this.onBufferReset,this),u.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var u=this.hls;u.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(R.Events.ERROR,this.onError,this),u.off(R.Events.BUFFER_RESET,this.onBufferReset,this),u.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(u,l){var v=l.frag,p=l.id,T=l.initPTS;if(p==="main"){var L=v.cc;this.initPTS[v.cc]=T,this.log("InitPTS for cc: "+L+" found from main: "+T),this.videoTrackCC=L,this.state===w.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=w.State.STOPPED;return}var l=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,l>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),this.state=w.State.IDLE):(this.loadedmetadata=!1,this.state=w.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},y.doTick=function(){switch(this.state){case w.State.IDLE:this.doTickIdle();break;case w.State.WAITING_TRACK:{var u,l=this.levels,v=this.trackId,p=l==null||((u=l[v])===null||u===void 0)?void 0:u.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=w.State.WAITING_INIT_PTS}break}case w.State.FRAG_LOADING_WAITING_RETRY:{var T,L=performance.now(),D=this.retryDate;(!D||L>=D||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=w.State.IDLE);break}case w.State.WAITING_INIT_PTS:{var x=this.waitingData;if(x){var M=x.frag,j=x.part,I=x.cache,W=x.complete;if(this.initPTS[M.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=w.State.FRAG_LOADING;var Q=I.flush(),fe={frag:M,part:j,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(fe),W&&E.prototype._handleFragmentLoadComplete.call(this,fe)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+M.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),Ce=H.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),Oe=Object(r.fragmentWithinToleranceTest)(Ce.end,this.config.maxFragLookUpTolerance,M);Oe<0&&(n.logger.log("Waiting fragment cc ("+M.cc+") @ "+M.start+" cancelled because another fragment at "+Ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=w.State.IDLE}}this.onTickEnd()},y.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=w.State.IDLE)},y.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var l=this.mediaBuffer?this.mediaBuffer:u,v=l.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},y.doTickIdle=function(){var u,l,v=this.hls,p=this.levels,T=this.media,L=this.trackId,D=v.config;if(!p||!p[L])return;if(!T&&(this.startFragRequested||!D.startFragPrefetch))return;var x=p[L],M=x.details;if(!M||M.live&&this.levelLastLoaded!==L||this.waitForCdnTuneIn(M)){this.state=w.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,f.ElementaryStreamTypes.AUDIO,S.PlaylistLevelType.AUDIO));var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,S.PlaylistLevelType.AUDIO);if(j===null)return;var I=j.len,W=this.getMaxBufferLength(),Q=this.audioSwitch;if(I>=W&&!Q)return;if(!Q&&this._streamEnded(j,M)){v.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=w.State.ENDED;return}var fe=M.fragments,le=fe[0].start,Ce=j.end;if(Q){var Oe=this.getLoadPosition();Ce=Oe,M.PTSKnown&&Oe<le&&((j.end>le||j.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),T.currentTime=le+.05))}var Re=this.getNextFragment(Ce,M);if(!Re){this.bufferFlushed=!0;return}((u=Re.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((l=Re.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(Re,M):this.loadFragment(Re,M,Ce)},y.getMaxBufferLength=function(){var u=E.prototype.getMaxBufferLength.call(this),l=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,S.PlaylistLevelType.MAIN);return l===null?u:Math.max(u,l.len)},y.onMediaDetaching=function(){this.videoBuffer=null,E.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(u,l){var v=l.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(p){return new e.Level(p)})},y.onAudioTrackSwitching=function(u,l){var v=!!l.url;this.trackId=l.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(m):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=w.State.IDLE):this.state=w.State.STOPPED,this.tick()},y.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},y.onLevelLoaded=function(u,l){this.mainDetails=l.details},y.onAudioTrackLoaded=function(u,l){var v,p=this.levels,T=l.details,L=l.id;if(!p){this.warn("Audio tracks were reset while loading level "+L);return}this.log("Track "+L+" loaded ["+T.startSN+","+T.endSN+"],duration:"+T.totalduration);var D=p[L],x=0;if(T.live||(v=D.details)!==null&&v!==void 0&&v.live){var M=this.mainDetails;if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed||!M)return;!D.details&&T.hasProgramDateTime&&M.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(T,M),x=T.fragments[0].start):x=this.alignPlaylists(T,D.details)}D.details=T,this.levelLastLoaded=L,!this.startFragRequested&&(this.mainDetails||!T.live)&&this.setStartPosition(D.details,x),this.state===w.State.WAITING_TRACK&&!this.waitForCdnTuneIn(T)&&(this.state=w.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(u){var l,v=u.frag,p=u.part,T=u.payload,L=this.config,D=this.trackId,x=this.levels;if(!x){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+v.sn+" of level "+v.level+" will not be buffered");return}var M=x[D];console.assert(M,"Audio track is defined on fragment load progress");var j=M.details;console.assert(j,"Audio track details are defined on fragment load progress");var I=L.defaultAudioCodec||M.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new o.default(this.hls,S.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[v.cc],fe=(l=v.initSegment)===null||l===void 0?void 0:l.data;if(Q!==void 0){var le=!1,Ce=p?p.index:-1,Oe=Ce!==-1,Re=new a.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,T.byteLength,Ce,Oe);W.push(T,fe,I,"",v,p,j.totalduration,le,Re,Q)}else{n.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+j.startSN+" ,"+j.endSN+"],track "+D);var Le=this.waitingData=this.waitingData||{frag:v,part:p,cache:new d.default,complete:!1},Pe=Le.cache;Pe.push(new Uint8Array(T)),this.waitingVideoCC=this.videoTrackCC,this.state=w.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}E.prototype._handleFragmentLoadComplete.call(this,u)},y.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},y.onBufferCreated=function(u,l){var v=l.tracks.audio;v&&(this.mediaBuffer=v.buffer),l.tracks.video&&(this.videoBuffer=l.tracks.video.buffer)},y.onFragBuffered=function(u,l){var v=l.frag,p=l.part;if(v.type!==S.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(p?" p: "+p.index:"")+" of level "+v.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}v.sn!=="initSegment"&&(this.fragPrevious=v,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,p)},y.onError=function(u,l){switch(l.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:this.onFragmentOrKeyLoadError(S.PlaylistLevelType.AUDIO,l);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==w.State.ERROR&&this.state!==w.State.STOPPED&&(this.state=l.fatal?w.State.ERROR:w.State.IDLE,this.warn(l.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="audio"&&(this.state===w.State.PARSING||this.state===w.State.PARSED)){var v=!0,p=this.getFwdBufferInfo(this.mediaBuffer,S.PlaylistLevelType.AUDIO);p&&p.len>.5&&(v=!this.reduceMaxBufferLength(p.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(u,l){var v=l.type;v===f.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(u){var l,v="audio",p=this.hls,T=u.remuxResult,L=u.chunkMeta,D=this.getCurrentContext(L);if(!D){this.warn("The loading context changed while buffering fragment "+L.sn+" of level "+L.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(L.level);return}var x=D.frag,M=D.part,j=T.audio,I=T.text,W=T.id3,Q=T.initSegment;if(this.fragContextChanged(x))return;if(this.state=w.State.PARSING,this.audioSwitch&&j&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,x,L),p.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:v,tracks:Q.tracks})),j){var fe=j.startPTS,le=j.endPTS,Ce=j.startDTS,Oe=j.endDTS;M&&(M.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:fe,endPTS:le,startDTS:Ce,endDTS:Oe}),x.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,fe,le,Ce,Oe),this.bufferFragmentData(j,x,M,L)}if(W!=null&&(l=W.samples)!==null&&l!==void 0&&l.length){var Re=i({frag:x,id:v},W);p.trigger(R.Events.FRAG_PARSING_METADATA,Re)}if(I){var Le=i({frag:x,id:v},I);p.trigger(R.Events.FRAG_PARSING_USERDATA,Le)}},y._bufferInitSegment=function(u,l,v){if(this.state!==w.State.PARSING)return;u.video&&delete u.video;var p=u.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,u);var T=p.initSegment;if(T!=null&&T.byteLength){var L={type:"audio",frag:l,part:null,chunkMeta:v,parent:l.type,data:T};this.hls.trigger(R.Events.BUFFER_APPENDING,L)}this.tick()},y.loadFragment=function(u,l,v){var p=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||p===U.FragmentState.NOT_LOADED||p===U.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):l.live&&!Object(k.isFiniteNumber)(this.initPTS[u.cc])?(this.log("Waiting for video PTS in continuity counter "+u.cc+" of live stream before loading audio fragment "+u.sn+" of level "+this.trackId),this.state=w.State.WAITING_INIT_PTS):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,u,l,v)))},y.completeAudioSwitch=function(){var u=this.hls,l=this.media,v=this.trackId;l&&(this.log("Switching audio track : flushing all audio"),E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:v})},_}(w.default);B.default=g},"./src/controller/audio-track-controller.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/events.ts"),w=A("./src/errors.ts"),R=A("./src/controller/base-playlist-controller.ts"),H=A("./src/types/loader.ts");function U(o,a){for(var r=0;r<a.length;r++){var h=a[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(o,h.key,h)}}function e(o,a,r){return a&&U(o.prototype,a),r&&U(o,r),o}function S(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,f(o,a)}function f(o,a){return f=Object.setPrototypeOf||function(h,s){return h.__proto__=s,h},f(o,a)}var d=function(o){S(a,o);function a(h){var s;return s=o.call(this,h,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var r=a.prototype;return r.registerListeners=function(){var s=this.hls;s.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(k.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var s=this.hls;s.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(k.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,o.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},r.onManifestParsed=function(s,n){this.tracks=n.audioTracks||[]},r.onAudioTrackLoaded=function(s,n){var i=n.id,t=n.details,b=this.tracksInGroup[i];if(!b){this.warn("Invalid audio track id "+i);return}var m=b.details;b.details=n.details,this.log("audioTrack "+i+" loaded ["+t.startSN+"-"+t.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,n,m))},r.onLevelLoading=function(s,n){this.switchLevel(n.level)},r.onLevelSwitching=function(s,n){this.switchLevel(n.level)},r.switchLevel=function(s){var n=this.hls.levels[s];if(!(n!=null&&n.audioGroupIds))return;var i=n.audioGroupIds[n.urlId];if(this.groupId!==i){this.groupId=i;var t=this.tracks.filter(function(m){return!i||m.groupId===i});this.selectDefaultTrack&&!t.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var b={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(k.Events.AUDIO_TRACKS_UPDATED,b),this.selectInitialTrack()}},r.onError=function(s,n){if(o.prototype.onError.call(this,s,n),n.fatal||!n.context)return;n.context.type===H.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},r.setAudioTrack=function(s){var n=this.tracksInGroup;if(s<0||s>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=n[this.trackId];this.log("Now switching to audio-track index "+s);var t=n[s],b=t.id,m=t.groupId,g=m===void 0?"":m,E=t.name,_=t.type,y=t.url;if(this.trackId=s,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHING,{id:b,groupId:g,name:E,type:_,url:y}),t.details&&!t.details.live)return;var c=this.switchParams(t.url,i==null?void 0:i.details);this.loadPlaylist(c)},r.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,i=this.findTrackId(n)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(s){for(var n=this.tracksInGroup,i=0;i<n.length;i++){var t=n[i];if((!this.selectDefaultTrack||t.default)&&(!s||s===t.name))return t.id}return-1},r.loadPlaylist=function(s){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var i=n.id,t=n.groupId,b=n.url;if(s)try{b=s.addDirectives(b)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(k.Events.AUDIO_TRACK_LOADING,{url:b,id:i,groupId:t,deliveryDirectives:s||null})}},e(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),a}(R.default);B.default=d},"./src/controller/base-playlist-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return e});var k=A("./src/polyfills/number.ts"),w=A("./src/types/level.ts"),R=A("./src/controller/level-helper.ts"),H=A("./src/utils/logger.ts"),U=A("./src/errors.ts"),e=function(){function S(d,o){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,o+":"),this.warn=H.logger.warn.bind(H.logger,o+":"),this.hls=d}var f=S.prototype;return f.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},f.onError=function(o,a){a.fatal&&a.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},f.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},f.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},f.stopLoad=function(){this.canLoad=!1,this.clearTimer()},f.switchParams=function(o,a){var r=a==null?void 0:a.renditionReports;if(r)for(var h=0;h<r.length;h++){var s=r[h],n=""+s.URI;if(n===o.substr(-n.length)){var i=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var b=Math.min(a.age-a.partTarget,a.targetduration);t!==void 0&&b>a.partTarget&&(t+=1)}if(Object(k.isFiniteNumber)(i))return new w.HlsUrlParameters(i,Object(k.isFiniteNumber)(t)?t:void 0,w.HlsSkip.No)}}},f.loadPlaylist=function(o){},f.shouldLoadTrack=function(o){return this.canLoad&&o&&!!o.url&&(!o.details||o.details.live)},f.playlistLoaded=function(o,a,r){var h=this,s=a.details,n=a.stats,i=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(s.advancedDateTime=Date.now()-i,s.live||r!=null&&r.live){if(s.reloaded(r),r&&this.log("live playlist "+o+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),r&&s.fragments.length>0&&Object(R.mergeDetails)(r,s),!this.canLoad||!s.live)return;var t,b=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var g=this.hls.config.lowLatencyMode,E=s.lastPartSn,_=s.endSN,y=s.lastPartIndex,c=y!==-1,u=E===_,l=g?0:y;c?(b=u?_+1:E,m=u?l:y+1):b=_+1;var v=s.age,p=v+s.ageHeader,T=Math.min(p-s.partTarget,s.targetduration*1.5);if(T>0){if(r&&T>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+T+" with playlist age: "+s.age),T=0;else{var L=Math.floor(T/s.targetduration);if(b+=L,m!==void 0){var D=Math.round(T%s.targetduration/s.partTarget);m+=D}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+T+" skip sn "+L+" to part "+m)}s.tuneInGoal=T}if(t=this.getDeliveryDirectives(s,a.deliveryDirectives,b,m),g||!u){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,a.deliveryDirectives,b,m);var x=Object(R.computeReloadInterval)(s,n);b!==void 0&&s.canBlockReload&&(x-=s.partTarget||1),this.log("reload live playlist "+o+" in "+Math.round(x)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(t)},x)}else this.clearTimer()},f.getDeliveryDirectives=function(o,a,r,h){var s=Object(w.getSkipValue)(o,r);return a!=null&&a.skip&&o.deltaUpdateFailed&&(r=a.msn,h=a.part,s=w.HlsSkip.No),new w.HlsUrlParameters(r,h,s)},f.retryLoadingOrFail=function(o){var a=this,r=this.hls.config,h=this.retryCount<r.levelLoadingMaxRetry;if(h){var s;if(this.retryCount++,o.details.indexOf("LoadTimeOut")>-1&&(s=o.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+o.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+o.details+'"')}}else this.warn('cannot recover from error "'+o.details+'"'),this.clearTimer(),o.fatal=!0;return h},S}()},"./src/controller/base-stream-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"State",function(){return _}),A.d(B,"default",function(){return y});var k=A("./src/polyfills/number.ts"),w=A("./src/task-loop.ts"),R=A("./src/controller/fragment-tracker.ts"),H=A("./src/utils/buffer-helper.ts"),U=A("./src/utils/logger.ts"),e=A("./src/events.ts"),S=A("./src/errors.ts"),f=A("./src/types/transmuxer.ts"),d=A("./src/utils/mp4-tools.ts"),o=A("./src/utils/discontinuities.ts"),a=A("./src/controller/fragment-finders.ts"),r=A("./src/controller/level-helper.ts"),h=A("./src/loader/fragment-loader.ts"),s=A("./src/crypt/decrypter.ts"),n=A("./src/utils/time-ranges.ts"),i=A("./src/types/loader.ts");function t(c,u){for(var l=0;l<u.length;l++){var v=u[l];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(c,v.key,v)}}function b(c,u,l){return u&&t(c.prototype,u),l&&t(c,l),c}function m(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function g(c,u){c.prototype=Object.create(u.prototype),c.prototype.constructor=c,E(c,u)}function E(c,u){return E=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v},E(c,u)}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"},y=function(c){g(u,c);function u(v,p,T){var L;return L=c.call(this)||this,L.hls=void 0,L.fragPrevious=null,L.fragCurrent=null,L.fragmentTracker=void 0,L.transmuxer=null,L._state=_.STOPPED,L.media=void 0,L.mediaBuffer=void 0,L.config=void 0,L.bitrateTest=!1,L.lastCurrentTime=0,L.nextLoadPosition=0,L.startPosition=0,L.loadedmetadata=!1,L.fragLoadError=0,L.retryDate=0,L.levels=null,L.fragmentLoader=void 0,L.levelLastLoaded=null,L.startFragRequested=!1,L.decrypter=void 0,L.initPTS=[],L.onvseeking=null,L.onvended=null,L.logPrefix="",L.log=void 0,L.warn=void 0,L.logPrefix=T,L.log=U.logger.log.bind(U.logger,T+":"),L.warn=U.logger.warn.bind(U.logger,T+":"),L.hls=v,L.fragmentLoader=new h.default(v.config),L.fragmentTracker=p,L.config=v.config,L.decrypter=new s.default(v,v.config),v.on(e.Events.KEY_LOADED,L.onKeyLoaded,m(L)),L}var l=u.prototype;return l.doTick=function(){this.onTickEnd()},l.onTickEnd=function(){},l.startLoad=function(p){},l.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},l._streamEnded=function(p,T){var L=this.fragCurrent,D=this.fragmentTracker;if(!T.live&&L&&L.sn===T.endSN&&!p.nextStart){var x=D.getState(L);return x===R.FragmentState.PARTIAL||x===R.FragmentState.OK}return!1},l.onMediaAttached=function(p,T){var L=this.media=this.mediaBuffer=T.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),L.addEventListener("seeking",this.onvseeking),L.addEventListener("ended",this.onvended);var D=this.config;this.levels&&D.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(D.startPosition)},l.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()},l.onMediaSeeking=function(){var p=this.config,T=this.fragCurrent,L=this.media,D=this.mediaBuffer,x=this.state,M=L?L.currentTime:0,j=H.BufferHelper.bufferInfo(D||L,M,p.maxBufferHole);if(this.log("media seeking to "+(Object(k.isFiniteNumber)(M)?M.toFixed(3):M)+", state: "+x),x===_.ENDED)this.resetLoadingState();else if(T&&!j.len){var I=p.maxFragLookUpTolerance,W=T.start-I,Q=T.start+T.duration+I,fe=M>Q;(M<W||fe)&&(fe&&T.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),T.loader.abort()),this.resetLoadingState())}L&&(this.lastCurrentTime=M),!this.loadedmetadata&&!j.len&&(this.nextLoadPosition=this.startPosition=M),this.tickImmediate()},l.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},l.onKeyLoaded=function(p,T){if(this.state!==_.KEY_LOADING||T.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var L=this.levels[T.frag.level].details;L&&this.loadFragment(T.frag,L,T.frag.start)},l.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},l.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,c.prototype.onHandlerDestroyed.call(this)},l.loadKey=function(p,T){this.log("Loading key for "+p.sn+" of ["+T.startSN+"-"+T.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})},l.loadFragment=function(p,T,L){this._loadFragForPlayback(p,T,L)},l._loadFragForPlayback=function(p,T,L){var D=this,x=function(j){if(D.fragContextChanged(p)){D.warn("Fragment "+p.sn+(j.part?" p: "+j.part.index:"")+" of level "+p.level+" was dropped during download."),D.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,D._handleFragmentLoadProgress(j)};this._doFragLoad(p,T,L,x).then(function(M){if(!M)return;D.fragLoadError=0;var j=D.state;if(D.fragContextChanged(p)){(j===_.FRAG_LOADING||j===_.BACKTRACKING||!D.fragCurrent&&j===_.PARSING)&&(D.fragmentTracker.removeFragment(p),D.state=_.IDLE);return}if("payload"in M&&(D.log("Loaded fragment "+p.sn+" of level "+p.level),D.hls.trigger(e.Events.FRAG_LOADED,M),D.state===_.BACKTRACKING)){D.fragmentTracker.backtrack(p,M),D.resetFragmentLoading(p);return}D._handleFragmentLoadComplete(M)}).catch(function(M){D.warn(M),D.resetFragmentLoading(p)})},l.flushMainBuffer=function(p,T,L){if(L===void 0&&(L=null),!(p-T))return;var D={startOffset:p,endOffset:T,type:L};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,D)},l._loadInitSegment=function(p){var T=this;this._doFragLoad(p).then(function(L){if(!L||T.fragContextChanged(p)||!T.levels)throw new Error("init load aborted");return L}).then(function(L){var D=T.hls,x=L.payload,M=p.decryptdata;if(x&&x.byteLength>0&&M&&M.key&&M.iv&&M.method==="AES-128"){var j=self.performance.now();return T.decrypter.webCryptoDecrypt(new Uint8Array(x),M.key.buffer,M.iv.buffer).then(function(I){var W=self.performance.now();return D.trigger(e.Events.FRAG_DECRYPTED,{frag:p,payload:I,stats:{tstart:j,tdecrypt:W}}),L.payload=I,L})}return L}).then(function(L){var D=T.fragCurrent,x=T.hls,M=T.levels;if(!M)throw new Error("init load aborted, missing levels");var j=M[p.level].details;console.assert(j,"Level details are defined when init segment is loaded");var I=p.stats;T.state=_.IDLE,T.fragLoadError=0,p.data=new Uint8Array(L.payload),I.parsing.start=I.buffering.start=self.performance.now(),I.parsing.end=I.buffering.end=self.performance.now(),L.frag===D&&x.trigger(e.Events.FRAG_BUFFERED,{stats:I,frag:D,part:null,id:p.type}),T.tick()}).catch(function(L){T.warn(L),T.resetFragmentLoading(p)})},l.fragContextChanged=function(p){var T=this.fragCurrent;return!p||!T||p.level!==T.level||p.sn!==T.sn||p.urlId!==T.urlId},l.fragBufferedComplete=function(p,T){var L=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(T?" part: "+T.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+n.default.toString(H.BufferHelper.getBuffered(L))),this.state=_.IDLE,this.tick()},l._handleFragmentLoadComplete=function(p){var T=this.transmuxer;if(!T)return;var L=p.frag,D=p.part,x=p.partsLoaded,M=!x||x.length===0||x.some(function(I){return!I}),j=new f.ChunkMetadata(L.level,L.sn,L.stats.chunkCount+1,0,D?D.index:-1,!M);T.flush(j)},l._handleFragmentLoadProgress=function(p){},l._doFragLoad=function(p,T,L,D){var x=this;if(L===void 0&&(L=null),!this.levels)throw new Error("frag load aborted, missing levels");if(L=Math.max(p.start,L||0),this.config.lowLatencyMode&&T){var M=T.partList;if(M&&D){L>p.end&&T.fragmentHint&&(p=T.fragmentHint);var j=this.getNextPart(M,p,L);if(j>-1){var I=M[j];return this.log("Loading part sn: "+p.sn+" p: "+I.index+" cc: "+p.cc+" of playlist ["+T.startSN+"-"+T.endSN+"] parts [0-"+j+"-"+(M.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(L.toFixed(3))),this.nextLoadPosition=I.start+I.duration,this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:p,part:M[j],targetBufferTime:L}),this.doFragPartsLoad(p,M,j,D).catch(function(W){return x.handleFragLoadError(W)})}else if(!p.url||this.loadedEndOfParts(M,L))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(T?"of ["+T.startSN+"-"+T.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(L.toFixed(3))),Object(k.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:L}),this.fragmentLoader.load(p,D).catch(function(W){return x.handleFragLoadError(W)})},l.doFragPartsLoad=function(p,T,L,D){var x=this;return new Promise(function(M,j){var I=[],W=function Q(fe){var le=T[fe];x.fragmentLoader.loadPart(p,le,D).then(function(Ce){I[le.index]=Ce;var Oe=Ce.part;x.hls.trigger(e.Events.FRAG_LOADED,Ce);var Re=T[fe+1];if(Re&&Re.fragment===p)Q(fe+1);else return M({frag:p,part:Oe,partsLoaded:I})}).catch(j)};W(L)})},l.handleFragLoadError=function(p){var T=p.data;return T&&T.details===S.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(T.frag,T.part):this.hls.trigger(e.Events.ERROR,T),null},l._handleTransmuxerFlush=function(p){var T=this.getCurrentContext(p);if(!T||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var L=T.frag,D=T.part,x=T.level,M=self.performance.now();L.stats.parsing.end=M,D&&(D.stats.parsing.end=M),this.updateLevelTiming(L,D,x,p.partial)},l.getCurrentContext=function(p){var T=this.levels,L=p.level,D=p.sn,x=p.part;if(!T||!T[L])return this.warn("Levels object was unset while buffering fragment "+D+" of level "+L+". The current chunk will not be buffered."),null;var M=T[L],j=x>-1?Object(r.getPartWith)(M,D,x):null,I=j?j.fragment:Object(r.getFragmentWithSN)(M,D,this.fragCurrent);return I?{frag:I,part:j,level:M}:null},l.bufferFragmentData=function(p,T,L,D){if(!p||this.state!==_.PARSING)return;var x=p.data1,M=p.data2,j=x;if(x&&M&&(j=Object(d.appendUint8Array)(x,M)),!j||!j.length)return;var I={type:p.type,frag:T,part:L,chunkMeta:D,parent:T.type,data:j};this.hls.trigger(e.Events.BUFFER_APPENDING,I),p.dropped&&p.independent&&!L&&this.flushBufferGap(T)},l.flushBufferGap=function(p){var T=this.media;if(!T)return;if(!H.BufferHelper.isBuffered(T,T.currentTime)){this.flushMainBuffer(0,p.start);return}var L=T.currentTime,D=H.BufferHelper.bufferInfo(T,L,0),x=p.duration,M=Math.min(this.config.maxFragLookUpTolerance*2,x*.25),j=Math.max(Math.min(p.start-M,D.end-M),L+M);p.start-j>M&&this.flushMainBuffer(j,p.start)},l.getFwdBufferInfo=function(p,T){var L=this.config,D=this.getLoadPosition();if(!Object(k.isFiniteNumber)(D))return null;var x=H.BufferHelper.bufferInfo(p,D,L.maxBufferHole);if(x.len===0&&x.nextStart!==void 0){var M=this.fragmentTracker.getBufferedFrag(D,T);if(M&&x.nextStart<M.end)return H.BufferHelper.bufferInfo(p,D,Math.max(x.nextStart,L.maxBufferHole))}return x},l.getMaxBufferLength=function(p){var T=this.config,L;return p?L=Math.max(8*T.maxBufferSize/p,T.maxBufferLength):L=T.maxBufferLength,Math.min(L,T.maxMaxBufferLength)},l.reduceMaxBufferLength=function(p){var T=this.config,L=p||T.maxBufferLength;return T.maxMaxBufferLength>=L?(T.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+T.maxMaxBufferLength+"s"),!0):!1},l.getNextFragment=function(p,T){var L,D,x=T.fragments,M=x.length;if(!M)return null;var j=this.config,I=x[0].start,W;if(T.live){var Q=j.initialLiveManifestSize;if(M<Q)return this.warn("Not enough fragments to start playback (have: "+M+", need: "+Q+")"),null;!T.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(T,x),this.startPosition=W?this.hls.liveSyncPosition||W.start:p)}else p<=I&&(W=x[0]);if(!W){var fe=j.lowLatencyMode?T.partEnd:T.fragmentEnd;W=this.getFragmentAtPosition(p,fe,T)}return(L=W)!==null&&L!==void 0&&L.initSegment&&!((D=W)!==null&&D!==void 0&&D.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},l.getNextPart=function(p,T,L){for(var D=-1,x=!1,M=!0,j=0,I=p.length;j<I;j++){var W=p[j];if(M=M&&!W.independent,D>-1&&L<W.start)break;var Q=W.loaded;!Q&&(x||W.independent||M)&&W.fragment===T&&(D=j),x=Q}return D},l.loadedEndOfParts=function(p,T){var L=p[p.length-1];return L&&T>L.start&&L.loaded},l.getInitialLiveFragment=function(p,T){var L=this.fragPrevious,D=null;if(L){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+L.programDateTime),D=Object(a.findFragmentByPDT)(T,L.endProgramDateTime,this.config.maxFragLookUpTolerance)),!D){var x=L.sn+1;if(x>=p.startSN&&x<=p.endSN){var M=T[x-p.startSN];L.cc===M.cc&&(D=M,this.log("Live playlist, switching playlist, load frag with next SN: "+D.sn))}D||(D=Object(a.findFragWithCC)(T,L.cc),D&&this.log("Live playlist, switching playlist, load frag with same CC: "+D.sn))}}else{var j=this.hls.liveSyncPosition;j!==null&&(D=this.getFragmentAtPosition(j,this.bitrateTest?p.fragmentEnd:p.edge,p))}return D},l.getFragmentAtPosition=function(p,T,L){var D=this.config,x=this.fragPrevious,M=L.fragments,j=L.endSN,I=L.fragmentHint,W=D.maxFragLookUpTolerance,Q=!!(D.lowLatencyMode&&L.partList&&I);Q&&I&&!this.bitrateTest&&(M=M.concat(I),j=I.sn);var fe;if(p<T){var le=p>T-W?0:W;fe=Object(a.findFragmentByPTS)(x,M,p,le)}else fe=M[M.length-1];if(fe){var Ce=fe.sn-L.startSN,Oe=x&&fe.level===x.level,Re=M[Ce+1],Le=this.fragmentTracker.getState(fe);if(Le===R.FragmentState.BACKTRACKED){fe=null;for(var Pe=Ce;M[Pe]&&this.fragmentTracker.getState(M[Pe])===R.FragmentState.BACKTRACKED;)x?fe=M[Pe--]:fe=M[--Pe];fe||(fe=Re)}else x&&fe.sn===x.sn&&!Q&&(Oe&&(fe.sn<j&&this.fragmentTracker.getState(Re)!==R.FragmentState.OK?(this.log("SN "+fe.sn+" just loaded, load next one: "+Re.sn),fe=Re):fe=null))}return fe},l.synchronizeToLiveEdge=function(p){var T=this.config,L=this.media;if(!L)return;var D=this.hls.liveSyncPosition,x=L.currentTime,M=p.fragments[0].start,j=p.edge,I=x>=M-T.maxFragLookUpTolerance&&x<=j;if(D!==null&&L.duration>D&&(x<D||!I)){var W=T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:T.liveMaxLatencyDurationCount*p.targetduration;(!I&&L.readyState<4||x<j-W)&&(this.loadedmetadata||(this.nextLoadPosition=D),L.readyState&&(this.warn("Playback: "+x.toFixed(3)+" is located too far from the end of live sliding playlist: "+j+", reset currentTime to : "+D.toFixed(3)),L.currentTime=D))}},l.alignPlaylists=function(p,T){var L=this.levels,D=this.levelLastLoaded,x=this.fragPrevious,M=D!==null?L[D]:null,j=p.fragments.length;if(!j)return this.warn("No fragments in live playlist"),0;var I=p.fragments[0].start,W=!T,Q=p.alignedSliding&&Object(k.isFiniteNumber)(I);if(W||!Q&&!I){Object(o.alignStream)(x,M,p);var fe=p.fragments[0].start;return this.log("Live playlist sliding: "+fe.toFixed(2)+" start-sn: "+(T?T.startSN:"na")+"->"+p.startSN+" prev-sn: "+(x?x.sn:"na")+" fragments: "+j),fe}return I},l.waitForCdnTuneIn=function(p){var T=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*T)},l.setStartPosition=function(p,T){var L=this.startPosition;if(L<T&&(L=-1),L===-1||this.lastCurrentTime===-1){var D=p.startTimeOffset;Object(k.isFiniteNumber)(D)?(L=T+D,D<0&&(L+=p.totalduration),L=Math.min(Math.max(T,L),T+p.totalduration),this.log("Start time offset "+D+" found in playlist, adjust startPosition to "+L),this.startPosition=L):p.live?L=this.hls.liveSyncPosition||T:this.startPosition=L=0,this.lastCurrentTime=L}this.nextLoadPosition=L},l.getLoadPosition=function(){var p=this.media,T=0;return this.loadedmetadata&&p?T=p.currentTime:this.nextLoadPosition&&(T=this.nextLoadPosition),T},l.handleFragLoadAborted=function(p,T){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(T?" part"+T.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},l.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=_.IDLE)},l.onFragmentOrKeyLoadError=function(p,T){if(T.fatal)return;var L=T.frag;if(!L||L.type!==p)return;var D=this.fragCurrent;console.assert(D&&L.sn===D.sn&&L.level===D.level&&L.urlId===D.urlId,"Frag load error must match current frag to retry");var x=this.config;if(this.fragLoadError+1<=x.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(L.level))return;var M=Math.min(Math.pow(2,this.fragLoadError)*x.fragLoadingRetryDelay,x.fragLoadingMaxRetryTimeout);this.warn("Fragment "+L.sn+" of "+p+" "+L.level+" failed to load, retrying in "+M+"ms"),this.retryDate=self.performance.now()+M,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else T.levelRetry?(p===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(U.logger.error(T.details+" reaches max retry, redispatch as fatal ..."),T.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},l.afterBufferFlushed=function(p,T,L){if(!p)return;var D=H.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(T,D,L),this.state===_.ENDED&&this.resetLoadingState()},l.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},l.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var T=this.levels?this.levels[p].details:null;if(T!=null&&T.live)return this.startPosition=-1,this.setStartPosition(T,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},l.updateLevelTiming=function(p,T,L,D){var x=this,M=L.details;console.assert(!!M,"level.details must be defined");var j=Object.keys(p.elementaryStreams).reduce(function(I,W){var Q=p.elementaryStreams[W];if(Q){var fe=Q.endPTS-Q.startPTS;if(fe<=0)return x.warn("Could not parse fragment "+p.sn+" "+W+" duration reliably ("+fe+") resetting transmuxer to fallback to playlist timing"),x.resetTransmuxer(),I||!1;var le=D?0:Object(r.updateFragPTSDTS)(M,p,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS);return x.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:M,level:L,drift:le,type:W,frag:p,start:Q.startPTS,end:Q.endPTS}),!0}return I},!1);j?(this.state=_.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:p,part:T})):this.resetLoadingState()},l.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},b(u,[{key:"state",get:function(){return this._state},set:function(p){var T=this._state;T!==p&&(this._state=p,this.log(T+"->"+p))}}]),u}(w.default)},"./src/controller/buffer-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return a});var k=A("./src/polyfills/number.ts"),w=A("./src/events.ts"),R=A("./src/utils/logger.ts"),H=A("./src/errors.ts"),U=A("./src/utils/buffer-helper.ts"),e=A("./src/utils/mediasource-helper.ts"),S=A("./src/loader/fragment.ts"),f=A("./src/controller/buffer-operation-queue.ts"),d=Object(e.getMediaSource)(),o=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function r(s){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 i=n.hls,t=n.media,b=n.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),t&&(n.updateMediaElementDuration(),i.trigger(w.Events.MEDIA_ATTACHED,{media:t})),b&&b.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var h=r.prototype;return h.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},h.destroy=function(){this.unregisterListeners(),this.details=null},h.registerListeners=function(){var n=this.hls;n.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(w.Events.BUFFER_RESET,this.onBufferReset,this),n.on(w.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(w.Events.BUFFER_EOS,this.onBufferEos,this),n.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(w.Events.FRAG_PARSED,this.onFragParsed,this),n.on(w.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var n=this.hls;n.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(w.Events.BUFFER_RESET,this.onBufferReset,this),n.off(w.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(w.Events.BUFFER_EOS,this.onBufferEos,this),n.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(w.Events.FRAG_PARSED,this.onFragParsed,this),n.off(w.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new f.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(n,i){var t=2;(i.audio&&!i.video||!i.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(n,i){var t=this.media=i.media;if(t&&d){var b=this.mediaSource=new d;b.addEventListener("sourceopen",this._onMediaSourceOpen),b.addEventListener("sourceended",this._onMediaSourceEnded),b.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(b),this._objectUrl=t.src}},h.onMediaDetaching=function(){var n=this.media,i=this.mediaSource,t=this._objectUrl;if(i){if(R.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(b){R.logger.warn("[buffer-controller]: onMediaDetaching: "+b.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(t&&self.URL.revokeObjectURL(t),n.src===t?(n.removeAttribute("src"),n.load()):R.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(w.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(i){var t=n.sourceBuffer[i];try{t&&(n.removeBufferListeners(i),n.mediaSource&&n.mediaSource.removeSourceBuffer(t),n.sourceBuffer[i]=void 0)}catch(b){R.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",b)}}),this._initSourceBuffer()},h.onBufferCodecs=function(n,i){var t=this,b=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(m){if(b){var g=t.tracks[m];if(g&&typeof g.buffer.changeType=="function"){var E=i[m],_=E.codec,y=E.levelCodec,c=E.container,u=(g.levelCodec||g.codec).replace(o,"$1"),l=(y||_).replace(o,"$1");if(u!==l){var v=c+";codecs="+(y||_);t.appendChangeType(m,v)}}}else t.pendingTracks[m]=i[m]}),b)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(n,i){var t=this,b=this.operationQueue,m={execute:function(){var E=t.sourceBuffer[n];E&&(R.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+i),E.changeType(i)),b.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(E){R.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",E)}};b.append(m,n)},h.onBufferAppending=function(n,i){var t=this,b=this.hls,m=this.operationQueue,g=this.tracks,E=i.data,_=i.type,y=i.frag,c=i.part,u=i.chunkMeta,l=u.buffering[_],v=self.performance.now();l.start=v;var p=y.stats.buffering,T=c?c.stats.buffering:null;p.start===0&&(p.start=v),T&&T.start===0&&(T.start=v);var L=g.audio,D=_==="audio"&&u.id===1&&(L==null?void 0:L.container)==="audio/mpeg",x={execute:function(){if(l.executeStart=self.performance.now(),D){var j=t.sourceBuffer[_];if(j){var I=y.start-j.timestampOffset;Math.abs(I)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+I+") sn: "+y.sn+")"),j.timestampOffset=y.start)}}t.appendExecutor(E,_)},onStart:function(){},onComplete:function(){var j=self.performance.now();l.executeEnd=l.end=j,p.first===0&&(p.first=j),T&&T.first===0&&(T.first=j);var I=t.sourceBuffer,W={};for(var Q in I)W[Q]=U.BufferHelper.getBuffered(I[Q]);t.appendError=0,t.hls.trigger(w.Events.BUFFER_APPENDED,{type:_,frag:y,part:c,chunkMeta:u,parent:y.type,timeRanges:W})},onError:function(j){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",j);var I={type:H.ErrorTypes.MEDIA_ERROR,parent:y.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:j,fatal:!1};j.code===DOMException.QUOTA_EXCEEDED_ERR?I.details=H.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,I.details=H.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>b.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+b.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),I.fatal=!0)),b.trigger(w.Events.ERROR,I)}};m.append(x,_)},h.onBufferFlushing=function(n,i){var t=this,b=this.operationQueue,m=function(E){return{execute:t.removeExecutor.bind(t,E,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(w.Events.BUFFER_FLUSHED,{type:E})},onError:function(y){R.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",y)}}};i.type?b.append(m(i.type),i.type):this.getSourceBufferTypes().forEach(function(g){b.append(m(g),g)})},h.onFragParsed=function(n,i){var t=this,b=i.frag,m=i.part,g=[],E=m?m.elementaryStreams:b.elementaryStreams;E[S.ElementaryStreamTypes.AUDIOVIDEO]?g.push("audiovideo"):(E[S.ElementaryStreamTypes.AUDIO]&&g.push("audio"),E[S.ElementaryStreamTypes.VIDEO]&&g.push("video"));var _=function(){var c=self.performance.now();b.stats.buffering.end=c,m&&(m.stats.buffering.end=c);var u=m?m.stats:b.stats;t.hls.trigger(w.Events.FRAG_BUFFERED,{frag:b,part:m,stats:u,id:b.type})};g.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+b.type+" level: "+b.level+" sn: "+b.sn),this.blockBuffers(_,g)},h.onFragChanged=function(n,i){this.flushBackBuffer()},h.onBufferEos=function(n,i){var t=this,b=this.getSourceBufferTypes().reduce(function(m,g){var E=t.sourceBuffer[g];return(!i.type||i.type===g)&&(E&&!E.ended&&(E.ended=!0,R.logger.log("[buffer-controller]: "+g+" sourceBuffer now EOS"))),m&&!!(!E||E.ended)},!0);b&&this.blockBuffers(function(){var m=t.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},h.onLevelUpdated=function(n,i){var t=i.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var n=this.hls,i=this.details,t=this.media,b=this.sourceBuffer;if(!t||i===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var g=i.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(k.isFiniteNumber)(g)||g<0)return;var E=t.currentTime,_=i.levelTargetDuration,y=Math.max(g,_),c=Math.floor(E/_)*_-y;m.forEach(function(u){var l=b[u];if(l){var v=U.BufferHelper.getBuffered(l);v.length>0&&c>v.start(0)&&(n.trigger(w.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),i.live&&n.trigger(w.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),n.trigger(w.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:u}))}})},h.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,i=this.hls,t=this.media,b=this.mediaSource,m=n.fragments[0].start+n.totalduration,g=t.duration,E=Object(k.isFiniteNumber)(b.duration)?b.duration:0;n.live&&i.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),b.duration=Infinity,this.updateSeekableRange(n)):(m>E&&m>g||!Object(k.isFiniteNumber)(g))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),b.duration=m)},h.updateSeekableRange=function(n){var i=this.mediaSource,t=n.fragments,b=t.length;if(b&&n.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var m=Math.max(0,t[0].start),g=Math.max(m,m+n.totalduration);i.setLiveSeekableRange(m,g)}},h.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,i=this.operationQueue,t=this.pendingTracks,b=Object.keys(t).length;if(b&&!n||b===2){this.createSourceBuffers(t),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(w.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(g){i.executeNext(g)})}},h.createSourceBuffers=function(n){var i=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var b=0;for(var m in n)if(!i[m]){var g=n[m];if(!g)throw Error("source buffer exists for track "+m+", however track does not");var E=g.levelCodec||g.codec,_=g.container+";codecs="+E;R.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var y=i[m]=t.addSourceBuffer(_),c=m;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[m]={buffer:y,codec:E,container:g.container,levelCodec:g.levelCodec,id:g.id},b++}catch(u){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(w.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:_})}}b&&this.hls.trigger(w.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(n){var i=this.operationQueue,t=i.current(n);t.onStart()},h._onSBUpdateEnd=function(n){var i=this.operationQueue,t=i.current(n);t.onComplete(),i.shiftAndExecuteNext(n)},h._onSBUpdateError=function(n,i){R.logger.error("[buffer-controller]: "+n+" SourceBuffer error",i),this.hls.trigger(w.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(n);t&&t.onError(i)},h.removeExecutor=function(n,i,t){var b=this.media,m=this.mediaSource,g=this.operationQueue,E=this.sourceBuffer,_=E[n];if(!b||!m||!_){R.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(n);return}var y=Object(k.isFiniteNumber)(b.duration)?b.duration:Infinity,c=Object(k.isFiniteNumber)(m.duration)?m.duration:Infinity,u=Math.max(0,i),l=Math.min(t,y,c);l>u?(R.logger.log("[buffer-controller]: Removing ["+u+","+l+"] from the "+n+" SourceBuffer"),console.assert(!_.updating,n+" sourceBuffer must not be updating"),_.remove(u,l)):g.shiftAndExecuteNext(n)},h.appendExecutor=function(n,i){var t=this.operationQueue,b=this.sourceBuffer,m=b[i];if(!m){R.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(i);return}m.ended=!1,console.assert(!m.updating,i+" sourceBuffer must not be updating"),m.appendBuffer(n)},h.blockBuffers=function(n,i){var t=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var b=this.operationQueue,m=i.map(function(g){return b.appendBlocker(g)});Promise.all(m).then(function(){n(),i.forEach(function(g){var E=t.sourceBuffer[g];(!E||!E.updating)&&b.shiftAndExecuteNext(g)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(n,i,t){var b=this.sourceBuffer[n];if(!b)return;var m=t.bind(this,n);this.listeners[n].push({event:i,listener:m}),b.addEventListener(i,m)},h.removeBufferListeners=function(n){var i=this.sourceBuffer[n];if(!i)return;this.listeners[n].forEach(function(t){i.removeEventListener(t.event,t.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return w});var k=A("./src/utils/logger.ts"),w=function(){function R(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var H=R.prototype;return H.append=function(e,S){var f=this.queues[S];f.push(e),f.length===1&&this.buffers[S]&&this.executeNext(S)},H.insertAbort=function(e,S){var f=this.queues[S];f.unshift(e),this.executeNext(S)},H.appendBlocker=function(e){var S,f=new Promise(function(o){S=o}),d={execute:S,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(d,e),f},H.executeNext=function(e){var S=this.buffers,f=this.queues,d=S[e],o=f[e];if(o.length){var a=o[0];try{a.execute()}catch(r){k.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(r),(!d||!d.updating)&&(o.shift(),this.executeNext(e))}}},H.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},H.current=function(e){return this.queues[e][0]},R}()},"./src/controller/cap-level-controller.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/events.ts");function w(U,e){for(var S=0;S<e.length;S++){var f=e[S];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(U,f.key,f)}}function R(U,e,S){return e&&w(U.prototype,e),S&&w(U,S),U}var H=function(){function U(S){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=S,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=U.prototype;return e.setStreamController=function(f){this.streamController=f},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 f=this.hls;f.on(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),f.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var f=this.hls;f.off(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),f.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(f,d){U.isLevelAllowed(d.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(d.droppedLevel)},e.onMediaAttaching=function(f,d){this.media=d.media instanceof HTMLVideoElement?d.media:null},e.onManifestParsed=function(f,d){var o=this.hls;this.restrictedLevels=[],this.firstLevel=d.firstLevel,o.config.capLevelToPlayerSize&&d.video&&this.startCapping()},e.onBufferCodecs=function(f,d){var o=this.hls;o.config.capLevelToPlayerSize&&d.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var f=this.hls.levels;if(f.length){var d=this.hls;d.autoLevelCapping=this.getMaxLevel(f.length-1),d.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=d.autoLevelCapping}}},e.getMaxLevel=function(f){var d=this,o=this.hls.levels;if(!o.length)return-1;var a=o.filter(function(r,h){return U.isLevelAllowed(h,d.restrictedLevels)&&h<=f});return this.clientRect=null,U.getMaxLevelByMediaSize(a,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 f=this.media,d={width:0,height:0};if(f){var o=f.getBoundingClientRect();d.width=o.width,d.height=o.height,!d.width&&!d.height&&(d.width=o.right-o.left||f.width||0,d.height=o.bottom-o.top||f.height||0)}return this.clientRect=d,d},U.isLevelAllowed=function(f,d){return d===void 0&&(d=[]),d.indexOf(f)===-1},U.getMaxLevelByMediaSize=function(f,d,o){if(!f||!f.length)return-1;for(var a=function(i,t){return t?i.width!==t.width||i.height!==t.height:!0},r=f.length-1,h=0;h<f.length;h+=1){var s=f[h];if((s.width>=d||s.height>=o)&&a(s,f[h+1])){r=h;break}}return r},R(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var f=1;try{f=self.devicePixelRatio}catch(d){}return f}}]),U}();B.default=H},"./src/controller/cmcd-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return a});var k=A("./src/events.ts"),w=A("./src/types/cmcd.ts"),R=A("./src/utils/buffer-helper.ts"),H=A("./src/utils/logger.ts");function U(r,h){for(var s=0;s<h.length;s++){var n=h[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function e(r,h,s){return h&&U(r.prototype,h),s&&U(r,s),r}function S(r,h){var s=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(s)return(s=s.call(r)).next.bind(s);if(Array.isArray(r)||(s=f(r))||h&&r&&typeof r.length=="number"){s&&(r=s);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[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 f(r,h){if(!r)return;if(typeof r=="string")return d(r,h);var s=Object.prototype.toString.call(r).slice(8,-1);if(s==="Object"&&r.constructor&&(s=r.constructor.name),s==="Map"||s==="Set")return Array.from(r);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return d(r,h)}function d(r,h){(h==null||h>r.length)&&(h=r.length);for(var s=0,n=new Array(h);s<h;s++)n[s]=r[s];return n}function o(){return o=Object.assign||function(r){for(var h=1;h<arguments.length;h++){var s=arguments[h];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[n]=s[n])}return r},o.apply(this,arguments)}var a=function(){function r(s){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(b){try{n.apply(b,{ot:w.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(m){H.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(b){try{var m=b.frag,g=n.hls.levels[m.level],E=n.getObjectType(m),_={d:m.duration*1e3,ot:E};(E===w.CMCDObjectType.VIDEO||E===w.CMCDObjectType.AUDIO||E==w.CMCDObjectType.MUXED)&&(_.br=g.bitrate/1e3,_.tb=n.getTopBandwidth(E),_.bl=n.getBufferLength(E)),n.apply(b,_)}catch(y){H.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=s;var i=this.config=s.config,t=i.cmcd;t!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||r.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var h=r.prototype;return h.registerListeners=function(){var n=this.hls;n.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this)},h.unregisterListeners=function(){var n=this.hls;n.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},h.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},h.onMediaAttached=function(n,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},h.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},h.onBufferCreated=function(n,i){var t,b;this.audioBuffer=(t=i.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(b=i.tracks.video)===null||b===void 0?void 0:b.buffer},h.createData=function(){var n;return{v:w.CMCDVersion,sf:w.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}},h.apply=function(n,i){i===void 0&&(i={}),o(i,this.createData());var t=i.ot===w.CMCDObjectType.INIT||i.ot===w.CMCDObjectType.VIDEO||i.ot===w.CMCDObjectType.MUXED;if(this.starved&&t&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var b=r.toHeaders(i);if(!Object.keys(b).length)return;n.headers||(n.headers={}),o(n.headers,b)}else{var m=r.toQuery(i);if(!m)return;n.url=r.appendQueryToUri(n.url,m)}},h.getObjectType=function(n){var i=n.type;return i==="subtitle"?w.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?w.CMCDObjectType.INIT:i==="audio"?w.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?w.CMCDObjectType.VIDEO:w.CMCDObjectType.MUXED:void 0},h.getTopBandwidth=function(n){for(var i=0,t=n===w.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,b=S(t),m;!(m=b()).done;){var g=m.value;g.bitrate>i&&(i=g.bitrate)}return i>0?i:NaN},h.getBufferLength=function(n){var i=this.hls.media,t=n===w.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!i)return NaN;var b=R.BufferHelper.bufferInfo(t,i.currentTime,this.config.maxBufferHole);return b.len*1e3},h.createPlaylistLoader=function(){var n=this.config.pLoader,i=this.applyPlaylistData,t=n||this.config.loader;return function(){function b(g){this.loader=void 0,this.loader=new t(g)}var m=b.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(E,_,y){i(E),this.loader.load(E,_,y)},e(b,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),b}()},h.createFragmentLoader=function(){var n=this.config.fLoader,i=this.applyFragmentData,t=n||this.config.loader;return function(){function b(g){this.loader=void 0,this.loader=new t(g)}var m=b.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(E,_,y){i(E),this.loader.load(E,_,y)},e(b,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),b}()},r.uuid=function(){var n=URL.createObjectURL(new Blob),i=n.toString();return URL.revokeObjectURL(n),i.substr(i.lastIndexOf("/")+1)},r.serialize=function(n){for(var i=[],t=function(D){return!Number.isNaN(D)&&D!=null&&D!==""&&D!==!1},b=function(D){return Math.round(D)},m=function(D){return b(D/100)*100},g=function(D){return encodeURIComponent(D)},E={br:b,d:b,bl:m,dl:m,mtp:m,nor:g,rtp:m,tb:b},_=Object.keys(n||{}).sort(),y=S(_),c;!(c=y()).done;){var u=c.value,l=n[u];if(!t(l))continue;if(u==="v"&&l===1)continue;if(u=="pr"&&l===1)continue;var v=E[u];v&&(l=v(l));var p=typeof l,T=void 0;u==="ot"||u==="sf"||u==="st"?T=u+"="+l:p==="boolean"?T=u:p==="number"?T=u+"="+l:T=u+"="+JSON.stringify(l),i.push(T)}return i.join(",")},r.toHeaders=function(n){for(var i=Object.keys(n),t={},b=["Object","Request","Session","Status"],m=[{},{},{},{}],g={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},E=0,_=i;E<_.length;E++){var y=_[E],c=g[y]!=null?g[y]:1;m[c][y]=n[y]}for(var u=0;u<m.length;u++){var l=r.serialize(m[u]);l&&(t["CMCD-"+b[u]]=l)}return t},r.toQuery=function(n){return"CMCD="+encodeURIComponent(r.serialize(n))},r.appendQueryToUri=function(n,i){if(!i)return n;var t=n.includes("?")?"&":"?";return""+n+t+i},r}()},"./src/controller/eme-controller.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/events.ts"),w=A("./src/errors.ts"),R=A("./src/utils/logger.ts"),H=A("./src/utils/mediakeys-helper.ts");function U(a,r){for(var h=0;h<r.length;h++){var s=r[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,r,h){return r&&U(a.prototype,r),h&&U(a,h),a}var S=3,f=function(r,h,s){var n={audioCapabilities:[],videoCapabilities:[]};return r.forEach(function(i){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:s.audioRobustness||""})}),h.forEach(function(i){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:s.videoRobustness||""})}),[n]},d=function(r,h,s,n){switch(r){case H.KeySystems.WIDEVINE:return f(h,s,n);default:throw new Error("Unknown key-system: "+r)}},o=function(){function a(h){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=h,this._config=h.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var r=a.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r._unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r.getLicenseServerUrl=function(s){switch(s){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},r._attemptKeySystemAccess=function(s,n,i){var t=this,b=d(s,n,i,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(s,b);this.mediaKeysPromise=m.then(function(g){return t._onMediaKeySystemAccessObtained(s,g)}),m.catch(function(g){R.logger.error('Failed to obtain key-system "'+s+'" access:',g)})},r._onMediaKeySystemAccessObtained=function(s,n){var i=this;R.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var b=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(m){return t.mediaKeys=m,R.logger.log('Media-keys created for key-system "'+s+'"'),i._onMediaKeysCreated(),m});return b.catch(function(m){R.logger.error("Failed to create media-keys:",m)}),b},r._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),s._onNewMediaKeySession(n.mediaKeysSession))})},r._onNewMediaKeySession=function(s){var n=this;R.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(i){n._onKeySessionMessage(s,i.message)},!1)},r._onKeySessionMessage=function(s,n){R.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(i){R.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),s.update(i)})},r.onMediaEncrypted=function(s){var n=this;if(R.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(b){if(!n._media)return;n._attemptSetMediaKeys(b),n._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(i).catch(i)},r._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(s,n){var i=this,t=this._mediaKeysList[0];if(!t){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var b=t.mediaKeysSession;if(!b){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,b.generateRequest(s,n).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(m){R.logger.error("Error generating key-session request:",m),i.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},r._createLicenseXhr=function(s,n,i){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,s,n,i);var b=this._licenseXhrSetup;if(b)try{b.call(this.hls,t,s),b=void 0}catch(m){R.logger.error(m)}try{t.readyState||t.open("POST",s,!0),b&&b.call(this.hls,t,s)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return t},r._onLicenseRequestReadyStageChange=function(s,n,i,t){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var b=s.response,m=this._licenseResponseCallback;if(m)try{b=m.call(this.hls,s,n)}catch(E){R.logger.error(E)}t(b)}else{if(R.logger.error("License Request XHR failed ("+n+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>S){this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var g=S-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+g+" attempts left"),this._requestLicense(i,t)}break}},r._generateLicenseRequestChallenge=function(s,n){switch(s.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},r._requestLicense=function(s,n){R.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(i.mediaKeySystemDomain),b=this._createLicenseXhr(t,s,n);R.logger.log("Sending license request to URL: "+t);var m=this._generateLicenseRequestChallenge(i,s);b.send(m)}catch(g){R.logger.error("Failure requesting DRM license: "+g),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(s,n){if(!this._emeEnabled)return;var i=n.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var s=this._media,n=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(s,n){if(!this._emeEnabled)return;var i=n.levels.map(function(b){return b.audioCodec}).filter(function(b){return!!b}),t=n.levels.map(function(b){return b.videoCodec}).filter(function(b){return!!b});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,i,t)},e(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();B.default=o},"./src/controller/fps-controller.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/events.ts"),w=A("./src/utils/logger.ts"),R=function(){function H(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 U=H.prototype;return U.setStreamController=function(S){this.streamController=S},U.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(S,f){var d=this.hls.config;if(d.capLevelOnFPSDrop){var o=f.media instanceof self.HTMLVideoElement?f.media:null;this.media=o,o&&typeof o.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),d.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(S,f,d){var o=performance.now();if(f){if(this.lastTime){var a=o-this.lastTime,r=d-this.lastDroppedFrames,h=f-this.lastDecodedFrames,s=1e3*r/a,n=this.hls;if(n.trigger(k.Events.FPS_DROP,{currentDropped:r,currentDecoded:h,totalDroppedFrames:d}),s>0&&r>n.config.fpsDroppedMonitoringThreshold*h){var i=n.currentLevel;w.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=i)&&(i=i-1,n.trigger(k.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:n.currentLevel}),n.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=d,this.lastDecodedFrames=f}},U.checkFPSInterval=function(){var S=this.media;if(S)if(this.isVideoPlaybackQualityAvailable){var f=S.getVideoPlaybackQuality();this.checkFPS(S,f.totalVideoFrames,f.droppedVideoFrames)}else this.checkFPS(S,S.webkitDecodedFrameCount,S.webkitDroppedFrameCount)},H}();B.default=R},"./src/controller/fragment-finders.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"findFragmentByPDT",function(){return R}),A.d(B,"findFragmentByPTS",function(){return H}),A.d(B,"fragmentWithinToleranceTest",function(){return U}),A.d(B,"pdtWithinToleranceTest",function(){return e}),A.d(B,"findFragWithCC",function(){return S});var k=A("./src/polyfills/number.ts"),w=A("./src/utils/binary-search.ts");function R(f,d,o){if(d===null||!Array.isArray(f)||!f.length||!Object(k.isFiniteNumber)(d))return null;var a=f[0].programDateTime;if(d<(a||0))return null;var r=f[f.length-1].endProgramDateTime;if(d>=(r||0))return null;o=o||0;for(var h=0;h<f.length;++h){var s=f[h];if(e(d,o,s))return s}return null}function H(f,d,o,a){o===void 0&&(o=0),a===void 0&&(a=0);var r=null;if(f?r=d[f.sn-d[0].sn+1]||null:o===0&&d[0].start===0&&(r=d[0]),r&&U(o,a,r)===0)return r;var h=w.default.search(d,U.bind(null,o,a));return h||r}function U(f,d,o){f===void 0&&(f=0),d===void 0&&(d=0);var a=Math.min(d,o.duration+(o.deltaPTS?o.deltaPTS:0));return o.start+o.duration-a<=f?1:o.start-a>f&&o.start?-1:0}function e(f,d,o){var a=Math.min(d,o.duration+(o.deltaPTS?o.deltaPTS:0))*1e3,r=o.endProgramDateTime||0;return r-a>f}function S(f,d){return w.default.search(f,function(o){return o.cc<d?1:o.cc>d?-1:0})}},"./src/controller/fragment-tracker.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"FragmentState",function(){return R}),A.d(B,"FragmentTracker",function(){return H});var k=A("./src/events.ts"),w=A("./src/types/loader.ts"),R;(function(S){S.NOT_LOADED="NOT_LOADED",S.BACKTRACKED="BACKTRACKED",S.APPENDING="APPENDING",S.PARTIAL="PARTIAL",S.OK="OK"})(R||(R={}));var H=function(){function S(d){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=d,this._registerListeners()}var f=S.prototype;return f._registerListeners=function(){var o=this.hls;o.on(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(k.Events.FRAG_LOADED,this.onFragLoaded,this)},f._unregisterListeners=function(){var o=this.hls;o.off(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(k.Events.FRAG_LOADED,this.onFragLoaded,this)},f.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},f.getAppendedFrag=function(o,a){if(a===w.PlaylistLevelType.MAIN){var r=this.activeFragment,h=this.activeParts;if(!r)return null;if(h)for(var s=h.length;s--;){var n=h[s],i=n?n.end:r.appendedPTS;if(n.start<=o&&i!==void 0&&o<=i)return s>9&&(this.activeParts=h.slice(s-9)),n}else if(r.start<=o&&r.appendedPTS!==void 0&&o<=r.appendedPTS)return r}return this.getBufferedFrag(o,a)},f.getBufferedFrag=function(o,a){for(var r=this.fragments,h=Object.keys(r),s=h.length;s--;){var n=r[h[s]];if((n==null?void 0:n.body.type)===a&&n.buffered){var i=n.body;if(i.start<=o&&o<=i.end)return i}}return null},f.detectEvictedFragments=function(o,a,r){var h=this;Object.keys(this.fragments).forEach(function(s){var n=h.fragments[s];if(!n)return;if(!n.buffered){n.body.type===r&&h.removeFragment(n.body);return}var i=n.range[o];if(!i)return;i.time.some(function(t){var b=!h.isTimeBuffered(t.startPTS,t.endPTS,a);return b&&h.removeFragment(n.body),b})})},f.detectPartialFragments=function(o){var a=this,r=this.timeRanges,h=o.frag,s=o.part;if(!r||h.sn==="initSegment")return;var n=e(h),i=this.fragments[n];if(!i)return;Object.keys(r).forEach(function(t){var b=h.elementaryStreams[t];if(!b)return;var m=r[t],g=s!==null||b.partial===!0;i.range[t]=a.getBufferedTimes(h,s,g,m)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},f.fragBuffered=function(o){var a=e(o),r=this.fragments[a];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},f.getBufferedTimes=function(o,a,r,h){for(var s={time:[],partial:r},n=a?a.start:o.start,i=a?a.end:o.end,t=o.minEndPTS||i,b=o.maxStartPTS||n,m=0;m<h.length;m++){var g=h.start(m)-this.bufferPadding,E=h.end(m)+this.bufferPadding;if(b>=g&&t<=E){s.time.push({startPTS:Math.max(n,h.start(m)),endPTS:Math.min(i,h.end(m))});break}else if(n<E&&i>g)s.partial=!0,s.time.push({startPTS:Math.max(n,h.start(m)),endPTS:Math.min(i,h.end(m))});else if(i<=g)break}return s},f.getPartialFragment=function(o){var a=null,r,h,s,n=0,i=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(b){var m=t[b];if(!m)return;U(m)&&(h=m.body.start-i,s=m.body.end+i,o>=h&&o<=s&&(r=Math.min(o-h,s-o),n<=r&&(a=m.body,n=r)))}),a},f.getState=function(o){var a=e(o),r=this.fragments[a];return r?r.buffered?U(r)?R.PARTIAL:R.OK:r.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},f.backtrack=function(o,a){var r=e(o),h=this.fragments[r];if(!h||h.backtrack)return null;var s=h.backtrack=a||h.loaded;return h.loaded=null,s},f.getBacktrackData=function(o){var a=e(o),r=this.fragments[a];if(r){var h,s=r.backtrack;if(s!=null&&(h=s.payload)!==null&&h!==void 0&&h.byteLength)return s;this.removeFragment(o)}return null},f.isTimeBuffered=function(o,a,r){for(var h,s,n=0;n<r.length;n++){if(h=r.start(n)-this.bufferPadding,s=r.end(n)+this.bufferPadding,o>=h&&a<=s)return!0;if(a<=h)return!1}return!1},f.onFragLoaded=function(o,a){var r=a.frag,h=a.part;if(r.sn==="initSegment"||r.bitrateTest||h)return;var s=e(r);this.fragments[s]={body:r,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},f.onBufferAppended=function(o,a){var r=this,h=a.frag,s=a.part,n=a.timeRanges;if(h.type===w.PlaylistLevelType.MAIN)if(this.activeFragment=h,s){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(s)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(t){var b=n[t];if(r.detectEvictedFragments(t,b),!s)for(var m=0;m<b.length;m++)h.appendedPTS=Math.max(b.end(m),h.appendedPTS||0)})},f.onFragBuffered=function(o,a){this.detectPartialFragments(a)},f.hasFragment=function(o){var a=e(o);return!!this.fragments[a]},f.removeFragmentsInRange=function(o,a,r){var h=this;Object.keys(this.fragments).forEach(function(s){var n=h.fragments[s];if(!n)return;if(n.buffered){var i=n.body;i.type===r&&i.start<a&&i.end>o&&h.removeFragment(i)}})},f.removeFragment=function(o){var a=e(o);o.stats.loaded=0,o.clearElementaryStreamInfo(),delete this.fragments[a]},f.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},S}();function U(S){var f,d;return S.buffered&&(((f=S.range.video)===null||f===void 0?void 0:f.partial)||((d=S.range.audio)===null||d===void 0?void 0:d.partial))}function e(S){return S.type+"_"+S.level+"_"+S.urlId+"_"+S.sn}},"./src/controller/gap-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"STALL_MINIMUM_DURATION_MS",function(){return U}),A.d(B,"MAX_START_GAP_JUMP",function(){return e}),A.d(B,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return S}),A.d(B,"SKIP_BUFFER_RANGE_START",function(){return f}),A.d(B,"default",function(){return d});var k=A("./src/utils/buffer-helper.ts"),w=A("./src/errors.ts"),R=A("./src/events.ts"),H=A("./src/utils/logger.ts"),U=250,e=2,S=.1,f=.05,d=function(){function o(r,h,s,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=r,this.media=h,this.fragmentTracker=s,this.hls=n}var a=o.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(h){var s=this.config,n=this.media,i=this.stalled,t=n.currentTime,b=n.seeking,m=this.seeking&&!b,g=!this.seeking&&b;if(this.seeking=b,t!==h){if(this.moved=!0,i!==null){if(this.stallReported){var E=self.performance.now()-i;H.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((g||m)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!k.BufferHelper.getBuffered(n).length)return;var _=k.BufferHelper.bufferInfo(n,t,0),y=_.len>0,c=_.nextStart||0;if(!y&&!c)return;if(b){var u=_.len>e,l=!c||c-t>e&&!this.fragmentTracker.getPartialFragment(t);if(u||l)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,p=Math.max(c,_.start||0)-t,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,L=T==null||((v=T.details)===null||v===void 0)?void 0:v.live,D=L?T.details.targetduration*2:e;if(p>0&&p<=D){this._trySkipBufferHole(null);return}}var x=self.performance.now();if(i===null){this.stalled=x;return}var M=x-i;!b&&M>=U&&this._reportStall(_.len);var j=k.BufferHelper.bufferInfo(n,t,s.maxBufferHole);this._tryFixBufferStall(j,M)},a._tryFixBufferStall=function(h,s){var n=this.config,i=this.fragmentTracker,t=this.media,b=t.currentTime,m=i.getPartialFragment(b);if(m){var g=this._trySkipBufferHole(m);if(g)return}h.len>n.maxBufferHole&&s>n.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(h){var s=this.hls,n=this.media,i=this.stallReported;i||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+h+")"),s.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},a._trySkipBufferHole=function(h){for(var s=this.config,n=this.hls,i=this.media,t=i.currentTime,b=0,m=k.BufferHelper.getBuffered(i),g=0;g<m.length;g++){var E=m.start(g);if(t+s.maxBufferHole>=b&&t<E){var _=Math.max(E+f,i.currentTime+S);return H.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+_),this.moved=!0,this.stalled=null,i.currentTime=_,h&&n.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+_,frag:h}),_}b=m.end(g)}return 0},a._tryNudgeBuffer=function(){var h=this.config,s=this.hls,n=this.media,i=n.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<h.nudgeMaxRetry){var b=i+t*h.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+i+" to "+b),n.currentTime=b,s.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+h.nudgeMaxRetry+" nudges"),s.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},o}()},"./src/controller/id3-track-controller.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/events.ts"),w=A("./src/utils/texttrack-utils.ts"),R=A("./src/demux/id3.ts"),H=.25,U=function(){function e(f){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=f,this._registerListeners()}var S=e.prototype;return S.destroy=function(){this._unregisterListeners()},S._registerListeners=function(){var d=this.hls;d.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S._unregisterListeners=function(){var d=this.hls;d.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S.onMediaAttached=function(d,o){this.media=o.media},S.onMediaDetaching=function(){if(!this.id3Track)return;Object(w.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},S.getID3Track=function(d){if(!this.media)return;for(var o=0;o<d.length;o++){var a=d[o];if(a.kind==="metadata"&&a.label==="id3")return Object(w.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},S.onFragParsingMetadata=function(d,o){if(!this.media)return;var a=o.frag,r=o.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var h=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<r.length;s++){var n=R.getID3Frames(r[s].data);if(n){var i=r[s].pts,t=s<r.length-1?r[s+1].pts:a.end,b=t-i;b<=0&&(t=i+H);for(var m=0;m<n.length;m++){var g=n[m];if(!R.isTimeStampFrame(g)){var E=new h(i,t,"");E.value=g,this.id3Track.addCue(E)}}}}},S.onBufferFlushing=function(d,o){var a=o.startOffset,r=o.endOffset,h=o.type;if(!h||h==="audio"){var s=this.id3Track;s&&Object(w.removeCuesInRange)(s,a,r)}},e}();B.default=U},"./src/controller/latency-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return e});var k=A("./src/errors.ts"),w=A("./src/events.ts"),R=A("./src/utils/logger.ts");function H(S,f){for(var d=0;d<f.length;d++){var o=f[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(S,o.key,o)}}function U(S,f,d){return f&&H(S.prototype,f),d&&H(S,d),S}var e=function(){function S(d){var o=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 o.timeupdate()},this.hls=d,this.config=d.config,this.registerListeners()}var f=S.prototype;return f.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},f.registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(w.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(w.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(w.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(w.Events.ERROR,this.onError)},f.onMediaAttached=function(o,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},f.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},f.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},f.onLevelUpdated=function(o,a){var r=a.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},f.onError=function(o,a){if(a.details!==k.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},f.timeupdate=function(){var o=this.media,a=this.levelDetails;if(!o||!a)return;this.currentTime=o.currentTime;var r=this.computeLatency();if(r===null)return;this._latency=r;var h=this.config,s=h.lowLatencyMode,n=h.maxLiveSyncPlaybackRate;if(!s||n===1)return;var i=this.targetLatency;if(i===null)return;var t=r-i,b=Math.min(this.maxLatency,i+a.targetduration),m=t<b;if(a.live&&m&&t>.05&&this.forwardBufferLength>1){var g=Math.min(2,Math.max(1,n)),E=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;o.playbackRate=Math.min(g,Math.max(1,E))}else o.playbackRate!==1&&o.playbackRate!==0&&(o.playbackRate=1)},f.estimateLiveEdge=function(){var o=this.levelDetails;return o===null?null:o.edge+o.age},f.computeLatency=function(){var o=this.estimateLiveEdge();return o===null?null:o-this.currentTime},U(S,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var o=this.config,a=this.levelDetails;return o.liveMaxLatencyDuration!==void 0?o.liveMaxLatencyDuration:a?o.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var o=this.levelDetails;if(o===null)return null;var a=o.holdBack,r=o.partHoldBack,h=o.targetduration,s=this.config,n=s.liveSyncDuration,i=s.liveSyncDurationCount,t=s.lowLatencyMode,b=this.hls.userConfig,m=t&&r||a;(b.liveSyncDuration||b.liveSyncDurationCount||m===0)&&(m=n!==void 0?n:i*h);var g=h,E=1;return m+Math.min(this.stallCount*E,g)}},{key:"liveSyncPosition",get:function(){var o=this.estimateLiveEdge(),a=this.targetLatency,r=this.levelDetails;if(o===null||a===null||r===null)return null;var h=r.edge,s=o-a-this.edgeStalled,n=h-r.totalduration,i=h-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(n,s),i)}},{key:"drift",get:function(){var o=this.levelDetails;return o===null?1:o.drift}},{key:"edgeStalled",get:function(){var o=this.levelDetails;if(o===null)return 0;var a=(this.config.lowLatencyMode&&o.partTarget||o.targetduration)*3;return Math.max(o.age-a,0)}},{key:"forwardBufferLength",get:function(){var o=this.media,a=this.levelDetails;if(!o||!a)return 0;var r=o.buffered.length;return r?o.buffered.end(r-1):a.edge-this.currentTime}}]),S}()},"./src/controller/level-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return s});var k=A("./src/types/level.ts"),w=A("./src/events.ts"),R=A("./src/errors.ts"),H=A("./src/utils/codecs.ts"),U=A("./src/controller/level-helper.ts"),e=A("./src/controller/base-playlist-controller.ts"),S=A("./src/types/loader.ts");function f(){return f=Object.assign||function(n){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var b in t)Object.prototype.hasOwnProperty.call(t,b)&&(n[b]=t[b])}return n},f.apply(this,arguments)}function d(n,i){for(var t=0;t<i.length;t++){var b=i[t];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(n,b.key,b)}}function o(n,i,t){return i&&d(n.prototype,i),t&&d(n,t),n}function a(n,i){n.prototype=Object.create(i.prototype),n.prototype.constructor=n,r(n,i)}function r(n,i){return r=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},r(n,i)}var h=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(n){a(i,n);function i(b){var m;return m=n.call(this,b,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var t=i.prototype;return t._registerListeners=function(){var m=this.hls;m.on(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(w.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(w.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(w.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var m=this.hls;m.off(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(w.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(w.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(w.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 m=this._levels;m.forEach(function(g){g.loadError=0}),n.prototype.startLoad.call(this)},t.onManifestLoaded=function(m,g){var E=[],_=[],y=[],c,u={},l,v=!1,p=!1,T=!1;if(g.levels.forEach(function(M){var j=M.attrs;v=v||!!(M.width&&M.height),p=p||!!M.videoCodec,T=T||!!M.audioCodec,h&&M.audioCodec&&M.audioCodec.indexOf("mp4a.40.34")!==-1&&(M.audioCodec=void 0);var I=M.bitrate+"-"+M.attrs.RESOLUTION+"-"+M.attrs.CODECS;l=u[I],l?l.url.push(M.url):(l=new k.Level(M),u[I]=l,E.push(l)),j&&(j.AUDIO&&Object(U.addGroupId)(l,"audio",j.AUDIO),j.SUBTITLES&&Object(U.addGroupId)(l,"text",j.SUBTITLES))}),(v||p)&&T&&(E=E.filter(function(M){var j=M.videoCodec,I=M.width,W=M.height;return!!j||!!(I&&W)})),E=E.filter(function(M){var j=M.audioCodec,I=M.videoCodec;return(!j||Object(H.isCodecSupportedInMp4)(j,"audio"))&&(!I||Object(H.isCodecSupportedInMp4)(I,"video"))}),g.audioTracks&&(_=g.audioTracks.filter(function(M){return!M.audioCodec||Object(H.isCodecSupportedInMp4)(M.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(_)),g.subtitles&&(y=g.subtitles,Object(U.assignTrackIdsByGroup)(y)),E.length>0){c=E[0].bitrate,E.sort(function(M,j){return M.bitrate-j.bitrate}),this._levels=E;for(var L=0;L<E.length;L++)if(E[L].bitrate===c){this._firstLevel=L,this.log("manifest loaded, "+E.length+" level(s) found, first bitrate: "+c);break}var D=T&&!p,x={levels:E,audioTracks:_,subtitleTracks:y,firstLevel:this._firstLevel,stats:g.stats,audio:T,video:p,altAudio:!D&&_.some(function(M){return!!M.url})};this.hls.trigger(w.Events.MANIFEST_PARSED,x),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(w.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:g.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(m,g){if(n.prototype.onError.call(this,m,g),g.fatal)return;var E=g.context,_=this._levels[this.currentLevelIndex];if(E&&(E.type===S.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&E.groupId===_.audioGroupIds[_.urlId]||E.type===S.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&E.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,c=!0,u;switch(g.details){case R.ErrorDetails.FRAG_LOAD_ERROR:case R.ErrorDetails.FRAG_LOAD_TIMEOUT:case R.ErrorDetails.KEY_LOAD_ERROR:case R.ErrorDetails.KEY_LOAD_TIMEOUT:if(g.frag){var l=this._levels[g.frag.level];l?(l.fragmentError++,l.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=g.frag.level)):u=g.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:E&&(E.deliveryDirectives&&(c=!1),u=E.level),y=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:u=g.level,y=!0;break}u!==void 0&&this.recoverLevel(g,u,y,c)},t.recoverLevel=function(m,g,E,_){var y=m.details,c=this._levels[g];if(c.loadError++,E){var u=this.retryLoadingOrFail(m);if(u)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var l=c.url.length;if(l>1&&c.loadError<l)m.levelRetry=!0,this.redundantFailover(g);else if(this.manualLevelIndex===-1){var v=g===0?this._levels.length-1:g-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(y+": switch to "+v),m.levelRetry=!0,this.hls.nextAutoLevel=v)}}},t.redundantFailover=function(m){var g=this._levels[m],E=g.url.length;if(E>1){var _=(g.urlId+1)%E;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(y){y.urlId=_}),this.level=m}},t.onFragLoaded=function(m,g){var E=g.frag;if(E!==void 0&&E.type===S.PlaylistLevelType.MAIN){var _=this._levels[E.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},t.onLevelLoaded=function(m,g){var E,_=g.level,y=g.details,c=this._levels[_];if(!c){var u;this.warn("Invalid level index "+_),(u=g.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(y.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(_,g,c.details)):(E=g.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(y.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(m,g){var E=this.hls.levels[this.currentLevelIndex];if(!E)return;if(E.audioGroupIds){for(var _=-1,y=this.hls.audioTracks[g.id].groupId,c=0;c<E.audioGroupIds.length;c++)if(E.audioGroupIds[c]===y){_=c;break}_!==E.urlId&&(E.urlId=_,this.startLoad())}},t.loadPlaylist=function(m){var g=this.currentLevelIndex,E=this._levels[g];if(this.canLoad&&E&&E.url.length>0){var _=E.urlId,y=E.url[_];if(m)try{y=m.addDirectives(y)}catch(c){this.warn("Could not construct new URL with HLS Delivery Directives: "+c)}this.log("Attempt loading level index "+g+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+_+" "+y),this.clearTimer(),this.hls.trigger(w.Events.LEVEL_LOADING,{url:y,level:g,id:_,deliveryDirectives:m||null})}},t.removeLevel=function(m,g){var E=function(c,u){return u!==g},_=this._levels.filter(function(y,c){return c!==m?!0:y.url.length>1&&g!==void 0?(y.url=y.url.filter(E),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(E)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(E)),y.urlId=0,!0):!1}).map(function(y,c){var u=y.details;return u!=null&&u.fragments&&u.fragments.forEach(function(l){l.level=c}),y});this._levels=_,this.hls.trigger(w.Events.LEVELS_UPDATED,{levels:_})},o(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var g,E=this._levels;if(E.length===0)return;if(this.currentLevelIndex===m&&(g=E[m])!==null&&g!==void 0&&g.details)return;if(m<0||m>=E.length){var _=m<0;if(this.hls.trigger(w.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:_,reason:"invalid level idx"}),_)return;m=Math.min(m,E.length-1)}this.clearTimer();var y=this.currentLevelIndex,c=E[y],u=E[m];this.log("switching to level "+m+" from "+y),this.currentLevelIndex=m;var l=f({},u,{level:m,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete l._urlId,this.hls.trigger(w.Events.LEVEL_SWITCHING,l);var v=u.details;if(!v||v.live){var p=this.switchParams(u.uri,c==null?void 0:c.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),i}(e.default)},"./src/controller/level-helper.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"addGroupId",function(){return R}),A.d(B,"assignTrackIdsByGroup",function(){return H}),A.d(B,"updatePTS",function(){return U}),A.d(B,"updateFragPTSDTS",function(){return S}),A.d(B,"mergeDetails",function(){return f}),A.d(B,"mapPartIntersection",function(){return d}),A.d(B,"mapFragmentIntersection",function(){return o}),A.d(B,"adjustSliding",function(){return a}),A.d(B,"addSliding",function(){return r}),A.d(B,"computeReloadInterval",function(){return h}),A.d(B,"getFragmentWithSN",function(){return s}),A.d(B,"getPartWith",function(){return n});var k=A("./src/polyfills/number.ts"),w=A("./src/utils/logger.ts");function R(i,t,b){switch(t){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(b);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(b);break}}function H(i){var t={};i.forEach(function(b){var m=b.groupId||"";b.id=t[m]=t[m]||0,t[m]++})}function U(i,t,b){var m=i[t],g=i[b];e(m,g)}function e(i,t){var b=t.startPTS;if(Object(k.isFiniteNumber)(b)){var m=0,g;t.sn>i.sn?(m=b-i.start,g=i):(m=i.start-b,g=t),g.duration!==m&&(g.duration=m)}else if(t.sn>i.sn){var E=i.cc===t.cc;E&&i.minEndPTS?t.start=i.start+(i.minEndPTS-i.start):t.start=i.start+i.duration}else t.start=Math.max(i.start-t.duration,0)}function S(i,t,b,m,g,E){var _=m-b;_<=0&&(w.logger.warn("Fragment should have a positive duration",t),m=b+t.duration,E=g+t.duration);var y=b,c=m,u=t.startPTS,l=t.endPTS;if(Object(k.isFiniteNumber)(u)){var v=Math.abs(u-b);Object(k.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(v,t.deltaPTS):t.deltaPTS=v,y=Math.max(b,u),b=Math.min(b,u),g=Math.min(g,t.startDTS),c=Math.min(m,l),m=Math.max(m,l),E=Math.max(E,t.endDTS)}t.duration=m-b;var p=b-t.start;t.appendedPTS=m,t.start=t.startPTS=b,t.maxStartPTS=y,t.startDTS=g,t.endPTS=m,t.minEndPTS=c,t.endDTS=E;var T=t.sn;if(!i||T<i.startSN||T>i.endSN)return 0;var L,D=T-i.startSN,x=i.fragments;for(x[D]=t,L=D;L>0;L--)e(x[L],x[L-1]);for(L=D;L<x.length-1;L++)e(x[L],x[L+1]);return i.fragmentHint&&e(x[x.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,p}function f(i,t){for(var b=null,m=i.fragments,g=m.length-1;g>=0;g--){var E=m[g].initSegment;if(E){b=E;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var _=0,y;if(o(i,t,function(L,D){L.relurl&&(_=L.cc-D.cc),Object(k.isFiniteNumber)(L.startPTS)&&Object(k.isFiniteNumber)(L.endPTS)&&(D.start=D.startPTS=L.startPTS,D.startDTS=L.startDTS,D.appendedPTS=L.appendedPTS,D.maxStartPTS=L.maxStartPTS,D.endPTS=L.endPTS,D.endDTS=L.endDTS,D.minEndPTS=L.minEndPTS,D.duration=L.endPTS-L.startPTS,D.duration&&(y=D),t.PTSKnown=t.alignedSliding=!0),D.elementaryStreams=L.elementaryStreams,D.loader=L.loader,D.stats=L.stats,D.urlId=L.urlId,L.initSegment&&(D.initSegment=L.initSegment,b=L.initSegment)}),b){var c=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;c.forEach(function(L){var D;(!L.initSegment||L.initSegment.relurl===((D=b)===null||D===void 0?void 0:D.relurl))&&(L.initSegment=b)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(L){return!L}),t.deltaUpdateFailed)){w.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=t.skippedSegments;u--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var l=t.fragments;if(_){w.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<l.length;v++)l[v].cc+=_}t.skippedSegments&&(t.startCC=t.fragments[0].cc),d(i.partList,t.partList,function(L,D){D.elementaryStreams=L.elementaryStreams,D.stats=L.stats}),y?S(t,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):a(i,t),l.length&&(t.totalduration=t.edge-l[0].start),t.driftStartTime=i.driftStartTime,t.driftStart=i.driftStart;var p=t.advancedDateTime;if(t.advanced&&p){var T=t.edge;t.driftStart||(t.driftStartTime=p,t.driftStart=T),t.driftEndTime=p,t.driftEnd=T}else t.driftEndTime=i.driftEndTime,t.driftEnd=i.driftEnd,t.advancedDateTime=i.advancedDateTime}function d(i,t,b){if(i&&t)for(var m=0,g=0,E=i.length;g<=E;g++){var _=i[g],y=t[g+m];_&&y&&_.index===y.index&&_.fragment.sn===y.fragment.sn?b(_,y):m--}}function o(i,t,b){for(var m=t.skippedSegments,g=Math.max(i.startSN,t.startSN)-t.startSN,E=(i.fragmentHint?1:0)+(m?t.endSN:Math.min(i.endSN,t.endSN))-t.startSN,_=t.startSN-i.startSN,y=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,c=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,u=g;u<=E;u++){var l=c[_+u],v=y[u];m&&!v&&u<m&&(v=t.fragments[u]=l),l&&v&&b(l,v)}}function a(i,t){var b=t.startSN+t.skippedSegments-i.startSN,m=i.fragments;if(b<0||b>=m.length)return;r(t,m[b].start)}function r(i,t){if(t){for(var b=i.fragments,m=i.skippedSegments;m<b.length;m++)b[m].start+=t;i.fragmentHint&&(i.fragmentHint.start+=t)}}function h(i,t){var b=1e3*i.levelTargetDuration,m=b/2,g=i.age,E=g>0&&g<b*3,_=t.loading.end-t.loading.start,y,c=i.availabilityDelay;if(i.updated===!1)if(E){var u=333*i.misses;y=Math.max(Math.min(m,_*2),u),i.availabilityDelay=(i.availabilityDelay||0)+y}else y=m;else E?(c=Math.min(c||b/2,g),i.availabilityDelay=c,y=c+b-g):y=b-_;return Math.round(y)}function s(i,t,b){if(!i||!i.details)return null;var m=i.details,g=m.fragments[t-m.startSN];return g||(g=m.fragmentHint,g&&g.sn===t?g:t<m.startSN&&b&&b.sn===t?b:null)}function n(i,t,b){if(!i||!i.details)return null;var m=i.details.partList;if(m)for(var g=m.length;g--;){var E=m[g];if(E.index===b&&E.fragment.sn===t)return E}return null}},"./src/controller/stream-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return m});var k=A("./src/polyfills/number.ts"),w=A("./src/controller/base-stream-controller.ts"),R=A("./src/is-supported.ts"),H=A("./src/events.ts"),U=A("./src/utils/buffer-helper.ts"),e=A("./src/controller/fragment-tracker.ts"),S=A("./src/types/loader.ts"),f=A("./src/loader/fragment.ts"),d=A("./src/demux/transmuxer-interface.ts"),o=A("./src/types/transmuxer.ts"),a=A("./src/controller/gap-controller.ts"),r=A("./src/errors.ts"),h=A("./src/utils/logger.ts");function s(g,E){for(var _=0;_<E.length;_++){var y=E[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}function n(g,E,_){return E&&s(g.prototype,E),_&&s(g,_),g}function i(g,E){g.prototype=Object.create(E.prototype),g.prototype.constructor=g,t(g,E)}function t(g,E){return t=Object.setPrototypeOf||function(y,c){return y.__proto__=c,y},t(g,E)}var b=100,m=function(g){i(E,g);function E(y,c){var u;return u=g.call(this,y,c,"[stream-controller]")||this,u.audioCodecSwap=!1,u.gapController=null,u.level=-1,u._forceStartLoad=!1,u.altAudio=!1,u.audioOnly=!1,u.fragPlaying=null,u.onvplaying=null,u.onvseeked=null,u.fragLastKbps=0,u.stalled=!1,u.couldBacktrack=!1,u.audioCodecSwitch=!1,u.videoBuffer=null,u._registerListeners(),u}var _=E.prototype;return _._registerListeners=function(){var c=this.hls;c.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(H.Events.ERROR,this.onError,this),c.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var c=this.hls;c.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(H.Events.ERROR,this.onError,this),c.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(c){if(this.levels){var u=this.lastCurrentTime,l=this.hls;if(this.stopLoad(),this.setInterval(b),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var v=l.startLevel;v===-1&&(l.config.testBandwidth?(v=0,this.bitrateTest=!0):v=l.nextAutoLevel),this.level=l.nextLoadLevel=v,this.loadedmetadata=!1}u>0&&c===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),c=u),this.state=w.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=w.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,g.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case w.State.IDLE:this.doTickIdle();break;case w.State.WAITING_LEVEL:{var c,u=this.levels,l=this.level,v=u==null||((c=u[l])===null||c===void 0)?void 0:c.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=w.State.IDLE;break}break}case w.State.FRAG_LOADING_WAITING_RETRY:{var p,T=self.performance.now(),L=this.retryDate;(!L||T>=L||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=w.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){g.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var c,u,l=this.hls,v=this.levelLastLoaded,p=this.levels,T=this.media,L=l.config,D=l.nextLoadLevel;if(v===null||!T&&(this.startFragRequested||!L.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[D])return;var x=p[D];this.level=l.nextLoadLevel=D;var M=x.details;if(!M||this.state===w.State.WAITING_LEVEL||M.live&&this.levelLastLoaded!==D){this.state=w.State.WAITING_LEVEL;return}var j=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:T,S.PlaylistLevelType.MAIN);if(j===null)return;var I=j.len,W=this.getMaxBufferLength(x.maxBitrate);if(I>=W)return;if(this._streamEnded(j,M)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,Q),this.state=w.State.ENDED;return}var fe=j.end,le=this.getNextFragment(fe,M);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var Ce=le.sn-M.startSN;Ce>1&&(le=M.fragments[Ce-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===e.FragmentState.OK&&this.nextLoadPosition>fe){var Oe=this.audioOnly&&!this.altAudio?f.ElementaryStreamTypes.AUDIO:f.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(T,Oe,S.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,M)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((c=le.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((u=le.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(le,M):this.loadFragment(le,M,fe)},_.loadFragment=function(c,u,l){var v,p=this.fragmentTracker.getState(c);if(this.fragCurrent=c,p===e.FragmentState.BACKTRACKED){var T=this.fragmentTracker.getBacktrackData(c);if(T){this._handleFragmentLoadProgress(T),this._handleFragmentLoadComplete(T);return}else p=e.FragmentState.NOT_LOADED}p===e.FragmentState.NOT_LOADED||p===e.FragmentState.PARTIAL?c.sn==="initSegment"?this._loadInitSegment(c):this.bitrateTest?(c.bitrateTest=!0,this.log("Fragment "+c.sn+" of level "+c.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(c)):(this.startFragRequested=!0,g.prototype.loadFragment.call(this,c,u,l)):p===e.FragmentState.APPENDING?this.reduceMaxBufferLength(c.duration)&&this.fragmentTracker.removeFragment(c):((v=this.media)===null||v===void 0?void 0:v.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(c){var u=this.fragmentTracker.getAppendedFrag(c,S.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},_.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,S.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var c=this.levels,u=this.media;if(u!=null&&u.readyState){var l,v=this.getAppendedFrag(u.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!u.paused&&c){var p=this.hls.nextLoadLevel,T=c[p],L=this.fragLastKbps;L&&this.fragCurrent?l=this.fragCurrent.duration*T.maxBitrate/(1e3*L)+1:l=0}else l=0;var D=this.getBufferedFrag(u.currentTime+l);if(D){var x=this.followingBufferedFrag(D);if(x){this.abortCurrentFrag();var M=x.maxStartPTS?x.maxStartPTS:x.start,j=x.duration,I=Math.max(D.end,M+Math.min(Math.max(j-this.config.maxFragLookUpTolerance,j*.5),j*.75));this.flushMainBuffer(I,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===w.State.KEY_LOADING&&(this.state=w.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(c,u){g.prototype.flushMainBuffer.call(this,c,u,this.altAudio?"video":null)},_.onMediaAttached=function(c,u){g.prototype.onMediaAttached.call(this,c,u);var l=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),l.addEventListener("playing",this.onvplaying),l.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,l,this.fragmentTracker,this.hls)},_.onMediaDetaching=function(){var c=this.media;c&&(c.removeEventListener("playing",this.onvplaying),c.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),g.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var c=this.media,u=c?c.currentTime:null;Object(k.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(c,u){var l=!1,v=!1,p;u.levels.forEach(function(T){p=T.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(l=!0),p.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=l&&v&&!Object(R.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=u.levels,this.startFragRequested=!1},_.onLevelLoading=function(c,u){var l=this.levels;if(!l||this.state!==w.State.IDLE)return;var v=l[u.level];(!v.details||v.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(v.details))&&(this.state=w.State.WAITING_LEVEL)},_.onLevelLoaded=function(c,u){var l,v=this.levels,p=u.level,T=u.details,L=T.totalduration;if(!v){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+L);var D=this.fragCurrent;D&&(this.state===w.State.FRAG_LOADING||this.state===w.State.FRAG_LOADING_WAITING_RETRY)&&(D.level!==u.level&&D.loader&&(this.state=w.State.IDLE,D.loader.abort()));var x=v[p],M=0;if(T.live||(l=x.details)!==null&&l!==void 0&&l.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;M=this.alignPlaylists(T,x.details)}if(x.details=T,this.levelLastLoaded=p,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:T,level:p}),this.state===w.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=w.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,M),this.tick()},_._handleFragmentLoadProgress=function(c){var u,l=c.frag,v=c.part,p=c.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+l.sn+" of level "+l.level+" will not be buffered");return}var L=T[l.level],D=L.details;if(!D){this.warn("Dropping fragment "+l.sn+" of level "+l.level+" after level details were reset");return}var x=L.videoCodec,M=D.PTSKnown||!D.live,j=(u=l.initSegment)===null||u===void 0?void 0:u.data,I=this._getAudioCodec(L),W=this.transmuxer=this.transmuxer||new d.default(this.hls,S.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=v?v.index:-1,fe=Q!==-1,le=new o.ChunkMetadata(l.level,l.sn,l.stats.chunkCount,p.byteLength,Q,fe),Ce=this.initPTS[l.cc];W.push(p,j,I,x,l,v,D.totalduration,M,le,Ce)},_.onAudioTrackSwitching=function(c,u){var l=this.altAudio,v=!!u.url,p=u.id;if(!v){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T!=null&&T.loader&&(this.log("Switching to main audio track, cancel main fragment load"),T.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var L=this.hls;l&&L.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),L.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:p})}},_.onAudioTrackSwitched=function(c,u){var l=u.id,v=!!this.hls.audioTracks[l].url;if(v){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=v,this.tick()},_.onBufferCreated=function(c,u){var l=u.tracks,v,p,T=!1;for(var L in l){var D=l[L];if(D.id==="main"){if(p=L,v=D,L==="video"){var x=l[L];x&&(this.videoBuffer=x.buffer)}}else T=!0}T&&v?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(c,u){var l=u.frag,v=u.part;if(l&&l.type!==S.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(l)){this.warn("Fragment "+l.sn+(v?" p: "+v.index:"")+" of level "+l.level+" finished buffering, but was aborted. state: "+this.state),this.state===w.State.PARSED&&(this.state=w.State.IDLE);return}var p=v?v.stats:l.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),l.sn!=="initSegment"&&(this.fragPrevious=l),this.fragBufferedComplete(l,v)},_.onError=function(c,u){switch(u.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(S.PlaylistLevelType.MAIN,u);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==w.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=w.State.ERROR):!u.levelRetry&&this.state===w.State.WAITING_LEVEL&&(this.state=w.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===w.State.PARSING||this.state===w.State.PARSED)){var l=!0,v=this.getFwdBufferInfo(this.media,S.PlaylistLevelType.MAIN);v&&v.len>.5&&(l=!this.reduceMaxBufferLength(v.len)),l&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var c=this.media,u=this.gapController;if(!c||!u||!c.readyState)return;var l=U.BufferHelper.getBuffered(c);!this.loadedmetadata&&l.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=c.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=w.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(c,u){var l=u.type;if(l!==f.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(l===f.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,l,S.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(c,u){this.levels=u.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var c=this.media,u=c.currentTime,l=this.startPosition;if(l>=0&&u<l){if(c.seeking){h.logger.log("could not seek to "+l+", already seeking at "+u);return}var v=U.BufferHelper.getBuffered(c),p=v.length?v.start(0):0,T=p-l;T>0&&(T<this.config.maxBufferHole||T<this.config.maxFragLookUpTolerance)&&(h.logger.log("adjusting start position by "+T+" to match buffer start"),l+=T,this.startPosition=l),this.log("seek to target start position "+l+" from current time "+u),c.currentTime=l}},_._getAudioCodec=function(c){var u=this.config.defaultAudioCodec||c.audioCodec;return this.audioCodecSwap&&u&&(this.log("Swapping audio codec"),u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5"),u},_._loadBitrateTestFrag=function(c){var u=this;this._doFragLoad(c).then(function(l){var v=u.hls;if(!l||v.nextLoadLevel||u.fragContextChanged(c))return;u.fragLoadError=0,u.state=w.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var p=c.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),v.trigger(H.Events.FRAG_LOADED,l)})},_._handleTransmuxComplete=function(c){var u,l="main",v=this.hls,p=c.remuxResult,T=c.chunkMeta,L=this.getCurrentContext(T);if(!L){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var D=L.frag,x=L.part,M=L.level,j=p.video,I=p.text,W=p.id3,Q=p.initSegment,fe=this.altAudio?void 0:p.audio;if(this.fragContextChanged(D))return;if(this.state=w.State.PARSING,Q){Q.tracks&&(this._bufferInitSegment(M,Q.tracks,D,T),v.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:l,tracks:Q.tracks}));var le=Q.initPTS,Ce=Q.timescale;Object(k.isFiniteNumber)(le)&&(this.initPTS[D.cc]=le,v.trigger(H.Events.INIT_PTS_FOUND,{frag:D,id:l,initPTS:le,timescale:Ce}))}if(j&&p.independent!==!1){if(M.details){var Oe=j.startPTS,Re=j.endPTS,Le=j.startDTS,Pe=j.endDTS;if(x)x.elementaryStreams[j.type]={startPTS:Oe,endPTS:Re,startDTS:Le,endDTS:Pe};else if(j.firstKeyFrame&&j.independent&&(this.couldBacktrack=!0),j.dropped&&j.independent){var _e=this.getLoadPosition()+this.config.maxBufferHole;if(_e<Oe){this.backtrack(D);return}D.setElementaryStreamInfo(j.type,D.start,Re,D.start,Pe,!0)}D.setElementaryStreamInfo(j.type,Oe,Re,Le,Pe),this.bufferFragmentData(j,D,x,T)}}else if(p.independent===!1){this.backtrack(D);return}if(fe){var N=fe.startPTS,O=fe.endPTS,C=fe.startDTS,F=fe.endDTS;x&&(x.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:N,endPTS:O,startDTS:C,endDTS:F}),D.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,N,O,C,F),this.bufferFragmentData(fe,D,x,T)}if(W!=null&&(u=W.samples)!==null&&u!==void 0&&u.length){var z={frag:D,id:l,samples:W.samples};v.trigger(H.Events.FRAG_PARSING_METADATA,z)}if(I){var P={frag:D,id:l,samples:I.samples};v.trigger(H.Events.FRAG_PARSING_USERDATA,P)}},_._bufferInitSegment=function(c,u,l,v){var p=this;if(this.state!==w.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var T=u.audio,L=u.video,D=u.audiovideo;if(T){var x=c.audioCodec,M=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),T.metadata.channelCount!==1&&M.indexOf("firefox")===-1&&(x="mp4a.40.5")),M.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log("Android: force audio codec to "+x)),c.audioCodec&&c.audioCodec!==x&&this.log('Swapping manifest audio codec "'+c.audioCodec+'" for "'+x+'"'),T.levelCodec=x,T.id="main",this.log("Init audio buffer, container:"+T.container+", codecs[selected/level/parsed]=["+(x||"")+"/"+(c.audioCodec||"")+"/"+T.codec+"]")}L&&(L.levelCodec=c.videoCodec,L.id="main",this.log("Init video buffer, container:"+L.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+L.codec+"]")),D&&this.log("Init audiovideo buffer, container:"+D.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+D.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(j){var I=u[j],W=I.initSegment;W!=null&&W.byteLength&&p.hls.trigger(H.Events.BUFFER_APPENDING,{type:j,data:W,frag:l,part:null,chunkMeta:v,parent:l.type})}),this.tick()},_.backtrack=function(c){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(c);var u=this.fragmentTracker.backtrack(c);this.fragPrevious=null,this.nextLoadPosition=c.start,u?this.resetFragmentLoading(c):this.state=w.State.BACKTRACKING},_.checkFragmentChanged=function(){var c=this.media,u=null;if(c&&c.readyState>1&&c.seeking===!1){var l=c.currentTime;if(U.BufferHelper.isBuffered(c,l)?u=this.getAppendedFrag(l):U.BufferHelper.isBuffered(c,l+.1)&&(u=this.getAppendedFrag(l+.1)),u){var v=this.fragPlaying,p=u.level;(!v||u.sn!==v.sn||v.level!==p||u.urlId!==v.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:u}),(!v||v.level!==p)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=u)}}},n(E,[{key:"nextLevel",get:function(){var c=this.nextBufferedFrag;return c?c.level:-1}},{key:"currentLevel",get:function(){var c=this.media;if(c){var u=this.getAppendedFrag(c.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var c=this.media;if(c){var u=this.getAppendedFrag(c.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),E}(w.default)},"./src/controller/subtitle-stream-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"SubtitleStreamController",function(){return i});var k=A("./src/events.ts"),w=A("./src/utils/logger.ts"),R=A("./src/utils/buffer-helper.ts"),H=A("./src/controller/fragment-finders.ts"),U=A("./src/utils/discontinuities.ts"),e=A("./src/controller/level-helper.ts"),S=A("./src/controller/fragment-tracker.ts"),f=A("./src/controller/base-stream-controller.ts"),d=A("./src/types/loader.ts"),o=A("./src/types/level.ts");function a(t,b){for(var m=0;m<b.length;m++){var g=b[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(t,g.key,g)}}function r(t,b,m){return b&&a(t.prototype,b),m&&a(t,m),t}function h(t,b){t.prototype=Object.create(b.prototype),t.prototype.constructor=t,s(t,b)}function s(t,b){return s=Object.setPrototypeOf||function(g,E){return g.__proto__=E,g},s(t,b)}var n=500,i=function(t){h(b,t);function b(g,E){var _;return _=t.call(this,g,E,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var m=b.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var E=this.hls;E.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(k.Events.ERROR,this.onError,this),E.on(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.on(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.on(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var E=this.hls;E.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(k.Events.ERROR,this.onError,this),E.off(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.off(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.off(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=f.State.IDLE,this.setInterval(n),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(E,_){this.mainDetails=_.details},m.onSubtitleFragProcessed=function(E,_){var y=_.frag,c=_.success;if(this.fragPrevious=y,this.state=f.State.IDLE,!c)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var l,v=y.start,p=0;p<u.length;p++)if(v>=u[p].start&&v<=u[p].end){l=u[p];break}var T=y.start+y.duration;l?l.end=T:(l={start:v,end:T},u.push(l)),this.fragmentTracker.fragBuffered(y)},m.onBufferFlushing=function(E,_){var y=_.startOffset,c=_.endOffset;if(y===0&&c!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,l=this.levels;if(!l.length||!l[u]||!l[u].details)return;var v=l[u].details,p=v.targetduration,T=c-p;if(T<=0)return;_.endOffsetSubtitles=Math.max(0,T),this.tracksBuffered.forEach(function(L){for(var D=0;D<L.length;){if(L[D].end<=T){L.shift();continue}else if(L[D].start<T)L[D].start=T;else break;D++}}),this.fragmentTracker.removeFragmentsInRange(y,T,d.PlaylistLevelType.SUBTITLE)}},m.onError=function(E,_){var y,c=_.frag;if(!c||c.type!==d.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=f.State.IDLE},m.onSubtitleTracksUpdated=function(E,_){var y=this,c=_.subtitleTracks;this.tracksBuffered=[],this.levels=c.map(function(u){return new o.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){y.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(E,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var y=this.levels[this.currentTrackId];y!=null&&y.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,y&&this.setInterval(n)},m.onSubtitleTrackLoaded=function(E,_){var y,c=_.details,u=_.id,l=this.currentTrackId,v=this.levels;if(!v.length)return;var p=v[l];if(u>=v.length||u!==l||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(y=p.details)!==null&&y!==void 0&&y.live){var T=this.mainDetails;if(c.deltaUpdateFailed||!T)return;var L=T.fragments[0];if(!p.details)c.hasProgramDateTime&&T.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(c,T):L&&Object(e.addSliding)(c,L.start);else{var D=this.alignPlaylists(c,p.details);D===0&&L&&Object(e.addSliding)(c,L.start)}}if(p.details=c,this.levelLastLoaded=u,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===f.State.IDLE){var x=Object(H.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);x||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},m._handleFragmentLoadComplete=function(E){var _=E.frag,y=E.payload,c=_.decryptdata,u=this.hls;if(this.fragContextChanged(_))return;if(y&&y.byteLength>0&&c&&c.key&&c.iv&&c.method==="AES-128"){var l=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(y),c.key.buffer,c.iv.buffer).then(function(v){var p=performance.now();u.trigger(k.Events.FRAG_DECRYPTED,{frag:_,payload:v,stats:{tstart:l,tdecrypt:p}})})}},m.doTick=function(){if(!this.media){this.state=f.State.IDLE;return}if(this.state===f.State.IDLE){var E,_=this.currentTrackId,y=this.levels;if(!y.length||!y[_]||!y[_].details)return;var c=y[_].details,u=c.targetduration,l=this.config,v=this.media,p=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-u,l.maxBufferHole),T=p.end,L=p.len,D=this.getMaxBufferLength()+u;if(L>D)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var x=c.fragments,M=x.length,j=c.edge,I,W=this.fragPrevious;if(T<j){var Q=l.maxFragLookUpTolerance;W&&c.hasProgramDateTime&&(I=Object(H.findFragmentByPDT)(x,W.endProgramDateTime,Q)),I||(I=Object(H.findFragmentByPTS)(W,x,T,Q),!I&&W&&W.start<x[0].start&&(I=x[0]))}else I=x[M-1];(E=I)!==null&&E!==void 0&&E.encrypted?(w.logger.log("Loading key for "+I.sn),this.state=f.State.KEY_LOADING,this.hls.trigger(k.Events.KEY_LOADING,{frag:I})):I&&this.fragmentTracker.getState(I)===S.FragmentState.NOT_LOADED&&this.loadFragment(I,c,T)}},m.loadFragment=function(E,_,y){this.fragCurrent=E,t.prototype.loadFragment.call(this,E,_,y)},r(b,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),b}(f.default)},"./src/controller/subtitle-track-controller.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/events.ts"),w=A("./src/utils/texttrack-utils.ts"),R=A("./src/controller/base-playlist-controller.ts"),H=A("./src/types/loader.ts");function U(a,r){for(var h=0;h<r.length;h++){var s=r[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,r,h){return r&&U(a.prototype,r),h&&U(a,h),a}function S(a,r){a.prototype=Object.create(r.prototype),a.prototype.constructor=a,f(a,r)}function f(a,r){return f=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},f(a,r)}var d=function(a){S(r,a);function r(s){var n;return n=a.call(this,s,"[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 h=r.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},h.registerListeners=function(){var n=this.hls;n.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(k.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var n=this.hls;n.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(k.Events.ERROR,this.onError,this)},h.onMediaAttached=function(n,i){if(this.media=i.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},h.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},h.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var n=o(this.media.textTracks);n.forEach(function(i){Object(w.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},h.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},h.onManifestParsed=function(n,i){this.tracks=i.subtitleTracks},h.onSubtitleTrackLoaded=function(n,i){var t=i.id,b=i.details,m=this.trackId,g=this.tracksInGroup[m];if(!g){this.warn("Invalid subtitle track id "+t);return}var E=g.details;g.details=i.details,this.log("subtitle track "+t+" loaded ["+b.startSN+"-"+b.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,i,E))},h.onLevelLoading=function(n,i){this.switchLevel(i.level)},h.onLevelSwitching=function(n,i){this.switchLevel(i.level)},h.switchLevel=function(n){var i=this.hls.levels[n];if(!(i!=null&&i.textGroupIds))return;var t=i.textGroupIds[i.urlId];if(this.groupId!==t){var b=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(_){return!t||_.groupId===t});this.tracksInGroup=m;var g=this.findTrackId(b==null?void 0:b.name)||this.findTrackId();this.groupId=t;var E={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(k.Events.SUBTITLE_TRACKS_UPDATED,E),g!==-1&&this.setSubtitleTrack(g,b)}},h.findTrackId=function(n){for(var i=this.tracksInGroup,t=0;t<i.length;t++){var b=i[t];if((!this.selectDefaultTrack||b.default)&&(!n||n===b.name))return b.id}return-1},h.onError=function(n,i){if(a.prototype.onError.call(this,n,i),i.fatal||!i.context)return;i.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},h.loadPlaylist=function(n){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var t=i.id,b=i.groupId,m=i.url;if(n)try{m=n.addDirectives(m)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADING,{url:m,id:t,groupId:b,deliveryDirectives:n||null})}},h.toggleTrackModes=function(n){var i=this,t=this.media,b=this.subtitleDisplay,m=this.trackId;if(!t)return;var g=o(t.textTracks),E=g.filter(function(c){return c.groupId===i.groupId});if(n===-1)[].slice.call(g).forEach(function(c){c.mode="disabled"});else{var _=E[m];_&&(_.mode="disabled")}var y=E[n];y&&(y.mode=b?"showing":"hidden")},h.setSubtitleTrack=function(n,i){var t,b=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(t=b[n])!==null&&t!==void 0&&t.details)||n<-1||n>=b.length)return;this.clearTimer();var m=b[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,m){var g=m.id,E=m.groupId,_=E===void 0?"":E,y=m.name,c=m.type,u=m.url;this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:g,groupId:_,name:y,type:c,url:u});var l=this.switchParams(m.url,i==null?void 0:i.details);this.loadPlaylist(l)}else this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:n})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,i=o(this.media.textTracks),t=0;t<i.length;t++)if(i[t].mode==="hidden")n=t;else if(i[t].mode==="showing"){n=t;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},e(r,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,i)}}]),r}(R.default);function o(a){for(var r=[],h=0;h<a.length;h++){var s=a[h];s.kind==="subtitles"&&s.label&&r.push(a[h])}return r}B.default=d},"./src/controller/timeline-controller.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"TimelineController",function(){return o});var k=A("./src/polyfills/number.ts"),w=A("./src/events.ts"),R=A("./src/utils/cea-608-parser.ts"),H=A("./src/utils/output-filter.ts"),U=A("./src/utils/webvtt-parser.ts"),e=A("./src/utils/texttrack-utils.ts"),S=A("./src/utils/imsc1-ttml-parser.ts"),f=A("./src/types/loader.ts"),d=A("./src/utils/logger.ts"),o=function(){function s(i){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new H.default(this,"textTrack1"),b=new H.default(this,"textTrack2"),m=new H.default(this,"textTrack3"),g=new H.default(this,"textTrack4");this.cea608Parser1=new R.default(1,t,b),this.cea608Parser2=new R.default(3,m,g)}i.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(w.Events.FRAG_LOADING,this.onFragLoading,this),i.on(w.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(w.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(w.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(w.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(w.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=s.prototype;return n.destroy=function(){var t=this.hls;t.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(w.Events.FRAG_LOADING,this.onFragLoading,this),t.off(w.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(w.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(w.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(w.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(w.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(t,b,m,g,E){for(var _=!1,y=E.length;y--;){var c=E[y],u=r(c[0],c[1],b,m);if(u>=0&&(c[0]=Math.min(c[0],b),c[1]=Math.max(c[1],m),_=!0,u/(m-b)>.5))return}if(_||E.push([b,m]),this.config.renderTextTracksNatively){var l=this.captionsTracks[t];this.Cues.newCue(l,b,m,g)}else{var v=this.Cues.newCue(null,b,m,g);this.hls.trigger(w.Events.CUES_PARSED,{type:"captions",cues:v,track:t})}},n.onInitPtsFound=function(t,b){var m=this,g=b.frag,E=b.id,_=b.initPTS,y=b.timescale,c=this.unparsedVttFrags;E==="main"&&(this.initPTS[g.cc]=_,this.timescale[g.cc]=y),c.length&&(this.unparsedVttFrags=[],c.forEach(function(u){m.onFragLoaded(w.Events.FRAG_LOADED,u)}))},n.getExistingTrack=function(t){var b=this.media;if(b)for(var m=0;m<b.textTracks.length;m++){var g=b.textTracks[m];if(g[t])return g}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 b=this.captionsProperties,m=this.captionsTracks,g=this.media,E=b[t],_=E.label,y=E.languageCode,c=this.getExistingTrack(t);if(c)m[t]=c,Object(e.clearCurrentCues)(m[t]),Object(e.sendAddTrackEvent)(m[t],g);else{var u=this.createTextTrack("captions",_,y);u&&(u[t]=!0,m[t]=u)}},n.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var b=this.captionsProperties[t];if(!b)return;var m=b.label,g={_id:t,label:m,kind:"captions",default:b.media?!!b.media.default:!1,closedCaptions:b.media};this.nonNativeCaptionsTracks[t]=g,this.hls.trigger(w.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[g]})},n.createTextTrack=function(t,b,m){var g=this.media;return g?g.addTextTrack(t,b,m):void 0},n.onMediaAttaching=function(t,b){this.media=b.media,this._cleanTracks()},n.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(b){Object(e.clearCurrentCues)(t[b]),delete t[b]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=h(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},n._cleanTracks=function(){var t=this.media;if(!t)return;var b=t.textTracks;if(b)for(var m=0;m<b.length;m++)Object(e.clearCurrentCues)(b[m])},n.onSubtitleTracksUpdated=function(t,b){var m=this;this.textTracks=[];var g=b.subtitleTracks||[],E=g.some(function(u){return u.textCodec===S.IMSC1_CODEC});if(this.config.enableWebVTT||E&&this.config.enableIMSC1){var _=this.tracks&&g&&this.tracks.length===g.length;if(this.tracks=g||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,l){var v;if(l<y.length){for(var p=null,T=0;T<y.length;T++)if(a(y[T],u)){p=y[T];break}p&&(v=p)}v?Object(e.clearCurrentCues)(v):(v=m.createTextTrack("subtitles",u.name,u.lang),v&&(v.mode="disabled")),v&&(v.groupId=u.groupId,m.textTracks.push(v))})}else if(!_&&this.tracks&&this.tracks.length){var c=this.tracks.map(function(u){return{label:u.name,kind:u.type.toLowerCase(),default:u.default,subtitleTrack:u}});this.hls.trigger(w.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},n.onManifestLoaded=function(t,b){var m=this;this.config.enableCEA708Captions&&b.captions&&b.captions.forEach(function(g){var E=/(?:CC|SERVICE)([1-4])/.exec(g.instreamId);if(!E)return;var _="textTrack"+E[1],y=m.captionsProperties[_];if(!y)return;y.label=g.name,g.lang&&(y.languageCode=g.lang),y.media=g})},n.onFragLoading=function(t,b){var m=this.cea608Parser1,g=this.cea608Parser2,E=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(m&&g))return;if(b.frag.type===f.PlaylistLevelType.MAIN){var y,c,u=b.frag.sn,l=(y=b==null||((c=b.part)===null||c===void 0)?void 0:c.index)!=null?y:-1;u===E+1||u===E&&l===_+1||(m.reset(),g.reset()),this.lastSn=u,this.lastPartIndex=l}},n.onFragLoaded=function(t,b){var m=b.frag,g=b.payload,E=this.initPTS,_=this.unparsedVttFrags;if(m.type===f.PlaylistLevelType.SUBTITLE)if(g.byteLength){if(!Object(k.isFiniteNumber)(E[m.cc])){_.push(b),E.length&&this.hls.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var y=m.decryptdata;if(y==null||y.key==null||y.method!=="AES-128"){var c=this.tracks[m.level],u=this.vttCCs;u[m.cc]||(u[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),c&&c.textCodec===S.IMSC1_CODEC?this._parseIMSC1(m,g):this._parseVTTs(m,g,u)}}else this.hls.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(t,b){var m=this,g=this.hls;Object(S.parseIMSC1)(b,this.initPTS[t.cc],this.timescale[t.cc],function(E){m._appendCues(E,t.level),g.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(E){d.logger.log("Failed to parse IMSC1: "+E),g.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:E})})},n._parseVTTs=function(t,b,m){var g=this,E=this.hls;Object(U.parseWebVTT)(b,this.initPTS[t.cc],this.timescale[t.cc],m,t.cc,t.start,function(_){g._appendCues(_,t.level),E.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(_){g._fallbackToIMSC1(t,b),d.logger.log("Failed to parse VTT cue: "+_),E.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:_})})},n._fallbackToIMSC1=function(t,b){var m=this,g=this.tracks[t.level];g.textCodec||Object(S.parseIMSC1)(b,this.initPTS[t.cc],this.timescale[t.cc],function(){g.textCodec=S.IMSC1_CODEC,m._parseIMSC1(t,b)},function(){g.textCodec="wvtt"})},n._appendCues=function(t,b){var m=this.hls;if(this.config.renderTextTracksNatively){var g=this.textTracks[b];if(g.mode==="disabled")return;t.forEach(function(y){return Object(e.addCueToTrack)(g,y)})}else{var E=this.tracks[b],_=E.default?"default":"subtitles"+b;m.trigger(w.Events.CUES_PARSED,{type:"subtitles",cues:t,track:_})}},n.onFragDecrypted=function(t,b){var m=b.frag;if(m.type===f.PlaylistLevelType.SUBTITLE){if(!Object(k.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(b);return}this.onFragLoaded(w.Events.FRAG_LOADED,b)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(t,b){var m=this.cea608Parser1,g=this.cea608Parser2;if(!this.enabled||!(m&&g))return;for(var E=0;E<b.samples.length;E++){var _=b.samples[E].bytes;if(_){var y=this.extractCea608Data(_);m.addData(b.samples[E].pts,y[0]),g.addData(b.samples[E].pts,y[1])}}},n.onBufferFlushing=function(t,b){var m=b.startOffset,g=b.endOffset,E=b.endOffsetSubtitles,_=b.type,y=this.media;if(!y||y.currentTime<g)return;if(!_||_==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(l){return Object(e.removeCuesInRange)(c[l],m,g)})}if(this.config.renderTextTracksNatively&&(m===0&&E!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(l){return Object(e.removeCuesInRange)(u[l],m,E)})}},n.extractCea608Data=function(t){for(var b=t[0]&31,m=2,g=[[],[]],E=0;E<b;E++){var _=t[m++],y=127&t[m++],c=127&t[m++],u=(4&_)!==0,l=3&_;if(y===0&&c===0)continue;u&&((l===0||l===1)&&(g[l].push(y),g[l].push(c)))}return g},s}();function a(s,n){return s&&s.label===n.name&&!(s.textTrack1||s.textTrack2)}function r(s,n,i,t){return Math.min(n,t)-Math.max(s,i)}function h(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return k});var k=function(){function w(H,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=U}var R=w.prototype;return R.decrypt=function(U,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,U)},w}()},"./src/crypt/aes-decryptor.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"removePadding",function(){return w}),A.d(B,"default",function(){return R});var k=A("./src/utils/typed-array.ts");function w(H){var U=H.byteLength,e=U&&new DataView(H.buffer).getUint8(U-1);return e?Object(k.sliceUint8)(H,0,U-e):H}var R=function(){function H(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=H.prototype;return U.uint8ArrayToUint32Array_=function(S){for(var f=new DataView(S),d=new Uint32Array(4),o=0;o<4;o++)d[o]=f.getUint32(o*4);return d},U.initTable=function(){var S=this.sBox,f=this.invSBox,d=this.subMix,o=d[0],a=d[1],r=d[2],h=d[3],s=this.invSubMix,n=s[0],i=s[1],t=s[2],b=s[3],m=new Uint32Array(256),g=0,E=0,_=0;for(_=0;_<256;_++)_<128?m[_]=_<<1:m[_]=_<<1^283;for(_=0;_<256;_++){var y=E^E<<1^E<<2^E<<3^E<<4;y=y>>>8^y&255^99,S[g]=y,f[y]=g;var c=m[g],u=m[c],l=m[u],v=m[y]*257^y*16843008;o[g]=v<<24|v>>>8,a[g]=v<<16|v>>>16,r[g]=v<<8|v>>>24,h[g]=v,v=l*16843009^u*65537^c*257^g*16843008,n[y]=v<<24|v>>>8,i[y]=v<<16|v>>>16,t[y]=v<<8|v>>>24,b[y]=v,g?(g=c^m[m[m[l^c]]],E^=m[m[E]]):g=E=1}},U.expandKey=function(S){for(var f=this.uint8ArrayToUint32Array_(S),d=!0,o=0;o<f.length&&d;)d=f[o]===this.key[o],o++;if(d)return;this.key=f;var a=this.keySize=f.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var r=this.ksRows=(a+6+1)*4,h,s,n=this.keySchedule=new Uint32Array(r),i=this.invKeySchedule=new Uint32Array(r),t=this.sBox,b=this.rcon,m=this.invSubMix,g=m[0],E=m[1],_=m[2],y=m[3],c,u;for(h=0;h<r;h++){if(h<a){c=n[h]=f[h];continue}u=c,h%a===0?(u=u<<8|u>>>24,u=t[u>>>24]<<24|t[u>>>16&255]<<16|t[u>>>8&255]<<8|t[u&255],u^=b[h/a|0]<<24):a>6&&h%a===4&&(u=t[u>>>24]<<24|t[u>>>16&255]<<16|t[u>>>8&255]<<8|t[u&255]),n[h]=c=(n[h-a]^u)>>>0}for(s=0;s<r;s++)h=r-s,s&3?u=n[h]:u=n[h-4],s<4||h<=4?i[s]=u:i[s]=g[t[u>>>24]]^E[t[u>>>16&255]]^_[t[u>>>8&255]]^y[t[u&255]],i[s]=i[s]>>>0},U.networkToHostOrderSwap=function(S){return S<<24|(S&65280)<<8|(S&16711680)>>8|S>>>24},U.decrypt=function(S,f,d){for(var o=this.keySize+6,a=this.invKeySchedule,r=this.invSBox,h=this.invSubMix,s=h[0],n=h[1],i=h[2],t=h[3],b=this.uint8ArrayToUint32Array_(d),m=b[0],g=b[1],E=b[2],_=b[3],y=new Int32Array(S),c=new Int32Array(y.length),u,l,v,p,T,L,D,x,M,j,I,W,Q,fe,le=this.networkToHostOrderSwap;f<y.length;){for(M=le(y[f]),j=le(y[f+1]),I=le(y[f+2]),W=le(y[f+3]),T=M^a[0],L=W^a[1],D=I^a[2],x=j^a[3],Q=4,fe=1;fe<o;fe++)u=s[T>>>24]^n[L>>16&255]^i[D>>8&255]^t[x&255]^a[Q],l=s[L>>>24]^n[D>>16&255]^i[x>>8&255]^t[T&255]^a[Q+1],v=s[D>>>24]^n[x>>16&255]^i[T>>8&255]^t[L&255]^a[Q+2],p=s[x>>>24]^n[T>>16&255]^i[L>>8&255]^t[D&255]^a[Q+3],T=u,L=l,D=v,x=p,Q=Q+4;u=r[T>>>24]<<24^r[L>>16&255]<<16^r[D>>8&255]<<8^r[x&255]^a[Q],l=r[L>>>24]<<24^r[D>>16&255]<<16^r[x>>8&255]<<8^r[T&255]^a[Q+1],v=r[D>>>24]<<24^r[x>>16&255]<<16^r[T>>8&255]<<8^r[L&255]^a[Q+2],p=r[x>>>24]<<24^r[T>>16&255]<<16^r[L>>8&255]<<8^r[D&255]^a[Q+3],c[f]=le(u^m),c[f+1]=le(p^g),c[f+2]=le(v^E),c[f+3]=le(l^_),m=M,g=j,E=I,_=W,f=f+4}return c.buffer},H}()},"./src/crypt/decrypter.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return f});var k=A("./src/crypt/aes-crypto.ts"),w=A("./src/crypt/fast-aes-key.ts"),R=A("./src/crypt/aes-decryptor.ts"),H=A("./src/utils/logger.ts"),U=A("./src/utils/mp4-tools.ts"),e=A("./src/utils/typed-array.ts"),S=16,f=function(){function d(a,r,h){var s=h===void 0?{}:h,n=s.removePKCS7Padding,i=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=a,this.config=r,this.removePKCS7Padding=i,i)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(b){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var o=d.prototype;return o.destroy=function(){this.observer=null},o.isSync=function(){return this.config.enableSoftwareAES},o.flush=function(){var r=this.currentResult;if(!r){this.reset();return}var h=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(h):h},o.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},o.decrypt=function(r,h,s,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(r),h,s);var i=this.flush();i&&n(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(r),h,s).then(n)},o.softwareDecrypt=function(r,h,s){var n=this.currentIV,i=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(r=Object(U.appendUint8Array)(t,r),this.remainderData=null);var b=this.getValidChunk(r);if(!b.length)return null;n&&(s=n);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new R.default),m.expandKey(h);var g=i;return this.currentResult=m.decrypt(b.buffer,0,s),this.currentIV=Object(e.sliceUint8)(b,-16).buffer,g||null},o.webCryptoDecrypt=function(r,h,s){var n=this,i=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new w.default(i,h)),this.fastAesKey.expandKey().then(function(t){if(!i)return Promise.reject(new Error("web crypto not initialized"));var b=new k.default(i,s);return b.decrypt(r.buffer,t)}).catch(function(t){return n.onWebCryptoError(t,r,h,s)})},o.onWebCryptoError=function(r,h,s,n){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",r),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,s,n)},o.getValidChunk=function(r){var h=r,s=r.length-r.length%S;return s!==r.length&&(h=Object(e.sliceUint8)(r,0,s),this.remainderData=Object(e.sliceUint8)(r,s)),h},o.logOnce=function(r){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+r),this.logEnabled=!1},d}()},"./src/crypt/fast-aes-key.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return k});var k=function(){function w(H,U){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=U}var R=w.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},w}()},"./src/demux/aacdemuxer.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/demux/base-audio-demuxer.ts"),w=A("./src/demux/adts.ts"),R=A("./src/utils/logger.ts"),H=A("./src/demux/id3.ts");function U(f,d){f.prototype=Object.create(d.prototype),f.prototype.constructor=f,e(f,d)}function e(f,d){return e=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},e(f,d)}var S=function(f){U(d,f);function d(a,r){var h;return h=f.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=a,h.config=r,h}var o=d.prototype;return o.resetInitSegment=function(r,h,s){f.prototype.resetInitSegment.call(this,r,h,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:r,duration:s,inputTimeScale:9e4,dropped:0}},d.probe=function(r){if(!r)return!1;for(var h=H.getID3Data(r,0)||[],s=h.length,n=r.length;s<n;s++)if(w.probe(r,s))return R.logger.log("ADTS sync word found !"),!0;return!1},o.canParse=function(r,h){return w.canParse(r,h)},o.appendFrame=function(r,h,s){w.initTrackConfig(r,this.observer,h,s,r.manifestCodec);var n=w.appendFrame(r,h,s,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},d}(k.default);S.minProbeByteLength=9,B.default=S},"./src/demux/adts.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"getAudioConfig",function(){return H}),A.d(B,"isHeaderPattern",function(){return U}),A.d(B,"getHeaderLength",function(){return e}),A.d(B,"getFullFrameLength",function(){return S}),A.d(B,"canGetFrameLength",function(){return f}),A.d(B,"isHeader",function(){return d}),A.d(B,"canParse",function(){return o}),A.d(B,"probe",function(){return a}),A.d(B,"initTrackConfig",function(){return r}),A.d(B,"getFrameDuration",function(){return h}),A.d(B,"parseFrameHeader",function(){return s}),A.d(B,"appendFrame",function(){return n});var k=A("./src/utils/logger.ts"),w=A("./src/errors.ts"),R=A("./src/events.ts");function H(i,t,b,m){var g,E,_,y,c=navigator.userAgent.toLowerCase(),u=m,l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];g=((t[b+2]&192)>>>6)+1;var v=(t[b+2]&60)>>>2;if(v>l.length-1){i.trigger(R.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return _=(t[b+2]&1)<<2,_|=(t[b+3]&192)>>>6,k.logger.log("manifest codec:"+m+", ADTS type:"+g+", samplingIndex:"+v),/firefox/i.test(c)?v>=6?(g=5,y=new Array(4),E=v-3):(g=2,y=new Array(2),E=v):c.indexOf("android")!==-1?(g=2,y=new Array(2),E=v):(g=5,y=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&v>=6?E=v-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(v>=6&&_===1||/vivaldi/i.test(c))||!m&&_===1)&&(g=2,y=new Array(2)),E=v)),y[0]=g<<3,y[0]|=(v&14)>>1,y[1]|=(v&1)<<7,y[1]|=_<<3,g===5&&(y[1]|=(E&14)>>1,y[2]=(E&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:l[v],channelCount:_,codec:"mp4a.40."+g,manifestCodec:u}}function U(i,t){return i[t]===255&&(i[t+1]&246)===240}function e(i,t){return i[t+1]&1?7:9}function S(i,t){return(i[t+3]&3)<<11|i[t+4]<<3|(i[t+5]&224)>>>5}function f(i,t){return t+5<i.length}function d(i,t){return t+1<i.length&&U(i,t)}function o(i,t){return f(i,t)&&U(i,t)&&S(i,t)<=i.length-t}function a(i,t){if(d(i,t)){var b=e(i,t);if(t+b>=i.length)return!1;var m=S(i,t);if(m<=b)return!1;var g=t+m;return g===i.length||d(i,g)}return!1}function r(i,t,b,m,g){if(!i.samplerate){var E=H(t,b,m,g);if(!E)return;i.config=E.config,i.samplerate=E.samplerate,i.channelCount=E.channelCount,i.codec=E.codec,i.manifestCodec=E.manifestCodec,k.logger.log("parsed codec:"+i.codec+", rate:"+E.samplerate+", channels:"+E.channelCount)}}function h(i){return 1024*9e4/i}function s(i,t,b,m,g){var E=e(i,t),_=S(i,t);if(_-=E,_>0){var y=b+m*g;return{headerLength:E,frameLength:_,stamp:y}}}function n(i,t,b,m,g){var E=h(i.samplerate),_=s(t,b,m,g,E);if(_){var y=_.frameLength,c=_.headerLength,u=_.stamp,l=c+y,v=Math.max(0,b+l-t.length),p;v?(p=new Uint8Array(l-c),p.set(t.subarray(b+c,t.length),0)):p=t.subarray(b+c,b+l);var T={unit:p,pts:u};return v||i.samples.push(T),{sample:T,length:l,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"initPTSFn",function(){return S});var k=A("./src/polyfills/number.ts"),w=A("./src/demux/id3.ts"),R=A("./src/demux/dummy-demuxed-track.ts"),H=A("./src/utils/mp4-tools.ts"),U=A("./src/utils/typed-array.ts"),e=function(){function f(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var d=f.prototype;return d.resetInitSegment=function(a,r,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},d.resetTimeStamp=function(){},d.resetContiguity=function(){},d.canParse=function(a,r){return!1},d.appendFrame=function(a,r,h){},d.demux=function(a,r){this.cachedData&&(a=Object(H.appendUint8Array)(this.cachedData,a),this.cachedData=null);var h=w.getID3Data(a,0),s=h?h.length:0,n,i,t=this._audioTrack,b=this._id3Track,m=h?w.getTimeStamp(h):void 0,g=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=S(m,r)),h&&h.length>0&&b.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),i=this.initPTS;s<g;){if(this.canParse(a,s)){var E=this.appendFrame(t,a,s);E?(this.frameIndex++,i=E.sample.pts,s+=E.length,n=s):s=g}else w.canParse(a,s)?(h=w.getID3Data(a,s),b.samples.push({pts:i,dts:i,data:h}),s+=h.length,n=s):s++;if(s===g&&n!==g){var _=Object(U.sliceUint8)(a,n);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:t,avcTrack:Object(R.dummyTrack)(),id3Track:b,textTrack:Object(R.dummyTrack)()}},d.demuxSampleAes=function(a,r,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},d.flush=function(a){var r=this.cachedData;return r&&(this.cachedData=null,this.demux(r,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},d.destroy=function(){},f}(),S=function(d,o){return Object(k.isFiniteNumber)(d)?d*90:o*9e4};B.default=e},"./src/demux/chunk-cache.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return k});var k=function(){function R(){this.chunks=[],this.dataLength=0}var H=R.prototype;return H.push=function(e){this.chunks.push(e),this.dataLength+=e.length},H.flush=function(){var e=this.chunks,S=this.dataLength,f;if(e.length)e.length===1?f=e[0]:f=w(e,S);else return new Uint8Array(0);return this.reset(),f},H.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function w(R,H){for(var U=new Uint8Array(H),e=0,S=0;S<R.length;S++){var f=R[S];U.set(f,e),e+=f.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"dummyTrack",function(){return k});function k(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/utils/logger.ts"),w=function(){function R(U){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=U,this.bytesAvailable=U.byteLength,this.word=0,this.bitsAvailable=0}var H=R.prototype;return H.loadWord=function(){var e=this.data,S=this.bytesAvailable,f=e.byteLength-S,d=new Uint8Array(4),o=Math.min(4,S);if(o===0)throw new Error("no bytes available");d.set(e.subarray(f,f+o)),this.word=new DataView(d.buffer).getUint32(0),this.bitsAvailable=o*8,this.bytesAvailable-=o},H.skipBits=function(e){var S;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,S=e>>3,e-=S>>3,this.bytesAvailable-=S,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},H.readBits=function(e){var S=Math.min(this.bitsAvailable,e),f=this.word>>>32-S;return e>32&&k.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=S,this.bitsAvailable>0?this.word<<=S:this.bytesAvailable>0&&this.loadWord(),S=e-S,S>0&&this.bitsAvailable?f<<S|this.readBits(S):f},H.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()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},H.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(e){for(var S=8,f=8,d,o=0;o<e;o++)f!==0&&(d=this.readEG(),f=(S+d+256)%256),S=f===0?S:f},H.readSPS=function(){var e=0,S=0,f=0,d=0,o,a,r,h=this.readUByte.bind(this),s=this.readBits.bind(this),n=this.readUEG.bind(this),i=this.readBoolean.bind(this),t=this.skipBits.bind(this),b=this.skipEG.bind(this),m=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);h();var E=h();if(s(5),t(3),h(),m(),E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128){var _=n();if(_===3&&t(1),m(),m(),t(1),i())for(a=_!==3?8:12,r=0;r<a;r++)i()&&(r<6?g(16):g(64))}m();var y=n();if(y===0)n();else if(y===1)for(t(1),b(),b(),o=n(),r=0;r<o;r++)b();m(),t(1);var c=n(),u=n(),l=s(1);l===0&&t(1),t(1),i()&&(e=n(),S=n(),f=n(),d=n());var v=[1,1];if(i()&&i()){var p=h();switch(p){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:{v=[h()<<8|h(),h()<<8|h()];break}}}return{width:Math.ceil((c+1)*16-e*2-S*2),height:(2-l)*(u+1)*16-(l?2:4)*(f+d),pixelRatio:v}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();B.default=w},"./src/demux/id3.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"isHeader",function(){return k}),A.d(B,"isFooter",function(){return w}),A.d(B,"getID3Data",function(){return R}),A.d(B,"canParse",function(){return U}),A.d(B,"getTimeStamp",function(){return e}),A.d(B,"isTimeStampFrame",function(){return S}),A.d(B,"getID3Frames",function(){return d}),A.d(B,"decodeFrame",function(){return o}),A.d(B,"utf8ArrayToStr",function(){return n}),A.d(B,"testables",function(){return i});var k=function(g,E){return E+10<=g.length&&(g[E]===73&&g[E+1]===68&&g[E+2]===51&&(g[E+3]<255&&g[E+4]<255&&(g[E+6]<128&&g[E+7]<128&&g[E+8]<128&&g[E+9]<128)))},w=function(g,E){return E+10<=g.length&&(g[E]===51&&g[E+1]===68&&g[E+2]===73&&(g[E+3]<255&&g[E+4]<255&&(g[E+6]<128&&g[E+7]<128&&g[E+8]<128&&g[E+9]<128)))},R=function(g,E){for(var _=E,y=0;k(g,E);){y+=10;var c=H(g,E+6);y+=c,w(g,E+10)&&(y+=10),E+=y}return y>0?g.subarray(_,_+y):void 0},H=function(g,E){var _=0;return _=(g[E]&127)<<21,_|=(g[E+1]&127)<<14,_|=(g[E+2]&127)<<7,_|=g[E+3]&127,_},U=function(g,E){return k(g,E)&&H(g,E+6)+10<=g.length-E},e=function(g){for(var E=d(g),_=0;_<E.length;_++){var y=E[_];if(S(y))return s(y)}return},S=function(g){return g&&g.key==="PRIV"&&g.info==="com.apple.streaming.transportStreamTimestamp"},f=function(g){var E=String.fromCharCode(g[0],g[1],g[2],g[3]),_=H(g,4),y=10;return{type:E,size:_,data:g.subarray(y,y+_)}},d=function(g){for(var E=0,_=[];k(g,E);){var y=H(g,E+6);E+=10;for(var c=E+y;E+8<c;){var u=f(g.subarray(E)),l=o(u);l&&_.push(l),E+=u.size+10}w(g,E)&&(E+=10)}return _},o=function(g){return g.type==="PRIV"?a(g):g.type[0]==="W"?h(g):r(g)},a=function(g){if(g.size<2)return;var E=n(g.data,!0),_=new Uint8Array(g.data.subarray(E.length+1));return{key:g.type,info:E,data:_.buffer}},r=function(g){if(g.size<2)return;if(g.type==="TXXX"){var E=1,_=n(g.data.subarray(E),!0);E+=_.length+1;var y=n(g.data.subarray(E));return{key:g.type,info:_,data:y}}var c=n(g.data.subarray(1));return{key:g.type,data:c}},h=function(g){if(g.type==="WXXX"){if(g.size<2)return;var E=1,_=n(g.data.subarray(E),!0);E+=_.length+1;var y=n(g.data.subarray(E));return{key:g.type,info:_,data:y}}var c=n(g.data);return{key:g.type,data:c}},s=function(g){if(g.data.byteLength===8){var E=new Uint8Array(g.data),_=E[3]&1,y=(E[4]<<23)+(E[5]<<15)+(E[6]<<7)+E[7];return y/=45,_&&(y+=4772185884e-2),Math.round(y)}return},n=function(g,E){E===void 0&&(E=!1);var _=b();if(_){var y=_.decode(g);if(E){var c=y.indexOf("\0");return c!==-1?y.substring(0,c):y}return y.replace(/\0/g,"")}for(var u=g.length,l,v,p,T="",L=0;L<u;){if(l=g[L++],l===0&&E)return T;if(l===0||l===3)continue;switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:T+=String.fromCharCode(l);break;case 12:case 13:v=g[L++],T+=String.fromCharCode((l&31)<<6|v&63);break;case 14:v=g[L++],p=g[L++],T+=String.fromCharCode((l&15)<<12|(v&63)<<6|(p&63)<<0);break;default:}}return T},i={decodeTextFrame:r},t;function b(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/demux/base-audio-demuxer.ts"),w=A("./src/demux/id3.ts"),R=A("./src/utils/logger.ts"),H=A("./src/demux/mpegaudio.ts");function U(f,d){f.prototype=Object.create(d.prototype),f.prototype.constructor=f,e(f,d)}function e(f,d){return e=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},e(f,d)}var S=function(f){U(d,f);function d(){return f.apply(this,arguments)||this}var o=d.prototype;return o.resetInitSegment=function(r,h,s){f.prototype.resetInitSegment.call(this,r,h,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:s,inputTimeScale:9e4,dropped:0}},d.probe=function(r){if(!r)return!1;for(var h=w.getID3Data(r,0)||[],s=h.length,n=r.length;s<n;s++)if(H.probe(r,s))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},o.canParse=function(r,h){return H.canParse(r,h)},o.appendFrame=function(r,h,s){return this.initPTS===null?void 0:H.appendFrame(r,h,s,this.initPTS,this.frameIndex)},d}(k.default);S.minProbeByteLength=4,B.default=S},"./src/demux/mp4demuxer.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/utils/mp4-tools.ts"),w=A("./src/demux/dummy-demuxed-track.ts"),R=function(){function H(e,S){this.remainderData=null,this.config=void 0,this.config=S}var U=H.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},H.probe=function(S){return Object(k.findBox)({data:S,start:0,end:Math.min(S.length,16384)},["moof"]).length>0},U.demux=function(S){var f=S,d=Object(w.dummyTrack)();if(this.config.progressive){this.remainderData&&(f=Object(k.appendUint8Array)(this.remainderData,S));var o=Object(k.segmentValidRange)(f);this.remainderData=o.remainder,d.samples=o.valid||new Uint8Array}else d.samples=f;return{audioTrack:Object(w.dummyTrack)(),avcTrack:d,id3Track:Object(w.dummyTrack)(),textTrack:Object(w.dummyTrack)()}},U.flush=function(){var S=Object(w.dummyTrack)();return S.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(w.dummyTrack)(),avcTrack:S,id3Track:Object(w.dummyTrack)(),textTrack:Object(w.dummyTrack)()}},U.demuxSampleAes=function(S,f,d){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},H}();R.minProbeByteLength=1024,B.default=R},"./src/demux/mpegaudio.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"appendFrame",function(){return e}),A.d(B,"parseHeader",function(){return S}),A.d(B,"isHeaderPattern",function(){return f}),A.d(B,"isHeader",function(){return d}),A.d(B,"canParse",function(){return o}),A.d(B,"probe",function(){return a});var k=null,w=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function e(r,h,s,n,i){if(s+24>h.length)return;var t=S(h,s);if(t&&s+t.frameLength<=h.length){var b=t.samplesPerFrame*9e4/t.sampleRate,m=n+i*b,g={unit:h.subarray(s,s+t.frameLength),pts:m,dts:m};return r.config=[],r.channelCount=t.channelCount,r.samplerate=t.sampleRate,r.samples.push(g),{sample:g,length:t.frameLength,missing:0}}}function S(r,h){var s=r[h+1]>>3&3,n=r[h+1]>>1&3,i=r[h+2]>>4&15,t=r[h+2]>>2&3;if(s!==1&&i!==0&&i!==15&&t!==3){var b=r[h+2]>>1&1,m=r[h+3]>>6,g=s===3?3-n:n===3?3:4,E=w[g*14+i-1]*1e3,_=s===3?0:s===2?1:2,y=R[_*3+t],c=m===3?1:2,u=H[s][n],l=U[n],v=u*8*l,p=Math.floor(u*E/y+b)*l;if(k===null){var T=navigator.userAgent||"",L=T.match(/Chrome\/(\d+)/i);k=L?parseInt(L[1]):0}var D=!!k&&k<=87;return D&&n===2&&E>=224e3&&m===0&&(r[h+3]=r[h+3]|128),{sampleRate:y,channelCount:c,frameLength:p,samplesPerFrame:v}}}function f(r,h){return r[h]===255&&(r[h+1]&224)===224&&(r[h+1]&6)!==0}function d(r,h){return h+1<r.length&&f(r,h)}function o(r,h){var s=4;return f(r,h)&&s<=r.length-h}function a(r,h){if(h+1<r.length&&f(r,h)){var s=4,n=S(r,h),i=s;n!=null&&n.frameLength&&(i=n.frameLength);var t=h+i;return t===r.length||d(r,t)}return!1}},"./src/demux/sample-aes.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/crypt/decrypter.ts"),w=A("./src/demux/tsdemuxer.ts"),R=function(){function H(e,S,f){this.keyData=void 0,this.decrypter=void 0,this.keyData=f,this.decrypter=new k.default(e,S,{removePKCS7Padding:!1})}var U=H.prototype;return U.decryptBuffer=function(S,f){this.decrypter.decrypt(S,this.keyData.key.buffer,this.keyData.iv.buffer,f)},U.decryptAacSample=function(S,f,d,o){var a=S[f].unit,r=a.subarray(16,a.length-a.length%16),h=r.buffer.slice(r.byteOffset,r.byteOffset+r.length),s=this;this.decryptBuffer(h,function(n){var i=new Uint8Array(n);a.set(i,16),o||s.decryptAacSamples(S,f+1,d)})},U.decryptAacSamples=function(S,f,d){for(;;f++){if(f>=S.length){d();return}if(S[f].unit.length<32)continue;var o=this.decrypter.isSync();if(this.decryptAacSample(S,f,d,o),!o)return}},U.getAvcEncryptedData=function(S){for(var f=Math.floor((S.length-48)/160)*16+16,d=new Int8Array(f),o=0,a=32;a<=S.length-16;a+=160,o+=16)d.set(S.subarray(a,a+16),o);return d},U.getAvcDecryptedUnit=function(S,f){for(var d=new Uint8Array(f),o=0,a=32;a<=S.length-16;a+=160,o+=16)S.set(d.subarray(o,o+16),a);return S},U.decryptAvcSample=function(S,f,d,o,a,r){var h=Object(w.discardEPB)(a.data),s=this.getAvcEncryptedData(h),n=this;this.decryptBuffer(s.buffer,function(i){a.data=n.getAvcDecryptedUnit(h,i),r||n.decryptAvcSamples(S,f,d+1,o)})},U.decryptAvcSamples=function(S,f,d,o){if(S instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;f++,d=0){if(f>=S.length){o();return}for(var a=S[f].units;!(d>=a.length);d++){var r=a[d];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(S,f,d,o,r,h),!h)return}}},H}();B.default=R},"./src/demux/transmuxer-interface.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return a});var k=A("./node_modules/webworkify-webpack/index.js"),w=A.n(k),R=A("./src/events.ts"),H=A("./src/demux/transmuxer.ts"),U=A("./src/utils/logger.ts"),e=A("./src/errors.ts"),S=A("./src/utils/mediasource-helper.ts"),f=A("./node_modules/eventemitter3/index.js"),d=A.n(f),o=Object(S.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function r(s,n,i,t){var b=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=s,this.id=n,this.onTransmuxComplete=i,this.onFlush=t;var m=s.config,g=function(u,l){l=l||{},l.frag=b.frag,l.id=b.id,s.trigger(u,l)};this.observer=new f.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,g),this.observer.on(R.Events.ERROR,g);var E={mp4:o.isTypeSupported("video/mp4"),mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var y;try{y=this.worker=k("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(c){s.trigger(R.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(c.message+" ("+c.filename+":"+c.lineno+")")})},y.postMessage({cmd:"init",typeSupported:E,vendor:_,id:n,config:JSON.stringify(m)})}catch(c){U.logger.warn("Error in worker:",c),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),y&&self.URL.revokeObjectURL(y.objectURL),this.transmuxer=new H.default(this.observer,E,m,_,n),this.worker=null}}else this.transmuxer=new H.default(this.observer,E,m,_,n)}var h=r.prototype;return h.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},h.push=function(n,i,t,b,m,g,E,_,y,c){var u=this;y.transmuxing.start=self.performance.now();var l=this.transmuxer,v=this.worker,p=g?g.start:m.start,T=m.decryptdata,L=this.frag,D=!(L&&m.cc===L.cc),x=!(L&&y.level===L.level),M=L?y.sn-L.sn:-1,j=this.part?y.part-this.part.index:1,I=!x&&(M===1||M===0&&j===1),W=self.performance.now();(x||M||m.stats.parsing.start===0)&&(m.stats.parsing.start=W),g&&(j||!I)&&(g.stats.parsing.start=W);var Q=new H.TransmuxState(D,I,_,x,p);if(!I||D){U.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+y.sn+" p: "+y.part+" level: "+y.level+" id: "+y.id+`
|
|
discontinuity: `+D+`
|
|
trackSwitch: `+x+`
|
|
contiguous: `+I+`
|
|
accurateTimeOffset: `+_+`
|
|
timeOffset: `+p);var fe=new H.TransmuxConfig(t,b,i,E,c);this.configureTransmuxer(fe)}if(this.frag=m,this.part=g,v)v.postMessage({cmd:"demux",data:n,decryptdata:T,chunkMeta:y,state:Q},n instanceof ArrayBuffer?[n]:[]);else if(l){var le=l.push(n,T,y,Q);Object(H.isPromise)(le)?le.then(function(Ce){u.handleTransmuxComplete(Ce)}):this.handleTransmuxComplete(le)}},h.flush=function(n){var i=this;n.transmuxing.start=self.performance.now();var t=this.transmuxer,b=this.worker;if(b)b.postMessage({cmd:"flush",chunkMeta:n});else if(t){var m=t.flush(n);Object(H.isPromise)(m)?m.then(function(g){i.handleFlushResult(g,n)}):this.handleFlushResult(m,n)}},h.handleFlushResult=function(n,i){var t=this;n.forEach(function(b){t.handleTransmuxComplete(b)}),this.onFlush(i)},h.onWorkerMessage=function(n){var i=n.data,t=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,t.trigger(i.event,i.data);break}}},h.configureTransmuxer=function(n){var i=this.worker,t=this.transmuxer;i?i.postMessage({cmd:"configure",config:n}):t&&t.configure(n)},h.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},r}()},"./src/demux/transmuxer-worker.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return e});var k=A("./src/demux/transmuxer.ts"),w=A("./src/events.ts"),R=A("./src/utils/logger.ts"),H=A("./node_modules/eventemitter3/index.js"),U=A.n(H);function e(a){var r=new H.EventEmitter,h=function(n,i){a.postMessage({event:n,data:i})};r.on(w.Events.FRAG_DECRYPTED,h),r.on(w.Events.ERROR,h),a.addEventListener("message",function(s){var n=s.data;switch(n.cmd){case"init":{var i=JSON.parse(n.config);a.transmuxer=new k.default(r,n.typeSupported,i,n.vendor,n.id),Object(R.enableLogs)(i.debug),h("init",null);break}case"configure":{a.transmuxer.configure(n.config);break}case"demux":{var t=a.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(k.isPromise)(t)?t.then(function(g){S(a,g)}):S(a,t);break}case"flush":{var b=n.chunkMeta,m=a.transmuxer.flush(b);Object(k.isPromise)(m)?m.then(function(g){d(a,g,b)}):d(a,m,b);break}default:break}})}function S(a,r){if(o(r.remuxResult))return;var h=[],s=r.remuxResult,n=s.audio,i=s.video;n&&f(h,n),i&&f(h,i),a.postMessage({event:"transmuxComplete",data:r},h)}function f(a,r){r.data1&&a.push(r.data1.buffer),r.data2&&a.push(r.data2.buffer)}function d(a,r,h){r.forEach(function(s){S(a,s)}),a.postMessage({event:"flush",data:h})}function o(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return i}),A.d(B,"isPromise",function(){return m}),A.d(B,"TransmuxConfig",function(){return g}),A.d(B,"TransmuxState",function(){return E});var k=A("./src/events.ts"),w=A("./src/errors.ts"),R=A("./src/crypt/decrypter.ts"),H=A("./src/demux/aacdemuxer.ts"),U=A("./src/demux/mp4demuxer.ts"),e=A("./src/demux/tsdemuxer.ts"),S=A("./src/demux/mp3demuxer.ts"),f=A("./src/remux/mp4-remuxer.ts"),d=A("./src/remux/passthrough-remuxer.ts"),o=A("./src/demux/chunk-cache.ts"),a=A("./src/utils/mp4-tools.ts"),r=A("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(_){r.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var s=[{demux:e.default,remux:f.default},{demux:U.default,remux:d.default},{demux:H.default,remux:f.default},{demux:S.default,remux:f.default}],n=1024;s.forEach(function(_){var y=_.demux;n=Math.max(n,y.minProbeByteLength)});var i=function(){function _(c,u,l,v,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 o.default,this.observer=c,this.typeSupported=u,this.config=l,this.vendor=v,this.id=p}var y=_.prototype;return y.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},y.push=function(u,l,v,p){var T=this,L=v.transmuxing;L.executeStart=h();var D=new Uint8Array(u),x=this.cache,M=this.config,j=this.currentTransmuxState,I=this.transmuxConfig;p&&(this.currentTransmuxState=p);var W=t(D,l);if(W&&W.method==="AES-128"){var Q=this.getDecrypter();if(M.enableSoftwareAES){var fe=Q.softwareDecrypt(D,W.key.buffer,W.iv.buffer);if(!fe)return L.executeEnd=h(),b(v);D=new Uint8Array(fe)}else return this.decryptionPromise=Q.webCryptoDecrypt(D,W.key.buffer,W.iv.buffer).then(function(we){var Ae=T.push(we,null,v);return T.decryptionPromise=null,Ae}),this.decryptionPromise}var le=p||j,Ce=le.contiguous,Oe=le.discontinuity,Re=le.trackSwitch,Le=le.accurateTimeOffset,Pe=le.timeOffset,_e=I.audioCodec,N=I.videoCodec,O=I.defaultInitPts,C=I.duration,F=I.initSegmentData;if((Oe||Re)&&this.resetInitSegment(F,_e,N,C),Oe&&this.resetInitialTimestamp(O),Ce||this.resetContiguity(),this.needsProbing(D,Oe,Re)){if(x.dataLength){var z=x.flush();D=Object(a.appendUint8Array)(z,D)}this.configureTransmuxer(D,I)}var P=this.transmux(D,W,Pe,Le,v),oe=this.currentTransmuxState;return oe.contiguous=!0,oe.discontinuity=!1,oe.trackSwitch=!1,L.executeEnd=h(),P},y.flush=function(u){var l=this,v=u.transmuxing;v.executeStart=h();var p=this.decrypter,T=this.cache,L=this.currentTransmuxState,D=this.decryptionPromise;if(D)return D.then(function(){return l.flush(u)});var x=[],M=L.timeOffset;if(p){var j=p.flush();j&&x.push(this.push(j,null,u))}var I=T.dataLength;T.reset();var W=this.demuxer,Q=this.remuxer;if(!W||!Q)return I>=n&&this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=h(),[b(u)];var fe=W.flush(M);return m(fe)?fe.then(function(le){return l.flushRemux(x,le,u),x}):(this.flushRemux(x,fe,u),x)},y.flushRemux=function(u,l,v){var p=l.audioTrack,T=l.avcTrack,L=l.id3Track,D=l.textTrack,x=this.currentTransmuxState,M=x.accurateTimeOffset,j=x.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var I=this.remuxer.remux(p,T,L,D,j,M,!0,this.id);u.push({remuxResult:I,chunkMeta:v}),v.transmuxing.executeEnd=h()},y.resetInitialTimestamp=function(u){var l=this.demuxer,v=this.remuxer;if(!l||!v)return;l.resetTimeStamp(u),v.resetTimeStamp(u)},y.resetContiguity=function(){var u=this.demuxer,l=this.remuxer;if(!u||!l)return;u.resetContiguity(),l.resetNextTimestamp()},y.resetInitSegment=function(u,l,v,p){var T=this.demuxer,L=this.remuxer;if(!T||!L)return;T.resetInitSegment(l,v,p),L.resetInitSegment(u,l,v)},y.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},y.transmux=function(u,l,v,p,T){var L;return l&&l.method==="SAMPLE-AES"?L=this.transmuxSampleAes(u,l,v,p,T):L=this.transmuxUnencrypted(u,v,p,T),L},y.transmuxUnencrypted=function(u,l,v,p){var T=this.demuxer.demux(u,l,!1,!this.config.progressive),L=T.audioTrack,D=T.avcTrack,x=T.id3Track,M=T.textTrack,j=this.remuxer.remux(L,D,x,M,l,v,!1,this.id);return{remuxResult:j,chunkMeta:p}},y.transmuxSampleAes=function(u,l,v,p,T){var L=this;return this.demuxer.demuxSampleAes(u,l,v).then(function(D){var x=L.remuxer.remux(D.audioTrack,D.avcTrack,D.id3Track,D.textTrack,v,p,!1,L.id);return{remuxResult:x,chunkMeta:T}})},y.configureTransmuxer=function(u,l){for(var v=this.config,p=this.observer,T=this.typeSupported,L=this.vendor,D=l.audioCodec,x=l.defaultInitPts,M=l.duration,j=l.initSegmentData,I=l.videoCodec,W,Q=0,fe=s.length;Q<fe;Q++)if(s[Q].demux.probe(u)){W=s[Q];break}W||(r.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:U.default,remux:d.default});var le=this.demuxer,Ce=this.remuxer,Oe=W.remux,Re=W.demux;(!Ce||!(Ce instanceof Oe))&&(this.remuxer=new Oe(p,v,T,L)),(!le||!(le instanceof Re))&&(this.demuxer=new Re(p,v,T),this.probe=Re.probe),this.resetInitSegment(j,D,I,M),this.resetInitialTimestamp(x)},y.needsProbing=function(u,l,v){return!this.demuxer||!this.remuxer||l||v},y.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new R.default(this.observer,this.config)),u},_}();function t(_,y){var c=null;return _.byteLength>0&&y!=null&&y.key!=null&&y.iv!==null&&y.method!=null&&(c=y),c}var b=function(y){return{remuxResult:{},chunkMeta:y}};function m(_){return"then"in _&&_.then instanceof Function}var g=function(y,c,u,l,v){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=y,this.videoCodec=c,this.initSegmentData=u,this.duration=l,this.defaultInitPts=v},E=function(y,c,u,l,v){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=y,this.contiguous=c,this.accurateTimeOffset=u,this.trackSwitch=l,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"discardEPB",function(){return b});var k=A("./src/demux/adts.ts"),w=A("./src/demux/mpegaudio.ts"),R=A("./src/demux/exp-golomb.ts"),H=A("./src/demux/id3.ts"),U=A("./src/demux/sample-aes.ts"),e=A("./src/events.ts"),S=A("./src/utils/mp4-tools.ts"),f=A("./src/utils/logger.ts"),d=A("./src/errors.ts"),o={video:1,audio:2,id3:3,text:4},a=function(){function m(E,_,y){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=E,this.config=_,this.typeSupported=y}m.probe=function(_){var y=m.syncOffset(_);return y<0?!1:(y&&f.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},m.syncOffset=function(_){for(var y=Math.min(1e3,_.length-3*188),c=0;c<y;){if(_[c]===71&&_[c+188]===71&&_[c+2*188]===71)return c;c++}return-1},m.createTrack=function(_,y){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:o[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?y:void 0}};var g=m.prototype;return g.resetInitSegment=function(_,y,c){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",c),this._audioTrack=m.createTrack("audio",c),this._id3Track=m.createTrack("id3",c),this._txtTrack=m.createTrack("text",c),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=_,this.videoCodec=y,this._duration=c},g.resetTimeStamp=function(){},g.resetContiguity=function(){var _=this._audioTrack,y=this._avcTrack,c=this._id3Track;_&&(_.pesData=null),y&&(y.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},g.demux=function(_,y,c,u){c===void 0&&(c=!1),u===void 0&&(u=!1),c||(this.sampleAes=null);var l,v=this._avcTrack,p=this._audioTrack,T=this._id3Track,L=v.pid,D=v.pesData,x=p.pid,M=T.pid,j=p.pesData,I=T.pesData,W=!1,Q=this.pmtParsed,fe=this._pmtId,le=_.length;if(this.remainderData&&(_=Object(S.appendUint8Array)(this.remainderData,_),le=_.length,this.remainderData=null),le<188&&!u)return this.remainderData=_,{audioTrack:p,avcTrack:v,id3Track:T,textTrack:this._txtTrack};var Ce=Math.max(0,m.syncOffset(_));le-=(le+Ce)%188,le<_.byteLength&&!u&&(this.remainderData=new Uint8Array(_.buffer,le,_.buffer.byteLength-le));for(var Oe=Ce;Oe<le;Oe+=188)if(_[Oe]===71){var Re=!!(_[Oe+1]&64),Le=((_[Oe+1]&31)<<8)+_[Oe+2],Pe=(_[Oe+3]&48)>>4,_e=void 0;if(Pe>1){if(_e=Oe+5+_[Oe+4],_e===Oe+188)continue}else _e=Oe+4;switch(Le){case L:Re&&(D&&(l=n(D))&&this.parseAVCPES(l,!1),D={data:[],size:0}),D&&(D.data.push(_.subarray(_e,Oe+188)),D.size+=Oe+188-_e);break;case x:Re&&(j&&(l=n(j))&&(p.isAAC?this.parseAACPES(l):this.parseMPEGPES(l)),j={data:[],size:0}),j&&(j.data.push(_.subarray(_e,Oe+188)),j.size+=Oe+188-_e);break;case M:Re&&(I&&(l=n(I))&&this.parseID3PES(l),I={data:[],size:0}),I&&(I.data.push(_.subarray(_e,Oe+188)),I.size+=Oe+188-_e);break;case 0:Re&&(_e+=_[_e]+1),fe=this._pmtId=h(_,_e);break;case fe:{Re&&(_e+=_[_e]+1);var N=s(_,_e,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);L=N.avc,L>0&&(v.pid=L),x=N.audio,x>0&&(p.pid=x,p.isAAC=N.isAAC),M=N.id3,M>0&&(T.pid=M),W&&!Q&&(f.logger.log("reparse from beginning"),W=!1,Oe=Ce-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});v.pesData=D,p.pesData=j,T.pesData=I;var O={audioTrack:p,avcTrack:v,id3Track:T,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(O),O},g.flush=function(){var _=this.remainderData;this.remainderData=null;var y;return _?y=this.demux(_,-1,!1,!0):y={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(y),this.sampleAes?this.decrypt(y,this.sampleAes):y},g.extractRemainingSamples=function(_){var y=_.audioTrack,c=_.avcTrack,u=_.id3Track,l=c.pesData,v=y.pesData,p=u.pesData,T;l&&(T=n(l))?(this.parseAVCPES(T,!0),c.pesData=null):c.pesData=l,v&&(T=n(v))?(y.isAAC?this.parseAACPES(T):this.parseMPEGPES(T),y.pesData=null):(v!=null&&v.size&&f.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=v),p&&(T=n(p))?(this.parseID3PES(T),u.pesData=null):u.pesData=p},g.demuxSampleAes=function(_,y,c){var u=this.demux(_,c,!0,!this.config.progressive),l=this.sampleAes=new U.default(this.observer,this.config,y);return this.decrypt(u,l)},g.decrypt=function(_,y){return new Promise(function(c){var u=_.audioTrack,l=_.avcTrack;u.samples&&u.isAAC?y.decryptAacSamples(u.samples,0,function(){l.samples?y.decryptAvcSamples(l.samples,0,0,function(){c(_)}):c(_)}):l.samples&&y.decryptAvcSamples(l.samples,0,0,function(){c(_)})})},g.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},g.parseAVCPES=function(_,y){var c=this,u=this._avcTrack,l=this.parseAVCNALu(_.data),v=!1,p=this.avcSample,T,L=!1;_.data=null,p&&l.length&&!u.audFound&&(i(p,u),p=this.avcSample=r(!1,_.pts,_.dts,"")),l.forEach(function(D){switch(D.type){case 1:{T=!0,p||(p=c.avcSample=r(!0,_.pts,_.dts,"")),v&&(p.debug+="NDR "),p.frame=!0;var x=D.data;if(L&&x.length>4){var M=new R.default(x).readSliceType();(M===2||M===4||M===7||M===9)&&(p.key=!0)}break}case 5:T=!0,p||(p=c.avcSample=r(!0,_.pts,_.dts,"")),v&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{T=!0,v&&p&&(p.debug+="SEI ");var j=new R.default(b(D.data));j.readUByte();for(var I=0,W=0,Q=!1,fe=0;!Q&&j.bytesAvailable>1;){I=0;do fe=j.readUByte(),I+=fe;while(fe===255);W=0;do fe=j.readUByte(),W+=fe;while(fe===255);if(I===4&&j.bytesAvailable!==0){Q=!0;var le=j.readUByte();if(le===181){var Ce=j.readUShort();if(Ce===49){var Oe=j.readUInt();if(Oe===1195456820){var Re=j.readUByte();if(Re===3){for(var Le=j.readUByte(),Pe=j.readUByte(),_e=31&Le,N=[Le,Pe],O=0;O<_e;O++)N.push(j.readUByte()),N.push(j.readUByte()),N.push(j.readUByte());t(c._txtTrack.samples,{type:3,pts:_.pts,bytes:N})}}}}}else if(I===5&&j.bytesAvailable!==0){if(Q=!0,W>16){for(var C=[],F=0;F<16;F++)C.push(j.readUByte().toString(16)),(F===3||F===5||F===7||F===9)&&C.push("-");for(var z=W-16,P=new Uint8Array(z),oe=0;oe<z;oe++)P[oe]=j.readUByte();t(c._txtTrack.samples,{pts:_.pts,payloadType:I,uuid:C.join(""),userData:Object(H.utf8ArrayToStr)(P),userDataBytes:P})}}else if(W<j.bytesAvailable)for(var we=0;we<W;we++)j.readUByte()}break}case 7:if(T=!0,L=!0,v&&p&&(p.debug+="SPS "),!u.sps){var Ae=new R.default(D.data),ee=Ae.readSPS();u.width=ee.width,u.height=ee.height,u.pixelRatio=ee.pixelRatio,u.sps=[D.data],u.duration=c._duration;for(var de=D.data.subarray(1,4),ge="avc1.",xe=0;xe<3;xe++){var Me=de[xe].toString(16);Me.length<2&&(Me="0"+Me),ge+=Me}u.codec=ge}break;case 8:T=!0,v&&p&&(p.debug+="PPS "),u.pps||(u.pps=[D.data]);break;case 9:T=!1,u.audFound=!0,p&&i(p,u),p=c.avcSample=r(!1,_.pts,_.dts,v?"AUD ":"");break;case 12:T=!1;break;default:T=!1,p&&(p.debug+="unknown NAL "+D.type+" ");break}if(p&&T){var Ue=p.units;Ue.push(D)}}),y&&p&&(i(p,u),this.avcSample=null)},g.getLastNalUnit=function(){var _,y=this.avcSample,c;if(!y||y.units.length===0){var u=this._avcTrack.samples;y=u[u.length-1]}if((_=y)!==null&&_!==void 0&&_.units){var l=y.units;c=l[l.length-1]}return c},g.parseAVCNALu=function(_){var y=_.byteLength,c=this._avcTrack,u=c.naluState||0,l=u,v=[],p=0,T,L,D,x=-1,M=0;for(u===-1&&(x=0,M=_[0]&31,u=0,p=1);p<y;){if(T=_[p++],!u){u=T?0:1;continue}if(u===1){u=T?0:2;continue}if(!T)u=3;else if(T===1){if(x>=0){var j={data:_.subarray(x,p-u-1),type:M};v.push(j)}else{var I=this.getLastNalUnit();if(I&&(l&&p<=4-l&&(I.state&&(I.data=I.data.subarray(0,I.data.byteLength-l))),L=p-u-1,L>0)){var W=new Uint8Array(I.data.byteLength+L);W.set(I.data,0),W.set(_.subarray(0,L),I.data.byteLength),I.data=W,I.state=0}}p<y?(D=_[p]&31,x=p,M=D,u=0):u=-1}else u=0}if(x>=0&&u>=0){var Q={data:_.subarray(x,y),type:M,state:u};v.push(Q)}if(v.length===0){var fe=this.getLastNalUnit();if(fe){var le=new Uint8Array(fe.data.byteLength+_.byteLength);le.set(fe.data,0),le.set(_,fe.data.byteLength),fe.data=le}}return c.naluState=u,v},g.parseAACPES=function(_){var y=0,c=this._audioTrack,u=this.aacOverFlow,l=_.data;if(u){this.aacOverFlow=null;var v=u.sample.unit.byteLength,p=Math.min(u.missing,v),T=v-p;u.sample.unit.set(l.subarray(0,p),T),c.samples.push(u.sample),y=u.missing}var L,D;for(L=y,D=l.length;L<D-1&&!k.isHeader(l,L);L++);if(L!==y){var x,M;if(L<D-1?(x="AAC PES did not start with ADTS header,offset:"+L,M=!1):(x="no ADTS header found in AAC PES",M=!0),f.logger.warn("parsing error:"+x),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:M,reason:x}),M)return}k.initTrackConfig(c,this.observer,l,L,this.audioCodec);var j;if(_.pts!==void 0)j=_.pts;else if(u){var I=k.getFrameDuration(c.samplerate);j=u.sample.pts+I}else{f.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;L<D;)if(k.isHeader(l,L)){if(L+5<D){var Q=k.appendFrame(c,l,L,j,W);if(Q)if(Q.missing)this.aacOverFlow=Q;else{L+=Q.length,W++;continue}}break}else L++},g.parseMPEGPES=function(_){var y=_.data,c=y.length,u=0,l=0,v=_.pts;if(v===void 0){f.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;l<c;)if(w.isHeader(y,l)){var p=w.appendFrame(this._audioTrack,y,l,v,u);if(p)l+=p.length,u++;else break}else l++},g.parseID3PES=function(_){if(_.pts===void 0){f.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},m}();a.minProbeByteLength=188;function r(m,g,E,_){return{key:m,frame:!1,pts:g,dts:E,units:[],debug:_,length:0}}function h(m,g){return(m[g+10]&31)<<8|m[g+11]}function s(m,g,E,_){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(m[g+1]&15)<<8|m[g+2],u=g+3+c-4,l=(m[g+10]&15)<<8|m[g+11];for(g+=12+l;g<u;){var v=(m[g+1]&31)<<8|m[g+2];switch(m[g]){case 207:if(!_){f.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:y.audio===-1&&(y.audio=v);break;case 21:y.id3===-1&&(y.id3=v);break;case 219:if(!_){f.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:y.avc===-1&&(y.avc=v);break;case 3:case 4:E?y.audio===-1&&(y.audio=v,y.isAAC=!1):f.logger.log("MPEG audio found, not supported in this browser");break;case 36:f.logger.warn("Unsupported HEVC stream type found");break;default:break}g+=((m[g+3]&15)<<8|m[g+4])+5}return y}function n(m){var g=0,E,_,y,c,u,l=m.data;if(!m||m.size===0)return null;for(;l[0].length<19&&l.length>1;){var v=new Uint8Array(l[0].length+l[1].length);v.set(l[0]),v.set(l[1],l[0].length),l[0]=v,l.splice(1,1)}E=l[0];var p=(E[0]<<16)+(E[1]<<8)+E[2];if(p===1){if(_=(E[4]<<8)+E[5],_&&_>m.size-6)return null;var T=E[7];T&192&&(c=(E[9]&14)*536870912+(E[10]&255)*4194304+(E[11]&254)*16384+(E[12]&255)*128+(E[13]&254)/2,T&64?(u=(E[14]&14)*536870912+(E[15]&255)*4194304+(E[16]&254)*16384+(E[17]&255)*128+(E[18]&254)/2,c-u>60*9e4&&(f.logger.warn(Math.round((c-u)/9e4)+"s delta between PTS and DTS, align them"),c=u)):u=c),y=E[8];var L=y+9;if(m.size<=L)return null;m.size-=L;for(var D=new Uint8Array(m.size),x=0,M=l.length;x<M;x++){E=l[x];var j=E.byteLength;if(L)if(L>j){L-=j;continue}else E=E.subarray(L),j-=L,L=0;D.set(E,g),g+=j}return _&&(_-=y+3),{data:D,pts:c,dts:u,len:_}}return null}function i(m,g){if(m.units.length&&m.frame){if(m.pts===void 0){var E=g.samples,_=E.length;if(_){var y=E[_-1];m.pts=y.pts,m.dts=y.dts}else{g.dropped++;return}}g.samples.push(m)}m.debug.length&&f.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function t(m,g){var E=m.length;if(E>0){if(g.pts>=m[E-1].pts)m.push(g);else for(var _=E-1;_>=0;_--)if(g.pts<m[_].pts){m.splice(_,0,g);break}}else m.push(g)}function b(m){for(var g=m.byteLength,E=[],_=1;_<g-2;)m[_]===0&&m[_+1]===0&&m[_+2]===3?(E.push(_+2),_+=2):_++;if(E.length===0)return m;var y=g-E.length,c=new Uint8Array(y),u=0;for(_=0;_<y;u++,_++)u===E[0]&&(u++,E.shift()),c[_]=m[u];return c}B.default=a},"./src/errors.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"ErrorTypes",function(){return k}),A.d(B,"ErrorDetails",function(){return w});var k;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(k||(k={}));var w;(function(R){R.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",R.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",R.KEY_SYSTEM_NO_SESSION="keySystemNoSession",R.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",R.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",R.MANIFEST_LOAD_ERROR="manifestLoadError",R.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",R.MANIFEST_PARSING_ERROR="manifestParsingError",R.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",R.LEVEL_EMPTY_ERROR="levelEmptyError",R.LEVEL_LOAD_ERROR="levelLoadError",R.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",R.LEVEL_SWITCH_ERROR="levelSwitchError",R.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",R.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",R.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",R.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",R.FRAG_LOAD_ERROR="fragLoadError",R.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",R.FRAG_DECRYPT_ERROR="fragDecryptError",R.FRAG_PARSING_ERROR="fragParsingError",R.REMUX_ALLOC_ERROR="remuxAllocError",R.KEY_LOAD_ERROR="keyLoadError",R.KEY_LOAD_TIMEOUT="keyLoadTimeOut",R.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",R.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",R.BUFFER_APPEND_ERROR="bufferAppendError",R.BUFFER_APPENDING_ERROR="bufferAppendingError",R.BUFFER_STALLED_ERROR="bufferStalledError",R.BUFFER_FULL_ERROR="bufferFullError",R.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",R.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",R.INTERNAL_EXCEPTION="internalException",R.INTERNAL_ABORTED="aborted",R.UNKNOWN="unknown"})(w||(w={}))},"./src/events.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"Events",function(){return k});var k;(function(w){w.MEDIA_ATTACHING="hlsMediaAttaching",w.MEDIA_ATTACHED="hlsMediaAttached",w.MEDIA_DETACHING="hlsMediaDetaching",w.MEDIA_DETACHED="hlsMediaDetached",w.BUFFER_RESET="hlsBufferReset",w.BUFFER_CODECS="hlsBufferCodecs",w.BUFFER_CREATED="hlsBufferCreated",w.BUFFER_APPENDING="hlsBufferAppending",w.BUFFER_APPENDED="hlsBufferAppended",w.BUFFER_EOS="hlsBufferEos",w.BUFFER_FLUSHING="hlsBufferFlushing",w.BUFFER_FLUSHED="hlsBufferFlushed",w.MANIFEST_LOADING="hlsManifestLoading",w.MANIFEST_LOADED="hlsManifestLoaded",w.MANIFEST_PARSED="hlsManifestParsed",w.LEVEL_SWITCHING="hlsLevelSwitching",w.LEVEL_SWITCHED="hlsLevelSwitched",w.LEVEL_LOADING="hlsLevelLoading",w.LEVEL_LOADED="hlsLevelLoaded",w.LEVEL_UPDATED="hlsLevelUpdated",w.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",w.LEVELS_UPDATED="hlsLevelsUpdated",w.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",w.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",w.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",w.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",w.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",w.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",w.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",w.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",w.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",w.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",w.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",w.CUES_PARSED="hlsCuesParsed",w.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",w.INIT_PTS_FOUND="hlsInitPtsFound",w.FRAG_LOADING="hlsFragLoading",w.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",w.FRAG_LOADED="hlsFragLoaded",w.FRAG_DECRYPTED="hlsFragDecrypted",w.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",w.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",w.FRAG_PARSING_METADATA="hlsFragParsingMetadata",w.FRAG_PARSED="hlsFragParsed",w.FRAG_BUFFERED="hlsFragBuffered",w.FRAG_CHANGED="hlsFragChanged",w.FPS_DROP="hlsFpsDrop",w.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",w.ERROR="hlsError",w.DESTROYING="hlsDestroying",w.KEY_LOADING="hlsKeyLoading",w.KEY_LOADED="hlsKeyLoaded",w.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",w.BACK_BUFFER_REACHED="hlsBackBufferReached"})(k||(k={}))},"./src/hls.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return m});var k=A("./node_modules/url-toolkit/src/url-toolkit.js"),w=A.n(k),R=A("./src/loader/playlist-loader.ts"),H=A("./src/loader/key-loader.ts"),U=A("./src/controller/id3-track-controller.ts"),e=A("./src/controller/latency-controller.ts"),S=A("./src/controller/level-controller.ts"),f=A("./src/controller/fragment-tracker.ts"),d=A("./src/controller/stream-controller.ts"),o=A("./src/is-supported.ts"),a=A("./src/utils/logger.ts"),r=A("./src/config.ts"),h=A("./node_modules/eventemitter3/index.js"),s=A.n(h),n=A("./src/events.ts"),i=A("./src/errors.ts");function t(g,E){for(var _=0;_<E.length;_++){var y=E[_];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(g,y.key,y)}}function b(g,E,_){return E&&t(g.prototype,E),_&&t(g,_),g}var m=function(){g.isSupported=function(){return Object(o.isSupported)()};function g(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new h.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var y=this.config=Object(r.mergeConfig)(g.DefaultConfig,_);this.userConfig=_,Object(a.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(r.enableStreamingMode)(y);var c=y.abrController,u=y.bufferController,l=y.capLevelController,v=y.fpsController,p=this.abrController=new c(this),T=this.bufferController=new u(this),L=this.capLevelController=new l(this),D=new v(this),x=new R.default(this),M=new H.default(this),j=new U.default(this),I=this.levelController=new S.default(this),W=new f.FragmentTracker(this),Q=this.streamController=new d.default(this,W);L.setStreamController(Q),D.setStreamController(Q);var fe=[I,Q];this.networkControllers=fe;var le=[x,M,p,T,L,D,j,W];this.audioTrackController=this.createController(y.audioTrackController,null,fe),this.createController(y.audioStreamController,W,fe),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,fe),this.createController(y.subtitleStreamController,W,fe),this.createController(y.timelineController,null,le),this.emeController=this.createController(y.emeController,null,le),this.cmcdController=this.createController(y.cmcdController,null,le),this.latencyController=this.createController(e.default,null,le),this.coreComponents=le}var E=g.prototype;return E.createController=function(y,c,u){if(y){var l=c?new y(this,c):new y(this);return u&&u.push(l),l}return null},E.on=function(y,c,u){u===void 0&&(u=this),this._emitter.on(y,c,u)},E.once=function(y,c,u){u===void 0&&(u=this),this._emitter.once(y,c,u)},E.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},E.off=function(y,c,u,l){u===void 0&&(u=this),this._emitter.off(y,c,u,l)},E.listeners=function(y){return this._emitter.listeners(y)},E.emit=function(y,c,u){return this._emitter.emit(y,c,u)},E.trigger=function(y,c){if(this.config.debug)return this.emit(y,y,c);try{return this.emit(y,y,c)}catch(u){a.logger.error("An internal error happened while handling event "+y+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(n.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:u})}return!1},E.listenerCount=function(y){return this._emitter.listenerCount(y)},E.destroy=function(){a.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(y){return y.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(y){return y.destroy()}),this.coreComponents.length=0},E.attachMedia=function(y){a.logger.log("attachMedia"),this._media=y,this.trigger(n.Events.MEDIA_ATTACHING,{media:y})},E.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},E.loadSource=function(y){this.stopLoad();var c=this.media,u=this.url,l=this.url=k.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});a.logger.log("loadSource:"+l),c&&u&&u!==l&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(n.Events.MANIFEST_LOADING,{url:y})},E.startLoad=function(y){y===void 0&&(y=-1),a.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(c){c.startLoad(y)})},E.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},E.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},E.recoverMediaError=function(){a.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},E.removeLevel=function(y,c){c===void 0&&(c=0),this.levelController.removeLevel(y,c)},b(g,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){a.logger.log("set currentLevel:"+y),this.loadLevel=y,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(y){a.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){a.logger.log("set loadLevel:"+y),this.levelController.manualLevel=y}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(y){this.levelController.nextLoadLevel=y}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(y){a.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){a.logger.log("set startLevel:"+y),y!==-1&&(y=Math.max(y,this.minAutoLevel)),this.levelController.startLevel=y}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(y){var c=!!y;c!==this.config.capLevelToPlayerSize&&(c?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=c)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(y){this._autoLevelCapping!==y&&(a.logger.log("set autoLevelCapping:"+y),this._autoLevelCapping=y)}},{key:"bandwidthEstimate",get:function(){var y=this.abrController.bwEstimator;return y?y.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var y=this.levels,c=this.config.minAutoBitrate;if(!y)return 0;for(var u=y.length,l=0;l<u;l++)if(y[l].maxBitrate>c)return l;return 0}},{key:"maxAutoLevel",get:function(){var y=this.levels,c=this.autoLevelCapping,u;return c===-1&&y&&y.length?u=y.length-1:u=c,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(y){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,y)}},{key:"audioTracks",get:function(){var y=this.audioTrackController;return y?y.audioTracks:[]}},{key:"audioTrack",get:function(){var y=this.audioTrackController;return y?y.audioTrack:-1},set:function(y){var c=this.audioTrackController;c&&(c.audioTrack=y)}},{key:"subtitleTracks",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var y=this.subtitleTrackController;return y?y.subtitleTrack:-1},set:function(y){var c=this.subtitleTrackController;c&&(c.subtitleTrack=y)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var y=this.subtitleTrackController;return y?y.subtitleDisplay:!1},set:function(y){var c=this.subtitleTrackController;c&&(c.subtitleDisplay=y)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(y){this.config.lowLatencyMode=y}},{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 i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return g.defaultConfig?g.defaultConfig:r.hlsDefaultConfig},set:function(y){g.defaultConfig=y}}]),g}();m.defaultConfig=void 0},"./src/is-supported.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"isSupported",function(){return R}),A.d(B,"changeTypeSupported",function(){return H});var k=A("./src/utils/mediasource-helper.ts");function w(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var U=Object(k.getMediaSource)();if(!U)return!1;var e=w(),S=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),f=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!S&&!!f}function H(){var U,e=w();return typeof(e==null||((U=e.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return a}),A.d(B,"LoadError",function(){return h});var k=A("./src/polyfills/number.ts"),w=A("./src/errors.ts");function R(s,n){s.prototype=Object.create(n.prototype),s.prototype.constructor=s,f(s,n)}function H(s){var n=typeof Map=="function"?new Map:void 0;return H=function(t){if(t===null||!S(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,b)}function b(){return U(t,arguments,d(this).constructor)}return b.prototype=Object.create(t.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),f(b,t)},H(s)}function U(s,n,i){return e()?U=Reflect.construct:U=function(b,m,g){var E=[null];E.push.apply(E,m);var _=Function.bind.apply(b,E),y=new _;return g&&f(y,g.prototype),y},U.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(s){return!1}}function S(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function f(s,n){return f=Object.setPrototypeOf||function(t,b){return t.__proto__=b,t},f(s,n)}function d(s){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},d(s)}var o=Math.pow(2,17),a=function(){function s(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var n=s.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,b){var m=this,g=t.url;if(!g)return Promise.reject(new h({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(g?"part list":"url")));this.abort();var E=this.config,_=E.fLoader,y=E.loader;return new Promise(function(c,u){m.loader&&m.loader.destroy();var l=m.loader=t.loader=_?new _(E):new y(E),v=r(t),p={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:o};t.stats=l.stats,l.load(v,p,{onSuccess:function(L,D,x,M){m.resetLoader(t,l),c({frag:t,part:null,payload:L.data,networkDetails:M})},onError:function(L,D,x){m.resetLoader(t,l),u(new h({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:L,networkDetails:x}))},onAbort:function(L,D,x){m.resetLoader(t,l),u(new h({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:x}))},onTimeout:function(L,D,x){m.resetLoader(t,l),u(new h({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:x}))},onProgress:function(L,D,x,M){b&&b({frag:t,part:null,payload:x,networkDetails:M})}})})},n.loadPart=function(t,b,m){var g=this;this.abort();var E=this.config,_=E.fLoader,y=E.loader;return new Promise(function(c,u){g.loader&&g.loader.destroy();var l=g.loader=t.loader=_?new _(E):new y(E),v=r(t,b),p={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:o};b.stats=l.stats,l.load(v,p,{onSuccess:function(L,D,x,M){g.resetLoader(t,l),g.updateStatsFromPart(t,b);var j={frag:t,part:b,payload:L.data,networkDetails:M};m(j),c(j)},onError:function(L,D,x){g.resetLoader(t,l),u(new h({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:b,response:L,networkDetails:x}))},onAbort:function(L,D,x){t.stats.aborted=b.stats.aborted,g.resetLoader(t,l),u(new h({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:b,networkDetails:x}))},onTimeout:function(L,D,x){g.resetLoader(t,l),u(new h({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:b,networkDetails:x}))}})})},n.updateStatsFromPart=function(t,b){var m=t.stats,g=b.stats,E=g.total;if(m.loaded+=g.loaded,E){var _=Math.round(t.duration/b.duration),y=Math.min(Math.round(m.loaded/E),_),c=_-y,u=c*Math.round(m.loaded/y);m.total=m.loaded+u}else m.total=Math.max(m.loaded,m.total);var l=m.loading,v=g.loading;l.start?l.first+=v.first-v.start:(l.start=v.start,l.first=v.first),l.end=v.end},n.resetLoader=function(t,b){t.loader=null,this.loader===b&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),b.destroy()},s}();function r(s,n){n===void 0&&(n=null);var i=n||s,t={frag:s,part:n,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},b=i.byteRangeStartOffset,m=i.byteRangeEndOffset;return Object(k.isFiniteNumber)(b)&&Object(k.isFiniteNumber)(m)&&(t.rangeStart=b,t.rangeEnd=m),t}var h=function(s){R(n,s);function n(i){for(var t,b=arguments.length,m=new Array(b>1?b-1:0),g=1;g<b;g++)m[g-1]=arguments[g];return t=s.call.apply(s,[this].concat(m))||this,t.data=void 0,t.data=i,t}return n}(H(Error))},"./src/loader/fragment.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"ElementaryStreamTypes",function(){return a}),A.d(B,"BaseSegment",function(){return r}),A.d(B,"Fragment",function(){return h}),A.d(B,"Part",function(){return s});var k=A("./src/polyfills/number.ts"),w=A("./node_modules/url-toolkit/src/url-toolkit.js"),R=A.n(w),H=A("./src/utils/logger.ts"),U=A("./src/loader/level-key.ts"),e=A("./src/loader/load-stats.ts");function S(n,i){n.prototype=Object.create(i.prototype),n.prototype.constructor=n,f(n,i)}function f(n,i){return f=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},f(n,i)}function d(n,i){for(var t=0;t<i.length;t++){var b=i[t];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(n,b.key,b)}}function o(n,i,t){return i&&d(n.prototype,i),t&&d(n,t),n}var a;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(a||(a={}));var r=function(){function n(t){var b;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(b={},b[a.AUDIO]=null,b[a.VIDEO]=null,b[a.AUDIOVIDEO]=null,b),this.baseurl=t}var i=n.prototype;return i.setByteRange=function(b,m){var g=b.split("@",2),E=[];g.length===1?E[0]=m?m.byteRangeEndOffset:0:E[0]=parseInt(g[1]),E[1]=parseInt(g[0])+E[0],this._byteRange=E},o(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(w.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(b){this._url=b}}]),n}(),h=function(n){S(i,n);function i(b,m){var g;return g=n.call(this,m)||this,g._decryptdata=null,g.rawProgramDateTime=null,g.programDateTime=null,g.tagList=[],g.duration=0,g.sn=0,g.levelkey=void 0,g.type=void 0,g.loader=null,g.level=-1,g.cc=0,g.startPTS=void 0,g.endPTS=void 0,g.appendedPTS=void 0,g.startDTS=void 0,g.endDTS=void 0,g.start=0,g.deltaPTS=void 0,g.maxStartPTS=void 0,g.minEndPTS=void 0,g.stats=new e.LoadStats,g.urlId=0,g.data=void 0,g.bitrateTest=!1,g.title=null,g.initSegment=null,g.type=b,g}var t=i.prototype;return t.createInitializationVector=function(m){for(var g=new Uint8Array(16),E=12;E<16;E++)g[E]=m>>8*(15-E)&255;return g},t.setDecryptDataFromLevelKey=function(m,g){var E=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(E=U.LevelKey.fromURI(m.uri),E.method=m.method,E.iv=this.createInitializationVector(g),E.keyFormat="identity"),E},t.setElementaryStreamInfo=function(m,g,E,_,y,c){c===void 0&&(c=!1);var u=this.elementaryStreams,l=u[m];if(!l){u[m]={startPTS:g,endPTS:E,startDTS:_,endDTS:y,partial:c};return}l.startPTS=Math.min(l.startPTS,g),l.endPTS=Math.max(l.endPTS,E),l.startDTS=Math.min(l.startDTS,_),l.endDTS=Math.max(l.endDTS,y)},t.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[a.AUDIO]=null,m[a.VIDEO]=null,m[a.AUDIOVIDEO]=null},o(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(k.isFiniteNumber)(this.programDateTime))return null;var m=Object(k.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),i}(r),s=function(n){S(i,n);function i(t,b,m,g,E){var _;_=n.call(this,m)||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=b,_.index=g;var y=t.enumeratedString("BYTERANGE");return y&&_.setByteRange(y,E),E&&(_.fragOffset=E.fragOffset+E.duration),_}return o(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var b=this.elementaryStreams;return!!(b.audio||b.video||b.audiovideo)}}]),i}(r)},"./src/loader/key-loader.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return H});var k=A("./src/events.ts"),w=A("./src/errors.ts"),R=A("./src/utils/logger.ts"),H=function(){function U(S){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=S,this._registerListeners()}var e=U.prototype;return e._registerListeners=function(){this.hls.on(k.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(k.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var f in this.loaders){var d=this.loaders[f];d&&d.destroy()}this.loaders={}},e.onKeyLoading=function(f,d){var o=d.frag,a=o.type,r=this.loaders[a];if(!o.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var h=o.decryptdata.uri;if(h!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(r&&(R.logger.warn("abort previous key loader for type:"+a),r.abort()),!h){R.logger.warn("key uri is falsy");return}var n=s.loader,i=o.loader=this.loaders[a]=new n(s);this.decrypturl=h,this.decryptkey=null;var t={url:h,frag:o,responseType:"arraybuffer"},b={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(t,b,m)}else this.decryptkey&&(o.decryptdata.key=this.decryptkey,this.hls.trigger(k.Events.KEY_LOADED,{frag:o}))},e.loadsuccess=function(f,d,o){var a=o.frag;if(!a.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(f.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(k.Events.KEY_LOADED,{frag:a})},e.loaderror=function(f,d){var o=d.frag,a=o.loader;a&&a.abort(),delete this.loaders[o.type],this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:o,response:f})},e.loadtimeout=function(f,d){var o=d.frag,a=o.loader;a&&a.abort(),delete this.loaders[o.type],this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:o})},U}()},"./src/loader/level-details.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"LevelDetails",function(){return U});var k=A("./src/polyfills/number.ts");function w(e,S){for(var f=0;f<S.length;f++){var d=S[f];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function R(e,S,f){return S&&w(e.prototype,S),f&&w(e,f),e}var H=10,U=function(){function e(f){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=f}var S=e.prototype;return S.reloaded=function(d){if(!d){this.advanced=!0,this.updated=!0;return}var o=this.lastPartSn-d.lastPartSn,a=this.lastPartIndex-d.lastPartIndex;this.updated=this.endSN!==d.endSN||!!a||!!o,this.advanced=this.endSN>d.endSN||o>0||o===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(d.misses*.6):this.misses=d.misses+1,this.availabilityDelay=d.availabilityDelay},R(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(k.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var d=this.driftEndTime-this.driftStartTime;if(d>0){var o=this.driftEnd-this.driftStart;return o*1e3/d}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var d;return(d=this.fragments)!==null&&d!==void 0&&d.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 d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"LevelKey",function(){return U});var k=A("./node_modules/url-toolkit/src/url-toolkit.js"),w=A.n(k);function R(e,S){for(var f=0;f<S.length;f++){var d=S[f];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(e,d.key,d)}}function H(e,S,f){return S&&R(e.prototype,S),f&&R(e,f),e}var U=function(){e.fromURL=function(f,d){return new e(f,d)},e.fromURI=function(f){return new e(f)};function e(S,f){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,f?this._uri=Object(k.buildAbsoluteURL)(S,f,{alwaysNormalize:!0}):this._uri=S}return H(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"LoadStats",function(){return k});var k=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return i});var k=A("./src/polyfills/number.ts"),w=A("./node_modules/url-toolkit/src/url-toolkit.js"),R=A.n(w),H=A("./src/loader/fragment.ts"),U=A("./src/loader/level-details.ts"),e=A("./src/loader/level-key.ts"),S=A("./src/utils/attr-list.ts"),f=A("./src/utils/logger.ts"),d=A("./src/utils/codecs.ts"),o=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),h=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function n(E){var _,y;return s.test((_=(y=w.parseURL(E))===null||y===void 0?void 0:y.path)!=null?_:"")}var i=function(){function E(){}return E.findGroup=function(y,c){for(var u=0;u<y.length;u++){var l=y[u];if(l.id===c)return l}},E.convertAVC1ToAVCOTI=function(y){var c=y.split(".");if(c.length>2){var u=c.shift()+".";return u+=parseInt(c.shift()).toString(16),u+=("000"+parseInt(c.shift()).toString(16)).substr(-4),u}return y},E.resolve=function(y,c){return w.buildAbsoluteURL(c,y,{alwaysNormalize:!0})},E.parseMasterPlaylist=function(y,c){var u=[],l={},v=!1;o.lastIndex=0;for(var p;(p=o.exec(y))!=null;)if(p[1]){var T=new S.AttrList(p[1]),L={attrs:T,bitrate:T.decimalInteger("AVERAGE-BANDWIDTH")||T.decimalInteger("BANDWIDTH"),name:T.NAME,url:E.resolve(p[2],c)},D=T.decimalResolution("RESOLUTION");D&&(L.width=D.width,L.height=D.height),t((T.CODECS||"").split(/[ ,]+/).filter(function(M){return M}),L),L.videoCodec&&L.videoCodec.indexOf("avc1")!==-1&&(L.videoCodec=E.convertAVC1ToAVCOTI(L.videoCodec)),u.push(L)}else if(p[3]){var x=new S.AttrList(p[3]);x["DATA-ID"]&&(v=!0,l[x["DATA-ID"]]=x)}return{levels:u,sessionData:v?l:null}},E.parseMasterPlaylistMedia=function(y,c,u,l){l===void 0&&(l=[]);var v,p=[],T=0;for(a.lastIndex=0;(v=a.exec(y))!==null;){var L=new S.AttrList(v[1]);if(L.TYPE===u){var D={attrs:L,bitrate:0,id:T++,groupId:L["GROUP-ID"],instreamId:L["INSTREAM-ID"],name:L.NAME||L.LANGUAGE||"",type:u,default:L.bool("DEFAULT"),autoselect:L.bool("AUTOSELECT"),forced:L.bool("FORCED"),lang:L.LANGUAGE,url:L.URI?E.resolve(L.URI,c):""};if(l.length){var x=E.findGroup(l,D.groupId)||l[0];b(D,x,"audioCodec"),b(D,x,"textCodec")}p.push(D)}}return p},E.parseLevelPlaylist=function(y,c,u,l,v){var p=new U.LevelDetails(c),T=p.fragments,L=null,D=0,x=0,M=0,j=0,I=null,W=new H.Fragment(l,c),Q,fe,le,Ce=-1,Oe=!1;for(r.lastIndex=0,p.m3u8=y;(Q=r.exec(y))!==null;){Oe&&(Oe=!1,W=new H.Fragment(l,c),W.start=M,W.sn=D,W.cc=j,W.level=u,L&&(W.initSegment=L,W.rawProgramDateTime=L.rawProgramDateTime));var Re=Q[1];if(Re){W.duration=parseFloat(Re);var Le=(" "+Q[2]).slice(1);W.title=Le||null,W.tagList.push(Le?["INF",Re,Le]:["INF",Re])}else if(Q[3])Object(k.isFiniteNumber)(W.duration)&&(W.start=M,le&&(W.levelkey=le),W.sn=D,W.level=u,W.cc=j,W.urlId=v,T.push(W),W.relurl=(" "+Q[3]).slice(1),g(W,I),I=W,M+=W.duration,D++,x=0,Oe=!0);else if(Q[4]){var Pe=(" "+Q[4]).slice(1);I?W.setByteRange(Pe,I):W.setByteRange(Pe)}else if(Q[5])W.rawProgramDateTime=(" "+Q[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Ce===-1&&(Ce=T.length);else{if(Q=Q[0].match(h),!Q){f.logger.warn("No matches on slow regex match for level playlist!");continue}for(fe=1;fe<Q.length&&!(typeof Q[fe]!="undefined");fe++);var _e=(" "+Q[fe]).slice(1),N=(" "+Q[fe+1]).slice(1),O=Q[fe+2]?(" "+Q[fe+2]).slice(1):"";switch(_e){case"PLAYLIST-TYPE":p.type=N.toUpperCase();break;case"MEDIA-SEQUENCE":D=p.startSN=parseInt(N);break;case"SKIP":{var C=new S.AttrList(N),F=C.decimalInteger("SKIPPED-SEGMENTS");if(Object(k.isFiniteNumber)(F)){p.skippedSegments=F;for(var z=F;z--;)T.unshift(null);D+=F}var P=C.enumeratedString("RECENTLY-REMOVED-DATERANGES");P&&(p.recentlyRemovedDateranges=P.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(N);break;case"VERSION":p.version=parseInt(N);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(N||O)&&W.tagList.push(O?[N,O]:[N]);break;case"DIS":j++;case"GAP":W.tagList.push([_e]);break;case"BITRATE":W.tagList.push([_e,N]);break;case"DISCONTINUITY-SEQ":j=parseInt(N);break;case"KEY":{var oe,we=new S.AttrList(N),Ae=we.enumeratedString("METHOD"),ee=we.URI,de=we.hexadecimalInteger("IV"),ge=we.enumeratedString("KEYFORMATVERSIONS"),xe=we.enumeratedString("KEYID"),Me=(oe=we.enumeratedString("KEYFORMAT"))!=null?oe:"identity",Ue=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ue.indexOf(Me)>-1){f.logger.warn("Keyformat "+Me+" is not supported from the manifest");continue}else if(Me!=="identity")continue;Ae&&(le=e.LevelKey.fromURL(c,ee),ee&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ae)>=0&&(le.method=Ae,le.keyFormat=Me,xe&&(le.keyID=xe),ge&&(le.keyFormatVersions=ge),le.iv=de));break}case"START":{var He=new S.AttrList(N),Be=He.decimalFloatingPoint("TIME-OFFSET");Object(k.isFiniteNumber)(Be)&&(p.startTimeOffset=Be);break}case"MAP":{var ze=new S.AttrList(N);W.relurl=ze.URI,ze.BYTERANGE&&W.setByteRange(ze.BYTERANGE),W.level=u,W.sn="initSegment",le&&(W.levelkey=le),W.initSegment=null,L=W,Oe=!0;break}case"SERVER-CONTROL":{var We=new S.AttrList(N);p.canBlockReload=We.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=We.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&We.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=We.optionalFloat("PART-HOLD-BACK",0),p.holdBack=We.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ke=new S.AttrList(N);p.partTarget=Ke.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Fe=p.partList;Fe||(Fe=p.partList=[]);var Ye=x>0?Fe[Fe.length-1]:void 0,$e=x++,q=new H.Part(new S.AttrList(N),W,c,$e,Ye);Fe.push(q),W.duration+=q.duration;break}case"PRELOAD-HINT":{var K=new S.AttrList(N);p.preloadHint=K;break}case"RENDITION-REPORT":{var G=new S.AttrList(N);p.renditionReports=p.renditionReports||[],p.renditionReports.push(G);break}default:f.logger.warn("line parsed but not handled: "+Q);break}}}I&&!I.relurl?(T.pop(),M-=I.duration,p.partList&&(p.fragmentHint=I)):p.partList&&(g(W,I),W.cc=j,p.fragmentHint=W);var Z=T.length,te=T[0],X=T[Z-1];if(M+=p.skippedSegments*p.targetduration,M>0&&Z&&X){p.averagetargetduration=M/Z;var $=X.sn;p.endSN=$!=="initSegment"?$:0,te&&(p.startCC=te.cc,te.initSegment||p.fragments.every(function(ne){return ne.relurl&&n(ne.relurl)})&&(f.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new H.Fragment(l,c),W.relurl=X.relurl,W.level=u,W.sn="initSegment",te.initSegment=W,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(M+=p.fragmentHint.duration),p.totalduration=M,p.endCC=j,Ce>0&&m(T,Ce),p},E}();function t(E,_){["video","audio","text"].forEach(function(y){var c=E.filter(function(l){return Object(d.isCodecType)(l,y)});if(c.length){var u=c.filter(function(l){return l.lastIndexOf("avc1",0)===0||l.lastIndexOf("mp4a",0)===0});_[y+"Codec"]=u.length>0?u[0]:c[0],E=E.filter(function(l){return c.indexOf(l)===-1})}}),_.unknownCodecs=E}function b(E,_,y){var c=_[y];c&&(E[y]=c)}function m(E,_){for(var y=E[_],c=_;c--;){var u=E[c];if(!u)return;u.programDateTime=y.programDateTime-u.duration*1e3,y=u}}function g(E,_){E.rawProgramDateTime?E.programDateTime=Date.parse(E.rawProgramDateTime):_!=null&&_.programDateTime&&(E.programDateTime=_.endProgramDateTime),Object(k.isFiniteNumber)(E.programDateTime)||(E.programDateTime=null,E.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/polyfills/number.ts"),w=A("./src/events.ts"),R=A("./src/errors.ts"),H=A("./src/utils/logger.ts"),U=A("./src/utils/mp4-tools.ts"),e=A("./src/loader/m3u8-parser.ts"),S=A("./src/types/loader.ts"),f=A("./src/utils/attr-list.ts");function d(r){var h=r.type;switch(h){case S.PlaylistContextType.AUDIO_TRACK:return S.PlaylistLevelType.AUDIO;case S.PlaylistContextType.SUBTITLE_TRACK:return S.PlaylistLevelType.SUBTITLE;default:return S.PlaylistLevelType.MAIN}}function o(r,h){var s=r.url;return(s===void 0||s.indexOf("data:")===0)&&(s=h.url),s}var a=function(){function r(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var h=r.prototype;return h.registerListeners=function(){var n=this.hls;n.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(w.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(w.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(w.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var n=this.hls;n.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(w.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(w.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(w.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(n){var i=this.hls.config,t=i.pLoader,b=i.loader,m=t||b,g=new m(i);return n.loader=g,this.loaders[n.type]=g,g},h.getInternalLoader=function(n){return this.loaders[n.type]},h.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},h.destroyInternalLoaders=function(){for(var n in this.loaders){var i=this.loaders[n];i&&i.destroy(),this.resetInternalLoader(n)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(n,i){var t=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:S.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},h.onLevelLoading=function(n,i){var t=i.id,b=i.level,m=i.url,g=i.deliveryDirectives;this.load({id:t,groupId:null,level:b,responseType:"text",type:S.PlaylistContextType.LEVEL,url:m,deliveryDirectives:g})},h.onAudioTrackLoading=function(n,i){var t=i.id,b=i.groupId,m=i.url,g=i.deliveryDirectives;this.load({id:t,groupId:b,level:null,responseType:"text",type:S.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:g})},h.onSubtitleTrackLoading=function(n,i){var t=i.id,b=i.groupId,m=i.url,g=i.deliveryDirectives;this.load({id:t,groupId:b,level:null,responseType:"text",type:S.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:g})},h.load=function(n){var i,t=this.hls.config,b=this.getInternalLoader(n);if(b){var m=b.context;if(m&&m.url===n.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),b.abort()}var g,E,_,y;switch(n.type){case S.PlaylistContextType.MANIFEST:g=t.manifestLoadingMaxRetry,E=t.manifestLoadingTimeOut,_=t.manifestLoadingRetryDelay,y=t.manifestLoadingMaxRetryTimeout;break;case S.PlaylistContextType.LEVEL:case S.PlaylistContextType.AUDIO_TRACK:case S.PlaylistContextType.SUBTITLE_TRACK:g=0,E=t.levelLoadingTimeOut;break;default:g=t.levelLoadingMaxRetry,E=t.levelLoadingTimeOut,_=t.levelLoadingRetryDelay,y=t.levelLoadingMaxRetryTimeout;break}if(b=this.createInternalLoader(n),(i=n.deliveryDirectives)!==null&&i!==void 0&&i.part){var c;if(n.type===S.PlaylistContextType.LEVEL&&n.level!==null?c=this.hls.levels[n.level].details:n.type===S.PlaylistContextType.AUDIO_TRACK&&n.id!==null?c=this.hls.audioTracks[n.id].details:n.type===S.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(c=this.hls.subtitleTracks[n.id].details),c){var u=c.partTarget,l=c.targetduration;u&&l&&(E=Math.min(Math.max(u*3,l*.8)*1e3,E))}}var v={timeout:E,maxRetry:g,retryDelay:_,maxRetryDelay:y,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};b.load(n,v,p)},h.loadsuccess=function(n,i,t,b){if(b===void 0&&(b=null),t.isSidxRequest){this.handleSidxRequest(n,t),this.handlePlaylistLoaded(n,i,t,b);return}this.resetInternalLoader(t.type);var m=n.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,t,"no EXTM3U delimiter",b);return}i.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,i,t,b):this.handleMasterPlaylist(n,i,t,b)},h.loaderror=function(n,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!1,n)},h.loadtimeout=function(n,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!0)},h.handleMasterPlaylist=function(n,i,t,b){var m=this.hls,g=n.data,E=o(n,t),_=e.default.parseMasterPlaylist(g,E),y=_.levels,c=_.sessionData;if(!y.length){this.handleManifestParsingError(n,t,"no level found in manifest",b);return}var u=y.map(function(D){return{id:D.attrs.AUDIO,audioCodec:D.audioCodec}}),l=y.map(function(D){return{id:D.attrs.SUBTITLES,textCodec:D.textCodec}}),v=e.default.parseMasterPlaylistMedia(g,E,"AUDIO",u),p=e.default.parseMasterPlaylistMedia(g,E,"SUBTITLES",l),T=e.default.parseMasterPlaylistMedia(g,E,"CLOSED-CAPTIONS");if(v.length){var L=v.some(function(D){return!D.url});!L&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new f.AttrList({}),bitrate:0,url:""}))}m.trigger(w.Events.MANIFEST_LOADED,{levels:y,audioTracks:v,subtitles:p,captions:T,url:E,stats:i,networkDetails:b,sessionData:c})},h.handleTrackOrLevelPlaylist=function(n,i,t,b){var m=this.hls,g=t.id,E=t.level,_=t.type,y=o(n,t),c=Object(k.isFiniteNumber)(g)?g:0,u=Object(k.isFiniteNumber)(E)?E:c,l=d(t),v=e.default.parseLevelPlaylist(n.data,y,u,l,c);if(!v.fragments.length){m.trigger(w.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(_===S.PlaylistContextType.MANIFEST){var p={attrs:new f.AttrList({}),bitrate:0,details:v,name:"",url:y};m.trigger(w.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:y,stats:i,networkDetails:b,sessionData:null})}if(i.parsing.end=performance.now(),v.needSidxRanges){var T,L=(T=v.fragments[0].initSegment)===null||T===void 0?void 0:T.url;this.load({url:L,isSidxRequest:!0,type:_,level:E,levelDetails:v,id:g,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=v,this.handlePlaylistLoaded(n,i,t,b)},h.handleSidxRequest=function(n,i){var t=Object(U.parseSegmentIndex)(new Uint8Array(n.data));if(!t)return;var b=t.references,m=i.levelDetails;b.forEach(function(g,E){var _=g.info,y=m.fragments[E];y.byteRange.length===0&&y.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),y.initSegment&&y.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(n,i,t,b){this.hls.trigger(w.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===S.PlaylistContextType.MANIFEST,url:n.url,reason:t,response:n,context:i,networkDetails:b})},h.handleNetworkError=function(n,i,t,b){t===void 0&&(t=!1),H.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 m=R.ErrorDetails.UNKNOWN,g=!1,E=this.getInternalLoader(n);switch(n.type){case S.PlaylistContextType.MANIFEST:m=t?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,g=!0;break;case S.PlaylistContextType.LEVEL:m=t?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,g=!1;break;case S.PlaylistContextType.AUDIO_TRACK:m=t?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case S.PlaylistContextType.SUBTITLE_TRACK:m=t?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,g=!1;break}E&&this.resetInternalLoader(n.type);var _={type:R.ErrorTypes.NETWORK_ERROR,details:m,fatal:g,url:n.url,loader:E,context:n,networkDetails:i};b&&(_.response=b),this.hls.trigger(w.Events.ERROR,_)},h.handlePlaylistLoaded=function(n,i,t,b){var m=t.type,g=t.level,E=t.id,_=t.groupId,y=t.loader,c=t.levelDetails,u=t.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(n,t,"invalid target duration",b);return}if(!y)return;c.live&&(y.getCacheAge&&(c.ageHeader=y.getCacheAge()||0),(!y.getCacheAge||isNaN(c.ageHeader))&&(c.ageHeader=0));switch(m){case S.PlaylistContextType.MANIFEST:case S.PlaylistContextType.LEVEL:this.hls.trigger(w.Events.LEVEL_LOADED,{details:c,level:g||0,id:E||0,stats:i,networkDetails:b,deliveryDirectives:u});break;case S.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(w.Events.AUDIO_TRACK_LOADED,{details:c,id:E||0,groupId:_||"",stats:i,networkDetails:b,deliveryDirectives:u});break;case S.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(w.Events.SUBTITLE_TRACK_LOADED,{details:c,id:E||0,groupId:_||"",stats:i,networkDetails:b,deliveryDirectives:u});break}},r}();B.default=a},"./src/polyfills/number.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"isFiniteNumber",function(){return k}),A.d(B,"MAX_SAFE_INTEGER",function(){return w});var k=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},w=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ae,B,A){"use strict";A.r(B);var k=function(){function w(){}return w.getSilentFrame=function(H,U){switch(H){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===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(U===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(U===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(U===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(U===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},w}();B.default=k},"./src/remux/mp4-generator.ts":function(ae,B,A){"use strict";A.r(B);var k=Math.pow(2,32)-1,w=function(){function R(){}return R.init=function(){R.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var U;for(U in R.types)R.types.hasOwnProperty(U)&&(R.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.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]),S=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);R.HDLR_TYPES={video:e,audio:S};var f=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),d=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=d,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,o,r,o,a),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,f))},R.box=function(U){for(var e=8,S=arguments.length,f=new Array(S>1?S-1:0),d=1;d<S;d++)f[d-1]=arguments[d];for(var o=f.length,a=o;o--;)e+=f[o].byteLength;var r=new Uint8Array(e);for(r[0]=e>>24&255,r[1]=e>>16&255,r[2]=e>>8&255,r[3]=e&255,r.set(U,4),o=0,e=8;o<a;o++)r.set(f[o],e),e+=f[o].byteLength;return r},R.hdlr=function(U){return R.box(R.types.hdlr,R.HDLR_TYPES[U])},R.mdat=function(U){return R.box(R.types.mdat,U)},R.mdhd=function(U,e){e*=U;var S=Math.floor(e/(k+1)),f=Math.floor(e%(k+1));return R.box(R.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,S>>24,S>>16&255,S>>8&255,S&255,f>>24,f>>16&255,f>>8&255,f&255,85,196,0,0]))},R.mdia=function(U){return R.box(R.types.mdia,R.mdhd(U.timescale,U.duration),R.hdlr(U.type),R.minf(U))},R.mfhd=function(U){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},R.minf=function(U){return U.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(U)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(U))},R.moof=function(U,e,S){return R.box(R.types.moof,R.mfhd(U),R.traf(S,e))},R.moov=function(U){for(var e=U.length,S=[];e--;)S[e]=R.trak(U[e]);return R.box.apply(null,[R.types.moov,R.mvhd(U[0].timescale,U[0].duration)].concat(S).concat(R.mvex(U)))},R.mvex=function(U){for(var e=U.length,S=[];e--;)S[e]=R.trex(U[e]);return R.box.apply(null,[R.types.mvex].concat(S))},R.mvhd=function(U,e){e*=U;var S=Math.floor(e/(k+1)),f=Math.floor(e%(k+1)),d=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,S>>24,S>>16&255,S>>8&255,S&255,f>>24,f>>16&255,f>>8&255,f&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return R.box(R.types.mvhd,d)},R.sdtp=function(U){var e=U.samples||[],S=new Uint8Array(4+e.length),f,d;for(f=0;f<e.length;f++)d=e[f].flags,S[f+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return R.box(R.types.sdtp,S)},R.stbl=function(U){return R.box(R.types.stbl,R.stsd(U),R.box(R.types.stts,R.STTS),R.box(R.types.stsc,R.STSC),R.box(R.types.stsz,R.STSZ),R.box(R.types.stco,R.STCO))},R.avc1=function(U){var e=[],S=[],f,d,o;for(f=0;f<U.sps.length;f++)d=U.sps[f],o=d.byteLength,e.push(o>>>8&255),e.push(o&255),e=e.concat(Array.prototype.slice.call(d));for(f=0;f<U.pps.length;f++)d=U.pps[f],o=d.byteLength,S.push(o>>>8&255),S.push(o&255),S=S.concat(Array.prototype.slice.call(d));var a=R.box(R.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|U.sps.length].concat(e).concat([U.pps.length]).concat(S))),r=U.width,h=U.height,s=U.pixelRatio[0],n=U.pixelRatio[1];return R.box(R.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>8&255,r&255,h>>8&255,h&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,n>>24,n>>16&255,n>>8&255,n&255])))},R.esds=function(U){var e=U.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(U.config).concat([6,1,2]))},R.mp4a=function(U){var e=U.samplerate;return R.box(R.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),R.box(R.types.esds,R.esds(U)))},R.mp3=function(U){var e=U.samplerate;return R.box(R.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},R.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(U)):R.box(R.types.stsd,R.STSD,R.mp4a(U)):R.box(R.types.stsd,R.STSD,R.avc1(U))},R.tkhd=function(U){var e=U.id,S=U.duration*U.timescale,f=U.width,d=U.height,o=Math.floor(S/(k+1)),a=Math.floor(S%(k+1));return R.box(R.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&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,f>>8&255,f&255,0,0,d>>8&255,d&255,0,0]))},R.traf=function(U,e){var S=R.sdtp(U),f=U.id,d=Math.floor(e/(k+1)),o=Math.floor(e%(k+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,o>>24,o>>16&255,o>>8&255,o&255])),R.trun(U,S.length+16+20+8+16+8+8),S)},R.trak=function(U){return U.duration=U.duration||4294967295,R.box(R.types.trak,R.tkhd(U),R.mdia(U))},R.trex=function(U){var e=U.id;return R.box(R.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},R.trun=function(U,e){var S=U.samples||[],f=S.length,d=12+16*f,o=new Uint8Array(d),a,r,h,s,n,i;for(e+=8+d,o.set([0,0,15,1,f>>>24&255,f>>>16&255,f>>>8&255,f&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),a=0;a<f;a++)r=S[a],h=r.duration,s=r.size,n=r.flags,i=r.cts,o.set([h>>>24&255,h>>>16&255,h>>>8&255,h&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*a);return R.box(R.types.trun,o)},R.initSegment=function(U){R.types||R.init();var e=R.moov(U),S=new Uint8Array(R.FTYP.byteLength+e.byteLength);return S.set(R.FTYP),S.set(e,R.FTYP.byteLength),S},R}();w.types=void 0,w.HDLR_TYPES=void 0,w.STTS=void 0,w.STSC=void 0,w.STCO=void 0,w.STSZ=void 0,w.VMHD=void 0,w.SMHD=void 0,w.STSD=void 0,w.FTYP=void 0,w.DINF=void 0,B.default=w},"./src/remux/mp4-remuxer.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return i}),A.d(B,"normalizePts",function(){return t});var k=A("./src/polyfills/number.ts"),w=A("./src/remux/aac-helper.ts"),R=A("./src/remux/mp4-generator.ts"),H=A("./src/events.ts"),U=A("./src/errors.ts"),e=A("./src/utils/logger.ts"),S=A("./src/types/loader.ts"),f=A("./src/utils/timescale-conversion.ts");function d(){return d=Object.assign||function(E){for(var _=1;_<arguments.length;_++){var y=arguments[_];for(var c in y)Object.prototype.hasOwnProperty.call(y,c)&&(E[c]=y[c])}return E},d.apply(this,arguments)}var o=10*1e3,a=1024,r=1152,h=null,s=null,n=!1,i=function(){function E(y,c,u,l){if(l===void 0&&(l=""),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=y,this.config=c,this.typeSupported=u,this.ISGenerated=!1,h===null){var v=navigator.userAgent||"",p=v.match(/Chrome\/(\d+)/i);h=p?parseInt(p[1]):0}if(s===null){var T=navigator.userAgent.match(/Safari\/(\d+)/i);s=T?parseInt(T[1]):0}n=!!h&&h<75||!!s&&s<600}var _=E.prototype;return _.destroy=function(){},_.resetTimeStamp=function(c){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},_.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(c){var u=!1,l=c.reduce(function(v,p){var T=p.pts-v;return T<-4294967296?(u=!0,t(v,p.pts)):T>0?v:p.pts},c[0].pts);return u&&e.logger.debug("PTS rollover detected"),l},_.remux=function(c,u,l,v,p,T,L,D){var x,M,j,I,W,Q,fe=p,le=p,Ce=c.pid>-1,Oe=u.pid>-1,Re=u.samples.length,Le=c.samples.length>0,Pe=Re>1,_e=(!Ce||Le)&&(!Oe||Pe)||this.ISGenerated||L;if(_e){this.ISGenerated||(j=this.generateIS(c,u,p));var N=this.isVideoContiguous,O=-1;if(Pe&&(O=b(u.samples),!N&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,O>0){e.logger.warn("[mp4-remuxer]: Dropped "+O+" out of "+Re+" video samples due to a missing keyframe");var C=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(O),u.dropped+=O,le+=(u.samples[0].pts-C)/(u.timescale||9e4)}else O===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+Re+" video samples"),Q=!1);if(this.ISGenerated){if(Le&&Pe){var F=this.getVideoStartPts(u.samples),z=t(c.samples[0].pts,F)-F,P=z/u.inputTimeScale;fe+=Math.max(0,P),le+=Math.max(0,-P)}if(Le){if(c.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),j=this.generateIS(c,u,p)),M=this.remuxAudio(c,fe,this.isAudioContiguous,T,Oe||Pe||D===S.PlaylistLevelType.AUDIO?le:void 0),Pe){var oe=M?M.endPTS-M.startPTS:0;u.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),j=this.generateIS(c,u,p)),x=this.remuxVideo(u,le,N,oe)}}else Pe&&(x=this.remuxVideo(u,le,N,0));x&&(x.firstKeyFrame=O,x.independent=O!==-1)}}return this.ISGenerated&&(l.samples.length&&(W=this.remuxID3(l,p)),v.samples.length&&(I=this.remuxText(v,p))),{audio:M,video:x,initSegment:j,independent:Q,text:I,id3:W}},_.generateIS=function(c,u,l){var v=c.samples,p=u.samples,T=this.typeSupported,L={},D=!Object(k.isFiniteNumber)(this._initPTS),x="audio/mp4",M,j,I;if(D&&(M=j=Infinity),c.config&&v.length&&(c.timescale=c.samplerate,c.isAAC||(T.mpeg?(x="audio/mpeg",c.codec=""):T.mp3&&(c.codec="mp3")),L.audio={id:"audio",container:x,codec:c.codec,initSegment:!c.isAAC&&T.mpeg?new Uint8Array(0):R.default.initSegment([c]),metadata:{channelCount:c.channelCount}},D&&(I=c.inputTimeScale,M=j=v[0].pts-Math.round(I*l))),u.sps&&u.pps&&p.length&&(u.timescale=u.inputTimeScale,L.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:R.default.initSegment([u]),metadata:{width:u.width,height:u.height}},D)){I=u.inputTimeScale;var W=this.getVideoStartPts(p),Q=Math.round(I*l);j=Math.min(j,t(p[0].dts,W)-Q),M=Math.min(M,W-Q)}if(Object.keys(L).length)return this.ISGenerated=!0,D&&(this._initPTS=M,this._initDTS=j),{tracks:L,initPTS:M,timescale:I}},_.remuxVideo=function(c,u,l,v){var p=c.inputTimeScale,T=c.samples,L=[],D=T.length,x=this._initPTS,M=this.nextAvcDts,j=8,I,W,Q,fe=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,Ce=0,Oe=!1;if(!l||M===null){var Re=u*p,Le=T[0].pts-t(T[0].dts,T[0].pts);M=Re-Le}for(var Pe=0;Pe<D;Pe++){var _e=T[Pe];if(_e.pts=t(_e.pts-x,M),_e.dts=t(_e.dts-x,M),_e.dts>_e.pts){var N=9e4*.2;Ce=Math.max(Math.min(Ce,_e.pts-_e.dts),-1*N)}_e.dts<T[Pe>0?Pe-1:Pe].dts&&(Oe=!0)}Oe&&T.sort(function(vt,it){var Xe=vt.dts-it.dts,Mt=vt.pts-it.pts;return Xe||Mt}),W=T[0].dts,Q=T[T.length-1].dts;var O=Math.round((Q-W)/(D-1));if(Ce<0){if(Ce<O*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(f.toMsFromMpegTsClock)(-O,!0)+" ms");for(var C=Ce,F=0;F<D;F++)T[F].dts=C=Math.max(C,T[F].pts-O),T[F].pts=Math.max(C,T[F].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(f.toMsFromMpegTsClock)(Ce,!0)+" ms to overcome this issue");for(var z=0;z<D;z++)T[z].dts=T[z].dts+Ce}W=T[0].dts}if(l){var P=W-M,oe=P>O,we=P<-1;if(oe||we){oe?e.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(P,!0)+" ms ("+P+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(-P,!0)+" ms ("+P+"dts) overlapping between fragments detected"),W=M;var Ae=T[0].pts-P;T[0].dts=W,T[0].pts=Ae,e.logger.log("Video: First PTS/DTS adjusted: "+Object(f.toMsFromMpegTsClock)(Ae,!0)+"/"+Object(f.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(f.toMsFromMpegTsClock)(P,!0)+" ms")}}n&&(W=Math.max(0,W));for(var ee=0,de=0,ge=0;ge<D;ge++){for(var xe=T[ge],Me=xe.units,Ue=Me.length,He=0,Be=0;Be<Ue;Be++)He+=Me[Be].data.length;de+=He,ee+=Ue,xe.length=He,xe.dts=Math.max(xe.dts,W),xe.pts=Math.max(xe.pts,xe.dts,0),fe=Math.min(xe.pts,fe),le=Math.max(xe.pts,le)}Q=T[D-1].dts;var ze=de+4*ee+8,We;try{We=new Uint8Array(ze)}catch(vt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ze,reason:"fail allocating video mdat "+ze});return}var Ke=new DataView(We.buffer);Ke.setUint32(0,ze),We.set(R.default.types.mdat,4);for(var Fe=0;Fe<D;Fe++){for(var Ye=T[Fe],$e=Ye.units,q=0,K=0,G=$e.length;K<G;K++){var Z=$e[K],te=Z.data,X=Z.data.byteLength;Ke.setUint32(j,X),j+=4,We.set(te,j),j+=X,q+=4+X}if(Fe<D-1)I=T[Fe+1].dts-Ye.dts;else{var $=this.config,ne=Ye.dts-T[Fe>0?Fe-1:Fe].dts;if($.stretchShortVideoTrack&&this.nextAudioPts!==null){var se=Math.floor($.maxBufferHole*p),Te=(v?fe+v*p:this.nextAudioPts)-Ye.pts;Te>se?(I=Te-ne,I<0&&(I=ne),e.logger.log("[mp4-remuxer]: It is approximately "+Te/90+" ms to the next segment; using duration "+I/90+" ms for the last video frame.")):I=ne}else I=ne}var Ee=Math.round(Ye.pts-Ye.dts);L.push(new m(Ye.key,I,q,Ee))}if(L.length&&h&&h<70){var De=L[0].flags;De.dependsOn=2,De.isNonSync=0}console.assert(I!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=M=Q+I,this.isVideoContiguous=!0;var Ge=R.default.moof(c.sequenceNumber++,W,d({},c,{samples:L})),Ze="video",Qe={data1:Ge,data2:We,startPTS:fe/p,endPTS:(le+I)/p,startDTS:W/p,endDTS:M/p,type:Ze,hasAudio:!1,hasVideo:!0,nb:L.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(We.length,"MDAT length must not be zero"),Qe},_.remuxAudio=function(c,u,l,v,p){var T=c.inputTimeScale,L=c.samplerate?c.samplerate:T,D=T/L,x=c.isAAC?a:r,M=x*D,j=this._initPTS,I=!c.isAAC&&this.typeSupported.mpeg,W=[],Q=c.samples,fe=I?0:8,le=this.nextAudioPts||-1,Ce=u*T;if(this.isAudioContiguous=l=l||Q.length&&le>0&&(v&&Math.abs(Ce-le)<9e3||Math.abs(t(Q[0].pts-j,Ce)-le)<20*M),Q.forEach(function(te){te.pts=t(te.pts-j,Ce)}),!l||le<0){if(Q=Q.filter(function(te){return te.pts>=0}),!Q.length)return;p===0?le=0:v?le=Math.max(0,Ce):le=Q[0].pts}if(c.isAAC)for(var Oe=p!==void 0,Re=this.config.maxAudioFramesDrift,Le=0,Pe=le;Le<Q.length;Le++){var _e=Q[Le],N=_e.pts,O=N-Pe,C=Math.abs(1e3*O/T);if(O<=-Re*M&&Oe)Le===0&&(e.logger.warn("Audio frame @ "+(N/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*O/T)+" ms."),this.nextAudioPts=le=Pe=N);else if(O>=Re*M&&C<o&&Oe){var F=Math.round(O/M);Pe=N-F*M,Pe<0&&(F--,Pe+=M),Le===0&&(this.nextAudioPts=le=Pe),e.logger.warn("[mp4-remuxer]: Injecting "+F+" audio frame @ "+(Pe/T).toFixed(3)+"s due to "+Math.round(1e3*O/T)+" ms gap.");for(var z=0;z<F;z++){var P=Math.max(Pe,0),oe=w.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);oe||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),oe=_e.unit.subarray()),Q.splice(Le,0,{unit:oe,pts:P}),Pe+=M,Le++}}_e.pts=Pe,Pe+=M}for(var we=null,Ae=null,ee,de=0,ge=Q.length;ge--;)de+=Q[ge].unit.byteLength;for(var xe=0,Me=Q.length;xe<Me;xe++){var Ue=Q[xe],He=Ue.unit,Be=Ue.pts;if(Ae!==null){var ze=W[xe-1];ze.duration=Math.round((Be-Ae)/D)}else if(l&&c.isAAC&&(Be=le),we=Be,de>0){de+=fe;try{ee=new Uint8Array(de)}catch(te){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:de,reason:"fail allocating audio mdat "+de});return}if(!I){var We=new DataView(ee.buffer);We.setUint32(0,de),ee.set(R.default.types.mdat,4)}}else return;ee.set(He,fe);var Ke=He.byteLength;fe+=Ke,W.push(new m(!0,x,Ke,0)),Ae=Be}var Fe=W.length;if(!Fe)return;var Ye=W[W.length-1];this.nextAudioPts=le=Ae+D*Ye.duration;var $e=I?new Uint8Array(0):R.default.moof(c.sequenceNumber++,we/D,d({},c,{samples:W}));c.samples=[];var q=we/T,K=le/T,G="audio",Z={data1:$e,data2:ee,startPTS:q,endPTS:K,startDTS:q,endDTS:K,type:G,hasAudio:!0,hasVideo:!1,nb:Fe};return this.isAudioContiguous=!0,console.assert(ee.length,"MDAT length must not be zero"),Z},_.remuxEmptyAudio=function(c,u,l,v){var p=c.inputTimeScale,T=c.samplerate?c.samplerate:p,L=p/T,D=this.nextAudioPts,x=(D!==null?D:v.startDTS*p)+this._initDTS,M=v.endDTS*p+this._initDTS,j=L*a,I=Math.ceil((M-x)/j),W=w.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Q=[],fe=0;fe<I;fe++){var le=x+fe*j;Q.push({unit:W,pts:le,dts:le})}return c.samples=Q,this.remuxAudio(c,u,l,!1)},_.remuxID3=function(c,u){var l=c.samples.length;if(!l)return;for(var v=c.inputTimeScale,p=this._initPTS,T=this._initDTS,L=0;L<l;L++){var D=c.samples[L];D.pts=t(D.pts-p,u*v)/v,D.dts=t(D.dts-T,u*v)/v}var x=c.samples;return c.samples=[],{samples:x}},_.remuxText=function(c,u){var l=c.samples.length;if(!l)return;for(var v=c.inputTimeScale,p=this._initPTS,T=0;T<l;T++){var L=c.samples[T];L.pts=t(L.pts-p,u*v)/v}c.samples.sort(function(x,M){return x.pts-M.pts});var D=c.samples;return c.samples=[],{samples:D}},E}();function t(E,_){var y;if(_===null)return E;for(_<E?y=-8589934592:y=8589934592;Math.abs(E-_)>4294967296;)E+=y;return E}function b(E){for(var _=0;_<E.length;_++)if(E[_].key)return _;return-1}var m=function(_,y,c,u){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=y,this.size=c,this.cts=u,this.flags=new g(_)},g=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(ae,B,A){"use strict";A.r(B);var k=A("./src/polyfills/number.ts"),w=A("./src/utils/mp4-tools.ts"),R=A("./src/loader/fragment.ts"),H=A("./src/utils/logger.ts"),U=function(){function f(){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 d=f.prototype;return d.destroy=function(){},d.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},d.resetNextTimestamp=function(){this.lastEndDTS=null},d.resetInitSegment=function(a,r,h){this.audioCodec=r,this.videoCodec=h,this.generateInitSegment(a),this.emitInitSegment=!0},d.generateInitSegment=function(a){var r=this.audioCodec,h=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(w.parseInitSegment)(a);r||(r=S(s.audio,R.ElementaryStreamTypes.AUDIO)),h||(h=S(s.video,R.ElementaryStreamTypes.VIDEO));var n={};s.audio&&s.video?n.audiovideo={container:"video/mp4",codec:r+","+h,initSegment:a,id:"main"}:s.audio?n.audio={container:"audio/mp4",codec:r,initSegment:a,id:"audio"}:s.video?n.video={container:"video/mp4",codec:h,initSegment:a,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},d.remux=function(a,r,h,s,n){var i=this.initPTS,t=this.lastEndDTS,b={audio:void 0,video:void 0,text:s,id3:h,initSegment:void 0};Object(k.isFiniteNumber)(t)||(t=this.lastEndDTS=n||0);var m=r.samples;if(!m||!m.length)return b;var g={initPTS:void 0,timescale:1},E=this.initData;if((!E||!E.length)&&(this.generateInitSegment(m),E=this.initData),!E||!E.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),b;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1),Object(k.isFiniteNumber)(i)||(this.initPTS=g.initPTS=i=e(E,m,t));var _=Object(w.getDuration)(m,E),y=t,c=_+y;Object(w.offsetStartDTS)(E,m,i),_>0?this.lastEndDTS=c:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!E.audio,l=!!E.video,v="";u&&(v+="audio"),l&&(v+="video");var p={data1:m,startPTS:y,startDTS:y,endPTS:c,endDTS:c,type:v,hasAudio:u,hasVideo:l,nb:1,dropped:0};return b.audio=p.type==="audio"?p:void 0,b.video=p.type!=="audio"?p:void 0,b.text=s,b.id3=h,b.initSegment=g,b},f}(),e=function(d,o,a){return Object(w.getStartDTS)(d,o)-a};function S(f,d){var o=f==null?void 0:f.codec;return o&&o.length>4?o:o==="hvc1"?"hvc1.1.c.L120.90":o==="av01"?"av01.0.04M.08":o==="avc1"||d===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}B.default=U},"./src/task-loop.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return k});var k=function(){function w(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=w.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},w}()},"./src/types/cmcd.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"CMCDVersion",function(){return k}),A.d(B,"CMCDObjectType",function(){return w}),A.d(B,"CMCDStreamingFormat",function(){return R}),A.d(B,"CMCDStreamType",function(){return H});var k=1,w;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(w||(w={}));var R;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(R||(R={}));var H;(function(U){U.VOD="v",U.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"HlsSkip",function(){return R}),A.d(B,"getSkipValue",function(){return H}),A.d(B,"HlsUrlParameters",function(){return U}),A.d(B,"Level",function(){return e});function k(S,f){for(var d=0;d<f.length;d++){var o=f[d];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(S,o.key,o)}}function w(S,f,d){return f&&k(S.prototype,f),d&&k(S,d),S}var R;(function(S){S.No="",S.Yes="YES",S.v2="v2"})(R||(R={}));function H(S,f){var d=S.canSkipUntil,o=S.canSkipDateRanges,a=S.endSN,r=f!==void 0?f-a:0;return d&&r<d?o?R.v2:R.Yes:R.No}var U=function(){function S(d,o,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=d,this.part=o,this.skip=a}var f=S.prototype;return f.addDirectives=function(o){var a=new self.URL(o);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},S}(),e=function(){function S(f){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=[f.url],this.attrs=f.attrs,this.bitrate=f.bitrate,f.details&&(this.details=f.details),this.id=f.id||0,this.name=f.name,this.width=f.width||0,this.height=f.height||0,this.audioCodec=f.audioCodec,this.videoCodec=f.videoCodec,this.unknownCodecs=f.unknownCodecs,this.codecSet=[f.videoCodec,f.audioCodec].filter(function(d){return d}).join(",").replace(/\.[^.,]+/g,"")}return w(S,[{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(d){var o=d%this.url.length;this._urlId!==o&&(this.details=void 0,this._urlId=o)}}]),S}()},"./src/types/loader.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"PlaylistContextType",function(){return k}),A.d(B,"PlaylistLevelType",function(){return w});var k;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(k||(k={}));var w;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(w||(w={}))},"./src/types/transmuxer.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"ChunkMetadata",function(){return k});var k=function(H,U,e,S,f,d){S===void 0&&(S=0),f===void 0&&(f=-1),d===void 0&&(d=!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=w(),this.buffering={audio:w(),video:w(),audiovideo:w()},this.level=H,this.sn=U,this.id=e,this.size=S,this.part=f,this.partial=d};function w(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"AttrList",function(){return R});var k=/^(\d+)x(\d+)$/,w=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function H(e){typeof e=="string"&&(e=H.parseAttrList(e));for(var S in e)e.hasOwnProperty(S)&&(this[S]=e[S])}var U=H.prototype;return U.decimalInteger=function(S){var f=parseInt(this[S],10);return f>Number.MAX_SAFE_INTEGER?Infinity:f},U.hexadecimalInteger=function(S){if(this[S]){var f=(this[S]||"0x").slice(2);f=(f.length&1?"0":"")+f;for(var d=new Uint8Array(f.length/2),o=0;o<f.length/2;o++)d[o]=parseInt(f.slice(o*2,o*2+2),16);return d}else return null},U.hexadecimalIntegerAsNumber=function(S){var f=parseInt(this[S],16);return f>Number.MAX_SAFE_INTEGER?Infinity:f},U.decimalFloatingPoint=function(S){return parseFloat(this[S])},U.optionalFloat=function(S,f){var d=this[S];return d?parseFloat(d):f},U.enumeratedString=function(S){return this[S]},U.bool=function(S){return this[S]==="YES"},U.decimalResolution=function(S){var f=k.exec(this[S]);return f===null?void 0:{width:parseInt(f[1],10),height:parseInt(f[2],10)}},H.parseAttrList=function(S){var f,d={},o='"';for(w.lastIndex=0;(f=w.exec(S))!==null;){var a=f[2];a.indexOf(o)===0&&a.lastIndexOf(o)===a.length-1&&(a=a.slice(1,-1)),d[f[1]]=a}return d},H}()},"./src/utils/binary-search.ts":function(ae,B,A){"use strict";A.r(B);var k={search:function(R,H){for(var U=0,e=R.length-1,S=null,f=null;U<=e;){S=(U+e)/2|0,f=R[S];var d=H(f);if(d>0)U=S+1;else if(d<0)e=S-1;else return f}return null}};B.default=k},"./src/utils/buffer-helper.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"BufferHelper",function(){return R});var k=A("./src/utils/logger.ts"),w={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function H(){}return H.isBuffered=function(e,S){try{if(e){for(var f=H.getBuffered(e),d=0;d<f.length;d++)if(S>=f.start(d)&&S<=f.end(d))return!0}}catch(o){}return!1},H.bufferInfo=function(e,S,f){try{if(e){var d=H.getBuffered(e),o=[],a;for(a=0;a<d.length;a++)o.push({start:d.start(a),end:d.end(a)});return this.bufferedInfo(o,S,f)}}catch(r){}return{len:0,start:S,end:S,nextStart:void 0}},H.bufferedInfo=function(e,S,f){S=Math.max(0,S),e.sort(function(g,E){var _=g.start-E.start;return _||E.end-g.end});var d=[];if(f)for(var o=0;o<e.length;o++){var a=d.length;if(a){var r=d[a-1].end;e[o].start-r<f?e[o].end>r&&(d[a-1].end=e[o].end):d.push(e[o])}else d.push(e[o])}else d=e;for(var h=0,s,n=S,i=S,t=0;t<d.length;t++){var b=d[t].start,m=d[t].end;if(S+f>=b&&S<m)n=b,i=m,h=i-S;else if(S+f<b){s=b;break}}return{len:h,start:n||0,end:i||0,nextStart:s}},H.getBuffered=function(e){try{return e.buffered}catch(S){return k.logger.log("failed to get media.buffered",S),w}},H}()},"./src/utils/cea-608-parser.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"Row",function(){return i}),A.d(B,"CaptionScreen",function(){return t});var k=A("./src/utils/logger.ts"),w={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},R=function(c){var u=c;return w.hasOwnProperty(c)&&(u=w[c]),String.fromCharCode(u)},H=15,U=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},S={17:2,18:4,21:6,22:8,23:10,19:13,20:15},f={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},d={25:2,26:4,29:6,30:8,31:10,27:13,28:15},o=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(y){y[y.ERROR=0]="ERROR",y[y.TEXT=1]="TEXT",y[y.WARNING=2]="WARNING",y[y.INFO=2]="INFO",y[y.DEBUG=3]="DEBUG",y[y.DATA=3]="DATA"})(a||(a={}));var r=function(){function y(){this.time=null,this.verboseLevel=a.ERROR}var c=y.prototype;return c.log=function(l,v){this.verboseLevel>=l&&k.logger.log(this.time+" ["+l+"] "+v)},y}(),h=function(c){for(var u=[],l=0;l<c.length;l++)u.push(c[l].toString(16));return u},s=function(){function y(u,l,v,p,T){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=u||"white",this.underline=l||!1,this.italics=v||!1,this.background=p||"black",this.flash=T||!1}var c=y.prototype;return c.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},c.setStyles=function(l){for(var v=["foreground","underline","italics","background","flash"],p=0;p<v.length;p++){var T=v[p];l.hasOwnProperty(T)&&(this[T]=l[T])}},c.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},c.equals=function(l){return this.foreground===l.foreground&&this.underline===l.underline&&this.italics===l.italics&&this.background===l.background&&this.flash===l.flash},c.copy=function(l){this.foreground=l.foreground,this.underline=l.underline,this.italics=l.italics,this.background=l.background,this.flash=l.flash},c.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},y}(),n=function(){function y(u,l,v,p,T,L){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new s(l,v,p,T,L)}var c=y.prototype;return c.reset=function(){this.uchar=" ",this.penState.reset()},c.setChar=function(l,v){this.uchar=l,this.penState.copy(v)},c.setPenState=function(l){this.penState.copy(l)},c.equals=function(l){return this.uchar===l.uchar&&this.penState.equals(l.penState)},c.copy=function(l){this.uchar=l.uchar,this.penState.copy(l.penState)},c.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},y}(),i=function(){function y(u){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var l=0;l<U;l++)this.chars.push(new n);this.logger=u,this.pos=0,this.currPenState=new s}var c=y.prototype;return c.equals=function(l){for(var v=!0,p=0;p<U;p++)if(!this.chars[p].equals(l.chars[p])){v=!1;break}return v},c.copy=function(l){for(var v=0;v<U;v++)this.chars[v].copy(l.chars[v])},c.isEmpty=function(){for(var l=!0,v=0;v<U;v++)if(!this.chars[v].isEmpty()){l=!1;break}return l},c.setCursor=function(l){this.pos!==l&&(this.pos=l),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},c.moveCursor=function(l){var v=this.pos+l;if(l>1)for(var p=this.pos+1;p<v+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(v)},c.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},c.insertChar=function(l){l>=144&&this.backSpace();var v=R(l);if(this.pos>=U){this.logger.log(a.ERROR,"Cannot insert "+l.toString(16)+" ("+v+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(v,this.currPenState),this.moveCursor(1)},c.clearFromPos=function(l){var v;for(v=l;v<U;v++)this.chars[v].reset()},c.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},c.clearToEndOfRow=function(){this.clearFromPos(this.pos)},c.getTextString=function(){for(var l=[],v=!0,p=0;p<U;p++){var T=this.chars[p].uchar;T!==" "&&(v=!1),l.push(T)}return v?"":l.join("")},c.setPenStyles=function(l){this.currPenState.setStyles(l);var v=this.chars[this.pos];v.setPenState(this.currPenState)},y}(),t=function(){function y(u){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var l=0;l<H;l++)this.rows.push(new i(u));this.logger=u,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=y.prototype;return c.reset=function(){for(var l=0;l<H;l++)this.rows[l].clear();this.currRow=H-1},c.equals=function(l){for(var v=!0,p=0;p<H;p++)if(!this.rows[p].equals(l.rows[p])){v=!1;break}return v},c.copy=function(l){for(var v=0;v<H;v++)this.rows[v].copy(l.rows[v])},c.isEmpty=function(){for(var l=!0,v=0;v<H;v++)if(!this.rows[v].isEmpty()){l=!1;break}return l},c.backSpace=function(){var l=this.rows[this.currRow];l.backSpace()},c.clearToEndOfRow=function(){var l=this.rows[this.currRow];l.clearToEndOfRow()},c.insertChar=function(l){var v=this.rows[this.currRow];v.insertChar(l)},c.setPen=function(l){var v=this.rows[this.currRow];v.setPenStyles(l)},c.moveCursor=function(l){var v=this.rows[this.currRow];v.moveCursor(l)},c.setCursor=function(l){this.logger.log(a.INFO,"setCursor: "+l);var v=this.rows[this.currRow];v.setCursor(l)},c.setPAC=function(l){this.logger.log(a.INFO,"pacData = "+JSON.stringify(l));var v=l.row-1;if(this.nrRollUpRows&&v<this.nrRollUpRows-1&&(v=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==v){for(var p=0;p<H;p++)this.rows[p].clear();var T=this.currRow+1-this.nrRollUpRows,L=this.lastOutputScreen;if(L){var D=L.rows[T].cueStartTime,x=this.logger.time;if(D&&x!==null&&D<x)for(var M=0;M<this.nrRollUpRows;M++)this.rows[v-this.nrRollUpRows+M+1].copy(L.rows[T+M])}}this.currRow=v;var j=this.rows[this.currRow];if(l.indent!==null){var I=l.indent,W=Math.max(I-1,0);j.setCursor(l.indent),l.color=j.chars[W].penState.foreground}var Q={foreground:l.color,underline:l.underline,italics:l.italics,background:"black",flash:!1};this.setPen(Q)},c.setBkgData=function(l){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(l)),this.backSpace(),this.setPen(l),this.insertChar(32)},c.setRollUpRows=function(l){this.nrRollUpRows=l},c.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var l=this.currRow+1-this.nrRollUpRows,v=this.rows.splice(l,1)[0];v.clear(),this.rows.splice(this.currRow,0,v),this.logger.log(a.INFO,"Rolling up")},c.getDisplayText=function(l){l=l||!1;for(var v=[],p="",T=-1,L=0;L<H;L++){var D=this.rows[L].getTextString();D&&(T=L+1,l?v.push("Row "+T+": '"+D+"'"):v.push(D.trim()))}return v.length>0&&(l?p="["+v.join(" | ")+"]":p=v.join(`
|
|
`)),p},c.getTextAndFormat=function(){return this.rows},y}(),b=function(){function y(u,l,v){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=u,this.outputFilter=l,this.mode=null,this.verbose=0,this.displayedMemory=new t(v),this.nonDisplayedMemory=new t(v),this.lastOutputScreen=new t(v),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=v}var c=y.prototype;return c.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},c.getHandler=function(){return this.outputFilter},c.setHandler=function(l){this.outputFilter=l},c.setPAC=function(l){this.writeScreen.setPAC(l)},c.setBkgData=function(l){this.writeScreen.setBkgData(l)},c.setMode=function(l){if(l===this.mode)return;this.mode=l,this.logger.log(a.INFO,"MODE="+l),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=l},c.insertChars=function(l){for(var v=0;v<l.length;v++)this.writeScreen.insertChar(l[v]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,p+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},c.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},c.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},c.ccAOF=function(){},c.ccAON=function(){},c.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},c.ccRU=function(l){this.logger.log(a.INFO,"RU("+l+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(l)},c.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},c.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},c.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},c.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},c.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},c.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},c.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},c.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var l=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=l,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},c.ccTO=function(l){this.logger.log(a.INFO,"TO("+l+") - Tab Offset"),this.writeScreen.moveCursor(l)},c.ccMIDROW=function(l){var v={flash:!1};if(v.underline=l%2===1,v.italics=l>=46,v.italics)v.foreground="white";else{var p=Math.floor(l/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=T[p]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(v)),this.writeScreen.setPen(v)},c.outputDataUpdate=function(l){l===void 0&&(l=!1);var v=this.logger.time;if(v===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),l&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},c.cueSplitAtTime=function(l){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,l,this.displayedMemory),this.cueStartTime=l))},y}(),m=function(){function y(u,l,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new r;this.channels=[null,new b(u,l,p),new b(u+1,v,p)],this.cmdHistory=_(),this.logger=p}var c=y.prototype;return c.getHandler=function(l){return this.channels[l].getHandler()},c.setHandler=function(l,v){this.channels[l].setHandler(v)},c.addData=function(l,v){var p,T,L,D=!1;this.logger.time=l;for(var x=0;x<v.length;x+=2){if(T=v[x]&127,L=v[x+1]&127,T===0&&L===0)continue;if(this.logger.log(a.DATA,"["+h([v[x],v[x+1]])+"] -> ("+h([T,L])+")"),p=this.parseCmd(T,L),p||(p=this.parseMidrow(T,L)),p||(p=this.parsePAC(T,L)),p||(p=this.parseBackgroundAttributes(T,L)),!p&&(D=this.parseChars(T,L),D)){var M=this.currentChannel;if(M&&M>0){var j=this.channels[M];j.insertChars(D)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!D&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+h([T,L])+" orig: "+h([v[x],v[x+1]]))}},c.parseCmd=function(l,v){var p=this.cmdHistory,T=(l===20||l===28||l===21||l===29)&&v>=32&&v<=47,L=(l===23||l===31)&&v>=33&&v<=35;if(!(T||L))return!1;if(E(l,v,p))return g(null,null,p),this.logger.log(a.DEBUG,"Repeated command ("+h([l,v])+") is dropped"),!0;var D=l===20||l===21||l===23?1:2,x=this.channels[D];return l===20||l===21||l===28||l===29?v===32?x.ccRCL():v===33?x.ccBS():v===34?x.ccAOF():v===35?x.ccAON():v===36?x.ccDER():v===37?x.ccRU(2):v===38?x.ccRU(3):v===39?x.ccRU(4):v===40?x.ccFON():v===41?x.ccRDC():v===42?x.ccTR():v===43?x.ccRTD():v===44?x.ccEDM():v===45?x.ccCR():v===46?x.ccENM():v===47&&x.ccEOC():x.ccTO(v-32),g(l,v,p),this.currentChannel=D,!0},c.parseMidrow=function(l,v){var p=0;if((l===17||l===25)&&v>=32&&v<=47){if(l===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[p];return T?(T.ccMIDROW(v),this.logger.log(a.DEBUG,"MIDROW ("+h([l,v])+")"),!0):!1}return!1},c.parsePAC=function(l,v){var p,T=this.cmdHistory,L=(l>=17&&l<=23||l>=25&&l<=31)&&v>=64&&v<=127,D=(l===16||l===24)&&v>=64&&v<=95;if(!(L||D))return!1;if(E(l,v,T))return g(null,null,T),!0;var x=l<=23?1:2;v>=64&&v<=95?p=x===1?e[l]:f[l]:p=x===1?S[l]:d[l];var M=this.channels[x];return M?(M.setPAC(this.interpretPAC(p,v)),g(l,v,T),this.currentChannel=x,!0):!1},c.interpretPAC=function(l,v){var p,T={color:null,italics:!1,indent:null,underline:!1,row:l};return v>95?p=v-96:p=v-64,T.underline=(p&1)===1,p<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((p-16)/2)*4,T},c.parseChars=function(l,v){var p,T=null,L=null;if(l>=25?(p=2,L=l-8):(p=1,L=l),L>=17&&L<=19){var D;L===17?D=v+80:L===18?D=v+112:D=v+144,this.logger.log(a.INFO,"Special char '"+R(D)+"' in channel "+p),T=[D]}else l>=32&&l<=127&&(T=v===0?[l]:[l,v]);if(T){var x=h(T);this.logger.log(a.DEBUG,"Char codes = "+x.join(",")),g(l,v,this.cmdHistory)}return T},c.parseBackgroundAttributes=function(l,v){var p=(l===16||l===24)&&v>=32&&v<=47,T=(l===23||l===31)&&v>=45&&v<=47;if(!(p||T))return!1;var L,D={};l===16||l===24?(L=Math.floor((v-32)/2),D.background=o[L],v%2===1&&(D.background=D.background+"_semi")):v===45?D.background="transparent":(D.foreground="black",v===47&&(D.underline=!0));var x=l<=23?1:2,M=this.channels[x];return M.setBkgData(D),g(l,v,this.cmdHistory),!0},c.reset=function(){for(var l=0;l<Object.keys(this.channels).length;l++){var v=this.channels[l];v&&v.reset()}this.cmdHistory=_()},c.cueSplitAtTime=function(l){for(var v=0;v<this.channels.length;v++){var p=this.channels[v];p&&p.cueSplitAtTime(l)}},y}();function g(y,c,u){u.a=y,u.b=c}function E(y,c,u){return u.a===y&&u.b===c}function _(){return{a:null,b:null}}B.default=m},"./src/utils/codecs.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"isCodecType",function(){return w}),A.d(B,"isCodecSupportedInMp4",function(){return R});var k={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function w(H,U){var e=k[U];return!!e&&e[H.slice(0,4)]===!0}function R(H,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/utils/vttparser.ts"),w=A("./src/utils/webvtt-parser.ts"),R=A("./src/utils/texttrack-utils.ts"),H=/\s/,U={newCue:function(S,f,d,o){for(var a=[],r,h,s,n,i,t=self.VTTCue||self.TextTrackCue,b=0;b<o.rows.length;b++)if(r=o.rows[b],s=!0,n=0,i="",!r.isEmpty()){for(var m=0;m<r.chars.length;m++)H.test(r.chars[m].uchar)&&s?n++:(i+=r.chars[m].uchar,s=!1);r.cueStartTime=f,f===d&&(d+=1e-4),n>=16?n--:n++;var g=Object(k.fixLineBreaks)(i.trim()),E=Object(w.generateCueId)(f,d,g);(!S||!S.cues||!S.cues.getCueById(E))&&(h=new t(f,d,g),h.id=E,h.line=b+1,h.align="left",h.position=10+Math.min(80,Math.floor(n*8/32)*10),a.push(h))}return S&&a.length&&(a.sort(function(_,y){return _.line==="auto"||y.line==="auto"?0:_.line>8&&y.line>8?y.line-_.line:_.line-y.line}),a.forEach(function(_){return Object(R.addCueToTrack)(S,_)})),a}};B.default=U},"./src/utils/discontinuities.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"findFirstFragWithCC",function(){return H}),A.d(B,"shouldAlignOnDiscontinuities",function(){return U}),A.d(B,"findDiscontinuousReferenceFrag",function(){return e}),A.d(B,"adjustSlidingStart",function(){return f}),A.d(B,"alignStream",function(){return d}),A.d(B,"alignPDT",function(){return a}),A.d(B,"alignFragmentByPDTDelta",function(){return r}),A.d(B,"alignMediaPlaylistByPDT",function(){return h});var k=A("./src/polyfills/number.ts"),w=A("./src/utils/logger.ts"),R=A("./src/controller/level-helper.ts");function H(s,n){for(var i=null,t=0,b=s.length;t<b;t++){var m=s[t];if(m&&m.cc===n){i=m;break}}return i}function U(s,n,i){return!!(n.details&&(i.endCC>i.startCC||s&&s.cc<i.startCC))}function e(s,n){var i=s.fragments,t=n.fragments;if(!t.length||!i.length){w.logger.log("No fragments to align");return}var b=H(i,t[0].cc);if(!b||b&&!b.startPTS){w.logger.log("No frag in previous level to align on");return}return b}function S(s,n){if(s){var i=s.start+n;s.start=s.startPTS=i,s.endPTS=i+s.duration}}function f(s,n){for(var i=n.fragments,t=0,b=i.length;t<b;t++)S(i[t],s);n.fragmentHint&&S(n.fragmentHint,s),n.alignedSliding=!0}function d(s,n,i){if(!n)return;o(s,i,n),!i.alignedSliding&&n.details&&a(i,n.details),!i.alignedSliding&&n.details&&!i.skippedSegments&&Object(R.adjustSliding)(n.details,i)}function o(s,n,i){if(U(s,i,n)){var t=e(i.details,n);t&&Object(k.isFiniteNumber)(t.start)&&(w.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),f(t.start,n))}}function a(s,n){if(!n.fragments.length||!s.hasProgramDateTime||!n.hasProgramDateTime)return;var i=n.fragments[0].programDateTime,t=s.fragments[0].programDateTime,b=(t-i)/1e3+n.fragments[0].start;b&&Object(k.isFiniteNumber)(b)&&(w.logger.log("Adjusting PTS using programDateTime delta "+(t-i)+"ms, sliding:"+b.toFixed(3)+" "+s.url+" "),f(b,s))}function r(s,n){var i=s.programDateTime;if(!i)return;var t=(i-n)/1e3;s.start=s.startPTS=t,s.endPTS=t+s.duration}function h(s,n){if(!n.fragments.length||!s.hasProgramDateTime||!n.hasProgramDateTime)return;var i=n.fragments[0].programDateTime,t=n.fragments[0].start,b=i-t*1e3;s.fragments.forEach(function(m){r(m,b)}),s.fragmentHint&&r(s.fragmentHint,b),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/utils/ewma.ts"),w=function(){function R(U,e,S){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=S,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new k.default(U),this.fast_=new k.default(e)}var H=R.prototype;return H.update=function(e,S){var f=this.slow_,d=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new k.default(e,f.getEstimate(),f.getTotalWeight())),this.fast_.halfLife!==S&&(this.fast_=new k.default(S,d.getEstimate(),d.getTotalWeight()))},H.sample=function(e,S){e=Math.max(e,this.minDelayMs_);var f=8*S,d=e/1e3,o=f/d;this.fast_.sample(d,o),this.slow_.sample(d,o)},H.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},R}();B.default=w},"./src/utils/ewma.ts":function(ae,B,A){"use strict";A.r(B);var k=function(){function w(H,U,e){U===void 0&&(U=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=U,this.totalWeight_=e}var R=w.prototype;return R.sample=function(U,e){var S=Math.pow(this.alpha_,U);this.estimate_=e*(1-S)+S*this.estimate_,this.totalWeight_+=U},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},w}();B.default=k},"./src/utils/fetch-loader.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"fetchSupported",function(){return r});var k=A("./src/polyfills/number.ts"),w=A("./src/loader/load-stats.ts"),R=A("./src/demux/chunk-cache.ts");function H(t,b){t.prototype=Object.create(b.prototype),t.prototype.constructor=t,d(t,b)}function U(t){var b=typeof Map=="function"?new Map:void 0;return U=function(g){if(g===null||!f(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof b!="undefined"){if(b.has(g))return b.get(g);b.set(g,E)}function E(){return e(g,arguments,o(this).constructor)}return E.prototype=Object.create(g.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),d(E,g)},U(t)}function e(t,b,m){return S()?e=Reflect.construct:e=function(E,_,y){var c=[null];c.push.apply(c,_);var u=Function.bind.apply(E,c),l=new u;return y&&d(l,y.prototype),l},e.apply(null,arguments)}function S(){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 f(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function d(t,b){return d=Object.setPrototypeOf||function(g,E){return g.__proto__=E,g},d(t,b)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},o(t)}function a(){return a=Object.assign||function(t){for(var b=1;b<arguments.length;b++){var m=arguments[b];for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(t[g]=m[g])}return t},a.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var h=function(){function t(m){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=m.fetchSetup||n,this.controller=new self.AbortController,this.stats=new w.LoadStats}var b=t.prototype;return b.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},b.abortInternal=function(){var g=this.response;(!g||!g.ok)&&(this.stats.aborted=!0,this.controller.abort())},b.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},b.load=function(g,E,_){var y=this,c=this.stats;if(c.loading.start)throw new Error("Loader can only be used once.");c.loading.start=self.performance.now();var u=s(g,this.controller.signal),l=_.onProgress,v=g.responseType==="arraybuffer",p=v?"byteLength":"length";this.context=g,this.config=E,this.callbacks=_,this.request=this.fetchSetup(g,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),_.onTimeout(c,g,y.response)},E.timeout),self.fetch(this.request).then(function(T){if(y.response=y.loader=T,!T.ok){var L=T.status,D=T.statusText;throw new i(D||"fetch, bad network response",L,T)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(T.headers.get("Content-Length")||"0"),l&&Object(k.isFiniteNumber)(E.highWaterMark)?y.loadProgressively(T,c,g,E.highWaterMark,l):v?T.arrayBuffer():T.text()}).then(function(T){var L=y.response;self.clearTimeout(y.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=T[p];var D={url:L.url,data:T};l&&!Object(k.isFiniteNumber)(E.highWaterMark)&&l(c,g,T,L),_.onSuccess(D,c,g,L)}).catch(function(T){if(self.clearTimeout(y.requestTimeout),c.aborted)return;var L=T.code||0;_.onError({code:L,text:T.message},g,T.details)})},b.getCacheAge=function(){var g=null;if(this.response){var E=this.response.headers.get("age");g=E?parseFloat(E):null}return g},b.loadProgressively=function(g,E,_,y,c){y===void 0&&(y=0);var u=new R.default,l=g.body.getReader(),v=function p(){return l.read().then(function(T){if(T.done)return u.dataLength&&c(E,_,u.flush(),g),Promise.resolve(new ArrayBuffer(0));var L=T.value,D=L.length;return E.loaded+=D,D<y||u.dataLength?(u.push(L),u.dataLength>=y&&c(E,_,u.flush(),g)):c(E,_,L,g),p()}).catch(function(){return Promise.reject()})};return v()},t}();function s(t,b){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:b,headers:new self.Headers(a({},t.headers))};return t.rangeEnd&&m.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),m}function n(t,b){return new self.Request(t.url,b)}var i=function(t){H(b,t);function b(m,g,E){var _;return _=t.call(this,m)||this,_.code=void 0,_.details=void 0,_.code=g,_.details=E,_}return b}(U(Error));B.default=h},"./src/utils/imsc1-ttml-parser.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"IMSC1_CODEC",function(){return f}),A.d(B,"parseIMSC1",function(){return r});var k=A("./src/utils/mp4-tools.ts"),w=A("./src/utils/vttparser.ts"),R=A("./src/utils/vttcue.ts"),H=A("./src/demux/id3.ts"),U=A("./src/utils/timescale-conversion.ts"),e=A("./src/utils/webvtt-parser.ts");function S(){return S=Object.assign||function(y){for(var c=1;c<arguments.length;c++){var u=arguments[c];for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&(y[l]=u[l])}return y},S.apply(this,arguments)}var f="stpp.ttml.im1t",d=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,o=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(y,c,u,l,v){var p=Object(k.findBox)(new Uint8Array(y),["mdat"]);if(p.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var T=p[0],L=Object(H.utf8ArrayToStr)(new Uint8Array(y,T.start,T.end-T.start)),D=Object(U.toTimescaleFromScale)(c,1,u);try{l(h(L,D))}catch(x){v(x)}}function h(y,c){var u=new DOMParser,l=u.parseFromString(y,"text/xml"),v=l.getElementsByTagName("tt")[0];if(!v)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},T=Object.keys(p).reduce(function(j,I){return j[I]=v.getAttribute("ttp:"+I)||p[I],j},{}),L=v.getAttribute("xml:space")!=="preserve",D=n(s(v,"styling","style")),x=n(s(v,"layout","region")),M=s(v,"body","[begin]");return[].map.call(M,function(j){var I=i(j,L);if(!I||!j.hasAttribute("begin"))return null;var W=g(j.getAttribute("begin"),T),Q=g(j.getAttribute("dur"),T),fe=g(j.getAttribute("end"),T);if(W===null)throw m(j);if(fe===null){if(Q===null)throw m(j);fe=W+Q}var le=new R.default(W-c,fe-c,I);le.id=Object(e.generateCueId)(le.startTime,le.endTime,le.text);var Ce=x[j.getAttribute("region")],Oe=D[j.getAttribute("style")];le.position=10,le.size=80;var Re=t(Ce,Oe),Le=Re.textAlign;if(Le){var Pe=a[Le];Pe&&(le.lineAlign=Pe),le.align=Le}return S(le,Re),le}).filter(function(j){return j!==null})}function s(y,c,u){var l=y.getElementsByTagName(c)[0];return l?[].slice.call(l.querySelectorAll(u)):[]}function n(y){return y.reduce(function(c,u){var l=u.getAttribute("xml:id");return l&&(c[l]=u),c},{})}function i(y,c){return[].slice.call(y.childNodes).reduce(function(u,l,v){var p;return l.nodeName==="br"&&v?u+`
|
|
`:(p=l.childNodes)!==null&&p!==void 0&&p.length?i(l,c):c?u+l.textContent.trim().replace(/\s+/g," "):u+l.textContent},"")}function t(y,c){var u="http://www.w3.org/ns/ttml#styling",l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return l.reduce(function(v,p){var T=b(c,u,p)||b(y,u,p);return T&&(v[p]=T),v},{})}function b(y,c,u){return y.hasAttributeNS(c,u)?y.getAttributeNS(c,u):null}function m(y){return new Error("Could not parse ttml timestamp "+y)}function g(y,c){if(!y)return null;var u=Object(w.parseTimeStamp)(y);return u===null&&(d.test(y)?u=E(y,c):o.test(y)&&(u=_(y,c))),u}function E(y,c){var u=d.exec(y),l=(u[4]|0)+(u[5]|0)/c.subFrameRate;return(u[1]|0)*3600+(u[2]|0)*60+(u[3]|0)+l/c.frameRate}function _(y,c){var u=o.exec(y),l=Number(u[1]),v=u[2];switch(v){case"h":return l*3600;case"m":return l*60;case"ms":return l*1e3;case"f":return l/c.frameRate;case"t":return l/c.tickRate}return l}},"./src/utils/logger.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"enableLogs",function(){return e}),A.d(B,"logger",function(){return S});var k=function(){},w={trace:k,debug:k,log:k,warn:k,info:k,error:k},R=w;function H(f){var d=self.console[f];return d?d.bind(self.console,"["+f+"] >"):k}function U(f){for(var d=arguments.length,o=new Array(d>1?d-1:0),a=1;a<d;a++)o[a-1]=arguments[a];o.forEach(function(r){R[r]=f[r]?f[r].bind(f):H(r)})}function e(f){if(self.console&&f===!0||typeof f=="object"){U(f,"debug","log","info","warn","error");try{R.log()}catch(d){R=w}}else R=w}var S=R},"./src/utils/mediakeys-helper.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"KeySystems",function(){return k}),A.d(B,"requestMediaKeySystemAccess",function(){return w});var k;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(k||(k={}));var w=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"getMediaSource",function(){return k});function k(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"bin2str",function(){return U}),A.d(B,"readUint16",function(){return e}),A.d(B,"readUint32",function(){return S}),A.d(B,"writeUint32",function(){return f}),A.d(B,"findBox",function(){return d}),A.d(B,"parseSegmentIndex",function(){return o}),A.d(B,"parseInitSegment",function(){return a}),A.d(B,"getStartDTS",function(){return r}),A.d(B,"getDuration",function(){return h}),A.d(B,"computeRawDurationFromSamples",function(){return s}),A.d(B,"offsetStartDTS",function(){return n}),A.d(B,"segmentValidRange",function(){return i}),A.d(B,"appendUint8Array",function(){return t});var k=A("./src/utils/typed-array.ts"),w=A("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,H=[].push;function U(b){return String.fromCharCode.apply(null,b)}function e(b,m){"data"in b&&(m+=b.start,b=b.data);var g=b[m]<<8|b[m+1];return g<0?65536+g:g}function S(b,m){"data"in b&&(m+=b.start,b=b.data);var g=b[m]<<24|b[m+1]<<16|b[m+2]<<8|b[m+3];return g<0?4294967296+g:g}function f(b,m,g){"data"in b&&(m+=b.start,b=b.data),b[m]=g>>24,b[m+1]=g>>16&255,b[m+2]=g>>8&255,b[m+3]=g&255}function d(b,m){var g=[];if(!m.length)return g;var E,_,y;"data"in b?(E=b.data,_=b.start,y=b.end):(E=b,_=0,y=E.byteLength);for(var c=_;c<y;){var u=S(E,c),l=U(E.subarray(c+4,c+8)),v=u>1?c+u:y;if(l===m[0])if(m.length===1)g.push({data:E,start:c+8,end:v});else{var p=d({data:E,start:c+8,end:v},m.slice(1));p.length&&H.apply(g,p)}c=v}return g}function o(b){var m=d(b,["moov"]),g=m[0],E=g?g.end:null,_=d(b,["sidx"]);if(!_||!_[0])return null;var y=[],c=_[0],u=c.data[0],l=u===0?8:16,v=S(c,l);l+=4;var p=0,T=0;u===0?l+=8:l+=16,l+=2;var L=c.end+T,D=e(c,l);l+=2;for(var x=0;x<D;x++){var M=l,j=S(c,M);M+=4;var I=j&2147483647,W=(j&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=S(c,M);M+=4,y.push({referenceSize:I,subsegmentDuration:Q,info:{duration:Q/v,start:L,end:L+I-1}}),L+=I,M+=4,l=M}return{earliestPresentationTime:p,timescale:v,version:u,referencesCount:D,references:y,moovEndOffset:E}}function a(b){for(var m=[],g=d(b,["moov","trak"]),E=0;E<g.length;E++){var _=g[E],y=d(_,["tkhd"])[0];if(y){var c=y.data[y.start],u=c===0?12:20,l=S(y,u),v=d(_,["mdia","mdhd"])[0];if(v){c=v.data[v.start],u=c===0?12:20;var p=S(v,u),T=d(_,["mdia","hdlr"])[0];if(T){var L=U(T.data.subarray(T.start+8,T.start+12)),D={soun:w.ElementaryStreamTypes.AUDIO,vide:w.ElementaryStreamTypes.VIDEO}[L];if(D){var x=d(_,["mdia","minf","stbl","stsd"])[0],M=void 0;x&&(M=U(x.data.subarray(x.start+12,x.start+16))),m[l]={timescale:p,type:D},m[D]={timescale:p,id:l,codec:M}}}}}}var j=d(b,["moov","mvex","trex"]);return j.forEach(function(I){var W=S(I,4),Q=m[W];Q&&(Q.default={duration:S(I,12),flags:S(I,20)})}),m}function r(b,m){return d(m,["moof","traf"]).reduce(function(g,E){var _=d(E,["tfdt"])[0],y=_.data[_.start],c=d(E,["tfhd"]).reduce(function(u,l){var v=S(l,4),p=b[v];if(p){var T=S(_,4);y===1&&(T*=Math.pow(2,32),T+=S(_,8));var L=p.timescale||9e4,D=T/L;if(isFinite(D)&&(u===null||D<u))return D}return u},null);return c!==null&&isFinite(c)&&(g===null||c<g)?c:g},null)||0}function h(b,m){for(var g=0,E=0,_=0,y=d(b,["moof","traf"]),c=0;c<y.length;c++){var u=y[c],l=d(u,["tfhd"])[0],v=S(l,4),p=m[v];if(!p)continue;var T=p.default,L=S(l,0)|(T==null?void 0:T.flags),D=T==null?void 0:T.duration;L&8&&(L&2?D=S(l,12):D=S(l,8));for(var x=p.timescale||9e4,M=d(u,["trun"]),j=0;j<M.length;j++){if(D){var I=S(M[j],4);g=D*I}else g=s(M[j]);p.type===w.ElementaryStreamTypes.VIDEO?E+=g/x:p.type===w.ElementaryStreamTypes.AUDIO&&(_+=g/x)}}if(E===0&&_===0){var W=o(b);if(W!=null&&W.references)return W.references.reduce(function(Q,fe){return Q+fe.info.duration||0},0)}return E||_}function s(b){var m=S(b,0),g=8;m&1&&(g+=4),m&4&&(g+=4);for(var E=0,_=S(b,4),y=0;y<_;y++){if(m&256){var c=S(b,g);E+=c,g+=4}m&512&&(g+=4),m&1024&&(g+=4),m&2048&&(g+=4)}return E}function n(b,m,g){d(m,["moof","traf"]).forEach(function(E){d(E,["tfhd"]).forEach(function(_){var y=S(_,4),c=b[y];if(!c)return;var u=c.timescale||9e4;d(E,["tfdt"]).forEach(function(l){var v=l.data[l.start],p=S(l,4);if(v===0)f(l,4,p-g*u);else{p*=Math.pow(2,32),p+=S(l,8),p-=g*u,p=Math.max(p,0);var T=Math.floor(p/(R+1)),L=Math.floor(p%(R+1));f(l,4,T),f(l,8,L)}})})})}function i(b){var m={valid:null,remainder:null},g=d(b,["moof"]);if(g){if(g.length<2)return m.remainder=b,m}else return m;var E=g[g.length-1];return m.valid=Object(k.sliceUint8)(b,0,E.start-8),m.remainder=Object(k.sliceUint8)(b,E.start-8),m}function t(b,m){var g=new Uint8Array(b.length+m.length);return g.set(b),g.set(m,b.length),g}},"./src/utils/output-filter.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"default",function(){return k});var k=function(){function w(H,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=U}var R=w.prototype;return R.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},R.newCue=function(U,e,S){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=e,this.screen=S,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},w}()},"./src/utils/texttrack-utils.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"sendAddTrackEvent",function(){return w}),A.d(B,"addCueToTrack",function(){return R}),A.d(B,"clearCurrentCues",function(){return H}),A.d(B,"removeCuesInRange",function(){return U}),A.d(B,"getCuesInRange",function(){return S});var k=A("./src/utils/logger.ts");function w(f,d){var o;try{o=new Event("addtrack")}catch(a){o=document.createEvent("Event"),o.initEvent("addtrack",!1,!1)}o.track=f,d.dispatchEvent(o)}function R(f,d){var o=f.mode;if(o==="disabled"&&(f.mode="hidden"),f.cues&&!f.cues.getCueById(d.id))try{if(f.addCue(d),!f.cues.getCueById(d.id))throw new Error("addCue is failed for: "+d)}catch(r){k.logger.debug("[texttrack-utils]: "+r);var a=new self.TextTrackCue(d.startTime,d.endTime,d.text);a.id=d.id,f.addCue(a)}o==="disabled"&&(f.mode=o)}function H(f){var d=f.mode;if(d==="disabled"&&(f.mode="hidden"),f.cues)for(var o=f.cues.length;o--;)f.removeCue(f.cues[o]);d==="disabled"&&(f.mode=d)}function U(f,d,o){var a=f.mode;if(a==="disabled"&&(f.mode="hidden"),f.cues&&f.cues.length>0)for(var r=S(f.cues,d,o),h=0;h<r.length;h++)f.removeCue(r[h]);a==="disabled"&&(f.mode=a)}function e(f,d){if(d<f[0].startTime)return 0;var o=f.length-1;if(d>f[o].endTime)return-1;for(var a=0,r=o;a<=r;){var h=Math.floor((r+a)/2);if(d<f[h].startTime)r=h-1;else if(d>f[h].startTime&&a<o)a=h+1;else return h}return f[a].startTime-d<d-f[r].startTime?a:r}function S(f,d,o){var a=[],r=e(f,d);if(r>-1)for(var h=r,s=f.length;h<s;h++){var n=f[h];if(n.startTime>=d&&n.endTime<=o)a.push(n);else if(n.startTime>o)return a}return a}},"./src/utils/time-ranges.ts":function(ae,B,A){"use strict";A.r(B);var k={toString:function(R){for(var H="",U=R.length,e=0;e<U;e++)H+="["+R.start(e).toFixed(3)+","+R.end(e).toFixed(3)+"]";return H}};B.default=k},"./src/utils/timescale-conversion.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"toTimescaleFromBase",function(){return w}),A.d(B,"toTimescaleFromScale",function(){return R}),A.d(B,"toMsFromMpegTsClock",function(){return H}),A.d(B,"toMpegTsClockFromTimescale",function(){return U});var k=9e4;function w(e,S,f,d){f===void 0&&(f=1),d===void 0&&(d=!1);var o=e*S*f;return d?Math.round(o):o}function R(e,S,f,d){return f===void 0&&(f=1),d===void 0&&(d=!1),w(e,S,1/f,d)}function H(e,S){return S===void 0&&(S=!1),w(e,1e3,1/k,S)}function U(e,S){return S===void 0&&(S=1),w(e,k,1/S)}},"./src/utils/typed-array.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"sliceUint8",function(){return k});function k(w,R,H){return Uint8Array.prototype.slice?w.slice(R,H):new Uint8Array(Array.prototype.slice.call(w,R,H))}},"./src/utils/vttcue.ts":function(ae,B,A){"use strict";A.r(B),B.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var k=["","lr","rl"],w=["start","middle","end","left","right"];function R(f,d){if(typeof d!="string")return!1;if(!Array.isArray(f))return!1;var o=d.toLowerCase();return~f.indexOf(o)?o:!1}function H(f){return R(k,f)}function U(f){return R(w,f)}function e(f){for(var d=arguments.length,o=new Array(d>1?d-1:0),a=1;a<d;a++)o[a-1]=arguments[a];for(var r=1;r<arguments.length;r++){var h=arguments[r];for(var s in h)f[s]=h[s]}return f}function S(f,d,o){var a=this,r={enumerable:!0};a.hasBeenReset=!1;var h="",s=!1,n=f,i=d,t=o,b=null,m="",g=!0,E="auto",_="start",y=50,c="middle",u=50,l="middle";Object.defineProperty(a,"id",e({},r,{get:function(){return h},set:function(p){h=""+p}})),Object.defineProperty(a,"pauseOnExit",e({},r,{get:function(){return s},set:function(p){s=!!p}})),Object.defineProperty(a,"startTime",e({},r,{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(a,"endTime",e({},r,{get:function(){return i},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");i=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",e({},r,{get:function(){return t},set:function(p){t=""+p,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",e({},r,{get:function(){return b},set:function(p){b=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",e({},r,{get:function(){return m},set:function(p){var T=H(p);if(T===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=T,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",e({},r,{get:function(){return g},set:function(p){g=!!p,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",e({},r,{get:function(){return E},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");E=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",e({},r,{get:function(){return _},set:function(p){var T=U(p);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");_=T,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",e({},r,{get:function(){return y},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");y=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",e({},r,{get:function(){return c},set:function(p){var T=U(p);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");c=T,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",e({},r,{get:function(){return u},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");u=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",e({},r,{get:function(){return l},set:function(p){var T=U(p);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");l=T,this.hasBeenReset=!0}})),a.displayState=void 0}return S.prototype.getCueAsHTML=function(){var f=self.WebVTT;return f.convertCueToDOMTree(self,this.text)},S}()},"./src/utils/vttparser.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"parseTimeStamp",function(){return R}),A.d(B,"fixLineBreaks",function(){return d}),A.d(B,"VTTParser",function(){return o});var k=A("./src/utils/vttcue.ts"),w=function(){function a(){}var r=a.prototype;return r.decode=function(s,n){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},a}();function R(a){function r(s,n,i,t){return(s|0)*3600+(n|0)*60+(i|0)+parseFloat(t||0)}var h=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?r(h[2],h[3],0,h[4]):r(h[1],h[2],h[3],h[4]):null}var H=function(){function a(){this.values=Object.create(null)}var r=a.prototype;return r.set=function(s,n){!this.get(s)&&n!==""&&(this.values[s]=n)},r.get=function(s,n,i){return i?this.has(s)?this.values[s]:n[i]:this.has(s)?this.values[s]:n},r.has=function(s){return s in this.values},r.alt=function(s,n,i){for(var t=0;t<i.length;++t)if(n===i[t]){this.set(s,n);break}},r.integer=function(s,n){/^-?\d+$/.test(n)&&this.set(s,parseInt(n,10))},r.percent=function(s,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var i=parseFloat(n);if(i>=0&&i<=100)return this.set(s,i),!0}return!1},a}();function U(a,r,h,s){var n=s?a.split(s):[a];for(var i in n){if(typeof n[i]!="string")continue;var t=n[i].split(h);if(t.length!==2)continue;var b=t[0],m=t[1];r(b,m)}}var e=new k.default(0,0,""),S=e.align==="middle"?"middle":"center";function f(a,r,h){var s=a;function n(){var b=R(a);if(b===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),b}function i(b,m){var g=new H;U(b,function(y,c){var u;switch(y){case"region":for(var l=h.length-1;l>=0;l--)if(h[l].id===c){g.set(y,h[l].region);break}break;case"vertical":g.alt(y,c,["rl","lr"]);break;case"line":u=c.split(","),g.integer(y,u[0]),g.percent(y,u[0])&&g.set("snapToLines",!1),g.alt(y,u[0],["auto"]),u.length===2&&g.alt("lineAlign",u[1],["start",S,"end"]);break;case"position":u=c.split(","),g.percent(y,u[0]),u.length===2&&g.alt("positionAlign",u[1],["start",S,"end","line-left","line-right","auto"]);break;case"size":g.percent(y,c);break;case"align":g.alt(y,c,["start",S,"end","left","right"]);break}},/:/,/\s/),m.region=g.get("region",null),m.vertical=g.get("vertical","");var E=g.get("line","auto");E==="auto"&&e.line===-1&&(E=-1),m.line=E,m.lineAlign=g.get("lineAlign","start"),m.snapToLines=g.get("snapToLines",!0),m.size=g.get("size",100),m.align=g.get("align",S);var _=g.get("position","auto");_==="auto"&&e.position===50&&(_=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=_}function t(){a=a.replace(/^\s+/,"")}if(t(),r.startTime=n(),t(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.substr(3),t(),r.endTime=n(),t(),i(a,r)}function d(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}var o=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new w,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=a.prototype;return r.parse=function(s){var n=this;s&&(n.buffer+=n.decoder.decode(s,{stream:!0}));function i(){var _=n.buffer,y=0;for(_=d(_);y<_.length&&_[y]!=="\r"&&_[y]!==`
|
|
`;)++y;var c=_.substr(0,y);return _[y]==="\r"&&++y,_[y]===`
|
|
`&&++y,n.buffer=_.substr(y),c}function t(_){U(_,function(y,c){},/:/)}try{var b="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;b=i();var m=b.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var g=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;g?g=!1:b=i();switch(n.state){case"HEADER":/:/.test(b)?t(b):b||(n.state="ID");continue;case"NOTE":b||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(b)){n.state="NOTE";break}if(!b)continue;if(n.cue=new k.default(0,0,""),n.state="CUE",b.indexOf("-->")===-1){n.cue.id=b;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{f(b,n.cue,n.regionList)}catch(_){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var E=b.indexOf("-->")!==-1;if(!b||E&&(g=!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+=b}continue;case"BADCUE":b||(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},r.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
|
|
|
|
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(n){s.onparsingerror&&s.onparsingerror(n)}return s.onflush&&s.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(ae,B,A){"use strict";A.r(B),A.d(B,"generateCueId",function(){return o}),A.d(B,"parseWebVTT",function(){return r});var k=A("./src/polyfills/number.ts"),w=A("./src/utils/vttparser.ts"),R=A("./src/demux/id3.ts"),H=A("./src/utils/timescale-conversion.ts"),U=A("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,S=function(s,n,i){return i===void 0&&(i=0),s.substr(i,n.length)===n},f=function(s){var n=parseInt(s.substr(-3)),i=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),b=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(k.isFiniteNumber)(n)||!Object(k.isFiniteNumber)(i)||!Object(k.isFiniteNumber)(t)||!Object(k.isFiniteNumber)(b))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return n+=1e3*i,n+=60*1e3*t,n+=60*60*1e3*b,n},d=function(s){for(var n=5381,i=s.length;i;)n=n*33^s.charCodeAt(--i);return(n>>>0).toString()};function o(h,s,n){return d(h.toString())+d(s.toString())+d(n)}var a=function(s,n,i){var t=s[n],b=s[t.prevCC];if(!b||!b.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(m=b)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=t.start-b.start,t.new=!1,t=b,b=s[t.prevCC]}s.presentationOffset=i};function r(h,s,n,i,t,b,m,g){var E=new w.VTTParser,_=Object(R.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(e,`
|
|
`).split(`
|
|
`),y=[],c=Object(H.toMpegTsClockFromTimescale)(s,n),u="00:00.000",l=0,v=0,p,T=!0,L=!1;E.oncue=function(D){var x=i[t],M=i.ccOffset,j=(l-c)/9e4;if(x!=null&&x.new&&(v!==void 0?M=i.ccOffset=x.start:a(i,t,j)),j&&(M=j-i.presentationOffset),L){var I=D.endTime-D.startTime,W=Object(U.normalizePts)((D.startTime+M-v)*9e4,b*9e4)/9e4;D.startTime=W,D.endTime=W+I}var Q=D.text.trim();D.text=decodeURIComponent(encodeURIComponent(Q)),D.id||(D.id=o(D.startTime,D.endTime,Q)),D.endTime>0&&y.push(D)},E.onparsingerror=function(D){p=D},E.onflush=function(){if(p){g(p);return}m(y)},_.forEach(function(D){if(T)if(S(D,"X-TIMESTAMP-MAP=")){T=!1,L=!0,D.substr(16).split(",").forEach(function(x){S(x,"LOCAL:")?u=x.substr(6):S(x,"MPEGTS:")&&(l=parseInt(x.substr(7)))});try{v=f(u)/1e3}catch(x){L=!1,p=x}return}else D===""&&(T=!1);E.parse(D+`
|
|
`)}),E.flush()}},"./src/utils/xhr-loader.ts":function(ae,B,A){"use strict";A.r(B);var k=A("./src/utils/logger.ts"),w=A("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,H=function(){function U(S){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=S?S.xhrSetup:null,this.stats=new w.LoadStats,this.retryDelay=0}var e=U.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var f=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),f&&(f.onreadystatechange=null,f.onprogress=null,f.readyState!==4&&(this.stats.aborted=!0,f.abort()))},e.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(f,d,o){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=f,this.config=d,this.callbacks=o,this.retryDelay=d.retryDelay,this.loadInternal()},e.loadInternal=function(){var f=this.config,d=this.context;if(!f)return;var o=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var r=this.xhrSetup;try{if(r)try{r(o,d.url)}catch(n){o.open("GET",d.url,!0),r(o,d.url)}o.readyState||o.open("GET",d.url,!0);var h=this.context.headers;if(h)for(var s in h)o.setRequestHeader(s,h[s])}catch(n){this.callbacks.onError({code:o.status,text:n.message},d,o);return}d.rangeEnd&&o.setRequestHeader("Range","bytes="+d.rangeStart+"-"+(d.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=d.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),f.timeout),o.send()},e.readystatechange=function(){var f=this.context,d=this.loader,o=this.stats;if(!f||!d)return;var a=d.readyState,r=this.config;if(o.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),o.loading.first===0&&(o.loading.first=Math.max(self.performance.now(),o.loading.start)),a===4){d.onreadystatechange=null,d.onprogress=null;var h=d.status;if(h>=200&&h<300){o.loading.end=Math.max(self.performance.now(),o.loading.first);var s,n;if(f.responseType==="arraybuffer"?(s=d.response,n=s.byteLength):(s=d.responseText,n=s.length),o.loaded=o.total=n,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(o,f,s,d),!this.callbacks)return;var t={url:d.responseURL,data:s};this.callbacks.onSuccess(t,o,f,d)}else o.retry>=r.maxRetry||h>=400&&h<499?(k.logger.error(h+" while loading "+f.url),this.callbacks.onError({code:h,text:d.statusText},f,d)):(k.logger.warn(h+" while loading "+f.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,r.maxRetryDelay),o.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},e.loadtimeout=function(){k.logger.warn("timeout while loading "+this.context.url);var f=this.callbacks;f&&(this.abortInternal(),f.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(f){var d=this.stats;d.loaded=f.loaded,f.lengthComputable&&(d.total=f.total)},e.getCacheAge=function(){var f=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var d=this.loader.getResponseHeader("age");f=d?parseFloat(d):null}return f},U}();B.default=H}}).default})},vHTk:function(Je,be,V){Je.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|