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.
404 lines
921 KiB
404 lines
921 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[185,5,7,8],{"+ua5":function(Ge,oe,K){},"/cxE":function(Ge,oe,K){"use strict";K.d(oe,"f",function(){return R}),K.d(oe,"g",function(){return F}),K.d(oe,"h",function(){return L}),K.d(oe,"e",function(){return j}),K.d(oe,"b",function(){return U}),K.d(oe,"c",function(){return e}),K.d(oe,"d",function(){return A}),K.d(oe,"a",function(){return d});class ee{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
|
|
|
|
`+f.stack):f},0)}}emit(f){this.listeners.forEach(o=>{o(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const W=new ee;function R(f){j(f)||W.onUnexpectedError(f);return}function F(f){j(f)||W.onUnexpectedExternalError(f);return}function L(f){if(f instanceof Error){let{name:o,message:n}=f;const a=f.stacktrace||f.stack;return{$isError:!0,name:o,message:n,stack:a}}return f}const D="Canceled";function j(f){return f instanceof Error&&f.name===D&&f.message===D}function U(){const f=new Error(D);return f.name=f.message,f}function e(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function A(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class d extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"24hK":function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return W});class ee{constructor(R){this.element=R,this.next=ee.Undefined,this.prev=ee.Undefined}}ee.Undefined=new ee(void 0);class W{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let R=this._first;for(;R!==ee.Undefined;){const F=R.next;R.prev=ee.Undefined,R.next=ee.Undefined,R=F}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(R){return this._insert(R,!1)}push(R){return this._insert(R,!0)}_insert(R,F){const L=new ee(R);if(this._first===ee.Undefined)this._first=L,this._last=L;else if(F){const j=this._last;this._last=L,L.prev=j,j.next=L}else{const j=this._first;this._first=L,L.next=j,j.prev=L}this._size+=1;let D=!1;return()=>{D||(D=!0,this._remove(L))}}shift(){if(this._first===ee.Undefined)return;{const R=this._first.element;return this._remove(this._first),R}}pop(){if(this._last===ee.Undefined)return;{const R=this._last.element;return this._remove(this._last),R}}_remove(R){if(R.prev!==ee.Undefined&&R.next!==ee.Undefined){const F=R.prev;F.next=R.next,R.next.prev=F}else R.prev===ee.Undefined&&R.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):R.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):R.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let R=this._first;for(;R!==ee.Undefined;)yield R.element,R=R.next}}},"3/fG":function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return W});function ee(R,F){let L;return F.length===0?L=R:L=R.replace(/\{(\d+)\}/g,function(D,j){const U=j[0];return typeof F[U]!="undefined"?F[U]:D}),L}function W(R,F,...L){return ee(F,L)}},"30zm":function(Ge,oe,K){"use strict";var ee=K("k1fw"),W=K("tJVT"),R=K("PpiC"),F=K("B9cy"),L=K("Ol7k"),D=K("lUTK"),j=K("BvKs"),U=K("q1tI"),e=K.n(U),A=K("Ty5D"),d=K("55Ip"),f=K("9kvl"),o=K("m3rI"),n=K("kzJb"),a=K.n(n),h=j.a.SubMenu,s=L.a.Sider,r=L.a.Content,t=function(b){var m,_,x,E,y=b.messages,c=b.globalSetting,u=b.loading,l=b.user,v=b.dispatch,g=Object(R.a)(b,["messages","globalSetting","loading","user","dispatch"]),w=Object(A.i)(),O=l.userInfo,I=Object(A.h)(),S=y.tidingsList,P=y.privateMessage,B=y.unreadInfo,C=Object(U.useState)({per_page:10,page:1}),H=Object(W.a)(C,2),z=H[0],Z=H[1];Object(U.useEffect)(function(){Q()},[w.userId]);var Q=function(){v({type:"messages/unreadMessageInfo",payload:Object(ee.a)(Object(ee.a)({},z),w)})};return e.a.createElement("section",{className:a.a.wrap},e.a.createElement("div",{className:a.a.avatarWrap},e.a.createElement("div",{className:a.a.avatar},e.a.createElement("div",{className:a.a.updateAvatarWrap},e.a.createElement("img",{className:a.a.img,src:o.a.IMG_SERVER+"/images/"+(O==null?void 0:O.image_url)}))),e.a.createElement("div",{className:a.a.name_role},e.a.createElement("div",{className:a.a.name,title:O==null?void 0:O.username},(O==null||((m=O.username)===null||m===void 0)?void 0:m.length)>6?(O==null||((_=O.username)===null||_===void 0)?void 0:_.substr(0,6))+"...":O==null?void 0:O.username),e.a.createElement("div",{className:a.a.role},((x=l.userInfo)===null||x===void 0?void 0:x.user_identity)=="\u8001\u5E08"?e.a.createElement("img",{src:K("ccQJ"),width:56,height:21,style:{position:"relative",top:-2}}):(E=l.userInfo)===null||E===void 0?void 0:E.user_identity))),e.a.createElement("div",{className:a.a.manage},e.a.createElement("ul",{className:"pl0 pt20"},e.a.createElement(d.a,{to:"/messages/".concat(O==null?void 0:O.login,"/user_tidings")},e.a.createElement("li",{className:"".concat(a.a.item," ").concat(I.pathname.indexOf("user_tidings")>-1&&a.a.active,`
|
|
`)},e.a.createElement("span",null,e.a.createElement("i",{className:"iconfont icon-tpixiaoxitixing font16 ".concat(a.a.colorGary)}),"\u6D88\u606F"),!!(B!=null&&B.unread_tiding_count)&&e.a.createElement("span",{className:a.a.newTip},B==null?void 0:B.unread_tiding_count))))))};oe.a=Object(f.a)(function(i){var b=i.messages,m=i.loading,_=i.user,x=i.globalSetting;return{messages:b,globalSetting:x,user:_,loading:m.effects}})(t)},"55Ip":function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return t});var ee=K("Ty5D"),W=K("dI71"),R=K("q1tI"),F=K.n(R),L=K("YS25"),D=K("17x9"),j=K.n(D),U=K("wx14"),e=K("zLVn"),A=K("9R94"),d=function(c){Object(W.a)(u,c);function u(){for(var v,g=arguments.length,w=new Array(g),O=0;O<g;O++)w[O]=arguments[O];return v=c.call.apply(c,[this].concat(w))||this,v.history=Object(L.a)(v.props),v}var l=u.prototype;return l.render=function(){return F.a.createElement(ee.c,{history:this.history,children:this.props.children})},u}(F.a.Component),f=function(c){Object(W.a)(u,c);function u(){for(var v,g=arguments.length,w=new Array(g),O=0;O<g;O++)w[O]=arguments[O];return v=c.call.apply(c,[this].concat(w))||this,v.history=Object(L.b)(v.props),v}var l=u.prototype;return l.render=function(){return F.a.createElement(ee.c,{history:this.history,children:this.props.children})},u}(F.a.Component),o=function(u,l){return typeof u=="function"?u(l):u},n=function(u,l){return typeof u=="string"?Object(L.c)(u,null,null,l):u},a=function(u){return u},h=F.a.forwardRef;typeof h=="undefined"&&(h=a);function s(c){return!!(c.metaKey||c.altKey||c.ctrlKey||c.shiftKey)}var r=h(function(c,u){var l=c.innerRef,v=c.navigate,g=c.onClick,w=Object(e.a)(c,["innerRef","navigate","onClick"]),O=w.target,I=Object(U.a)({},w,{onClick:function(P){try{g&&g(P)}catch(B){throw P.preventDefault(),B}!P.defaultPrevented&&P.button===0&&(!O||O==="_self")&&!s(P)&&(P.preventDefault(),v())}});return a!==h?I.ref=u||l:I.ref=l,F.a.createElement("a",I)}),t=h(function(c,u){var l=c.component,v=l===void 0?r:l,g=c.replace,w=c.to,O=c.innerRef,I=Object(e.a)(c,["component","replace","to","innerRef"]);return F.a.createElement(ee.e.Consumer,null,function(S){S||Object(A.a)(!1);var P=S.history,B=n(o(w,S.location),S.location),C=B?P.createHref(B):"",H=Object(U.a)({},I,{href:C,navigate:function(){var Z=o(w,S.location),Q=g?P.replace:P.push;Q(Z)}});return a!==h?H.ref=u||O:H.innerRef=O,F.a.createElement(v,H)})});if(!1)var i,b;var m=function(u){return u},_=F.a.forwardRef;typeof _=="undefined"&&(_=m);function x(){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 E=_(function(c,u){var l=c["aria-current"],v=l===void 0?"page":l,g=c.activeClassName,w=g===void 0?"active":g,O=c.activeStyle,I=c.className,S=c.exact,P=c.isActive,B=c.location,C=c.sensitive,H=c.strict,z=c.style,Z=c.to,Q=c.innerRef,pe=Object(e.a)(c,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return F.a.createElement(ee.e.Consumer,null,function(le){le||Object(A.a)(!1);var de=B||le.location,ce=n(o(Z,de),de),me=ce.pathname,te=me&&me.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),$=te?Object(ee.f)(de.pathname,{path:te,exact:S,sensitive:C,strict:H}):null,_e=!!(P?P($,de):$),Oe=_e?x(I,w):I,Ce=_e?Object(U.a)({},z,{},O):z,Ae=Object(U.a)({"aria-current":_e&&v||null,className:Oe,style:Ce,to:ce},pe);return m!==_?Ae.ref=u||Q:Ae.innerRef=Q,F.a.createElement(t,Ae)})});if(!1)var y},"5VLF":function(Ge,oe,K){"use strict";var ee,W;function R(F,L,D){var j=function(U,e){return F.js_beautify(U,e)};return j.js=F.js_beautify,j.css=L.css_beautify,j.html=D.html_beautify,j.js_beautify=F.js_beautify,j.css_beautify=L.css_beautify,j.html_beautify=D.html_beautify,j}!(ee=[K("6UM0"),K("TXwP"),K("psGv")],W=function(F,L,D){return R(F,L,D)}.apply(oe,ee),W!==void 0&&(Ge.exports=W))},"5Y4S":function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return R});var ee=K("MNsG");const W=ee.b.performance&&typeof ee.b.performance.now=="function";class R{constructor(F){this._highResolution=W&&F,this._startTime=this._now(),this._stopTime=-1}static create(F=!0){return new R(F)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ee.b.performance.now():Date.now()}}},"6+eU":function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return _});var ee=K("wx14"),W=K("rePB"),R=K("VTBJ"),F=K("1OyB"),L=K("vuIU"),D=K("Ji7U"),j=K("LK+K"),U=K("q1tI"),e=K.n(U),A=K("TSYQ"),d=K.n(A),f=function(E){var y,c="".concat(E.rootPrefixCls,"-item"),u=d()(c,"".concat(c,"-").concat(E.page),(y={},Object(W.a)(y,"".concat(c,"-active"),E.active),Object(W.a)(y,E.className,!!E.className),Object(W.a)(y,"".concat(c,"-disabled"),!E.page),y)),l=function(){E.onClick(E.page)},v=function(w){E.onKeyPress(w,E.onClick,E.page)};return e.a.createElement("li",{title:E.showTitle?E.page:null,className:u,onClick:l,onKeyPress:v,tabIndex:"0"},E.itemRender(E.page,"page",e.a.createElement("a",{rel:"nofollow"},E.page)))},o=f,n={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(x){Object(D.a)(y,x);var E=Object(j.a)(y);function y(){var c;Object(F.a)(this,y);for(var u=arguments.length,l=new Array(u),v=0;v<u;v++)l[v]=arguments[v];return c=E.call.apply(E,[this].concat(l)),c.state={goInputText:""},c.buildOptionText=function(g){return"".concat(g," ").concat(c.props.locale.items_per_page)},c.changeSize=function(g){c.props.changeSize(Number(g))},c.handleChange=function(g){c.setState({goInputText:g.target.value})},c.handleBlur=function(g){var w=c.props,O=w.goButton,I=w.quickGo,S=w.rootPrefixCls,P=c.state.goInputText;if(O||P==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(S,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(S,"-next"))>=0))return;c.setState({goInputText:""}),I(c.getValidValue())},c.go=function(g){var w=c.state.goInputText;if(w==="")return;(g.keyCode===n.ENTER||g.type==="click")&&(c.setState({goInputText:""}),c.props.quickGo(c.getValidValue()))},c}return Object(L.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(g){return g.toString()===l.toString()})?v:v.concat([l.toString()]).sort(function(g,w){var O=isNaN(Number(g))?0:Number(g),I=isNaN(Number(w))?0:Number(w);return O-I})}},{key:"render",value:function(){var u=this,l=this.props,v=l.pageSize,g=l.locale,w=l.rootPrefixCls,O=l.changeSize,I=l.quickGo,S=l.goButton,P=l.selectComponentClass,B=l.buildOptionText,C=l.selectPrefixCls,H=l.disabled,z=this.state.goInputText,Z="".concat(w,"-options"),Q=P,pe=null,le=null,de=null;if(!O&&!I)return null;var ce=this.getPageSizeOptions();if(O&&Q){var me=ce.map(function(te,$){return e.a.createElement(Q.Option,{key:$,value:te.toString()},(B||u.buildOptionText)(te))});pe=e.a.createElement(Q,{disabled:H,prefixCls:C,showSearch:!1,className:"".concat(Z,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(v||ce[0]).toString(),onChange:this.changeSize,getPopupContainer:function($){return $.parentNode}},me)}return I&&(S&&(de=typeof S=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(Z,"-quick-jumper-button")},g.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},S)),le=e.a.createElement("div",{className:"".concat(Z,"-quick-jumper")},g.jump_to,e.a.createElement("input",{disabled:H,type:"text",value:z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,de)),e.a.createElement("li",{className:"".concat(Z)},pe,le)}}]),y}(e.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var h=a,s=K("N2Kk");function r(){}function t(x){return typeof x=="number"&&isFinite(x)&&Math.floor(x)===x}function i(x,E,y){return y}function b(x,E,y){var c=typeof x=="undefined"?E.pageSize:x;return Math.floor((y.total-1)/c)+1}var m=function(x){Object(D.a)(y,x);var E=Object(j.a)(y);function y(c){var u;Object(F.a)(this,y),u=E.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(O,I){var S=u.props.prefixCls,P=O||e.a.createElement("button",{type:"button","aria-label":I,className:"".concat(S,"-item-link")});return typeof O=="function"&&(P=e.a.createElement(O,Object(R.a)({},u.props))),P},u.savePaginationNode=function(O){u.paginationNode=O},u.isValid=function(O){return t(O)&&O!==u.state.current},u.shouldDisplayQuickJumper=function(){var O=u.props,I=O.showQuickJumper,S=O.pageSize,P=O.total;return P<=S?!1:I},u.handleKeyDown=function(O){(O.keyCode===n.ARROW_UP||O.keyCode===n.ARROW_DOWN)&&O.preventDefault()},u.handleKeyUp=function(O){var I=u.getValidValue(O),S=u.state.currentInputValue;I!==S&&u.setState({currentInputValue:I}),O.keyCode===n.ENTER?u.handleChange(I):O.keyCode===n.ARROW_UP?u.handleChange(I-1):O.keyCode===n.ARROW_DOWN&&u.handleChange(I+1)},u.changePageSize=function(O){var I=u.state.current,S=b(O,u.state,u.props);I=I>S?S:I,S===0&&(I=u.state.current),typeof O=="number"&&("pageSize"in u.props||u.setState({pageSize:O}),"current"in u.props||u.setState({current:I,currentInputValue:I})),u.props.onShowSizeChange(I,O),"onChange"in u.props&&u.props.onChange&&u.props.onChange(I,O)},u.handleChange=function(O){var I=u.props.disabled,S=O;if(u.isValid(S)&&!I){var P=b(void 0,u.state,u.props);S>P?S=P:S<1&&(S=1),"current"in u.props||u.setState({current:S,currentInputValue:S});var B=u.state.pageSize;return u.props.onChange(S,B),S}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(O,I){if(O.key==="Enter"||O.charCode===13){for(var S=arguments.length,P=new Array(S>2?S-2:0),B=2;B<S;B++)P[B-2]=arguments[B];I.apply(void 0,P)}},u.runIfEnterPrev=function(O){u.runIfEnter(O,u.prev)},u.runIfEnterNext=function(O){u.runIfEnter(O,u.next)},u.runIfEnterJumpPrev=function(O){u.runIfEnter(O,u.jumpPrev)},u.runIfEnterJumpNext=function(O){u.runIfEnter(O,u.jumpNext)},u.handleGoTO=function(O){(O.keyCode===n.ENTER||O.type==="click")&&u.handleChange(u.state.currentInputValue)};var l=c.onChange!==r,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 g=c.defaultCurrent;"current"in c&&(g=c.current);var w=c.defaultPageSize;return"pageSize"in c&&(w=c.pageSize),g=Math.min(g,b(w,void 0,c)),u.state={current:g,currentInputValue:g,pageSize:w},u}return Object(L.a)(y,[{key:"componentDidUpdate",value:function(u,l){var v=this.props.prefixCls;if(l.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(v,"-item-").concat(l.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(u){var l=u.target.value,v=b(void 0,this.state,this.props),g=this.state.currentInputValue,w;return l===""?w=l:isNaN(Number(l))?w=g:l>=v?w=v:w=Number(l),w}},{key:"getShowSizeChanger",value:function(){var u=this.props,l=u.showSizeChanger,v=u.total,g=u.totalBoundaryShowSizeChanger;return typeof l!="undefined"?l:v>g}},{key:"renderPrev",value:function(u){var l=this.props,v=l.prevIcon,g=l.itemRender,w=g(u,"prev",this.getItemIcon(v,"prev page")),O=!this.hasPrev();return Object(U.isValidElement)(w)?Object(U.cloneElement)(w,{disabled:O}):w}},{key:"renderNext",value:function(u){var l=this.props,v=l.nextIcon,g=l.itemRender,w=g(u,"next",this.getItemIcon(v,"next page")),O=!this.hasNext();return Object(U.isValidElement)(w)?Object(U.cloneElement)(w,{disabled:O}):w}},{key:"render",value:function(){var u=this,l=this.props,v=l.prefixCls,g=l.className,w=l.style,O=l.disabled,I=l.hideOnSinglePage,S=l.total,P=l.locale,B=l.showQuickJumper,C=l.showLessItems,H=l.showTitle,z=l.showTotal,Z=l.simple,Q=l.itemRender,pe=l.showPrevNextJumpers,le=l.jumpPrevIcon,de=l.jumpNextIcon,ce=l.selectComponentClass,me=l.selectPrefixCls,te=l.pageSizeOptions,$=this.state,_e=$.current,Oe=$.pageSize,Ce=$.currentInputValue;if(I===!0&&S<=Oe)return null;var Ae=b(void 0,this.state,this.props),Pe=[],ye=null,Ee=null,Ie=null,X=null,se=null,ue=B&&B.goButton,he=C?1:2,xe=_e-1>0?_e-1:0,we=_e+1<Ae?_e+1:Ae,Me=Object.keys(this.props).reduce(function(V,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(V[Y]=u.props[Y]),V},{});if(Z)return ue&&(typeof ue=="boolean"?se=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},P.jump_to_confirm):se=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ue),se=e.a.createElement("li",{title:H?"".concat(P.jump_to).concat(_e,"/").concat(Ae):null,className:"".concat(v,"-simple-pager")},se)),e.a.createElement("ul",Object(ee.a)({className:d()(v,"".concat(v,"-simple"),Object(W.a)({},"".concat(v,"-disabled"),O),g),style:w,ref:this.savePaginationNode},Me),e.a.createElement("li",{title:H?P.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:d()("".concat(v,"-prev"),Object(W.a)({},"".concat(v,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(xe)),e.a.createElement("li",{title:H?"".concat(_e,"/").concat(Ae):null,className:"".concat(v,"-simple-pager")},e.a.createElement("input",{type:"text",value:Ce,disabled:O,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),e.a.createElement("span",{className:"".concat(v,"-slash")},"/"),Ae),e.a.createElement("li",{title:H?P.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:d()("".concat(v,"-next"),Object(W.a)({},"".concat(v,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(we)),se);if(Ae<=3+he*2){var De={locale:P,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:Q};Ae||Pe.push(e.a.createElement(o,Object(ee.a)({},De,{key:"noPager",page:Ae,className:"".concat(v,"-disabled")})));for(var ke=1;ke<=Ae;ke+=1){var Ne=_e===ke;Pe.push(e.a.createElement(o,Object(ee.a)({},De,{key:ke,page:ke,active:Ne})))}}else{var Ue=C?P.prev_3:P.prev_5,Le=C?P.next_3:P.next_5;pe&&(ye=e.a.createElement("li",{title:H?Ue:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:d()("".concat(v,"-jump-prev"),Object(W.a)({},"".concat(v,"-jump-prev-custom-icon"),!!le))},Q(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(le,"prev page"))),Ee=e.a.createElement("li",{title:H?Le:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:d()("".concat(v,"-jump-next"),Object(W.a)({},"".concat(v,"-jump-next-custom-icon"),!!de))},Q(this.getJumpNextPage(),"jump-next",this.getItemIcon(de,"next page")))),X=e.a.createElement(o,{locale:P,last:!0,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ae,page:Ae,active:!1,showTitle:H,itemRender:Q}),Ie=e.a.createElement(o,{locale:P,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:Q});var Fe=Math.max(1,_e-he),je=Math.min(_e+he,Ae);_e-1<=he&&(je=1+he*2),Ae-_e<=he&&(Fe=Ae-he*2);for(var ve=Fe;ve<=je;ve+=1){var be=_e===ve;Pe.push(e.a.createElement(o,{locale:P,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ve,page:ve,active:be,showTitle:H,itemRender:Q}))}_e-1>=he*2&&_e!==1+2&&(Pe[0]=Object(U.cloneElement)(Pe[0],{className:"".concat(v,"-item-after-jump-prev")}),Pe.unshift(ye)),Ae-_e>=he*2&&_e!==Ae-2&&(Pe[Pe.length-1]=Object(U.cloneElement)(Pe[Pe.length-1],{className:"".concat(v,"-item-before-jump-next")}),Pe.push(Ee)),Fe!==1&&Pe.unshift(Ie),je!==Ae&&Pe.push(X)}var ae=null;z&&(ae=e.a.createElement("li",{className:"".concat(v,"-total-text")},z(S,[S===0?0:(_e-1)*Oe+1,_e*Oe>S?S:_e*Oe])));var ie=!this.hasPrev()||!Ae,ne=!this.hasNext()||!Ae;return e.a.createElement("ul",Object(ee.a)({className:d()(v,g,Object(W.a)({},"".concat(v,"-disabled"),O)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},Me),ae,e.a.createElement("li",{title:H?P.prev_page:null,onClick:this.prev,tabIndex:ie?null:0,onKeyPress:this.runIfEnterPrev,className:d()("".concat(v,"-prev"),Object(W.a)({},"".concat(v,"-disabled"),ie)),"aria-disabled":ie},this.renderPrev(xe)),Pe,e.a.createElement("li",{title:H?P.next_page:null,onClick:this.next,tabIndex:ne?null:0,onKeyPress:this.runIfEnterNext,className:d()("".concat(v,"-next"),Object(W.a)({},"".concat(v,"-disabled"),ne)),"aria-disabled":ne},this.renderNext(we)),e.a.createElement(h,{disabled:O,locale:P,rootPrefixCls:v,selectComponentClass:ce,selectPrefixCls:me,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:_e,pageSize:Oe,pageSizeOptions:te,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ue}))}}],[{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 g=l.current,w=b(u.pageSize,l,u);g=g>w?w:g,"current"in u||(v.current=g,v.currentInputValue=g),v.pageSize=u.pageSize}return v}}]),y}(e.a.Component);m.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:r,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:r,locale:s.a,style:{},itemRender:i,totalBoundaryShowSizeChanger:50};var _=m},"6UM0":function(Ge,oe,K){var ee,W;(function(){var R;(function(){"use strict";var L=[function(e,A,d){var f=d(1).Beautifier,o=d(5).Options;function n(a,h){var s=new f(a,h);return s.beautify()}e.exports=n,e.exports.defaultOptions=function(){return new o}},function(e,A,d){var f=d(2).Output,o=d(3).Token,n=d(4),a=d(5).Options,h=d(7).Tokenizer,s=d(7).line_starters,r=d(7).positionable_operators,t=d(7).TOKEN;function i(C,H){return H.indexOf(C)!==-1}function b(C){return C.replace(/^\s+/g,"")}function m(C){for(var H={},z=0;z<C.length;z++)H[C[z].replace(/-/g,"_")]=C[z];return H}function _(C,H){return C&&C.type===t.RESERVED&&C.text===H}function x(C,H){return C&&C.type===t.RESERVED&&i(C.text,H)}var E=["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(C,H){if(H.multiline_frame||H.mode===l.ForInitializer||H.mode===l.Conditional)return;C.remove_indent(H.start_line_index)}function g(C){C=C.replace(n.allLineBreaks,`
|
|
`);for(var H=[],z=C.indexOf(`
|
|
`);z!==-1;)H.push(C.substring(0,z)),C=C.substring(z+1),z=C.indexOf(`
|
|
`);return C.length&&H.push(C),H}function w(C){return C===l.ArrayLiteral}function O(C){return i(C,[l.Expression,l.ForInitializer,l.Conditional])}function I(C,H){for(var z=0;z<C.length;z++){var Z=C[z].trim();if(Z.charAt(0)!==H)return!1}return!0}function S(C,H){for(var z=0,Z=C.length,Q;z<Z;z++)if(Q=C[z],Q&&Q.indexOf(H)!==0)return!1;return!0}function P(C,H){H=H||{},this._source_text=C||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new a(H)}P.prototype.create_flags=function(C,H){var z=0;C&&(z=C.indentation_level,!this._output.just_added_newline()&&C.line_indent_level>z&&(z=C.line_indent_level));var Z={mode:H,parent:C,last_token:C?C.last_token:new o(t.START_BLOCK,""),last_word:C?C.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:z,alignment:0,line_indent_level:C?C.line_indent_level:z,start_line_index:this._output.get_line_number(),ternary_depth:0};return Z},P.prototype._reset=function(C){var H=C.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(l.BlockStatement);var z=new h(C,this._options);return this._tokens=z.tokenize(),C},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C,H=this._reset(this._source_text),z=this._options.eol;this._options.eol==="auto"&&(z=`
|
|
`,H&&n.lineBreak.test(H||"")&&(z=H.match(n.lineBreak)[0]));for(var Z=this._tokens.next();Z;)this.handle_token(Z),this._last_last_text=this._flags.last_token.text,this._flags.last_token=Z,Z=this._tokens.next();return C=this._output.get_code(z),C},P.prototype.handle_token=function(C,H){C.type===t.START_EXPR?this.handle_start_expr(C):C.type===t.END_EXPR?this.handle_end_expr(C):C.type===t.START_BLOCK?this.handle_start_block(C):C.type===t.END_BLOCK?this.handle_end_block(C):C.type===t.WORD?this.handle_word(C):C.type===t.RESERVED?this.handle_word(C):C.type===t.SEMICOLON?this.handle_semicolon(C):C.type===t.STRING?this.handle_string(C):C.type===t.EQUALS?this.handle_equals(C):C.type===t.OPERATOR?this.handle_operator(C):C.type===t.COMMA?this.handle_comma(C):C.type===t.BLOCK_COMMENT?this.handle_block_comment(C,H):C.type===t.COMMENT?this.handle_comment(C,H):C.type===t.DOT?this.handle_dot(C):C.type===t.EOF?this.handle_eof(C):C.type===t.UNKNOWN?this.handle_unknown(C,H):this.handle_unknown(C,H)},P.prototype.handle_whitespace_and_comments=function(C,H){var z=C.newlines,Z=this._options.keep_array_indentation&&w(this._flags.mode);if(C.comments_before)for(var Q=C.comments_before.next();Q;)this.handle_whitespace_and_comments(Q,H),this.handle_token(Q,H),Q=C.comments_before.next();if(Z)for(var pe=0;pe<z;pe+=1)this.print_newline(pe>0,H);else if(this._options.max_preserve_newlines&&z>this._options.max_preserve_newlines&&(z=this._options.max_preserve_newlines),this._options.preserve_newlines&&z>1){this.print_newline(!1,H);for(var le=1;le<z;le+=1)this.print_newline(!0,H)}};var B=["async","break","continue","return","throw","yield"];P.prototype.allow_wrap_or_preserved_newline=function(C,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var z=this._options.preserve_newlines&&C.newlines||H,Z=i(this._flags.last_token.text,r)||i(C.text,r);if(Z){var Q=i(this._flags.last_token.text,r)&&i(this._options.operator_position,u)||i(C.text,r);z=z&&Q}if(z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(x(this._flags.last_token,B))return;this._output.set_wrap_point()}},P.prototype.print_newline=function(C,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var z=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&_(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(C)&&(this._flags.multiline_frame=!0)},P.prototype.print_token_line_indentation=function(C){this._output.just_added_newline()&&(this._options.keep_array_indentation&&C.newlines&&(C.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(C.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},P.prototype.print_token=function(C){if(this._output.raw){this._output.add_raw_token(C);return}if(this._options.comma_first&&C.previous&&C.previous.type===t.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(C),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(C),this._output.non_breaking_space=!0,this._output.add_token(C.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},P.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.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))},P.prototype.set_mode=function(C){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,C),this._flags=this.create_flags(this._previous_flags,C),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.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))},P.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||x(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(C){var H=!1;return H=H||x(this._flags.last_token,["var","let","const"])&&C.type===t.WORD,H=H||_(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===l.ObjectLiteral&&this._flags.mode===l.Statement)&&x(this._flags.last_token,B)&&!C.newlines,H=H||_(this._flags.last_token,"else")&&!(_(C,"if")&&!C.comments_before),H=H||this._flags.last_token.type===t.END_EXPR&&(this._previous_flags.mode===l.ForInitializer||this._previous_flags.mode===l.Conditional),H=H||this._flags.last_token.type===t.WORD&&this._flags.mode===l.BlockStatement&&!this._flags.in_case&&!(C.text==="--"||C.text==="++")&&this._last_last_text!=="function"&&C.type!==t.WORD&&C.type!==t.RESERVED,H=H||this._flags.mode===l.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||x(this._flags.last_token,["get","set"])),H?(this.set_mode(l.Statement),this.indent(),this.handle_whitespace_and_comments(C,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C,x(C,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C);var H=l.Expression;if(C.text==="["){if(this._flags.last_token.type===t.WORD||this._flags.last_token.text===")"){x(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(C),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=l.ArrayLiteral,w(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())),i(this._flags.last_token.type,[t.START_EXPR,t.END_EXPR,t.WORD,t.OPERATOR,t.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===t.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=l.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=l.Conditional):i(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&C.whitespace_before===""?this._output.space_before_token=!1:(i(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===t.EQUALS||this._flags.last_token.type===t.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C);else if(this._flags.last_token.type===t.WORD){this._output.space_before_token=!1;var z=this._tokens.peek(-3);if(this._options.space_after_named_function&&z){var Z=this._tokens.peek(-4);x(z,["async","function"])||z.text==="*"&&x(Z,["async","function"])?this._output.space_before_token=!0:this._flags.mode===l.ObjectLiteral?(z.text==="{"||z.text===","||z.text==="*"&&(Z.text==="{"||Z.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(C);(this._flags.last_token.type===t.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&i(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===t.START_BLOCK?this.print_newline():(this._flags.last_token.type===t.END_EXPR||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===t.COMMA)&&this.allow_wrap_or_preserved_newline(C,C.newlines),this.print_token(C),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(C){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(C,C.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===t.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(C),this.restore_mode(),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)},P.prototype.handle_start_block=function(C){this.handle_whitespace_and_comments(C);var H=this._tokens.peek(),z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===t.END_EXPR?(this.set_mode(l.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(l.BlockStatement):z&&(i(z.text,[":",","])&&i(H.type,[t.STRING,t.WORD,t.RESERVED])||i(H.text,["get","set","..."])&&i(z.type,[t.WORD,t.RESERVED]))?i(this._last_last_text,["class","interface"])&&!i(z.text,[":",","])?this.set_mode(l.BlockStatement):this.set_mode(l.ObjectLiteral):this._flags.last_token.type===t.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(l.BlockStatement):i(this._flags.last_token.type,[t.EQUALS,t.START_EXPR,t.COMMA,t.OPERATOR])||x(this._flags.last_token,["return","throw","import","default"])?this.set_mode(l.ObjectLiteral):this.set_mode(l.BlockStatement),this._flags.last_token&&(x(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var Z=!H.comments_before&&H.text==="}",Q=Z&&this._flags.last_word==="function"&&this._flags.last_token.type===t.END_EXPR;if(this._options.brace_preserve_inline){var pe=0,le=null;this._flags.inline_frame=!0;do if(pe+=1,le=this._tokens.peek(pe-1),le.newlines){this._flags.inline_frame=!1;break}while(le.type!==t.EOF&&!(le.type===t.END_BLOCK&&le.opened===C))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==t.OPERATOR&&(Q||this._flags.last_token.type===t.EQUALS||x(this._flags.last_token,E)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.COMMA)&&((this._flags.last_token.type===t.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(C),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==t.OPERATOR&&this._flags.last_token.type!==t.START_EXPR&&(this._flags.last_token.type===t.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(C),this.indent(),!Z&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(C){for(this.handle_whitespace_and_comments(C);this._flags.mode===l.Statement;)this.restore_mode();var H=this._flags.last_token.type===t.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(w(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(C)},P.prototype.handle_word=function(C){if(C.type===t.RESERVED){if(i(C.text,["set","get"])&&this._flags.mode!==l.ObjectLiteral)C.type=t.WORD;else if(C.text==="import"&&i(this._tokens.peek().text,["(","."]))C.type=t.WORD;else if(i(C.text,["as","from"])&&!this._flags.import_block)C.type=t.WORD;else if(this._flags.mode===l.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(C.type=t.WORD)}}if(this.start_of_statement(C)?x(this._flags.last_token,["var","let","const"])&&C.type===t.WORD&&(this._flags.declaration_statement=!0):C.newlines&&!O(this._flags.mode)&&(this._flags.last_token.type!==t.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==t.EQUALS&&(this._options.preserve_newlines||!x(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(C),this.print_newline()):this.handle_whitespace_and_comments(C),this._flags.do_block&&!this._flags.do_while)if(_(C,"while")){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&_(C,"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&&x(C,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(C),this._flags.in_case=!0;return}if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C)),_(C,"function")){(i(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(i(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===t.OPERATOR))&&(!this._output.just_added_blankline()&&!C.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD?x(this._flags.last_token,["get","set","new","export"])||x(this._flags.last_token,B)?this._output.space_before_token=!0:_(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===t.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(O(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(C),this._flags.last_word=C.text;return}var z="NONE";if(this._flags.last_token.type===t.END_BLOCK?this._previous_flags.inline_frame?z="SPACE":x(C,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines?z="NEWLINE":(z="SPACE",this._output.space_before_token=!0):z="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&this._flags.mode===l.BlockStatement?z="NEWLINE":this._flags.last_token.type===t.SEMICOLON&&O(this._flags.mode)?z="SPACE":this._flags.last_token.type===t.STRING?z="NEWLINE":this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===l.ObjectLiteral&&i(this._last_last_text,["{",","]))?z="SPACE":this._flags.last_token.type===t.START_BLOCK?this._flags.inline_frame?z="SPACE":z="NEWLINE":this._flags.last_token.type===t.END_EXPR&&(this._output.space_before_token=!0,z="NEWLINE"),x(C,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?z="SPACE":z="NEWLINE"),x(C,["else","catch","finally"]))if((!(this._flags.last_token.type===t.END_BLOCK&&this._previous_flags.mode===l.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&C.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var Z=this._output.current_line;Z.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else z==="NEWLINE"?x(this._flags.last_token,E)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&x(C,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==t.END_EXPR?(this._flags.last_token.type!==t.START_EXPR||!x(C,["var","let","const"]))&&this._flags.last_token.text!==":"&&(_(C,"if")&&_(C.previous,"else")?this._output.space_before_token=!0:this.print_newline()):x(C,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():z==="SPACE"&&(this._output.space_before_token=!0);C.previous&&(C.previous.type===t.WORD||C.previous.type===t.RESERVED)&&(this._output.space_before_token=!0),this.print_token(C),this._flags.last_word=C.text,C.type===t.RESERVED&&(C.text==="do"?this._flags.do_block=!0:C.text==="if"?this._flags.if_block=!0:C.text==="import"?this._flags.import_block=!0:this._flags.import_block&&_(C,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(C){this.start_of_statement(C)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(C);for(var H=this._tokens.peek();this._flags.mode===l.Statement&&!(this._flags.if_block&&_(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(C)},P.prototype.handle_string=function(C){C.text.startsWith("`")&&C.newlines===0&&C.whitespace_before===""&&(C.previous.text===")"||this._flags.last_token.type===t.WORD)||(this.start_of_statement(C)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(C),this._flags.last_token.type===t.RESERVED||this._flags.last_token.type===t.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR||this._flags.last_token.type===t.EQUALS||this._flags.last_token.type===t.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(C):C.text.startsWith("`")&&this._flags.last_token.type===t.END_EXPR&&(C.previous.text==="]"||C.previous.text===")")&&C.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(C)},P.prototype.handle_equals=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0},P.prototype.handle_comma=function(C){this.handle_whitespace_and_comments(C,!0),this.print_token(C),this._output.space_before_token=!0,this._flags.declaration_statement?(O(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(C)):this._flags.mode===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(C)},P.prototype.handle_operator=function(C){var H=C.text==="*"&&(x(this._flags.last_token,["function","yield"])||i(this._flags.last_token.type,[t.START_BLOCK,t.COMMA,t.END_BLOCK,t.SEMICOLON])),z=i(C.text,["-","+"])&&(i(this._flags.last_token.type,[t.START_BLOCK,t.START_EXPR,t.EQUALS,t.OPERATOR])||i(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(C)){var Z=!H;this.handle_whitespace_and_comments(C,Z)}if(C.text==="*"&&this._flags.last_token.type===t.DOT){this.print_token(C);return}if(C.text==="::"){this.print_token(C);return}if(this._flags.last_token.type===t.OPERATOR&&i(this._options.operator_position,u)&&this.allow_wrap_or_preserved_newline(C),C.text===":"&&this._flags.in_case){this.print_token(C),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==t.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 Q=!0,pe=!0,le=!1;if(C.text===":"?this._flags.ternary_depth===0?Q=!1:(this._flags.ternary_depth-=1,le=!0):C.text==="?"&&(this._flags.ternary_depth+=1),!z&&!H&&this._options.preserve_newlines&&i(C.text,r)){var de=C.text===":",ce=de&&le,me=de&&!le;switch(this._options.operator_position){case c.before_newline:this._output.space_before_token=!me,this.print_token(C),(!de||ce)&&this.allow_wrap_or_preserved_newline(C),this._output.space_before_token=!0;return;case c.after_newline:this._output.space_before_token=!0,!de||ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(C):this._output.space_before_token=!1,this.print_token(C),this._output.space_before_token=!0;return;case c.preserve_newline:me||this.allow_wrap_or_preserved_newline(C),Q=!(this._output.just_added_newline()||me),this._output.space_before_token=Q,this.print_token(C),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(C),Q=!1;var te=this._tokens.peek();pe=te&&i(te.type,[t.WORD,t.RESERVED])}else if(C.text==="...")this.allow_wrap_or_preserved_newline(C),Q=this._flags.last_token.type===t.START_BLOCK,pe=!1;else if(i(C.text,["--","++","!","~"])||z){if((this._flags.last_token.type===t.COMMA||this._flags.last_token.type===t.START_EXPR)&&this.allow_wrap_or_preserved_newline(C),Q=!1,pe=!1,C.newlines&&(C.text==="--"||C.text==="++"||C.text==="~")){var $=x(this._flags.last_token,E)&&C.newlines;$&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline($,!0)}this._flags.last_token.text===";"&&O(this._flags.mode)&&(Q=!0),this._flags.last_token.type===t.RESERVED?Q=!0:this._flags.last_token.type===t.END_EXPR?Q=!(this._flags.last_token.text==="]"&&(C.text==="--"||C.text==="++")):this._flags.last_token.type===t.OPERATOR&&(Q=i(C.text,["--","-","++","+"])&&i(this._flags.last_token.text,["--","-","++","+"]),i(C.text,["+","-"])&&i(this._flags.last_token.text,["--","++"])&&(pe=!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||Q,this.print_token(C),this._output.space_before_token=pe},P.prototype.handle_block_comment=function(C,H){if(this._output.raw){this._output.add_raw_token(C),C.directives&&C.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(C.directives){this.print_newline(!1,H),this.print_token(C),C.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!n.newline.test(C.text)&&!C.newlines){this._output.space_before_token=!0,this.print_token(C),this._output.space_before_token=!0;return}else this.print_block_commment(C,H)},P.prototype.print_block_commment=function(C,H){var z=g(C.text),Z,Q=!1,pe=!1,le=C.whitespace_before,de=le.length;if(this.print_newline(!1,H),this.print_token_line_indentation(C),this._output.add_token(z[0]),this.print_newline(!1,H),z.length>1){for(z=z.slice(1),Q=I(z,"*"),pe=S(z,le),Q&&(this._flags.alignment=1),Z=0;Z<z.length;Z++)Q?(this.print_token_line_indentation(C),this._output.add_token(b(z[Z]))):pe&&z[Z]?(this.print_token_line_indentation(C),this._output.add_token(z[Z].substring(de))):(this._output.current_line.set_indent(-1),this._output.add_token(z[Z])),this.print_newline(!1,H);this._flags.alignment=0}},P.prototype.handle_comment=function(C,H){C.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(C),this.print_newline(!1,H)},P.prototype.handle_dot=function(C){this.start_of_statement(C)||this.handle_whitespace_and_comments(C,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),x(this._flags.last_token,E)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(C,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(C)},P.prototype.handle_unknown=function(C,H){this.print_token(C),C.text[C.text.length-1]===`
|
|
`&&this.print_newline(!1,H)},P.prototype.handle_eof=function(C){for(;this._flags.mode===l.Statement;)this.restore_mode();this.handle_whitespace_and_comments(C)},e.exports.Beautifier=P},function(e){function A(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=[]}A.prototype.clone_empty=function(){var o=new A(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},A.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},A.prototype.has_match=function(o){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(o))return!0;return!1},A.prototype.set_indent=function(o,n){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.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)},A.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},A.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},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(o){this.__items.push(o);var n=o.lastIndexOf(`
|
|
`);n!==-1?this.__character_count=o.length-n:this.__character_count+=o.length},A.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.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 d(o,n){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)),n=n||"",o.indent_level>0&&(n=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}d.prototype.get_indent_size=function(o,n){var a=this.__base_string_length;return n=n||0,o<0&&(a=0),a+=o*this.__indent_size,a+=n,a},d.prototype.get_indent_string=function(o,n){var a=this.__base_string;return n=n||0,o<0&&(o=0,a=""),n+=o*this.__indent_size,this.__ensure_cache(n),a+=this.__cache[n],a},d.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var o=this.__cache.length,n=0,a="";this.__indent_size&&o>=this.__indent_size&&(n=Math.floor(o/this.__indent_size),o-=n*this.__indent_size,a=new Array(n+1).join(this.__indent_string)),o&&(a+=new Array(o+1).join(" ")),this.__cache.push(a)};function f(o,n){this.__indent_cache=new d(o,n),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 A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(o,n){return this.__indent_cache.get_indent_string(o,n)},f.prototype.get_indent_size=function(o,n){return this.__indent_cache.get_indent_size(o,n)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(o){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
|
|
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(a=a.replace(/[\n]/g,o)),a},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(o,n){return o=o||0,n=n||0,this.next_line.set_indent(o,n),this.__lines.length>1?(this.current_line.set_indent(o,n),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(o){for(var n=0;n<o.newlines;n++)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},f.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()},f.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(" "))},f.prototype.remove_indent=function(o){for(var n=this.__lines.length;o<n;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},f.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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(o,n){for(var a=this.__lines.length-2;a>=0;){var h=this.__lines[a];if(h.is_empty())break;if(h.item(0).indexOf(o)!==0&&h.item(-1)!==n){this.__lines.splice(a+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},e.exports.Output=f},function(e){function A(d,f,o,n){this.type=d,this.text=f,this.comments_before=null,this.newlines=o||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=A},function(e,A){var d="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\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",n="\\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",a="(?:\\\\u[0-9a-fA-F]{4}|["+d+o+"])",h="(?:\\\\u[0-9a-fA-F]{4}|["+f+o+n+"])*";A.identifier=new RegExp(a+h,"g"),A.identifierStart=new RegExp(a),A.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+o+n+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;A.newline=/[\n\r\u2028\u2029]/,A.lineBreak=new RegExp(`\r
|
|
|`+A.newline.source),A.allLineBreaks=new RegExp(A.lineBreak.source,"g")},function(e,A,d){var f=d(6).Options,o=["before-newline","after-newline","preserve-newline"];function n(a){f.call(this,a,"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 r=0;r<s.length;r++)s[r]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[r];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)}n.prototype=new f,e.exports.Options=n},function(e){function A(o,n){this.raw_options=d(o,n),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"])}A.prototype._get_array=function(o,n){var a=this.raw_options[o],h=n||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(h=a.concat()):typeof a=="string"&&(h=a.split(/[^a-zA-Z0-9_\/\-]+/)),h},A.prototype._get_boolean=function(o,n){var a=this.raw_options[o],h=a===void 0?!!n:!!a;return h},A.prototype._get_characters=function(o,n){var a=this.raw_options[o],h=n||"";return typeof a=="string"&&(h=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},A.prototype._get_number=function(o,n){var a=this.raw_options[o];n=parseInt(n,10),isNaN(n)&&(n=0);var h=parseInt(a,10);return isNaN(h)&&(h=n),h},A.prototype._get_selection=function(o,n,a){var h=this._get_selection_list(o,n,a);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+n+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h[0]},A.prototype._get_selection_list=function(o,n,a){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[n[0]],!this._is_valid_selection(a,n))throw new Error("Invalid Default Value!");var h=this._get_array(o,a);if(!this._is_valid_selection(h,n))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+n+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h},A.prototype._is_valid_selection=function(o,n){return o.length&&n.length&&!o.some(function(a){return n.indexOf(a)===-1})};function d(o,n){var a={};o=f(o);var h;for(h in o)h!==n&&(a[h]=o[h]);if(n&&o[n])for(h in o[n])a[h]=o[n][h];return a}function f(o){var n={},a;for(a in o){var h=a.replace(/-/g,"_");n[h]=o[a]}return n}e.exports.Options=A,e.exports.normalizeOpts=f,e.exports.mergeOpts=d},function(e,A,d){var f=d(8).InputScanner,o=d(9).Tokenizer,n=d(9).TOKEN,a=d(13).Directives,h=d(4),s=d(12).Pattern,r=d(14).TemplatablePattern;function t(I,S){return S.indexOf(I)!==-1}var i={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:n.START,RAW:n.RAW,EOF:n.EOF},b=new a(/\/\*/,/\*\//),m=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,_=/[0-9]/,x=/[^\d\.]/,E=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".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("|")+")$"),g,w=function(I,S){o.call(this,I,S),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var P=new s(this._input),B=new r(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(h.identifier).matching(h.identifierMatch),number:P.matching(m),punct:P.matching(c),comment:P.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:P.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:P.matching(/<!--/),html_comment_end:P.matching(/-->/),include:P.starting_with(/#include/).until_after(h.lineBreak),shebang:P.starting_with(/#!/).until_after(h.lineBreak),xml:P.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:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};w.prototype=new o,w.prototype._is_comment=function(I){return I.type===i.COMMENT||I.type===i.BLOCK_COMMENT||I.type===i.UNKNOWN},w.prototype._is_opening=function(I){return I.type===i.START_BLOCK||I.type===i.START_EXPR},w.prototype._is_closing=function(I,S){return(I.type===i.END_BLOCK||I.type===i.END_EXPR)&&S&&(I.text==="]"&&S.text==="["||I.text===")"&&S.text==="("||I.text==="}"&&S.text==="{")},w.prototype._reset=function(){g=!1},w.prototype._get_next_token=function(I,S){var P=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(i.EOF,""):(P=P||this._read_non_javascript(B),P=P||this._read_string(B),P=P||this._read_word(I),P=P||this._read_singles(B),P=P||this._read_comment(B),P=P||this._read_regexp(B,I),P=P||this._read_xml(B,I),P=P||this._read_punctuation(),P=P||this._create_token(i.UNKNOWN,this._input.next()),P)},w.prototype._read_word=function(I){var S;if(S=this.__patterns.identifier.read(),S!=="")return S=S.replace(h.allLineBreaks,`
|
|
`),!(I.type===i.DOT||I.type===i.RESERVED&&(I.text==="set"||I.text==="get"))&&v.test(S)?(S==="in"||S==="of")&&(I.type===i.WORD||I.type===i.STRING)?this._create_token(i.OPERATOR,S):this._create_token(i.RESERVED,S):this._create_token(i.WORD,S);if(S=this.__patterns.number.read(),S!=="")return this._create_token(i.WORD,S)},w.prototype._read_singles=function(I){var S=null;return I==="("||I==="["?S=this._create_token(i.START_EXPR,I):I===")"||I==="]"?S=this._create_token(i.END_EXPR,I):I==="{"?S=this._create_token(i.START_BLOCK,I):I==="}"?S=this._create_token(i.END_BLOCK,I):I===";"?S=this._create_token(i.SEMICOLON,I):I==="."&&x.test(this._input.peek(1))?S=this._create_token(i.DOT,I):I===","&&(S=this._create_token(i.COMMA,I)),S&&this._input.next(),S},w.prototype._read_punctuation=function(){var I=this.__patterns.punct.read();if(I!=="")return I==="="?this._create_token(i.EQUALS,I):I==="?."?this._create_token(i.DOT,I):this._create_token(i.OPERATOR,I)},w.prototype._read_non_javascript=function(I){var S="";if(I==="#"){if(this._is_first_token()&&(S=this.__patterns.shebang.read(),S))return this._create_token(i.UNKNOWN,S.trim()+`
|
|
`);if(S=this.__patterns.include.read(),S)return this._create_token(i.UNKNOWN,S.trim()+`
|
|
`);I=this._input.next();var P="#";if(this._input.hasNext()&&this._input.testChar(_)){do I=this._input.next(),P+=I;while(this._input.hasNext()&&I!=="#"&&I!=="=");return I==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(P+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(P+="{}",this._input.next(),this._input.next())),this._create_token(i.WORD,P)}this._input.back()}else if(I==="<"&&this._is_first_token()){if(S=this.__patterns.html_comment_start.read(),S){for(;this._input.hasNext()&&!this._input.testChar(h.newline);)S+=this._input.next();return g=!0,this._create_token(i.COMMENT,S)}}else if(g&&I==="-"&&(S=this.__patterns.html_comment_end.read(),S))return g=!1,this._create_token(i.COMMENT,S);return null},w.prototype._read_comment=function(I){var S=null;if(I==="/"){var P="";if(this._input.peek(1)==="*"){P=this.__patterns.block_comment.read();var B=b.get_directives(P);B&&B.ignore==="start"&&(P+=b.readIgnored(this._input)),P=P.replace(h.allLineBreaks,`
|
|
`),S=this._create_token(i.BLOCK_COMMENT,P),S.directives=B}else this._input.peek(1)==="/"&&(P=this.__patterns.comment.read(),S=this._create_token(i.COMMENT,P))}return S},w.prototype._read_string=function(I){if(I==="`"||I==="'"||I==='"'){var S=this._input.next();return this.has_char_escapes=!1,I==="`"?S+=this._read_string_recursive("`",!0,"${"):S+=this._read_string_recursive(I),this.has_char_escapes&&this._options.unescape_strings&&(S=O(S)),this._input.peek()===I&&(S+=this._input.next()),S=S.replace(h.allLineBreaks,`
|
|
`),this._create_token(i.STRING,S)}return null},w.prototype._allow_regexp_or_xml=function(I){return I.type===i.RESERVED&&t(I.text,["return","case","throw","else","do","typeof","yield"])||I.type===i.END_EXPR&&I.text===")"&&I.opened.previous.type===i.RESERVED&&t(I.opened.previous.text,["if","while","for"])||t(I.type,[i.COMMENT,i.START_EXPR,i.START_BLOCK,i.START,i.END_BLOCK,i.OPERATOR,i.EQUALS,i.EOF,i.SEMICOLON,i.COMMA])},w.prototype._read_regexp=function(I,S){if(I==="/"&&this._allow_regexp_or_xml(S)){for(var P=this._input.next(),B=!1,C=!1;this._input.hasNext()&&(B||C||this._input.peek()!==I)&&!this._input.testChar(h.newline);)P+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?C=!0:this._input.peek()==="]"&&(C=!1)),this._input.next();return this._input.peek()===I&&(P+=this._input.next(),P+=this._input.read(h.identifier)),this._create_token(i.STRING,P)}return null},w.prototype._read_xml=function(I,S){if(this._options.e4x&&I==="<"&&this._allow_regexp_or_xml(S)){var P="",B=this.__patterns.xml.read_match();if(B){for(var C=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=C.indexOf("{")===0,z=0;B;){var Z=!!B[1],Q=B[2],pe=!!B[B.length-1]||Q.slice(0,8)==="![CDATA[";if(!pe&&(Q===C||H&&Q.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(Z?--z:++z),P+=B[0],z<=0)break;B=this.__patterns.xml.read_match()}return B||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(h.allLineBreaks,`
|
|
`),this._create_token(i.STRING,P)}}return null};function O(I){for(var S="",P=0,B=new f(I),C=null;B.hasNext();)if(C=B.match(/([\s]|[^\\]|\\\\)+/g),C&&(S+=C[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")C=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")C=B.match(/u([0-9A-Fa-f]{4})/g);else{S+="\\",B.hasNext()&&(S+=B.next());continue}if(!C)return I;if(P=parseInt(C[1],16),P>126&&P<=255&&C[0].indexOf("x")===0)return I;if(P>=0&&P<32){S+="\\"+C[0];continue}else P===34||P===39||P===92?S+="\\"+String.fromCharCode(P):S+=String.fromCharCode(P)}return S}w.prototype._read_string_recursive=function(I,S,P){var B,C;I==="'"?C=this.__patterns.single_quote:I==='"'?C=this.__patterns.double_quote:I==="`"?C=this.__patterns.template_text:I==="}"&&(C=this.__patterns.template_expression);for(var H=C.read(),z="";this._input.hasNext();){if(z=this._input.next(),z===I||!S&&h.newline.test(z)){this._input.back();break}else z==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),z+=this._input.next()):P&&(P==="${"&&z==="$"&&this._input.peek()==="{"&&(z+=this._input.next()),P===z&&(I==="`"?z+=this._read_string_recursive("}",S,"`"):z+=this._read_string_recursive("`",S,"${"),this._input.hasNext()&&(z+=this._input.next())));z+=C.read(),H+=z}return H},e.exports.Tokenizer=w,e.exports.TOKEN=i,e.exports.positionable_operators=E.slice(),e.exports.line_starters=u.slice()},function(e){var A=RegExp.prototype.hasOwnProperty("sticky");function d(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}d.prototype.restart=function(){this.__position=0},d.prototype.back=function(){this.__position>0&&(this.__position-=1)},d.prototype.hasNext=function(){return this.__position<this.__input_length},d.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},d.prototype.peek=function(f){var o=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(o=this.__input.charAt(f)),o},d.prototype.__match=function(f,o){f.lastIndex=o;var n=f.exec(this.__input);return n&&!(A&&f.sticky)&&(n.index!==o&&(n=null)),n},d.prototype.test=function(f,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(f,o):!1},d.prototype.testChar=function(f,o){var n=this.peek(o);return f.lastIndex=0,n!==null&&f.test(n)},d.prototype.match=function(f){var o=this.__match(f,this.__position);return o?this.__position+=o[0].length:o=null,o},d.prototype.read=function(f,o,n){var a="",h;return f&&(h=this.match(f),h&&(a+=h[0])),o&&(h||!f)&&(a+=this.readUntil(o,n)),a},d.prototype.readUntil=function(f,o){var n="",a=this.__position;f.lastIndex=this.__position;var h=f.exec(this.__input);return h?(a=h.index,o&&(a+=h[0].length)):a=this.__input_length,n=this.__input.substring(this.__position,a),this.__position=a,n},d.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},d.prototype.get_regexp=function(f,o){var n=null,a="g";return o&&A&&(a="y"),typeof f=="string"&&f!==""?n=new RegExp(f,a):f&&(n=new RegExp(f.source,a)),n},d.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},d.prototype.peekUntilAfter=function(f){var o=this.__position,n=this.readUntilAfter(f);return this.__position=o,n},d.prototype.lookBack=function(f){var o=this.__position-1;return o>=f.length&&this.__input.substring(o-f.length,o).toLowerCase()===f},e.exports.InputScanner=d},function(e,A,d){var f=d(8).InputScanner,o=d(3).Token,n=d(10).TokenStream,a=d(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(r,t){this._input=new f(r),this._options=t||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new n,this._reset();for(var r,t=new o(h.START,""),i=null,b=[],m=new n;t.type!==h.EOF;){for(r=this._get_next_token(t,i);this._is_comment(r);)m.add(r),r=this._get_next_token(t,i);m.isEmpty()||(r.comments_before=m,m=new n),r.parent=i,this._is_opening(r)?(b.push(i),i=r):i&&this._is_closing(r,i)&&(r.opened=i,i.closed=r,i=b.pop(),r.parent=i),r.previous=t,t.next=r,this.__tokens.add(r),t=r}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(r,t){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(h.RAW,i):this._create_token(h.EOF,"")},s.prototype._is_comment=function(r){return!1},s.prototype._is_opening=function(r){return!1},s.prototype._is_closing=function(r,t){return!1},s.prototype._create_token=function(r,t){var i=new o(r,t,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return i},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=s,e.exports.TOKEN=h},function(e){function A(d){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=d}A.prototype.restart=function(){this.__position=0},A.prototype.isEmpty=function(){return this.__tokens_length===0},A.prototype.hasNext=function(){return this.__position<this.__tokens_length},A.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__tokens[this.__position],this.__position+=1),d},A.prototype.peek=function(d){var f=null;return d=d||0,d+=this.__position,d>=0&&d<this.__tokens_length&&(f=this.__tokens[d]),f},A.prototype.add=function(d){this.__parent_token&&(d.parent=this.__parent_token),this.__tokens.push(d),this.__tokens_length+=1},e.exports.TokenStream=A},function(e,A,d){var f=d(12).Pattern;function o(n,a){f.call(this,n,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new f,o.prototype.__set_whitespace_patterns=function(n,a){n+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+n+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var n=this._input.read(this._match_pattern);if(n===" ")this.whitespace_before_token=" ";else if(n){var a=this.__split(this._newline_regexp,n);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return n},o.prototype.matching=function(n,a){var h=this._create();return h.__set_whitespace_patterns(n,a),h._update(),h},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(n,a){n.lastIndex=0;for(var h=0,s=[],r=n.exec(a);r;)s.push(a.substring(h,r.index)),h=r.index+r[0].length,r=n.exec(a);return h<a.length?s.push(a.substring(h,a.length)):s.push(""),s},e.exports.WhitespacePattern=o},function(e){function A(d,f){this._input=d,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}A.prototype.read=function(){var d=this._input.read(this._starting_pattern);return(!this._starting_pattern||d)&&(d+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),d},A.prototype.read_match=function(){return this._input.match(this._match_pattern)},A.prototype.until_after=function(d){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(d),f._update(),f},A.prototype.until=function(d){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(d),f._update(),f},A.prototype.starting_with=function(d){var f=this._create();return f._starting_pattern=this._input.get_regexp(d,!0),f._update(),f},A.prototype.matching=function(d){var f=this._create();return f._match_pattern=this._input.get_regexp(d,!0),f._update(),f},A.prototype._create=function(){return new A(this._input,this)},A.prototype._update=function(){},e.exports.Pattern=A},function(e){function A(d,f){d=typeof d=="string"?d:d.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(d+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(d+/\sbeautify\signore:end\s/.source+f,"g")}A.prototype.get_directives=function(d){if(!d.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(d);o;)f[o[1]]=o[2],o=this.__directive_pattern.exec(d);return f},A.prototype.readIgnored=function(d){return d.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=A},function(e,A,d){var f=d(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function n(a,h){f.call(this,a,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 f(a);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}/)}}n.prototype=new f,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(a){var h=this._create();return h._disabled[a]=!0,h._update(),h},n.prototype.read_options=function(a){var h=this._create();for(var s in o)h._disabled[s]=a.templating.indexOf(s)===-1;return h._update(),h},n.prototype.exclude=function(a){var h=this._create();return h._excluded[a]=!0,h._update(),h},n.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),a+=h,h=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},n.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},n.prototype._read_template=function(){var a="",h=this._input.peek();if(h==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(a=a||this.__patterns.erb.read())}else h==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},e.exports.TemplatablePattern=n}],D={};function j(e){var A=D[e];if(A!==void 0)return A.exports;var d=D[e]={exports:{}};return L[e](d,d.exports,j),d.exports}var U=j(0);R=U})();var F=R;!(ee=[],W=function(){return{js_beautify:F}}.apply(oe,ee),W!==void 0&&(Ge.exports=W))})()},"746U":function(Ge,oe,K){"use strict";K.d(oe,"f",function(){return ee}),K.d(oe,"l",function(){return W}),K.d(oe,"k",function(){return R}),K.d(oe,"j",function(){return F}),K.d(oe,"g",function(){return L}),K.d(oe,"m",function(){return D}),K.d(oe,"h",function(){return j}),K.d(oe,"n",function(){return U}),K.d(oe,"c",function(){return e}),K.d(oe,"a",function(){return A}),K.d(oe,"i",function(){return d}),K.d(oe,"o",function(){return f}),K.d(oe,"e",function(){return a}),K.d(oe,"d",function(){return h}),K.d(oe,"p",function(){return s}),K.d(oe,"b",function(){return r});function ee(t){return Array.isArray(t)}function W(t){return typeof t=="string"}function R(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}function F(t){return typeof t=="number"&&!isNaN(t)}function L(t){return t===!0||t===!1}function D(t){return typeof t=="undefined"}function j(t){return!U(t)}function U(t){return D(t)||t===null}function e(t,i){if(!t)throw new Error(i?`Unexpected type, expected '${i}'`:"Unexpected type")}function A(t){if(U(t))throw new Error("Assertion Failed: argument is undefined or null");return t}function d(t){return typeof t=="function"}function f(t,i){const b=Math.min(t.length,i.length);for(let m=0;m<b;m++)o(t[m],i[m])}function o(t,i){if(W(i)){if(typeof t!==i)throw new Error(`argument does not match constraint: typeof ${i}`)}else if(d(i)){try{if(t instanceof i)return}catch(b){}if(!U(t)&&t.constructor===i)return;if(i.length===1&&i.call(void 0,t)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function n(t){let i=[],b=Object.getPrototypeOf(t);for(;Object.prototype!==b;)i=i.concat(Object.getOwnPropertyNames(b)),b=Object.getPrototypeOf(b);return i}function a(t){const i=[];for(const b of n(t))typeof t[b]=="function"&&i.push(b);return i}function h(t,i){const b=_=>function(){const x=Array.prototype.slice.call(arguments,0);return i(_,x)};let m={};for(const _ of t)m[_]=b(_);return m}function s(t){return t===null?void 0:t}function r(t,i="Unreachable"){throw new Error(i)}},"8HAY":function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return L}),K.d(oe,"b",function(){return D}),K.d(oe,"d",function(){return j}),K.d(oe,"e",function(){return U}),K.d(oe,"c",function(){return e});var ee=K("MI8n"),W=K("pmY6"),R=K("3/fG"),F=function(A,d,f,o){function n(a){return a instanceof f?a:new f(function(h){h(a)})}return new(f||(f=Promise))(function(a,h){function s(i){try{t(o.next(i))}catch(b){h(b)}}function r(i){try{t(o.throw(i))}catch(b){h(b)}}function t(i){i.done?a(i.value):n(i.value).then(s,r)}t((o=o.apply(A,d||[])).next())})};class L extends W.a{constructor(A,d="",f="",o=!0,n){super();this._onDidChange=this._register(new ee.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=A,this._label=d,this._cssClass=f,this._enabled=o,this._actionCallback=n}get id(){return this._id}get label(){return this._label}set label(A){this._setLabel(A)}_setLabel(A){this._label!==A&&(this._label=A,this._onDidChange.fire({label:A}))}get tooltip(){return this._tooltip||""}set tooltip(A){this._setTooltip(A)}_setTooltip(A){this._tooltip!==A&&(this._tooltip=A,this._onDidChange.fire({tooltip:A}))}get class(){return this._cssClass}set class(A){this._setClass(A)}_setClass(A){this._cssClass!==A&&(this._cssClass=A,this._onDidChange.fire({class:A}))}get enabled(){return this._enabled}set enabled(A){this._setEnabled(A)}_setEnabled(A){this._enabled!==A&&(this._enabled=A,this._onDidChange.fire({enabled:A}))}get checked(){return this._checked}set checked(A){this._setChecked(A)}_setChecked(A){this._checked!==A&&(this._checked=A,this._onDidChange.fire({checked:A}))}run(A,d){return F(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(A))})}}class D extends W.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ee.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ee.b),this.onDidRun=this._onDidRun.event}run(A,d){return F(this,void 0,void 0,function*(){if(!A.enabled)return;this._onBeforeRun.fire({action:A});let f;try{yield this.runAction(A,d)}catch(o){f=o}this._onDidRun.fire({action:A,error:f})})}runAction(A,d){return F(this,void 0,void 0,function*(){yield A.run(d)})}}class j extends L{constructor(A){super(j.ID,A,A?"separator text":"separator");this.checked=!1,this.enabled=!1}}j.ID="vs.actions.separator";class U{constructor(A,d,f,o){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=A,this.label=d,this.class=o,this._actions=f}get actions(){return this._actions}dispose(){}run(){return F(this,void 0,void 0,function*(){})}}class e extends L{constructor(){super(e.ID,R.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(Ge,oe,K){Ge.exports={button:"button___1wy9m"}},"9Bee":function(Ge,oe,K){"use strict";var ee=K("DYRE"),W=K("zeV3"),R=K("+L6B"),F=K("2/Rp"),L=K("k1fw"),D=K("9og8"),j=K("tJVT"),U=K("WmNS"),e=K.n(U),A=K("q1tI"),d=K.n(A),f=K("vg9a"),o=K("DlQD"),n=K.n(o),a=K("rUJ1");function h(N,p){var T=N.match(/^(\s+)(?:```)/);if(T===null)return p;var M=T[1];return p.split(`
|
|
`).map(function(G){var k=G.match(/^\s+/);if(k===null)return G;var re=Object(j.a)(k,1),Te=re[0];return Te.length>=M.length?G.slice(M.length):G}).join(`
|
|
`)}var s=[],r=["<ul>"],t=new n.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){s.length=0,r=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function _(N,p,T,M){if(p>=N.length||N[p].level<=T)return p;var G=N[p];M.push("<li><a href='#"+G.anchor+"'>"+G.text+"</a>"),p++;var k=[];return p=_(N,p,G.level,k),k.length>0&&(M.push("<ul>"),k.forEach(function(re){M.push(re)}),M.push("</ul>")),M.push("</li>"),p=_(N,p,T,M),p}function x(){return _(s,0,0,r),r.push("</ul>"),r.join("")}var E={heading:function(p){var T=i.exec(p);if(T)return{type:"heading",raw:T[0],depth:T[1].length,text:T[2]}},fences:function(p){var T=this.rules.block.fences.exec(p);if(T){var M=T[0],G=h(M,T[3]||""),k=T[2]?T[2].trim():T[2];if(["latex","katex","math"].indexOf(k)>=0){var re=u(),Te=G;G=re,l[re]={type:"block",expression:Te}}return{type:"code",raw:M,lang:k,text:G}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,u=function(){return"__special_katext_id_".concat(c++,"__")},l={};function v(){return l}function g(){c=0,l={}}function w(N){return N=N.replace(y,function(p,T){var M=u();return l[M]={type:"inline",expression:T},M}),N}var O=t.listitem;t.listitem=function(N){return O(w(N))};var I=t.paragraph;t.paragraph=function(N){return I(w(N))};var S=t.tablecell;t.tablecell=function(N,p){return S(w(N),p)},t.code=function(N,p,T){var M=(p||"").match(/\S*/)[0];return M?["latex","katex","math"].indexOf(M)>=0?"<p class='editormd-tex'>".concat(N,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(p,'">').concat(T?N:Object(a.escape)(N,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(T?N:Object(a.escape)(N,!0))+"</code></pre>"},t.heading=function(N,p,T){var M=this.options.headerPrefix+T.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:M,level:p,text:N}),"<h"+p+' id="'+M+'">'+N+"</h"+p+">"},n.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),n.a.use({tokenizer:E,renderer:t});var P=n.a,B=K("SJMd"),C=K("ulZh"),H=K.n(C),z=K("m3rI"),Z=K("Oy/b"),Q=K("p5ED"),pe=K("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var le=function(N,p){return(le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,M){T.__proto__=M}||function(T,M){for(var G in M)Object.prototype.hasOwnProperty.call(M,G)&&(T[G]=M[G])})(N,p)};function de(N,p){function T(){this.constructor=N}le(N,p),N.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}function ce(N,p,T,M){return new(T||(T=Promise))(function(G,k){function re(Ke){try{Be(M.next(Ke))}catch(Se){k(Se)}}function Te(Ke){try{Be(M.throw(Ke))}catch(Se){k(Se)}}function Be(Ke){var Se;Ke.done?G(Ke.value):(Se=Ke.value,Se instanceof T?Se:new T(function(Qe){Qe(Se)})).then(re,Te)}Be((M=M.apply(N,p||[])).next())})}function me(N,p){var T,M,G,k,re={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return k={next:Te(0),throw:Te(1),return:Te(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function Te(Be){return function(Ke){return function(Se){if(T)throw new TypeError("Generator is already executing.");for(;re;)try{if(T=1,M&&(G=2&Se[0]?M.return:Se[0]?M.throw||((G=M.return)&&G.call(M),0):M.next)&&!(G=G.call(M,Se[1])).done)return G;switch(M=0,G&&(Se=[2&Se[0],G.value]),Se[0]){case 0:case 1:G=Se;break;case 4:return re.label++,{value:Se[1],done:!1};case 5:re.label++,M=Se[1],Se=[0];continue;case 7:Se=re.ops.pop(),re.trys.pop();continue;default:if(!(G=re.trys,(G=G.length>0&&G[G.length-1])||Se[0]!==6&&Se[0]!==2)){re=0;continue}if(Se[0]===3&&(!G||Se[1]>G[0]&&Se[1]<G[3])){re.label=Se[1];break}if(Se[0]===6&&re.label<G[1]){re.label=G[1],G=Se;break}if(G&&re.label<G[2]){re.label=G[2],re.ops.push(Se);break}G[2]&&re.ops.pop(),re.trys.pop();continue}Se=p.call(N,re)}catch(Qe){Se=[6,Qe],M=0}finally{T=G=0}if(5&Se[0])throw Se[1];return{value:Se[0]?Se[1]:void 0,done:!0}}([Be,Ke])}}}function te(){for(var N=0,p=0,T=arguments.length;p<T;p++)N+=arguments[p].length;var M=Array(N),G=0;for(p=0;p<T;p++)for(var k=arguments[p],re=0,Te=k.length;re<Te;re++,G++)M[G]=k[re];return M}var $=function(){function N(){}return N.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},N.setAttributes=function(p,T){for(var M=0,G=T;M<G.length;M++){var k=G[M],re=k[0],Te=k[1];p.setAttribute(re,Te)}},N.createRect=function(p,T,M){var G=document.createElementNS("http://www.w3.org/2000/svg","rect");return G.setAttribute("width",p.toString()),G.setAttribute("height",T.toString()),M&&N.setAttributes(G,M),G},N.createLine=function(p,T,M,G,k){var re=document.createElementNS("http://www.w3.org/2000/svg","line");return re.setAttribute("x1",p.toString()),re.setAttribute("y1",T.toString()),re.setAttribute("x2",M.toString()),re.setAttribute("y2",G.toString()),k&&N.setAttributes(re,k),re},N.createPolygon=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","polygon");return M.setAttribute("points",p),T&&N.setAttributes(M,T),M},N.createCircle=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","circle");return M.setAttribute("cx",(p/2).toString()),M.setAttribute("cy",(p/2).toString()),M.setAttribute("r",p.toString()),T&&N.setAttributes(M,T),M},N.createEllipse=function(p,T,M){var G=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return G.setAttribute("cx",(p/2).toString()),G.setAttribute("cy",(T/2).toString()),G.setAttribute("rx",(p/2).toString()),G.setAttribute("ry",(T/2).toString()),M&&N.setAttributes(G,M),G},N.createGroup=function(p){var T=document.createElementNS("http://www.w3.org/2000/svg","g");return p&&N.setAttributes(T,p),T},N.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},N.createMarker=function(p,T,M,G,k,re,Te){var Be=document.createElementNS("http://www.w3.org/2000/svg","marker");return N.setAttributes(Be,[["id",p],["orient",T],["markerWidth",M.toString()],["markerHeight",G.toString()],["refX",k.toString()],["refY",re.toString()]]),Be.appendChild(Te),Be},N.createText=function(p){var T=document.createElementNS("http://www.w3.org/2000/svg","text");return T.setAttribute("x","0"),T.setAttribute("y","0"),p&&N.setAttributes(T,p),T},N.createTSpan=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","tspan");return M.textContent=p,T&&N.setAttributes(M,T),M},N.createImage=function(p){var T=document.createElementNS("http://www.w3.org/2000/svg","image");return p&&N.setAttributes(T,p),T},N.createPoint=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return M.x=p,M.y=T,M},N.createPath=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","path");return M.setAttribute("d",p),T&&N.setAttributes(M,T),M},N}(),_e=function(){function N(){}return N.addKey=function(p){N.key=p},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}(),Oe=function(){function N(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return N.prototype.rasterize=function(p,T,M){var G=this;return new Promise(function(k){var re=M!==void 0?M:document.createElement("canvas");p===null&&(G.markersOnly=!0,G.naturalSize=!1);var Te=document.createElementNS("http://www.w3.org/2000/svg","svg");Te.setAttribute("xmlns","http://www.w3.org/2000/svg"),Te.setAttribute("width",T.width.baseVal.valueAsString),Te.setAttribute("height",T.height.baseVal.valueAsString),Te.setAttribute("viewBox","0 0 "+T.viewBox.baseVal.width.toString()+" "+T.viewBox.baseVal.height.toString()),Te.innerHTML=T.innerHTML,G.naturalSize===!0?(Te.width.baseVal.value=p.naturalWidth,Te.height.baseVal.value=p.naturalHeight):G.width!==void 0&&G.height!==void 0&&(Te.width.baseVal.value=G.width,Te.height.baseVal.value=G.height),re.width=Te.width.baseVal.value,re.height=Te.height.baseVal.value;var Be=Te.outerHTML,Ke=re.getContext("2d");G.markersOnly!==!0&&Ke.drawImage(p,0,0,re.width,re.height);var Se=window.URL,Qe=new Image(re.width,re.height);Qe.setAttribute("crossOrigin","anonymous");var tt=new Blob([Be],{type:"image/svg+xml"}),st=Se.createObjectURL(tt);Qe.onload=function(){Ke.drawImage(Qe,0,0),Se.revokeObjectURL(st);var xt=re.toDataURL(G.imageType,G.imageQuality);k(xt)},Qe.src=st})},N}(),Ce=function(){},Ae=function(){function N(p){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+p+"_"}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(p){return this.styleSheet===void 0&&this.addStyleSheet(),p.name=""+this.classNamePrefix+p.localName,this.classes.push(p),this.styleSheet.sheet.insertRule("."+p.name+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length),p},N.prototype.addRule=function(p){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(p),this.styleSheet.sheet.insertRule(p.selector+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length)},N.prototype.addStyleSheet=function(){var p;this.styleSheet=document.createElement("style"),((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).appendChild(this.styleSheet),this.addRule(new Pe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Pe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Pe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ye("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ye("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},N.prototype.removeStyleSheet=function(){var p;this.styleSheet&&(((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},N}(),Pe=function(N,p){this.selector=N,this.style=p},ye=function(N,p){this.localName=N,this.style=p},Ee=function(){function N(p,T,M,G,k){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=p,this.displayMode=T,this.markerItems=M,this.uiStyleSettings=G,this.styles=k,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(p){var T=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=p,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var M=document.createElement("div");M.className=this.toolbarBlockStyleClass.name,M.style.whiteSpace="nowrap",this.uiContainer.appendChild(M),this.addActionButton(M,'<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(M,'<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(M,'<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(M,'<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(M,'<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(M,'<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(M,'<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(M,'<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(k){var re=document.createElement("div");re.className=""+T.toolbarButtonStyleClass.name,re.setAttribute("data-type-name",k.typeName),re.innerHTML=k.icon,re.addEventListener("click",function(){T.markerToolbarButtonClicked(re,k)}),T.buttons.push(re),T.markerButtons.push(re)}),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 G=document.createElement("div");G.className=this.toolbarBlockStyleClass.name,G.style.whiteSpace="nowrap",G.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(G),this.addActionButton(G,'<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(G,'<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(p){this.buttonClickListeners.push(p)},N.prototype.removeButtonClickListener=function(p){this.buttonClickListeners.indexOf(p)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(p),1)},N.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},N.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var p=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var T=0;T<this.markerButtons.length;T++)T<p||T===p&&this.markerButtons.length-1===p?this.markerButtonBlock.appendChild(this.markerButtons[T]):(T===p&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[T]))}},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 p=this;this.buttons.forEach(function(T){T.className=T.className.replace(p.uiStyleSettings.toolbarButtonStyleColorsClassName?p.uiStyleSettings.toolbarButtonStyleColorsClassName:p.toolbarButtonStyleColorsClass.name,"").trim(),T.className=T.className.replace(p.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?p.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:p.toolbarActiveButtonStyleColorsClass.name,"").trim(),T.className+=" "+(p.uiStyleSettings.toolbarButtonStyleColorsClassName?p.uiStyleSettings.toolbarButtonStyleColorsClassName:p.toolbarButtonStyleColorsClass.name)})},N.prototype.addActionButton=function(p,T,M){var G=this,k=document.createElement("div");switch(k.className=""+this.toolbarButtonStyleClass.name,k.innerHTML=T,k.setAttribute("data-action",M),k.addEventListener("click",function(){G.actionToolbarButtonClicked(k,M)}),M){case"select":k.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":k.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":k.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":k.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":k.style.fill=this.uiStyleSettings.closeButtonColor}p.appendChild(k),this.buttons.push(k)},N.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ye("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 ye("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ye("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ye("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 ye("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ye("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ye("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ye("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Pe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Pe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},N.prototype.markerToolbarButtonClicked=function(p,T){this.setActiveButton(p),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("marker",T)}),this.markerButtonOverflowBlock.style.display="none"},N.prototype.actionToolbarButtonClicked=function(p,T){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("action",T)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},N.prototype.setActiveButton=function(p){this.resetButtonStyles(),p.className=p.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),p.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},N.prototype.setActiveMarkerButton=function(p){var T=this.markerButtons.find(function(M){return M.getAttribute("data-type-name")===p});T&&this.setActiveButton(T)},N.prototype.setCurrentMarker=function(p){var T=this;this.currentMarker=p,this.buttons.filter(function(M){return/delete|notes/.test(M.getAttribute("data-action"))}).forEach(function(M){T.currentMarker===void 0?(M.style.fillOpacity="0.4",M.style.pointerEvents="none"):(M.style.fillOpacity="1",M.style.pointerEvents="all")})},N}(),Ie=function(){function N(p,T,M,G){this.panels=[],this.panelButtons=[],this.markerjsContainer=p,this.displayMode=T,this.uiStyleSettings=M,this.styles=G,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return N.prototype.addStyles=function(){var p;this.toolboxStyleClass=this.styles.addClass(new ye("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 ye("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ye("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ye("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ye("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 ye("toolbox-panel-row_colors",`
|
|
background-color: `+((p=this.uiStyleSettings.toolboxBackgroundColor)!==null&&p!==void 0?p:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ye("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ye("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ye("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Pe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Pe("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},N.prototype.show=function(p){var T;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=p,this.uiContainer.className=this.toolboxStyleClass.name+" "+((T=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&T!==void 0?T:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},N.prototype.setPanelButtons=function(p){var T,M,G=this;this.panels=p,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((T=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&T!==void 0?T:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(k){var re;k.uiStyleSettings=G.uiStyleSettings;var Te=document.createElement("div");Te.className=G.toolboxButtonStyleClass.name+" "+((re=G.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&re!==void 0?re:G.toolboxButtonStyleColorsClass.name),Te.innerHTML=k.icon,Te.title=k.title,Te.addEventListener("click",function(){G.panelButtonClick(k)}),G.panelButtons.push(Te),G.buttonRow.appendChild(Te)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},N.prototype.panelButtonClick=function(p){var T=this,M=-1;if(p!==this.activePanel){M=this.panels.indexOf(p),this.panelRow.innerHTML="";var G=p.getUi();G.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(G),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=p}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){T.displayMode==="inline"?T.panelRow.style.display="none":T.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(k,re){var Te,Be;k.className=T.toolboxButtonStyleClass.name+" "+(re===M?""+((Te=T.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Te!==void 0?Te:T.toolboxActiveButtonStyleColorsClass.name):""+((Be=T.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Be!==void 0?Be:T.toolboxButtonStyleColorsClass.name))})},N}(),X=function(N,p){this.title=N,this.icon=p},se=function(N){function p(T,M,G,k){var re=N.call(this,T,k||'<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 re.colors=[],re.addTransparent=!1,re.colorBoxes=[],re.colors=M,re.currentColor=G,re.setCurrentColor=re.setCurrentColor.bind(re),re.getColorBox=re.getColorBox.bind(re),re}return de(p,N),p.prototype.getUi=function(){var T=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.whiteSpace="nowrap",this.colors.forEach(function(G){var k=T.getColorBox(G);M.appendChild(k),T.colorBoxes.push(k)}),M},p.prototype.getColorBox=function(T){var M=this,G=this.uiStyleSettings.toolbarHeight/4,k=this.uiStyleSettings.toolbarHeight-G,re=document.createElement("div");re.style.display="inline-block",re.style.boxSizing="content-box",re.style.width=k-2+"px",re.style.height=k-2+"px",re.style.padding="1px",re.style.marginRight="2px",re.style.marginBottom="2px",re.style.borderWidth="2px",re.style.borderStyle="solid",re.style.borderRadius=(k+2)/2+"px",re.style.borderColor=T===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",re.addEventListener("click",function(){M.setCurrentColor(T,re)});var Te=document.createElement("div");return Te.style.display="inline-block",Te.style.width=k-2+"px",Te.style.height=k-2+"px",Te.style.backgroundColor=T,Te.style.borderRadius=k/2+"px",T==="transparent"&&(Te.style.fill=this.uiStyleSettings.toolboxAccentColor,Te.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>`),re.appendChild(Te),re},p.prototype.setCurrentColor=function(T,M){var G=this;this.currentColor=T,this.colorBoxes.forEach(function(k){k.style.borderColor=k===M?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(T)},p}(X),ue=function(){function N(p,T,M){this._state="new",this._isSelected=!1,this._container=p,this._overlayContainer=T,this.globalSettings=M,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(p){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(p,T){},N.prototype.dblClick=function(p,T){},N.prototype.manipulate=function(p){},N.prototype.pointerUp=function(p){this.stateChanged()},N.prototype.dispose=function(){},N.prototype.addMarkerVisualToContainer=function(p){this.container.childNodes.length>0?this.container.insertBefore(p,this.container.childNodes[0]):this.container.appendChild(p)},N.prototype.getState=function(){return{typeName:N.typeName,state:this.state,notes:this.notes}},N.prototype.restoreState=function(p){this._state=p.state,this.notes=p.notes},N.prototype.scale=function(p,T){},N.prototype.colorChanged=function(p){this.onColorChanged&&this.onColorChanged(p),this.stateChanged()},N.prototype.fillColorChanged=function(p){this.onFillColorChanged&&this.onFillColorChanged(p),this.stateChanged()},N.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var p=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),p.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(p)&&this.onStateChanged(this)}},N.typeName="MarkerBase",N}(),he=function(){function N(){this.findGripByVisual=this.findGripByVisual.bind(this)}return N.prototype.findGripByVisual=function(p){return this.topLeft.ownsTarget(p)?this.topLeft:this.topCenter.ownsTarget(p)?this.topCenter:this.topRight.ownsTarget(p)?this.topRight:this.centerLeft.ownsTarget(p)?this.centerLeft:this.centerRight.ownsTarget(p)?this.centerRight:this.bottomLeft.ownsTarget(p)?this.bottomLeft:this.bottomCenter.ownsTarget(p)?this.bottomCenter:this.bottomRight.ownsTarget(p)?this.bottomRight:void 0},N}(),xe=function(){function N(){this.GRIP_SIZE=10,this.visual=$.createGroup(),this.visual.appendChild($.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild($.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return N.prototype.ownsTarget=function(p){return p===this.visual||p===this.visual.childNodes[0]||p===this.visual.childNodes[1]},N}(),we=function(){function N(){}return N.toITransformMatrix=function(p){return{a:p.a,b:p.b,c:p.c,d:p.d,e:p.e,f:p.f}},N.toSVGMatrix=function(p,T){return p.a=T.a,p.b=T.b,p.c=T.c,p.d=T.d,p.e=T.e,p.f=T.f,p},N}(),Me=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.left=0,k.top=0,k.width=0,k.height=0,k.defaultSize={x:50,y:20},k.offsetX=0,k.offsetY=0,k.rotationAngle=0,k.CB_DISTANCE=10,k._suppressMarkerCreateEvent=!1,k.container.transform.baseVal.appendItem($.createTransform()),k.setupControlBox(),k}return de(p,N),Object.defineProperty(p.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"visual",{get:function(){return this._visual},set:function(T){this._visual=T;var M=$.createTransform();this._visual.transform.baseVal.appendItem(M)},enumerable:!1,configurable:!0}),p.prototype.ownsTarget=function(T){return!!N.prototype.ownsTarget.call(this,T)||!!(this.controlGrips.findGripByVisual(T)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(T))},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.state==="new"&&(this.left=T.x,this.top=T.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var G=this.unrotatePoint(T);if(this.manipulationStartX=G.x,this.manipulationStartY=G.y,this.offsetX=G.x-this.left,this.offsetY=G.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(M),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M)){this.activeGrip=this.rotatorGrip;var k=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=k.x-this.width/2,this.top=k.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var re=this.container.transform.baseVal.getItem(0);re.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(re,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},p.prototype.pointerUp=function(T){var M=this.state;N.prototype.pointerUp.call(this,T),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(T),this._state="select",M==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},p.prototype.moveVisual=function(T){this.visual.style.transform="translate("+T.x+"px, "+T.y+"px)"},p.prototype.manipulate=function(T){var M=this.unrotatePoint(T);this.state==="creating"?this.resize(T):this.state==="move"?(this.left=this.manipulationStartLeft+(M.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(M.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(M):this.state==="rotate"&&this.rotate(T)},p.prototype.resize=function(T){var M=this.manipulationStartLeft,G=this.manipulationStartWidth,k=this.manipulationStartTop,re=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:M=this.manipulationStartLeft+T.x-this.manipulationStartX,G=this.manipulationStartWidth+this.manipulationStartLeft-M;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:G=this.manipulationStartWidth+T.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:k=this.manipulationStartTop+T.y-this.manipulationStartY,re=this.manipulationStartHeight+this.manipulationStartTop-k;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:re=this.manipulationStartHeight+T.y-this.manipulationStartY}G>=0?(this.left=M,this.width=G):(this.left=M+G,this.width=-G),re>=0?(this.top=k,this.height=re):(this.top=k+re,this.height=-re),this.setSize()},p.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},p.prototype.rotate=function(T){if(Math.abs(T.x-this.centerX)>.1){var M=Math.sign(T.x-this.centerX);this.rotationAngle=180*Math.atan((T.y-this.centerY)/(T.x-this.centerX))/Math.PI+90*M,this.applyRotation()}},p.prototype.applyRotation=function(){var T=this.container.transform.baseVal.getItem(0);T.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(T,0)},p.prototype.rotatePoint=function(T){if(this.rotationAngle===0)return T;var M=this.container.getCTM(),G=$.createPoint(T.x,T.y);return{x:(G=G.matrixTransform(M)).x,y:G.y}},p.prototype.unrotatePoint=function(T){if(this.rotationAngle===0)return T;var M=this.container.getCTM();M=M.inverse();var G=$.createPoint(T.x,T.y);return{x:(G=G.matrixTransform(M)).x,y:G.y}},p.prototype.select=function(){N.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},p.prototype.deselect=function(){N.prototype.deselect.call(this),this.controlBox.style.display="none"},p.prototype.setupControlBox=function(){this.controlBox=$.createGroup();var T=$.createTransform();T.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(T),this.container.appendChild(this.controlBox),this.controlRect=$.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=$.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 he,this.addControlGrips(),this.controlBox.style.display="none"},p.prototype.adjustControlBox=function(){var T=this.controlBox.transform.baseVal.getItem(0);T.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(T,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()},p.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()},p.prototype.createGrip=function(){var T=new xe;return T.visual.transform.baseVal.appendItem($.createTransform()),this.controlBox.appendChild(T.visual),T},p.prototype.positionGrips=function(){var T=this.controlGrips.topLeft.GRIP_SIZE,M=-T/2,G=M,k=(this.width+this.CB_DISTANCE)/2-T/2,re=(this.height+this.CB_DISTANCE)/2-T/2,Te=this.height+this.CB_DISTANCE-T/2,Be=this.width+this.CB_DISTANCE-T/2;this.positionGrip(this.controlGrips.topLeft.visual,M,G),this.positionGrip(this.controlGrips.topCenter.visual,k,G),this.positionGrip(this.controlGrips.topRight.visual,Be,G),this.positionGrip(this.controlGrips.centerLeft.visual,M,re),this.positionGrip(this.controlGrips.centerRight.visual,Be,re),this.positionGrip(this.controlGrips.bottomLeft.visual,M,Te),this.positionGrip(this.controlGrips.bottomCenter.visual,k,Te),this.positionGrip(this.controlGrips.bottomRight.visual,Be,Te),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,k,G-3*this.CB_DISTANCE)},p.prototype.positionGrip=function(T,M,G){var k=T.transform.baseVal.getItem(0);k.setTranslate(M,G),T.transform.baseVal.replaceItem(k,0)},p.prototype.hideControlBox=function(){this.controlBox.style.display="none"},p.prototype.showControlBox=function(){this.controlBox.style.display=""},p.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:we.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:we.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},N.prototype.getState.call(this))},p.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var M=T;this.left=M.left,this.top=M.top,this.width=M.width,this.height=M.height,this.rotationAngle=M.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(we.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,M.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(we.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,M.containerTransformMatrix))},p.prototype.scale=function(T,M){N.prototype.scale.call(this,T,M);var G=this.rotatePoint({x:this.left,y:this.top}),k=this.unrotatePoint({x:G.x*T,y:G.y*M});this.left=k.x,this.top=k.y,this.width=this.width*T,this.height=this.height*M,this.adjustControlBox()},p}(ue),De=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.fillColor="transparent",k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.opacity=1,k.setStrokeColor=k.setStrokeColor.bind(k),k.setFillColor=k.setFillColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.createVisual=k.createVisual.bind(k),k}return de(p,N),p.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual)},p.prototype.createVisual=function(){this.visual=$.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)},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},p.prototype.manipulate=function(T){N.prototype.manipulate.call(this,T)},p.prototype.resize=function(T){N.prototype.resize.call(this,T),this.setSize()},p.prototype.setSize=function(){N.prototype.setSize.call(this),$.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},p.prototype.pointerUp=function(T){N.prototype.pointerUp.call(this,T),this.setSize()},p.prototype.setStrokeColor=function(T){this.strokeColor=T,this.visual&&$.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(T),this.stateChanged()},p.prototype.setFillColor=function(T){this.fillColor=T,this.visual&&$.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},p.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.visual&&$.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},p.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.visual&&$.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},p.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))},p.prototype.restoreState=function(T){var M=T;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),N.prototype.restoreState.call(this,T),this.setSize()},p.prototype.scale=function(T,M){N.prototype.scale.call(this,T,M),this.setSize()},p.title="Rectangle marker",p}(Me),ke=function(N){function p(T,M,G,k){var re=N.call(this,T,k||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return re.widths=[],re.widthBoxes=[],re.widths=M,re.currentWidth=G,re.setCurrentWidth=re.setCurrentWidth.bind(re),re}return de(p,N),p.prototype.getUi=function(){var T=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.widths.forEach(function(G){var k=document.createElement("div");k.style.display="flex",k.style.flexGrow="2",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.borderColor=G===T.currentWidth?T.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){T.setCurrentWidth(G,k)}),M.appendChild(k);var re=document.createElement("div");re.innerText=G.toString(),re.style.marginRight="5px",k.appendChild(re);var Te=document.createElement("div");Te.style.minHeight="20px",Te.style.flexGrow="2",Te.style.display="flex",Te.style.alignItems="center";var Be=document.createElement("hr");Be.style.minWidth="20px",Be.style.border="0px",Be.style.borderTop=G+"px solid "+T.uiStyleSettings.toolboxColor,Be.style.flexGrow="2",Te.appendChild(Be),k.appendChild(Te),T.widthBoxes.push(k)}),M},p.prototype.setCurrentWidth=function(T,M){var G=this;this.currentWidth=T,this.widthBoxes.forEach(function(k){k.style.borderColor=k===M?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},p}(X),Ne=function(N){function p(T,M,G,k){var re=N.call(this,T,k||'<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 re.styles=[],re.styleBoxes=[],re.styles=M,re.currentStyle=G,re.setCurrentStyle=re.setCurrentStyle.bind(re),re}return de(p,N),p.prototype.getUi=function(){var T=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.styles.forEach(function(G){var k=document.createElement("div");k.style.display="flex",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.overflow="hidden",k.style.maxWidth=100/T.styles.length-5+"%",k.style.borderColor=G===T.currentStyle?T.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){T.setCurrentStyle(G,k)}),M.appendChild(k);var re=document.createElement("div");re.style.minHeight="20px",re.style.flexGrow="2",re.style.overflow="hidden";var Te=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+T.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(G!==""?'stroke-dasharray="'+G+'"':"")+` />
|
|
</svg>`;re.innerHTML=Te,k.appendChild(re),T.styleBoxes.push(k)}),M},p.prototype.setCurrentStyle=function(T,M){var G=this;this.currentStyle=T,this.styleBoxes.forEach(function(k){k.style.borderColor=k===M?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},p}(X),Ue=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.strokeColor=G.defaultColor,k.strokeWidth=G.defaultStrokeWidth,k.strokeDasharray=G.defaultStrokeDasharray,k.strokePanel=new se("Line color",G.defaultColorSet,G.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new ke("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new Ne("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return de(p,N),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=p.typeName,T},p.typeName="FrameMarker",p.title="Frame marker",p.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',p}(De),Le=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},Fe=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.x1=0,k.y1=0,k.x2=0,k.y2=0,k.defaultLength=50,k.manipulationStartX=0,k.manipulationStartY=0,k.manipulationStartX1=0,k.manipulationStartY1=0,k.manipulationStartX2=0,k.manipulationStartY2=0,k.setupControlBox(),k}return de(p,N),p.prototype.ownsTarget=function(T){return!!N.prototype.ownsTarget.call(this,T)||!(!this.grip1.ownsTarget(T)&&!this.grip2.ownsTarget(T))},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.manipulationStartX=T.x,this.manipulationStartY=T.y,this.state==="new"&&(this.x1=T.x,this.y1=T.y,this.x2=T.x,this.y2=T.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(M)?this.activeGrip=this.grip1:this.grip2.ownsTarget(M)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},p.prototype.pointerUp=function(T){var M=this.state;N.prototype.pointerUp.call(this,T),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(T),this._state="select",M==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},p.prototype.adjustVisual=function(){},p.prototype.manipulate=function(T){this.state==="creating"?this.resize(T):this.state==="move"?(this.x1=this.manipulationStartX1+T.x-this.manipulationStartX,this.y1=this.manipulationStartY1+T.y-this.manipulationStartY,this.x2=this.manipulationStartX2+T.x-this.manipulationStartX,this.y2=this.manipulationStartY2+T.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(T)},p.prototype.resize=function(T){switch(this.activeGrip){case this.grip1:this.x1=T.x,this.y1=T.y;break;case this.grip2:case void 0:this.x2=T.x,this.y2=T.y}this.adjustVisual(),this.adjustControlBox()},p.prototype.select=function(){N.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},p.prototype.deselect=function(){N.prototype.deselect.call(this),this.controlBox.style.display="none"},p.prototype.setupControlBox=function(){this.controlBox=$.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},p.prototype.adjustControlBox=function(){this.positionGrips()},p.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},p.prototype.createGrip=function(){var T=new xe;return T.visual.transform.baseVal.appendItem($.createTransform()),this.controlBox.appendChild(T.visual),T},p.prototype.positionGrips=function(){var T=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-T/2,this.y1-T/2),this.positionGrip(this.grip2.visual,this.x2-T/2,this.y2-T/2)},p.prototype.positionGrip=function(T,M,G){var k=T.transform.baseVal.getItem(0);k.setTranslate(M,G),T.transform.baseVal.replaceItem(k,0)},p.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},N.prototype.getState.call(this))},p.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var M=T;this.x1=M.x1,this.y1=M.y1,this.x2=M.x2,this.y2=M.y2},p.prototype.scale=function(T,M){N.prototype.scale.call(this,T,M),this.x1=this.x1*T,this.y1=this.y1*M,this.x2=this.x2*T,this.y2=this.y2*M,this.adjustVisual(),this.adjustControlBox()},p}(ue),je=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.setStrokeColor=k.setStrokeColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.strokeColor=G.defaultColor,k.strokeWidth=G.defaultStrokeWidth,k.strokeDasharray=G.defaultStrokeDasharray,k.strokePanel=new se("Line color",G.defaultColorSet,G.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new ke("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new Ne("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return de(p,N),p.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.selectorLine&&T!==this.visibleLine)},p.prototype.createVisual=function(){this.visual=$.createGroup(),this.selectorLine=$.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=$.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)},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},p.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()),$.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),$.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),$.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},p.prototype.setStrokeColor=function(T){this.strokeColor=T,this.adjustVisual(),this.colorChanged(T)},p.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.adjustVisual()},p.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.adjustVisual(),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},N.prototype.getState.call(this));return T.typeName=p.typeName,T},p.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var M=T;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.createVisual(),this.adjustVisual()},p.typeName="LineMarker",p.title="Line marker",p.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',p}(Fe),ve=function(N){function p(T,M,G,k){var re=N.call(this,T,k||'<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 re.fonts=[],re.fontBoxes=[],re.fonts=M,re.currentFont=G,re.setCurrentFont=re.setCurrentFont.bind(re),re}return de(p,N),p.prototype.getUi=function(){var T=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.flexGrow="2",this.fonts.forEach(function(G){var k=document.createElement("div");k.style.display="inline-block",k.style.alignItems="center",k.style.justifyContent="space-between",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.overflow="hidden",k.style.maxWidth=100/T.fonts.length-5+"%",k.style.borderColor=G===T.currentFont?T.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){T.setCurrentFont(G,k)}),M.appendChild(k);var re=document.createElement("div");re.style.display="flex",re.style.minHeight="20px",re.style.flexGrow="2",re.style.fontFamily=G,re.style.overflow="hidden";var Te=document.createElement("div");Te.style.whiteSpace="nowrap",Te.style.overflow="hidden",Te.style.textOverflow="ellipsis",Te.innerHTML="The quick brown fox jumps over the lazy dog",re.appendChild(Te),k.appendChild(re),T.fontBoxes.push(k)}),M},p.prototype.setCurrentFont=function(T,M){var G=this;this.currentFont=T,this.fontBoxes.forEach(function(k){k.style.borderColor=k===M?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},p}(X),be=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.color="transparent",k.padding=5,k.DEFAULT_TEXT="your text here",k.text=k.DEFAULT_TEXT,k.isMoved=!1,k.color=G.defaultColor,k.fontFamily=G.defaultFontFamily,k.defaultSize={x:100,y:30},k.setColor=k.setColor.bind(k),k.setFont=k.setFont.bind(k),k.renderText=k.renderText.bind(k),k.sizeText=k.sizeText.bind(k),k.textEditDivClicked=k.textEditDivClicked.bind(k),k.showTextEditor=k.showTextEditor.bind(k),k.setSize=k.setSize.bind(k),k.positionTextEditor=k.positionTextEditor.bind(k),k.colorPanel=new se("Color",G.defaultColorSet,G.defaultColor),k.colorPanel.onColorChanged=k.setColor,k.fontFamilyPanel=new ve("Font",G.defaultFontFamilies,G.defaultFontFamily),k.fontFamilyPanel.onFontChanged=k.setFont,k}return de(p,N),p.prototype.ownsTarget=function(T){if(N.prototype.ownsTarget.call(this,T)||T===this.visual||T===this.textElement||T===this.bgRectangle)return!0;var M=!1;return this.textElement.childNodes.forEach(function(G){G===T&&(M=!0)}),M},p.prototype.createVisual=function(){this.visual=$.createGroup(),this.bgRectangle=$.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=$.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem($.createTransform()),this.textElement.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.isMoved=!1,this.pointerDownPoint=T,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},p.prototype.renderText=function(){var T=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(M){T.textElement.appendChild($.createTSpan(M.trim()===""?" ":M.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},p.prototype.getTextScale=function(){var T=this.textElement.getBBox(),M=1;if(T.width>0&&T.height>0){var G=(1*this.width-this.width*this.padding*2/100)/T.width,k=(1*this.height-this.height*this.padding*2/100)/T.height;M=Math.min(G,k)}return M},p.prototype.getTextPosition=function(T){var M=this.textElement.getBBox(),G=0,k=0;return M.width>0&&M.height>0&&(G=(this.width-M.width*T)/2,k=this.height/2-M.height*T/2),{x:G,y:k}},p.prototype.sizeText=function(){var T=this.textElement.getBBox(),M=this.getTextScale(),G=this.getTextPosition(M);G.y-=T.y*M,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+G.x+"px, "+G.y+"px) scale("+M+", "+M+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(G.x,G.y),this.textElement.transform.baseVal.getItem(1).setScale(M,M))},p.prototype.manipulate=function(T){N.prototype.manipulate.call(this,T),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(T.x-this.pointerDownPoint.x)>5||Math.abs(T.y-this.pointerDownPoint.y)>5)},p.prototype.resize=function(T){N.prototype.resize.call(this,T),this.isMoved=!0,this.setSize(),this.sizeText()},p.prototype.setSize=function(){N.prototype.setSize.call(this),this.visual&&this.bgRectangle&&($.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},p.prototype.pointerUp=function(T){var M=this.state;M==="creating"&&(this._suppressMarkerCreateEvent=!0),N.prototype.pointerUp.call(this,T),this.setSize(),(M==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},p.prototype.showTextEditor=function(){var T=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(M){M.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var M=Number.parseFloat(T.textEditor.style.fontSize);T.textEditor.clientWidth>=Number.parseInt(T.textEditor.style.maxWidth)&&M>.9;)M-=.1,T.textEditor.style.fontSize=Math.max(M,.9)+"em"}),this.textEditor.addEventListener("keyup",function(M){M.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(M){if(M.clipboardData){var G=M.clipboardData.getData("text"),k=window.getSelection();if(!k.rangeCount)return!1;k.deleteFromDocument(),k.getRangeAt(0).insertNode(document.createTextNode(G)),M.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){T.textEditDivClicked(T.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},p.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var T=this.getTextScale(),M=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),G=this.textElement.getBBox(),k={x:G.width*T,y:G.height*T};M.x-=k.x/2,M.y-=k.y/2,this.textEditor.style.top=M.y+"px",this.textEditor.style.left=M.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-M.x+"px",this.textEditor.style.fontSize=Math.max(16*T,12)+"px",this.textElement.style.display="none"}},p.prototype.textEditDivClicked=function(T){this.text=T.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},p.prototype.select=function(){N.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},p.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),N.prototype.deselect.call(this)},p.prototype.dblClick=function(T,M){N.prototype.dblClick.call(this,T,M),this.showTextEditor()},p.prototype.setColor=function(T){this.textElement&&$.setAttributes(this.textElement,[["fill",T]]),this.color=T,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(T)},p.prototype.setFont=function(T){this.textElement&&$.setAttributes(this.textElement,[["font-family",T]]),this.fontFamily=T,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},p.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},p.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},N.prototype.getState.call(this));return T.typeName=p.typeName,T},p.prototype.restoreState=function(T){var M=T;this.color=M.color,this.fontFamily=M.fontFamily,this.padding=M.padding,this.text=M.text,this.createVisual(),N.prototype.restoreState.call(this,T),this.setSize()},p.prototype.scale=function(T,M){N.prototype.scale.call(this,T,M),this.setSize(),this.sizeText(),this.positionTextEditor()},p.typeName="TextMarker",p.title="Text marker",p.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>',p}(Me),ae=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.color="transparent",k.lineWidth=3,k.drawing=!1,k.pixelRatio=1,k.color=G.defaultColor,k.lineWidth=G.defaultStrokeWidth,k.pixelRatio=G.freehandPixelRatio,k.setColor=k.setColor.bind(k),k.addCanvas=k.addCanvas.bind(k),k.finishCreation=k.finishCreation.bind(k),k.setLineWidth=k.setLineWidth.bind(k),k.colorPanel=new se("Color",G.defaultColorSet,G.defaultColor),k.colorPanel.onColorChanged=k.setColor,k.lineWidthPanel=new ke("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),k.lineWidthPanel.onWidthChanged=k.setLineWidth,k}return de(p,N),p.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.drawingImage)},p.prototype.createVisual=function(){this.visual=$.createGroup(),this.drawingImage=$.createImage(),this.visual.appendChild(this.drawingImage);var T=$.createTransform();this.visual.transform.baseVal.appendItem(T),this.addMarkerVisualToContainer(this.visual)},p.prototype.pointerDown=function(T,M){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(T.x,T.y),this.drawing=!0):N.prototype.pointerDown.call(this,T,M)},p.prototype.manipulate=function(T){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(T.x,T.y),this.canvasContext.stroke()):N.prototype.manipulate.call(this,T)},p.prototype.resize=function(T){N.prototype.resize.call(this,T),$.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},p.prototype.pointerUp=function(T){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):N.prototype.pointerUp.call(this,T)},p.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)},p.prototype.select=function(){this.state==="creating"&&this.finishCreation(),N.prototype.select.call(this)},p.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),N.prototype.deselect.call(this)},p.prototype.finishCreation=function(){for(var T=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),M=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],G=M[0],k=M[1],re=M[2],Te=M[3],Be=!1,Ke=0;Ke<this.canvasElement.height;Ke++)for(var Se=0;Se<this.canvasElement.width;Se++)T.data[Ke*this.canvasElement.width*4+4*Se+3]>0&&(Be=!0,Ke<k&&(k=Ke),Se<G&&(G=Se),Ke>Te&&(Te=Ke),Se>re&&(re=Se));if(Be){this.left=G/this.pixelRatio,this.top=k/this.pixelRatio,this.width=(re-G)/this.pixelRatio,this.height=(Te-k)/this.pixelRatio;var Qe=document.createElement("canvas");Qe.width=re-G,Qe.height=Te-k,Qe.getContext("2d").putImageData(this.canvasContext.getImageData(G,k,re-G,Te-k),0,0),this.drawingImgUrl=Qe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},p.prototype.setDrawingImage=function(){$.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},p.prototype.setColor=function(T){this.color=T,this.colorChanged(T)},p.prototype.setLineWidth=function(T){this.lineWidth=T},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=Object.assign({drawingImgUrl:this.drawingImgUrl},N.prototype.getState.call(this));return T.typeName=p.typeName,T},p.prototype.restoreState=function(T){this.createVisual(),N.prototype.restoreState.call(this,T),this.drawingImgUrl=T.drawingImgUrl,this.setDrawingImage()},p.prototype.scale=function(T,M){N.prototype.scale.call(this,T,M),this.setDrawingImage()},p.typeName="FreehandMarker",p.title="Freehand marker",p.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>',p}(Me),ie=function(N){function p(T,M,G){var k=N.call(this,T,G||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return k.typeBoxes=[],k.currentType=M,k.setCurrentType=k.setCurrentType.bind(k),k}return de(p,N),p.prototype.getUi=function(){var T=this,M=document.createElement("div");M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2";for(var G=function(Te){var Be="both";switch(Te){case 0:Be="both";break;case 1:Be="start";break;case 2:Be="end";break;case 3:Be="none"}var Ke=document.createElement("div");if(Ke.style.display="flex",Ke.style.flexGrow="2",Ke.style.alignItems="center",Ke.style.justifyContent="space-between",Ke.style.padding="5px",Ke.style.borderWidth="2px",Ke.style.borderStyle="solid",Ke.style.borderColor=Be===k.currentType?k.uiStyleSettings.toolboxAccentColor:"transparent",Ke.addEventListener("click",function(){T.setCurrentType(Be,Ke)}),M.appendChild(Ke),Be==="both"||Be==="start"){var Se=document.createElement("div");Se.style.display="flex",Se.style.alignItems="center",Se.style.minHeight="20px",Se.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="`+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Se.style.marginLeft="5px",Ke.appendChild(Se)}var Qe=document.createElement("div");Qe.style.display="flex",Qe.style.alignItems="center",Qe.style.minHeight="20px",Qe.style.flexGrow="2";var tt=document.createElement("hr");if(tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop="3px solid "+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee"),tt.style.flexGrow="2",Qe.appendChild(tt),Ke.appendChild(Qe),Be==="both"||Be==="end"){var st=document.createElement("div");st.style.display="flex",st.style.alignItems="center",st.style.minHeight="20px",st.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="`+(k.uiStyleSettings!==void 0?k.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,st.style.marginRight="5px",Ke.appendChild(st)}k.typeBoxes.push(Ke)},k=this,re=0;re<4;re++)G(re);return M},p.prototype.setCurrentType=function(T,M){var G=this;this.currentType=T,this.typeBoxes.forEach(function(k){k.style.borderColor=k===M?G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},p}(X),ne=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.arrowType="end",k.arrowBaseHeight=10,k.arrowBaseWidth=10,k.getArrowPoints=k.getArrowPoints.bind(k),k.setArrowType=k.setArrowType.bind(k),k.arrowTypePanel=new ie("Arrow type","end"),k.arrowTypePanel.onArrowTypeChanged=k.setArrowType,k}return de(p,N),p.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.arrow1&&T!==this.arrow2)},p.prototype.getArrowPoints=function(T,M){var G=this.arrowBaseWidth+2*this.strokeWidth,k=this.arrowBaseHeight+2*this.strokeWidth;return T-G/2+","+(M+k/2)+" "+T+","+(M-k/2)+" "+(T+G/2)+","+(M+k/2)},p.prototype.createTips=function(){this.arrow1=$.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=$.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.arrow2)},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.state==="creating"&&this.createTips()},p.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",$.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),$.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var T=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.arrow1.transform.baseVal.getItem(0);M.setRotate(T,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(M,0);var G=this.arrow2.transform.baseVal.getItem(0);G.setRotate(T+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(G,0)}},p.prototype.setArrowType=function(T){this.arrowType=T,this.adjustVisual(),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=Object.assign({arrowType:this.arrowType},N.prototype.getState.call(this));return T.typeName=p.typeName,T},p.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var M=T;this.arrowType=M.arrowType,this.createTips(),this.adjustVisual()},p.typeName="ArrowMarker",p.title="Arrow marker",p.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',p}(je),V=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.fillColor=G.defaultFillColor,k.strokeWidth=0,k.fillPanel=new se("Color",G.defaultColorSet,G.defaultFillColor),k.fillPanel.onColorChanged=k.setFillColor,k}return de(p,N),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=p.typeName,T},p.typeName="CoverMarker",p.title="Cover marker",p.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',p}(De),Y=function(N){function p(T,M,G,k){var re=N.call(this,T,k||'<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 re.opacities=[],re.opacityBoxes=[],re.opacities=M,re.currentOpacity=G,re.setCurrentOpacity=re.setCurrentOpacity.bind(re),re}return de(p,N),p.prototype.getUi=function(){var T=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",M.style.justifyContent="space-between",this.opacities.forEach(function(G){var k=document.createElement("div");k.style.display="flex",k.style.alignItems="center",k.style.justifyContent="center",k.style.padding="5px",k.style.borderWidth="2px",k.style.borderStyle="solid",k.style.borderColor=G===T.currentOpacity?T.uiStyleSettings.toolboxAccentColor:"transparent",k.addEventListener("click",function(){T.setCurrentOpacity(G,k)}),M.appendChild(k);var re=document.createElement("div");re.innerText=100*G+"%",k.appendChild(re),T.opacityBoxes.push(k)}),M},p.prototype.setCurrentOpacity=function(T,M){var G=this;this.currentOpacity=T,this.opacityBoxes.forEach(function(k){k.style.borderColor=k===M?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},p}(X),J=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.setOpacity=k.setOpacity.bind(k),k.fillColor=G.defaultHighlightColor,k.strokeWidth=0,k.opacity=G.defaultHighlightOpacity,k.fillPanel=new se("Color",G.defaultColorSet,k.fillColor),k.fillPanel.onColorChanged=k.setFillColor,k.opacityPanel=new Y("Opacity",G.defaultOpacitySteps,k.opacity),k.opacityPanel.onOpacityChanged=k.setOpacity,k}return de(p,N),p.prototype.setOpacity=function(T){this.opacity=T,this.visual&&$.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=p.typeName,T},p.typeName="HighlightMarker",p.title="Highlight marker",p.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>',p}(V),q='<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>',fe=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.bgColor="transparent",k.tipPosition={x:0,y:0},k.tipBase1Position={x:0,y:0},k.tipBase2Position={x:0,y:0},k.tipMoving=!1,k.color=G.defaultStrokeColor,k.bgColor=G.defaultFillColor,k.fontFamily=G.defaultFontFamily,k.defaultSize={x:100,y:30},k.setBgColor=k.setBgColor.bind(k),k.getTipPoints=k.getTipPoints.bind(k),k.positionTip=k.positionTip.bind(k),k.setTipPoints=k.setTipPoints.bind(k),k.colorPanel=new se("Text color",G.defaultColorSet,k.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>'),k.colorPanel.onColorChanged=k.setColor,k.bgColorPanel=new se("Fill color",G.defaultColorSet,k.bgColor,q),k.bgColorPanel.onColorChanged=k.setBgColor,k.fontFamilyPanel=new ve("Font",G.defaultFontFamilies,G.defaultFontFamily),k.fontFamilyPanel.onFontChanged=k.setFont,k.tipGrip=new xe,k.tipGrip.visual.transform.baseVal.appendItem($.createTransform()),k.controlBox.appendChild(k.tipGrip.visual),k}return de(p,N),p.prototype.ownsTarget=function(T){return N.prototype.ownsTarget.call(this,T)||this.tipGrip.ownsTarget(T)||this.tip===T},p.prototype.createTip=function(){$.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=$.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},p.prototype.pointerDown=function(T,M){this.state==="new"&&N.prototype.pointerDown.call(this,T,M),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(M)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):N.prototype.pointerDown.call(this,T,M)},p.prototype.pointerUp=function(T){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,N.prototype.pointerUp.call(this,T);else{var M=this.state==="creating";N.prototype.pointerUp.call(this,T),this.setTipPoints(M),this.positionTip()}},p.prototype.manipulate=function(T){if(this.tipMoving){var M=this.unrotatePoint(T);this.tipPosition={x:M.x-this.manipulationStartLeft,y:M.y-this.manipulationStartTop},this.positionTip()}else N.prototype.manipulate.call(this,T)},p.prototype.setBgColor=function(T){this.bgRectangle&&this.tip&&($.setAttributes(this.bgRectangle,[["fill",T]]),$.setAttributes(this.tip,[["fill",T]])),this.bgColor=T,this.fillColorChanged(T)},p.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},p.prototype.setTipPoints=function(T){T===void 0&&(T=!1);var M=Math.min(this.height/2,15),G=this.height/5;T&&(this.tipPosition={x:M+G/2,y:this.height+20});var k=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?k<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(G=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:M,y:0},this.tipBase2Position={x:M+G,y:0}):(this.tipBase1Position={x:0,y:M},this.tipBase2Position={x:0,y:M+G}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?k<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(G=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-M-G,y:0},this.tipBase2Position={x:this.width-M,y:0}):(this.tipBase1Position={x:this.width,y:M},this.tipBase2Position={x:this.width,y:M+G}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?k<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(G=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-M-G,y:this.height},this.tipBase2Position={x:this.width-M,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-M-G},this.tipBase2Position={x:this.width,y:this.height-M}):k<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(G=this.width/5,M=Math.min(this.width/2,15),this.tipBase1Position={x:M,y:this.height},this.tipBase2Position={x:M+G,y:this.height}):(this.tipBase1Position={x:0,y:this.height-M},this.tipBase2Position={x:0,y:this.height-M-G})},p.prototype.resize=function(T){N.prototype.resize.call(this,T),this.positionTip()},p.prototype.positionTip=function(){$.setAttributes(this.tip,[["points",this.getTipPoints()]]);var T=this.tipGrip.visual.transform.baseVal.getItem(0);T.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(T,0)},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),p.prototype.select=function(){this.positionTip(),N.prototype.select.call(this)},p.prototype.getState=function(){var T=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},N.prototype.getState.call(this));return T.typeName=p.typeName,T},p.prototype.restoreState=function(T){var M=T;this.bgColor=M.bgColor,this.tipPosition=M.tipPosition,N.prototype.restoreState.call(this,T),this.createTip(),this.setTipPoints()},p.prototype.scale=function(T,M){N.prototype.scale.call(this,T,M),this.tipPosition={x:this.tipPosition.x*T,y:this.tipPosition.y*M},this.positionTip()},p.typeName="CalloutMarker",p.title="Callout marker",p.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>',p}(be),ge=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.fillColor="transparent",k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.opacity=1,k.strokeColor=G.defaultColor,k.strokeWidth=G.defaultStrokeWidth,k.strokeDasharray=G.defaultStrokeDasharray,k.fillColor=G.defaultFillColor,k.setStrokeColor=k.setStrokeColor.bind(k),k.setFillColor=k.setFillColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.setOpacity=k.setOpacity.bind(k),k.createVisual=k.createVisual.bind(k),k.strokePanel=new se("Line color",te(G.defaultColorSet,["transparent"]),G.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.fillPanel=new se("Fill color",te(G.defaultColorSet,["transparent"]),k.fillColor,q),k.fillPanel.onColorChanged=k.setFillColor,k.strokeWidthPanel=new ke("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new Ne("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k.opacityPanel=new Y("Opacity",G.defaultOpacitySteps,k.opacity),k.opacityPanel.onOpacityChanged=k.setOpacity,k}return de(p,N),p.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual)},p.prototype.createVisual=function(){this.visual=$.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)},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},p.prototype.manipulate=function(T){N.prototype.manipulate.call(this,T)},p.prototype.resize=function(T){N.prototype.resize.call(this,T),this.setSize()},p.prototype.setSize=function(){N.prototype.setSize.call(this),$.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},p.prototype.pointerUp=function(T){N.prototype.pointerUp.call(this,T),this.setSize()},p.prototype.setStrokeColor=function(T){this.strokeColor=T,this.visual&&$.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(T),this.stateChanged()},p.prototype.setFillColor=function(T){this.fillColor=T,this.visual&&$.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(T),this.stateChanged()},p.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.visual&&$.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},p.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.visual&&$.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},p.prototype.setOpacity=function(T){this.opacity=T,this.visual&&$.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},N.prototype.getState.call(this));return T.typeName=p.typeName,T},p.prototype.restoreState=function(T){var M=T;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),N.prototype.restoreState.call(this,T),this.setSize()},p.prototype.scale=function(T,M){N.prototype.scale.call(this,T,M),this.setSize()},p.typeName="EllipseMarker",p.title="Ellipse marker",p.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>',p}(Me),Re=function(N){function p(T,M,G){return N.call(this,T,M,G)||this}return de(p,N),Object.defineProperty(p.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),p.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.tip1&&T!==this.tip2)},p.prototype.createTips=function(){this.tip1=$.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($.createTransform()),this.visual.appendChild(this.tip1),this.tip2=$.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($.createTransform()),this.visual.appendChild(this.tip2)},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.state==="creating"&&this.createTips()},p.prototype.adjustVisual=function(){if(N.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&($.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()]]),$.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 T=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.tip1.transform.baseVal.getItem(0);M.setRotate(T,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(M,0);var G=this.tip2.transform.baseVal.getItem(0);G.setRotate(T+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(G,0)}},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=p.typeName,T},p.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T),this.createTips(),this.adjustVisual()},p.typeName="MeasurementMarker",p.title="Measurement marker",p.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>',p}(je),We=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.strokePanel.colors=G.defaultColorSet,k.fillColor="transparent",k}return de(p,N),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=N.prototype.getState.call(this);return T.typeName=p.typeName,T},p.typeName="EllipseFrameMarker",p.title="Ellipse frame marker",p.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>',p}(ge),Xe=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(p){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(p)||(this.undoStack.push(p),JSON.stringify(this.lastRedoStep)!==JSON.stringify(p)&&this.redoStack.splice(0,this.redoStack.length))},N.prototype.replaceLastUndoStep=function(p){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=p)},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 p=this.undoStack.pop();return p!==void 0&&this.redoStack.push(p),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}(),He=function(N){function p(T,M,G){var k=N.call(this,T,M,G)||this;return k.strokeColor="transparent",k.strokeWidth=0,k.strokeDasharray="",k.curveX=0,k.curveY=0,k.manipulationStartCurveX=0,k.manipulationStartCurveY=0,k.setStrokeColor=k.setStrokeColor.bind(k),k.setStrokeWidth=k.setStrokeWidth.bind(k),k.setStrokeDasharray=k.setStrokeDasharray.bind(k),k.positionGrips=k.positionGrips.bind(k),k.addControlGrips=k.addControlGrips.bind(k),k.adjustVisual=k.adjustVisual.bind(k),k.setupControlBox=k.setupControlBox.bind(k),k.resize=k.resize.bind(k),k.strokeColor=G.defaultColor,k.strokeWidth=G.defaultStrokeWidth,k.strokeDasharray=G.defaultStrokeDasharray,k.strokePanel=new se("Line color",G.defaultColorSet,G.defaultColor),k.strokePanel.onColorChanged=k.setStrokeColor,k.strokeWidthPanel=new ke("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),k.strokeWidthPanel.onWidthChanged=k.setStrokeWidth,k.strokeStylePanel=new Ne("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),k.strokeStylePanel.onStyleChanged=k.setStrokeDasharray,k}return de(p,N),p.prototype.ownsTarget=function(T){return!(!N.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.selectorCurve&&T!==this.visibleCurve&&!this.curveGrip.ownsTarget(T))},p.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},p.prototype.createVisual=function(){this.visual=$.createGroup(),this.selectorCurve=$.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=$.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)},p.prototype.pointerDown=function(T,M){N.prototype.pointerDown.call(this,T,M),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=T.x,this.curveY=T.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(M)&&(this.activeGrip=this.curveGrip,this._state="resize")},p.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),$.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),$.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),$.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},p.prototype.setupControlBox=function(){N.prototype.setupControlBox.call(this),this.curveControlLine1=$.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=$.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)},p.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,N.prototype.addControlGrips.call(this)},p.prototype.positionGrips=function(){N.prototype.positionGrips.call(this);var T=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-T/2,this.curveY-T/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()))},p.prototype.manipulate=function(T){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+T.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+T.y-this.manipulationStartY),N.prototype.manipulate.call(this,T)},p.prototype.resize=function(T){this.activeGrip===this.curveGrip&&(this.curveX=T.x,this.curveY=T.y),N.prototype.resize.call(this,T),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},p.prototype.setStrokeColor=function(T){this.strokeColor=T,this.adjustVisual(),this.colorChanged(T)},p.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.adjustVisual()},p.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.adjustVisual()},p.prototype.scale=function(T,M){this.curveX=this.curveX*T,this.curveY=this.curveY*M,N.prototype.scale.call(this,T,M)},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var T=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},N.prototype.getState.call(this));return T.typeName=p.typeName,T},p.prototype.restoreState=function(T){N.prototype.restoreState.call(this,T);var M=T;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.curveX=M.curveX,this.curveY=M.curveY,this.createVisual(),this.adjustVisual()},p.typeName="CurveMarker",p.title="Curve marker",p.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>',p}(Fe),$e=function(){function N(p,T){T===void 0&&(T=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=p,this.cancelable=T}return Object.defineProperty(N.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),N.prototype.preventDefault=function(){this._defaultPrevented=!0},N}(),Ze=function(N){function p(T,M,G){var k=N.call(this,T,!1)||this;return k.dataUrl=M,k.state=G,k}return de(p,N),p}($e),ze=function(N){function p(T,M,G){G===void 0&&(G=!1);var k=N.call(this,T,G)||this;return k.marker=M,k}return de(p,N),p}($e),it=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(p,T){this[p].push(T)},N.prototype.removeEventListener=function(p,T){var M=this[p].indexOf(T);M>-1&&this[p].splice(M,1)},N}(),rt=function(){function N(p){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Le,this._isOpen=!1,this.undoRedoManager=new Xe,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 it,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=N.instanceCounter++,this.styles=new Ae(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=p,this.targetRoot=document.body,this.width=p.clientWidth,this.height=p.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[Ue,ae,ne,be,We,ge,J,fe,Re,V,je,He]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ue,ae,ne,be,ge,J,fe]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ue,ae,ne,be,J]},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(p){var T=this;this._availableMarkerTypes.splice(0),p.forEach(function(M){if(typeof M=="string"){var G=T.ALL_MARKER_TYPES.find(function(k){return k.typeName===M});G!==void 0&&T._availableMarkerTypes.push(G)}else T._availableMarkerTypes.push(M)})},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(p){this._zoomLevel=p,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(),_e.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},N.prototype.show=function(){var p=this;this.styles.styleSheetRoot===void 0&&Ce.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ce.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(T){return T(new $e(p))})},N.prototype.render=function(){return ce(this,void 0,void 0,function(){var p;return me(this,function(T){switch(T.label){case 0:return this.setCurrentMarker(),(p=new Oe).naturalSize=this.renderAtNaturalSize,p.imageType=this.renderImageType,p.imageQuality=this.renderImageQuality,p.markersOnly=this.renderMarkersOnly,p.width=this.renderWidth,p.height=this.renderHeight,[4,p.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return T.sent(),[4,p.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,T.sent()]}})})},N.prototype.close=function(p){var T=this;if(p===void 0&&(p=!1),this.isOpen){var M=!1;p||this.eventListeners.beforeclose.forEach(function(G){var k=new $e(T,!0);G(k),k.defaultPrevented&&(M=!0)}),M||(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(G){return G(new $e(T))}),this.detachEvents(),this._isOpen=!1)}},N.prototype.addMarkersToToolbar=function(){for(var p,T=[],M=0;M<arguments.length;M++)T[M]=arguments[M];(p=this._availableMarkerTypes).push.apply(p,T)},N.prototype.addRenderEventListener=function(p){this.addEventListener("render",function(T){p(T.dataUrl,T.state)})},N.prototype.removeRenderEventListener=function(p){},N.prototype.addCloseEventListener=function(p){this.addEventListener("close",function(){p()})},N.prototype.removeCloseEventListener=function(p){},N.prototype.setupResizeObserver=function(){var p=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){p.resize(p.target.clientWidth,p.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return p.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},N.prototype.onPopupTargetResize=function(){var p=1*this.target.clientWidth/this.target.clientHeight,T=this.editorCanvas.clientWidth/p>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*p:this.editorCanvas.clientWidth,M=T<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/p;this.resize(T,M)},N.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},N.prototype.resize=function(p,T){this._isResizing=!0;var M=p/this.imageWidth,G=T/this.imageHeight;this.imageWidth=Math.round(p),this.imageHeight=Math.round(T),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(M,G),this._isResizing=!1},N.prototype.scaleMarkers=function(p,T){var M,G=this;this._currentMarker&&this._currentMarker instanceof be?this._currentMarker.scale(p,T):(M=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(k){k!==G._currentMarker&&k.scale(p,T)}),M!==void 0&&this.setCurrentMarker(M)},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 p=this.editingTarget.getBoundingClientRect(),T=this.editorCanvas.getBoundingClientRect();this.left=p.left-T.left,this.top=p.top-T.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 p,T=[],M=0;M<arguments.length;M++)T[M]=arguments[M];this.defs=$.createDefs(),this.addDefsToImage(),(p=this.defs).append.apply(p,T)},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 p=document.createElement("a");p.href="https://markerjs.com/",p.target="_blank",p.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>',p.title="Powered by marker.js",p.style.display="grid",p.style.alignItems="center",p.style.justifyItems="center",p.style.padding="3px",p.style.width="20px",p.style.height="20px",this.logoUI.appendChild(p),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 p=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=p+"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 Ee(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ie(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},N.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},N.prototype.removeMarker=function(p){this.markerImage.removeChild(p.container),this.markers.indexOf(p)>-1&&this.markers.splice(this.markers.indexOf(p),1),p.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(p,T){if(p==="marker"&&T!==void 0)this.createNewMarker(T);else if(p==="action")switch(T){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 p=this;if(this._currentMarker!==void 0){var T=!1;if(this.eventListeners.markerbeforedelete.forEach(function(G){var k=new ze(p,p._currentMarker,!0);G(k),k.defaultPrevented&&(T=!0)}),!T){var M=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(G){return G(new ze(p,M))})}}},N.prototype.clear=function(){var p=this,T=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(re){var Te=new ze(p,void 0,!0);re(Te),Te.defaultPrevented&&(T=!0)}),!T)){this.setCurrentMarker();for(var M=function(re){var Te=G.markers[re];G.setCurrentMarker(G.markers[re]),G._currentMarker.dispose(),G.markerImage.removeChild(G._currentMarker.container),G.markers.splice(G.markers.indexOf(G._currentMarker),1),G.eventListeners.markerdelete.forEach(function(Be){return Be(new ze(p,Te))})},G=this,k=this.markers.length-1;k>=0;k--)M(k);this.addUndoStep()}},Object.defineProperty(N.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),N.prototype.showNotesEditor=function(){var p;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=(p=this._currentMarker.notes)!==null&&p!==void 0?p:"",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 p=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var T=this.getState(),M=this.undoRedoManager.getLastUndoStep();if(!M||M.width===T.width&&M.height===T.height){var G=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(T),G<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(k){return k(new $e(p))})}else this.undoRedoManager.replaceLastUndoStep(T),this.eventListeners.statechange.forEach(function(k){return k(new $e(p))})}},N.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},N.prototype.undoStep=function(){var p=this,T=this.undoRedoManager.undo();T!==void 0&&(this.restoreState(T),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(M){return M(new $e(p))}))},N.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},N.prototype.redoStep=function(){var p=this,T=this.undoRedoManager.redo();T!==void 0&&(this.restoreState(T),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(M){return M(new $e(p))}))},N.prototype.stepZoom=function(){var p=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=p<this.zoomSteps.length-1?this.zoomSteps[p+1]:this.zoomSteps[0]},N.prototype.panTo=function(p){this.contentDiv.scrollBy({left:this.prevPanPoint.x-p.x,top:this.prevPanPoint.y-p.y}),this.prevPanPoint=p},N.prototype.startRenderAndClose=function(){return ce(this,void 0,void 0,function(){var p,T,M=this;return me(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return p=G.sent(),T=this.getState(),this.eventListeners.render.forEach(function(k){return k(new Ze(M,p,T))}),this.close(!0),[2]}})})},N.prototype.getState=function(p){p===!0&&this.setCurrentMarker();var T={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(M){return T.markers.push(M.getState())}),T},N.prototype.restoreState=function(p){var T=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);p.markers.forEach(function(M){var G=T._availableMarkerTypes.find(function(re){return re.typeName===M.typeName});if(G!==void 0){var k=T.addNewMarker(G);k.restoreState(M),T.markers.push(k)}}),p.width&&p.height&&(p.width!==this.imageWidth||p.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/p.width,this.imageHeight/p.height),this.eventListeners.restorestate.forEach(function(M){return M(new $e(T))})},N.prototype.addNewMarker=function(p){var T=$.createGroup();return this.markerImage.appendChild(T),new p(T,this.overlayContainer,this.settings)},N.prototype.createNewMarker=function(p){var T,M=this;(T=typeof p=="string"?this._availableMarkerTypes.find(function(G){return G.typeName===p}):p)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(T),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(T.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(G){return G(new ze(M,M._currentMarker))}))},N.prototype.markerCreated=function(p){var T=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(p),this.setCurrentMarker(p),p instanceof ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(M){return M(new ze(T,T._currentMarker))})},N.prototype.colorChanged=function(p){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=p,this.settings.defaultStrokeColor=p)},N.prototype.fillColorChanged=function(p){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=p)},N.prototype.markerStateChanged=function(p){var T=this;this.eventListeners.markerchange.forEach(function(M){return M(new ze(T,p))})},N.prototype.setCurrentMarker=function(p){var T=this;this._currentMarker!==p&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(M){return M(new ze(T,T._currentMarker))})),this._currentMarker=p,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(M){return M(new ze(T,T._currentMarker))}))},N.prototype.onPointerDown=function(p){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||p.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var T=this.markers.find(function(M){return M.ownsTarget(p.target)});T!==void 0?(this.setCurrentMarker(T),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(p.clientX,p.clientY),p.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:p.clientX,y:p.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(p.clientX,p.clientY))},N.prototype.onDblClick=function(p){if(this._isFocused||this.focus(),this.mode==="select"){var T=this.markers.find(function(M){return M.ownsTarget(p.target)});T!==void 0&&T!==this._currentMarker&&this.setCurrentMarker(T),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(p.clientX,p.clientY),p.target):this.setCurrentMarker()}},N.prototype.onPointerMove=function(p){this.touchPoints!==1&&p.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||p.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(p.clientX,p.clientY)):this.zoomLevel>1&&this.panTo({x:p.clientX,y:p.clientY}))},N.prototype.onPointerUp=function(p){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(p.clientX,p.clientY)),this.isDragging=!1,this.addUndoStep()},N.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},N.prototype.onKeyUp=function(p){this._currentMarker===void 0||this.notesArea!==void 0||p.key!=="Delete"&&p.key!=="Backspace"||this.deleteSelectedMarker()},N.prototype.clientToLocalCoordinates=function(p,T){var M=this.markerImage.getBoundingClientRect();return{x:(p-M.left)/this.zoomLevel,y:(T-M.top)/this.zoomLevel}},N.prototype.onWindowResize=function(){this.positionUI()},N.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var p=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=p+"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(p){_e.addKey(p)},N.prototype.addEventListener=function(p,T){this.eventListeners.addEventListener(p,T)},N.prototype.removeEventListener=function(p,T){this.eventListeners.removeEventListener(p,T)},N.prototype.renderState=function(p){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(p),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(N.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),N.prototype.focus=function(){var p=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(T){return T(new $e(p))}))},N.prototype.blur=function(){var p=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(T){return T(new $e(p))}))},N.instanceCounter=0,N}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var dt=function(N,p){return(dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,M){T.__proto__=M}||function(T,M){for(var G in M)Object.prototype.hasOwnProperty.call(M,G)&&(T[G]=M[G])})(N,p)};function ut(N,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");function T(){this.constructor=N}dt(N,p),N.prototype=p===null?Object.create(p):(T.prototype=p.prototype,new T)}function qe(N,p,T,M){return new(T||(T=Promise))(function(G,k){function re(Ke){try{Be(M.next(Ke))}catch(Se){k(Se)}}function Te(Ke){try{Be(M.throw(Ke))}catch(Se){k(Se)}}function Be(Ke){var Se;Ke.done?G(Ke.value):(Se=Ke.value,Se instanceof T?Se:new T(function(Qe){Qe(Se)})).then(re,Te)}Be((M=M.apply(N,p||[])).next())})}function vt(N,p){var T,M,G,k,re={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return k={next:Te(0),throw:Te(1),return:Te(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function Te(Be){return function(Ke){return function(Se){if(T)throw new TypeError("Generator is already executing.");for(;re;)try{if(T=1,M&&(G=2&Se[0]?M.return:Se[0]?M.throw||((G=M.return)&&G.call(M),0):M.next)&&!(G=G.call(M,Se[1])).done)return G;switch(M=0,G&&(Se=[2&Se[0],G.value]),Se[0]){case 0:case 1:G=Se;break;case 4:return re.label++,{value:Se[1],done:!1};case 5:re.label++,M=Se[1],Se=[0];continue;case 7:Se=re.ops.pop(),re.trys.pop();continue;default:if(!(G=re.trys,(G=G.length>0&&G[G.length-1])||Se[0]!==6&&Se[0]!==2)){re=0;continue}if(Se[0]===3&&(!G||Se[1]>G[0]&&Se[1]<G[3])){re.label=Se[1];break}if(Se[0]===6&&re.label<G[1]){re.label=G[1],G=Se;break}if(G&&re.label<G[2]){re.label=G[2],re.ops.push(Se);break}G[2]&&re.ops.pop(),re.trys.pop();continue}Se=p.call(N,re)}catch(Qe){Se=[6,Qe],M=0}finally{T=G=0}if(5&Se[0])throw Se[1];return{value:Se[0]?Se[1]:void 0,done:!0}}([Be,Ke])}}}var At=function(){function N(){}return N.addKey=function(p){N.key=p},Object.defineProperty(N,"isLicensed",{get:function(){return!!N.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(N.key)},enumerable:!1,configurable:!0}),N}(),Ve=function(){function N(){}return N.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},N.setAttributes=function(p,T){for(var M=0,G=T;M<G.length;M++){var k=G[M],re=k[0],Te=k[1];p.setAttribute(re,Te)}},N.createRect=function(p,T,M){var G=document.createElementNS("http://www.w3.org/2000/svg","rect");return G.setAttribute("width",p.toString()),G.setAttribute("height",T.toString()),M&&N.setAttributes(G,M),G},N.createLine=function(p,T,M,G,k){var re=document.createElementNS("http://www.w3.org/2000/svg","line");return re.setAttribute("x1",p.toString()),re.setAttribute("y1",T.toString()),re.setAttribute("x2",M.toString()),re.setAttribute("y2",G.toString()),k&&N.setAttributes(re,k),re},N.createPolygon=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","polygon");return M.setAttribute("points",p),T&&N.setAttributes(M,T),M},N.createCircle=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","circle");return M.setAttribute("cx",(p/2).toString()),M.setAttribute("cy",(p/2).toString()),M.setAttribute("r",p.toString()),T&&N.setAttributes(M,T),M},N.createEllipse=function(p,T,M){var G=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return G.setAttribute("cx",(p/2).toString()),G.setAttribute("cy",(T/2).toString()),G.setAttribute("rx",(p/2).toString()),G.setAttribute("ry",(T/2).toString()),M&&N.setAttributes(G,M),G},N.createGroup=function(p){var T=document.createElementNS("http://www.w3.org/2000/svg","g");return p&&N.setAttributes(T,p),T},N.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},N.createMarker=function(p,T,M,G,k,re,Te){var Be=document.createElementNS("http://www.w3.org/2000/svg","marker");return N.setAttributes(Be,[["id",p],["orient",T],["markerWidth",M.toString()],["markerHeight",G.toString()],["refX",k.toString()],["refY",re.toString()]]),Be.appendChild(Te),Be},N.createText=function(p){var T=document.createElementNS("http://www.w3.org/2000/svg","text");return T.setAttribute("x","0"),T.setAttribute("y","0"),p&&N.setAttributes(T,p),T},N.createTSpan=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","tspan");return M.textContent=p,T&&N.setAttributes(M,T),M},N.createImage=function(p){var T=document.createElementNS("http://www.w3.org/2000/svg","image");return p&&N.setAttributes(T,p),T},N.createPoint=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return M.x=p,M.y=T,M},N.createPath=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg","path");return M.setAttribute("d",p),T&&N.setAttributes(M,T),M},N.createElement=function(p,T){var M=document.createElementNS("http://www.w3.org/2000/svg",p);return T&&N.setAttributes(M,T),M},N.getHollowRectanglePath=function(p,T,M,G,k,re,Te,Be){return"M"+p+","+T+"V"+(T+G)+"H"+(p+M)+"V"+T+"H"+k+"V"+re+"H"+(k+Te)+"V"+(re+Be)+"H"+k+"V"+T+"Z"},N}(),Rt=function(){function N(p){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+p+"_"}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:"#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(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(p){return this.styleSheet===void 0&&this.addStyleSheet(),p.name=""+this.classNamePrefix+p.localName,this.classes.push(p),this.styleSheet.sheet.insertRule("."+p.name+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length),p},N.prototype.addRule=function(p){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(p),this.styleSheet.sheet.insertRule(p.selector+" {"+p.style+"}",this.styleSheet.sheet.cssRules.length)},N.prototype.addStyleSheet=function(){var p;this.styleSheet=document.createElement("style"),((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).appendChild(this.styleSheet),this.addRule(new Je("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Je("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Je("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ye("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ye("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},N.prototype.removeStyleSheet=function(){var p;this.styleSheet&&(((p=this.styleSheetRoot)!==null&&p!==void 0?p:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},N}(),Je=function(N,p){this.selector=N,this.style=p},Ye=function(N,p){this.localName=N,this.style=p},at=function(){function N(){this.blocks=[],this.display=""}return N.prototype.addButtonBlock=function(p){p.className=this.blockClassName,p.buttonClassName=this.buttonClassName,p.buttonColorsClassName=this.buttonColorsClassName,p.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(p)},N.prototype.addElementBlock=function(p){p.className===void 0&&(p.className=this.blockClassName),this.blocks.push(p)},N.prototype.getUI=function(){var p=document.createElement("div");return p.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,p.style.display=this.display,this.blocks.forEach(function(T){return p.appendChild(T.getUI())}),p},N}(),ht=function(){function N(){}return N.prototype.getUI=function(){var p=document.createElement("div");if(p.className=this.className,this.minWidth!==void 0&&(p.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":p.style.justifyContent="flex-start";break;case"center":p.style.justifyContent="center";break;case"end":p.style.justifyContent="flex-end"}return p.style.whiteSpace="nowrap",p},N}(),mt=function(N){function p(){var T=N!==null&&N.apply(this,arguments)||this;return T.buttons=[],T}return ut(p,N),p.prototype.addButton=function(T){T.className=this.buttonClassName,T.colorsClassName=this.buttonColorsClassName,T.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(T)},p.prototype.getUI=function(){var T=N.prototype.getUI.call(this);return this.buttons.forEach(function(M){return T.appendChild(M.getUI())}),T},p}(ht),ct=function(){function N(p,T){this._isActive=!1,this._isHidden=!1,this._icon=p,this.title=T,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(N.prototype,"icon",{get:function(){return this._icon},set:function(p){this._icon=p,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isActive",{get:function(){return this._isActive},set:function(p){this._isActive=p,this.adjustClassName()},enumerable:!1,configurable:!0}),N.prototype.getUI=function(){var p=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 p.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},N.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,"")))},N.prototype.hide=function(){this._isHidden=!0},N}(),Dt=function(N){function p(){var T=N!==null&&N.apply(this,arguments)||this;return T.elements=[],T}return ut(p,N),p.prototype.addElement=function(T){this.elements.push(T)},p.prototype.getUI=function(){var T=N.prototype.getUI.call(this);return this.elements.forEach(function(M){return T.appendChild(M)}),T},p}(ht),Pt=function(){function N(p,T){this.horizontal=p,this.vertical=T}return Object.defineProperty(N.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),N.prototype.getVerticalLength=function(p){return p/this.ratio},N.prototype.getHorizontalLength=function(p){return p*this.ratio},N}(),ot=function(){function N(){}return N.getIcon=function(p,T){if(p>0&&T>0){var M=new Pt(p,T),G=M.ratio>=1?20:M.getHorizontalLength(20),k=M.ratio<1?20:M.getVerticalLength(20),re=document.createElementNS("http://www.w3.org/2000/svg","svg");re.setAttribute("xmlns","http://www.w3.org/2000/svg"),re.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(re);var Te=Ve.createDefs();re.appendChild(Te);var Be=Ve.createElement("clipPath",[["id","text-bg-clip"]]);Te.appendChild(Be);var Ke=Ve.createPath(Ve.getHollowRectanglePath((24-G)/2,(24-k)/2,G,k,(24-G)/2+2,(24-k)/2+2,G-4,k-4));re.appendChild(Ke);var Se=Ve.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Se.appendChild(Ve.createTSpan(p+":"+T)),re.appendChild(Se);var Qe=Se.getBBox();Ve.setAttributes(Se,[["x",((24-Qe.width)/2).toString()],["y",((24-Qe.height)/2-Qe.y).toString()]]);var tt=Ve.createPath(Ve.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Qe.width))/2,(24-Math.ceil(Qe.height))/2,Math.ceil(Qe.width),Math.ceil(Qe.height)));return Be.appendChild(tt),Ve.setAttributes(Ke,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(re),re.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>'},N}(),bt=function(N){function p(T,M,G){var k=N.call(this,T,M)||this;return k.isDropdownOpen=!1,k.onClick=k.dropdownButtonClicked,k.dropdownButtons=G,k}return ut(p,N),p.prototype.setupDropdown=function(){var T=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(M){M.className=T.className,M.colorsClassName=T.colorsClassName,T.dropdownBlock.appendChild(M.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},p.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},p.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},p.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},p.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},p.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},p}(ct),Et=function(){function N(p,T){this.GRIP_SIZE=10,this.color=p,this.fillColor=T,this.visual=Ve.createGroup(),this.visual.appendChild(Ve.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ve.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return N.prototype.ownsTarget=function(p){return p===this.visual||p===this.visual.childNodes[0]||p===this.visual.childNodes[1]},N.prototype.setCenter=function(p,T){this.visual.childNodes.forEach(function(M){return Ve.setAttributes(M,[["cx",p.toString()],["cy",T.toString()]])})},N}(),Tt=function(){function N(p,T,M,G){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=p,this.canvasHeight=T,this.margin=M,this.container=G,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(N.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(p){this._aspectRatio=p,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(p){this._isGridVisible=p,this.gridContainer&&Ve.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(p){this._zoomFactor=p,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),N.prototype.open=function(){var p=this;this.cropShadeElement=Ve.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ve.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var T=0;T<this.numberOfGridLines;T++)this.horizontalGridLines.push(Ve.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ve.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(M){return p.gridContainer.appendChild(M)}),this.verticalGridLines.forEach(function(M){return p.gridContainer.appendChild(M)}),this.cropRectElement=Ve.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Et(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Et(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Et(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Et(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},N.prototype.setCropRectangle=function(p){this.cropRect=p;var T=Object.assign({},this.cropRect);this.zoomFactor!==1&&(T.width=this.cropRect.width*this.zoomFactor,T.height=this.cropRect.height*this.zoomFactor,T.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-T.width/2,T.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-T.height/2),Ve.setAttributes(this.cropRectElement,[["x",T.x.toString()],["y",T.y.toString()],["width",T.width.toString()],["height",T.height.toString()]]);var M=T.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(k,re){var Te=T.y+M*(re+1);Ve.setAttributes(k,[["x1",""+T.x],["y1",""+Te],["x2",""+(T.x+T.width)],["y2",""+Te]])});var G=T.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(k,re){var Te=T.x+G*(re+1);Ve.setAttributes(k,[["x1",""+Te],["y1",""+T.y],["x2",""+Te],["y2",""+(T.y+T.height)]])}),Ve.setAttributes(this.cropShadeElement,[["d",Ve.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,T.x,T.y,T.width,T.height)]]),this.topLeftGrip.setCenter(T.x,T.y),this.topRightGrip.setCenter(T.x+T.width,T.y),this.bottomLeftGrip.setCenter(T.x,T.y+T.height),this.bottomRightGrip.setCenter(T.x+T.width,T.y+T.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},N.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)},N.prototype.clientToLocalCoordinates=function(p,T){var M=this.container.getBoundingClientRect();return{x:p-M.left+this.margin,y:T-M.top+this.margin}},N.prototype.onPointerDown=function(p){this.container.setPointerCapture(p.pointerId),this.previousPoint=this.clientToLocalCoordinates(p.clientX,p.clientY),this.cropRectElement===p.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(p.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(p.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(p.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(p.target)&&(this.activeGrip=this.bottomRightGrip)},N.prototype.onPointerMove=function(p){if(this.isMoving)this.move(this.clientToLocalCoordinates(p.clientX,p.clientY));else if(this.activeGrip){var T=this.clientToLocalCoordinates(p.clientX,p.clientY);this.resize(T)}p.preventDefault()},N.prototype.onPointerUp=function(p){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(p.pointerId)},N.prototype.move=function(p){var T=p.x-this.previousPoint.x,M=p.y-this.previousPoint.y;this.zoomFactor!==1&&(T=-T/this.zoomFactor,M=-M/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+T),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+M),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=p},N.prototype.resize=function(p){var T=Object.assign({},this.cropRect),M=p.x-this.previousPoint.x,G=p.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:T.x+M<this.margin&&(M=this.margin-T.x),T.x+=M,T.width=this.cropRect.x+this.cropRect.width-T.x;break;case this.bottomRightGrip:case this.topRightGrip:T.width+M>this.canvasWidth*this.zoomFactor&&(M=this.canvasWidth*this.zoomFactor-T.width),T.width+=M}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(T.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(M),T.height=this.aspectRatio.getVerticalLength(T.width)):(T.y+=G,T.height=this.cropRect.y+this.cropRect.height-T.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?T.height=this.aspectRatio.getVerticalLength(T.width):T.height+=G}T.width<10&&(T.x=this.cropRect.x,T.width=10),T.height<10&&(T.y=this.cropRect.y,T.height=10),this.previousPoint=p,T.x>=this.margin&&T.y>=this.margin&&T.x-this.margin+T.width<=this.canvasWidth&&T.y-this.margin+T.height<=this.canvasHeight&&(this.cropRect=T,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},N.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var p=this.cropRect.x+this.cropRect.width/2,T=this.cropRect.y+this.cropRect.height/2,M=this.aspectRatio.getHorizontalLength(this.cropRect.height),G=this.aspectRatio.getVerticalLength(this.cropRect.width);M/this.canvasWidth<G/this.canvasHeight?this.cropRect.width=M:this.cropRect.height=G,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=p-this.cropRect.width/2,this.cropRect.y=T-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)}},N.prototype.getRescaledRect=function(p,T,M,G,k,re){var Te=M/p,Be=G/T;return{x:(k.x-re)*Te+re,y:(k.y-re)*Be+re,width:k.width*Te,height:k.height*Be}},N.prototype.scaleCanvas=function(p,T){var M=this.getRescaledRect(this.canvasWidth,this.canvasHeight,p,T,this.cropRect,this.margin);this.canvasWidth=p,this.canvasHeight=T,this.onCropChange&&this.onCropChange(M),this.setCropRectangle(M)},N}(),Ct=function(){function N(p){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=p,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(N.prototype,"angle",{get:function(){return this._angle},set:function(p){this._angle=p,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),N.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},N.prototype.onPointerDown=function(p){this.controlContainer.setPointerCapture(p.pointerId),this.isDragging=!0,this.previousPoint={x:p.clientX,y:p.clientY}},N.prototype.onPointerMove=function(p){this.isDragging&&(this.onAngleChange&&this.onAngleChange((p.clientX-this.previousPoint.x)/5),this.previousPoint.x=p.clientX)},N.prototype.onPointerUp=function(p){this.isDragging&&this.onAngleChange&&this.onAngleChange((p.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(p.pointerId)},N.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var p=this.angleLabelText.getBBox();Ve.setAttributes(this.angleLabelElement,[["x",((this.width-p.width)/2).toString()],["y",(this.height/2).toString()]])}},N.prototype.positionScaleShape=function(){if(this.scaleShape){var p=this.scaleShape.transform.baseVal.getItem(0);p.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(p,0)}},N.prototype.getVisual=function(){var p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("width",this.width+"px"),p.setAttribute("height",this.height+"px"),p.setAttribute("viewBox","0 0 "+this.width+" "+this.height),p.style.flexShrink="0",document.body.appendChild(p);for(var T="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,M=1;M<=this.width/5+10;M++){var G=M%5==0?this.height/3:this.height/6;T+="h4v"+-G+"h1v"+G}T+="v1H0Z",this.scaleShape=Ve.createPath(T);var k=Ve.createTransform();this.scaleShape.transform.baseVal.appendItem(k),p.appendChild(this.scaleShape),this.angleLabelElement=Ve.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ve.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var re=Ve.createTSpan("");return re.innerHTML="°",this.angleLabelElement.appendChild(re),p.appendChild(this.angleLabelElement),document.body.removeChild(p),p},N}(),Ot=function(){function N(){this.naturalSize=!1,this.imageType="image/png"}return N.prototype.rasterize=function(p,T,M,G,k,re,Te){var Be=this;return new Promise(function(Ke){var Se=document.createElement("canvas");Se.width=p.width.baseVal.value-2*G,Se.height=p.height.baseVal.value-2*G;var Qe=1,tt=1;Be.naturalSize===!0?(Qe=T.naturalWidth/(p.width.baseVal.value-2*G)/re,tt=T.naturalHeight/(p.height.baseVal.value-2*G)/Te,Se.width=T.naturalWidth/re,Se.height=T.naturalHeight/Te):Be.width!==void 0&&Be.height!==void 0&&(Qe=Be.width/M.width,tt=Be.height/M.height,Se.width*=Qe,Se.height*=tt);var st=Se.getContext("2d");st.translate(Se.width/2,Se.height/2),st.rotate(k*Math.PI/180),st.scale(re,Te),st.translate(-Se.width/2,-Se.height/2),st.drawImage(T,0,0,Se.width,Se.height);var xt=document.createElement("canvas");xt.width=M.width*Qe,xt.height=M.height*tt,xt.getContext("2d").putImageData(st.getImageData((M.x-G)*Qe,(M.y-G)*tt,M.width*Qe,M.height*tt),0,0),Ke(xt.toDataURL(Be.imageType,Be.imageQuality))})},N}(),Ut=function(){function N(p){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=N.instanceCounter++,this.styles=new Rt(this.instanceNo),this.target=p,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(N.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(p){this._zoomToCropEnabled=p,p?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(p){this._isGridVisible=p,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"gridLines",{get:function(){return this._gridLines},set:function(p){this._gridLines=p,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(p){this._rotationAngle=p,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"aspectRatio",{get:function(){var p;return(p=this._aspectRatio)!==null&&p!==void 0?p:this.aspectRatios[0]},set:function(p){this._aspectRatio=p},enumerable:!1,configurable:!0}),N.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},N.prototype.show=function(){this.showUI(),this.open()},N.prototype.close=function(p){p===void 0&&(p=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),p||this.closeEventListeners.forEach(function(T){return T()}),this._isOpen=!1)},N.prototype.addRenderEventListener=function(p){this.renderEventListeners.push(p)},N.prototype.removeRenderEventListener=function(p){this.renderEventListeners.indexOf(p)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(p),1)},N.prototype.addCloseEventListener=function(p){this.closeEventListeners.push(p)},N.prototype.removeCloseEventListener=function(p){this.closeEventListeners.indexOf(p)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(p),1)},N.prototype.setupResizeObserver=function(){var p=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){p.resize(p.target.clientWidth,p.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))},N.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var p=1*this.target.clientWidth/this.target.clientHeight,T=this.contentDiv.clientWidth/p>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*p:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,M=T+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/p;this.resize(T,M)}},N.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},N.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",Ve.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},N.prototype.resize=function(p,T){this.imageWidth=Math.round(p),this.imageHeight=Math.round(T),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()},N.prototype.setEditingTarget=function(){var p=document.createElement("canvas");p.width=this.target.naturalWidth,p.height=this.target.naturalHeight,p.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var T=p.toDataURL();Ve.setAttributes(this.editingTarget,[["href",T]]),this.setEditingTargetSize()},N.prototype.setTopLeft=function(){var p=this.target.getBoundingClientRect(),T=this.editorCanvas.getBoundingClientRect();this.left=p.left-T.left-this.CANVAS_MARGIN,this.top=p.top-T.top-this.CANVAS_MARGIN},N.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=Ve.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ve.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ve.createGroup(),this.editingTargetRotationScaleContainer=Ve.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var p=Ve.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(p);var T=Ve.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(T),this.editingTargetContainer=Ve.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)},N.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},N.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ve.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Tt(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()},N.prototype.zoomToCrop=function(){if(this.cropRect){var p=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,T=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=p+"px "+T+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-p+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-T+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},N.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)},N.prototype.cropRectChanged=function(p){this.cropRect=p,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},N.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},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.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 p=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,T=this.target.offsetTop>p+this.CANVAS_MARGIN?this.target.offsetTop-(p+this.CANVAS_MARGIN):0;this.coverDiv.style.top=T+"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},N.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},N.prototype.addTopToolbar=function(){var p=this;this.topToolbar=new at,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 T=new mt;T.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(T);var M=[];this.aspectRatios.forEach(function(tt){var st=new ct(ot.getIcon(tt.horizontal,tt.vertical),tt.horizontal===0&&tt.vertical===0?"FREE":tt.horizontal+":"+tt.vertical);st.onClick=function(){return p.ratioButtonClicked(tt)},M.push(st)}),this.aspectRatioButton=new bt(ot.getIcon(0,0),"Aspect ratio",M),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,T.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var G=new ct('<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");G.isActive=this.isGridVisible,G.onClick=function(){p.isGridVisible=!p.isGridVisible,G.isActive=p.isGridVisible},T.addButton(G);var k=new ct('<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(k.isActive=this.zoomToCropEnabled,k.onClick=function(){p.zoomToCropEnabled=!p.zoomToCropEnabled,k.isActive=p.zoomToCropEnabled},T.addButton(k),!At.isLicensed){var re=new Dt;this.topToolbar.addElementBlock(re);var Te=document.createElement("div");Te.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Be=document.createElement("a");Be.style.color="currentColor",Be.href="https://markerjs.com/products/cropro",Be.target="_blank",Be.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',Te.appendChild(Be),re.addElement(Te)}var Ke=new mt;Ke.minWidth=3*this.toolbarHeight+"px",Ke.contentAlign="end",this.topToolbar.addButtonBlock(Ke);var Se=new ct('<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");Se.onClick=this.startRenderAndClose,Ke.addButton(Se),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Se.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Qe=new ct('<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");Qe.onClick=this.close,Ke.addButton(Qe),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Qe.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},N.prototype.addBottomToolbar=function(){var p=this;this.bottomToolbar=new at,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 T=new mt;T.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(T);var M=new ct('<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");M.onClick=this.rotateLeftButtonClicked,T.addButton(M);var G=new ct('<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");G.onClick=this.rotateRightButtonClicked,T.addButton(G);var k=new Dt;k.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(k),this.straightener=new Ct("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(Ke){p.rotateBy(Ke),p.straightener.angle=p.rotationAngle},k.addElement(this.straightener.getUI());var re=new mt;re.minWidth=2*this.toolbarHeight+"px",re.contentAlign="end",this.bottomToolbar.addButtonBlock(re);var Te=new ct('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");Te.onClick=this.flipHorizontallyButtonClicked,re.addButton(Te);var Be=new ct('<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");Be.onClick=this.flipVerticallyButtonClicked,re.addButton(Be)},N.prototype.ratioButtonClicked=function(p){this.aspectRatio=p,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},N.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ot.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},N.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Pt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},N.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},N.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},N.prototype.restoreState=function(p){if(p){var T=this.cropLayer.getRescaledRect(p.width,p.height,this.imageWidth,this.imageHeight,p.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(T),this.cropRectChanged(T),this.flippedHorizontally=p.flippedHorizontally,this.flippedVertically=p.flippedVertically,this.applyFlip(),this.rotationAngle=p.rotationAngle,this.applyRotation()}},N.prototype.clientToLocalCoordinates=function(p,T){var M=this.cropImage.getBoundingClientRect();return{x:p-M.left,y:T-M.top}},N.prototype.onWindowResize=function(){this.positionUI()},N.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var p=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=p+"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()},N.prototype.rotateLeftButtonClicked=function(){var p=this.rotationAngle-90;this.rotationAngle%90!=0&&(p+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(p)},N.prototype.rotateRightButtonClicked=function(){var p=this.rotationAngle+90;this.rotationAngle%90!=0&&(p-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(p)},N.prototype.rotateTo=function(p){p=(p=p>180?p-360:p)<=-180?p+360:p,this.rotationAngle=p,this.applyRotation()},N.prototype.rotateBy=function(p){this.rotateTo((this.rotationAngle+p)%360)},N.prototype.applyRotation=function(){var p=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var T=this.editingTargetRotationContainer.transform.baseVal.getItem(0);T.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(T,0);var M=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/M.width,this.imageHeight/M.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=p},N.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},N.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},N.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},N.prototype.startRenderAndClose=function(){return qe(this,void 0,void 0,function(){var p,T;return vt(this,function(M){switch(M.label){case 0:return[4,this.render()];case 1:return p=M.sent(),T=this.getState(),this.renderEventListeners.forEach(function(G){return G(p,T)}),this.close(!0),[2]}})})},N.prototype.render=function(){return qe(this,void 0,void 0,function(){var p;return vt(this,function(T){switch(T.label){case 0:return(p=new Ot).naturalSize=this.renderAtNaturalSize,p.imageType=this.renderImageType,p.imageQuality=this.renderImageQuality,p.width=this.renderWidth,p.height=this.renderHeight,this.unzoomFromCrop(),Ve.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,p.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 T.sent(),[4,p.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,T.sent()]}})})},N.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ye("toolbar",`
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
overflow: hidden;
|
|
line-height: 0px;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ye("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ye("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var p=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ye("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*p)+`px;
|
|
height: `+(this.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Je("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Je("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ye("toolbar_dropdown",`
|
|
position: absolute;
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
z-index: 20;
|
|
white-space: normal;
|
|
box-sizing: content-box;
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
line-height: 0px;
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Ye("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ye("toolbar_straightener_block",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Ye("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*p)+`px;
|
|
padding: `+p+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ye("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},N.instanceCounter=0,N}(),Kt=K("8hTe"),jt=K.n(Kt),zt=/<pre[^>]*>/g;function Vt(N){var p=document.createElement("div");return p.innerHTML=N,p.childNodes.length===0?"":p.childNodes[0].nodeValue}var ii=oe.a=function(N){var p=N.value,T=p===void 0?"":p,M=N.edit,G=M===void 0?!1:M,k=N.className,re=N.showTextOnly,Te=N.showLines,Be=N.replaces,Ke=N.zoomImg,Se=N.hasMask,Qe=N.style,tt=Qe===void 0?{}:Qe,st=N.stylesPrev,xt=st===void 0?{}:st,It=String(T),gt=Object(A.useRef)(),wt=Object(A.useRef)(),Yt=Object(A.useState)(""),Ht=Object(j.a)(Yt,2),Mt=Ht[0],Lt=Ht[1],Xt=Object(A.useState)("office"),Wt=Object(j.a)(Xt,2),$t=Wt[0],kt=Wt[1],Jt=function(){var nt=new Ut(wt.current);nt.displayMode="popup",nt.addRenderEventListener(function(){var yt=Object(D.a)(e.a.mark(function et(_t){var lt;return e.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return gt.current.style.display="none",pt.next=3,Object(pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:_t}});case 3:lt=pt.sent,lt!=null&<.id&&Be(wt.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(lt==null?void 0:lt.id,"?type=").concat(lt.content_type));case 5:case"end":return pt.stop()}},et)}));return function(et){return yt.apply(this,arguments)}}()),nt.show()},Qt=function(){var nt=new rt(wt.current);nt.settings.displayMode="popup",nt.addEventListener("render",function(){var yt=Object(D.a)(e.a.mark(function et(_t){var lt;return e.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(gt.current.style.display="none",!wt.current){pt.next=6;break}return pt.next=4,Object(pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:_t.dataUrl}});case 4:lt=pt.sent,lt!=null&<.id&&Be(wt.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(lt==null?void 0:lt.id,"?type=").concat(lt.content_type));case 6:case"end":return pt.stop()}},et)}));return function(et){return yt.apply(this,arguments)}}()),nt.show(),window.markerArea=nt},Nt=Object(A.useMemo)(function(){gt.current&&(gt.current.style.zIndex=-1);try{var ft=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,nt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;It=It.replace(ft,"("+z.a.API_SERVER+"/api/attachments/").replace(nt,'"'+z.a.API_SERVER+"/api/attachments/").replace(yt,'"'+z.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(Ft){}var et=P(It),_t=v();if(It.match(/\[TOC\]/)&&(et=et.replace("<p>[TOC]</p>",x()),b()),et=et.replace(/(__special_katext_id_\d+__)/g,function(Ft,pt){var Gt=_t[pt],ei=Gt.type,ti=Gt.expression;return Object(Z.renderToString)(Vt(ti)||"",{displayMode:ei==="block",throwOnError:!1,output:"html"})}),et=et.replace(/▁/g,"\u2581\u2581\u2581"),g(),re){var lt=document.createElement("div");return lt.innerHTML=et,lt.innerText}return setTimeout(function(){return Zt()},500),et},[It]),St=Object(A.useRef)();m.WebkitLineClamp=Te,Te&&(tt=Object(L.a)(Object(L.a)({},tt),m));function Bt(ft){var nt=ft.target;if(nt.tagName.toUpperCase()==="IMG"){if(Ke){var yt=nt.getAttribute("src");Lt(yt),kt("image")}}else if(nt.tagName.toUpperCase()==="A"){var et=nt.getAttribute("href");if(et.indexOf("office")>-1)ft.preventDefault(),Lt(et),kt("office");else if(et.indexOf("application/pdf")>-1)ft.preventDefault(),Lt(et),kt("pdf");else if(et.indexOf("text/html")>-1)ft.preventDefault(),Lt(et),kt("html");else if(et.startsWith("#")){ft.preventDefault();var _t=document.getElementById(et.replace("#",""));_t&&_t.scrollIntoView(!0)}}}var Zt=function(){var nt,yt=(nt=St.current)===null||nt===void 0?void 0:nt.querySelectorAll("video");yt==null||yt.forEach(function(et){if(et.oncontextmenu=function(){return!1},et.src.indexOf(".m3u8")>-1&&!et.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var _t=new H.a;_t.loadSource(et.src),_t.attachMedia(et)}}})};Object(A.useEffect)(function(){if(St.current&&Nt&&(Nt.match(zt)&&window.PR.prettyPrint()),St.current)return St.current.addEventListener("click",Bt),function(){St.current.removeEventListener("click",Bt),g(),b()}},[Nt,St.current,Bt]);var qt=function(nt){if(!G)return;nt.target.nodeName==="IMG"?(gt.current.style.zIndex=1,gt.current.style.display="flex",gt.current.style.width=nt.target.clientWidth+"px",gt.current.style.height=nt.target.clientHeight+"px",gt.current.style.top=nt.target.offsetTop+"px",gt.current.style.left=nt.target.offsetLeft+"px",wt.current.src=nt.target.getAttribute("src")):gt.current.style.display="none"};return d.a.createElement("div",{style:{position:"relative"}},d.a.createElement("div",{ref:St,style:Object(L.a)({},tt),className:"".concat(k||""," markdown-body ").concat(jt.a.mdBody),onMouseOver:qt,dangerouslySetInnerHTML:{__html:Nt}}),d.a.createElement("div",{ref:gt,className:jt.a.button},d.a.createElement(W.a,null,d.a.createElement(F.a,{onClick:function(){return Jt()}},"\u88C1\u526A"),d.a.createElement(F.a,{onClick:function(){return Qt()}},"\u7F16\u8F91"))),d.a.createElement("img",{ref:wt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),d.a.createElement(Q.a,{close:!0,data:Mt,type:Mt!=null&&Mt.length?$t:"",style:Object(L.a)({},xt),onClose:function(){return Lt("")}}))}},BU3w:function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return D});var ee=K("MNnm"),W="rc-util-key";function R(j){if(j.attachTo)return j.attachTo;var U=document.querySelector("head");return U||document.body}function F(j){var U,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ee.a)())return null;var A=document.createElement("style");if((U=e.csp)===null||U===void 0?void 0:U.nonce){var d;A.nonce=(d=e.csp)===null||d===void 0?void 0:d.nonce}A.innerHTML=j;var f=R(e),o=f.firstChild;return e.prepend&&f.prepend?f.prepend(A):e.prepend&&o?f.insertBefore(A,o):f.appendChild(A),A}var L=new Map;function D(j,U){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=R(e);if(!L.has(A)){var d=F("",e),f=d.parentNode;L.set(A,f),f.removeChild(d)}var o=Array.from(L.get(A).children).find(function(r){return r.tagName==="STYLE"&&r[W]===U});if(o){var n,a;if(((n=e.csp)===null||n===void 0?void 0:n.nonce)&&o.nonce!==((a=e.csp)===null||a===void 0?void 0:a.nonce)){var h;o.nonce=(h=e.csp)===null||h===void 0?void 0:h.nonce}return o.innerHTML!==j&&(o.innerHTML=j),o}var s=F(j,e);return s[W]=U,s}},BdwD:function(Ge,oe,K){"use strict";var ee=K("+L6B"),W=K("2/Rp"),R=K("0Owb"),F=K("k1fw"),L=K("q1tI"),D=K.n(L),j=K("FOrL"),U=K.n(j),e=function(d){var f=d.buttonProps,o=f===void 0?{}:f,n=d.styles,a=n===void 0?{}:n,h=d.customText,s=d.ButtonText,r=d.ButtonClick,t=d.Buttonclass,i=d.ButtonTwo;return D.a.createElement("section",{className:"tc animated fadeIn",style:Object(F.a)(Object(F.a)({},{color:"#999",margin:"200px auto"}),a)},D.a.createElement("img",{src:U.a}),D.a.createElement("p",{className:"mt20 font14"},h||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&D.a.createElement(W.a,Object(R.a)({className:t,onClick:r},o),s),i&&i)};oe.a=e},"C/vA":function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return ee});function ee(W){const R=this;let F=!1,L;return function(){return F||(F=!0,L=W.apply(R,arguments)),L}}},"Cg/j":function(Ge,oe,K){"use strict";K.d(oe,"b",function(){return ee}),K.d(oe,"a",function(){return W}),K.d(oe,"c",function(){return F}),K.d(oe,"d",function(){return L});var ee;(function(D){D.serviceIds=new Map,D.DI_TARGET="$di$target",D.DI_DEPENDENCIES="$di$dependencies";function j(U){return U[D.DI_DEPENDENCIES]||[]}D.getServiceDependencies=j})(ee||(ee={}));const W=F("instantiationService");function R(D,j,U,e){j[ee.DI_TARGET]===j?j[ee.DI_DEPENDENCIES].push({id:D,index:U,optional:e}):(j[ee.DI_DEPENDENCIES]=[{id:D,index:U,optional:e}],j[ee.DI_TARGET]=j)}function F(D){if(ee.serviceIds.has(D))return ee.serviceIds.get(D);const j=function(U,e,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");R(j,U,A,!1)};return j.toString=()=>D,ee.serviceIds.set(D,j),j}function L(D){return function(j,U,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");R(D,j,e,!0)}}},DlQD:function(Ge,oe,K){(function(ee,W){Ge.exports=W()})(this,function(){"use strict";function ee(ae,ie){for(var ne=0;ne<ie.length;ne++){var V=ie[ne];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(ae,V.key,V)}}function W(ae,ie,ne){return ie&&ee(ae.prototype,ie),ne&&ee(ae,ne),ae}function R(ae,ie){if(!ae)return;if(typeof ae=="string")return F(ae,ie);var ne=Object.prototype.toString.call(ae).slice(8,-1);if(ne==="Object"&&ae.constructor&&(ne=ae.constructor.name),ne==="Map"||ne==="Set")return Array.from(ae);if(ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne))return F(ae,ie)}function F(ae,ie){(ie==null||ie>ae.length)&&(ie=ae.length);for(var ne=0,V=new Array(ie);ne<ie;ne++)V[ne]=ae[ne];return V}function L(ae,ie){var ne;if(typeof Symbol=="undefined"||ae[Symbol.iterator]==null){if(Array.isArray(ae)||(ne=R(ae))||ie&&ae&&typeof ae.length=="number"){ne&&(ae=ne);var V=0;return function(){return V>=ae.length?{done:!0}:{done:!1,value:ae[V++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ne=ae[Symbol.iterator](),ne.next.bind(ne)}function D(ae,ie){return ie={exports:{}},ae(ie,ie.exports),ie.exports}var j=D(function(ae){function ie(){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 ne(V){ae.exports.defaults=V}ae.exports={defaults:ie(),getDefaults:ie,changeDefaults:ne}}),U=j.defaults,e=j.getDefaults,A=j.changeDefaults,d=/[&<>"']/,f=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,n=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},h=function(ie){return a[ie]};function s(ae,ie){if(ie){if(d.test(ae))return ae.replace(f,h)}else if(o.test(ae))return ae.replace(n,h);return ae}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function t(ae){return ae.replace(r,function(ie,ne){return ne=ne.toLowerCase(),ne==="colon"?":":ne.charAt(0)==="#"?ne.charAt(1)==="x"?String.fromCharCode(parseInt(ne.substring(2),16)):String.fromCharCode(+ne.substring(1)):""})}var i=/(^|[^\[])\^/g;function b(ae,ie){ae=ae.source||ae,ie=ie||"";var ne={replace:function(Y,J){return J=J.source||J,J=J.replace(i,"$1"),ae=ae.replace(Y,J),ne},getRegex:function(){return new RegExp(ae,ie)}};return ne}var m=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function x(ae,ie,ne){if(ae){var V;try{V=decodeURIComponent(t(ne)).replace(m,"").toLowerCase()}catch(Y){return null}if(V.indexOf("javascript:")===0||V.indexOf("vbscript:")===0||V.indexOf("data:")===0)return null}ie&&!_.test(ne)&&(ne=l(ie,ne));try{ne=encodeURI(ne).replace(/%25/g,"%")}catch(Y){return null}return ne}var E={},y=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function l(ae,ie){E[" "+ae]||(y.test(ae)?E[" "+ae]=ae+"/":E[" "+ae]=O(ae,"/",!0)),ae=E[" "+ae];var ne=ae.indexOf(":")===-1;return ie.substring(0,2)==="//"?ne?ie:ae.replace(c,"$1")+ie:ie.charAt(0)==="/"?ne?ie:ae.replace(u,"$1")+ie:ae+ie}var v={exec:function(){}};function g(ae){for(var ie=1,ne,V;ie<arguments.length;ie++){ne=arguments[ie];for(V in ne)Object.prototype.hasOwnProperty.call(ne,V)&&(ae[V]=ne[V])}return ae}function w(ae,ie){var ne=ae.replace(/\|/g,function(J,q,fe){for(var ge=!1,Re=q;--Re>=0&&fe[Re]==="\\";)ge=!ge;return ge?"|":" |"}),V=ne.split(/ \|/),Y=0;if(V.length>ie)V.splice(ie);else for(;V.length<ie;)V.push("");for(;Y<V.length;Y++)V[Y]=V[Y].trim().replace(/\\\|/g,"|");return V}function O(ae,ie,ne){var V=ae.length;if(V===0)return"";for(var Y=0;Y<V;){var J=ae.charAt(V-Y-1);if(J===ie&&!ne)Y++;else if(J!==ie&&ne)Y++;else break}return ae.substr(0,V-Y)}function I(ae,ie){if(ae.indexOf(ie[1])===-1)return-1;for(var ne=ae.length,V=0,Y=0;Y<ne;Y++)if(ae[Y]==="\\")Y++;else if(ae[Y]===ie[0])V++;else if(ae[Y]===ie[1]&&(V--,V<0))return Y;return-1}function S(ae){ae&&ae.sanitize&&!ae.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 P={escape:s,unescape:t,edit:b,cleanUrl:x,resolveUrl:l,noopTest:v,merge:g,splitCells:w,rtrim:O,findClosingBracket:I,checkSanitizeDeprecation:S},B=j.defaults,C=P.rtrim,H=P.splitCells,z=P.escape,Z=P.findClosingBracket;function Q(ae,ie,ne){var V=ie.href,Y=ie.title?z(ie.title):null,J=ae[1].replace(/\\([\[\]])/g,"$1");return ae[0].charAt(0)!=="!"?{type:"link",raw:ne,href:V,title:Y,text:J}:{type:"image",raw:ne,href:V,title:Y,text:z(J)}}function pe(ae,ie){var ne=ae.match(/^(\s+)(?:```)/);if(ne===null)return ie;var V=ne[1];return ie.split(`
|
|
`).map(function(Y){var J=Y.match(/^\s+/);if(J===null)return Y;var q=J[0];return q.length>=V.length?Y.slice(V.length):Y}).join(`
|
|
`)}var le=function(){function ae(ne){this.options=ne||B}var ie=ae.prototype;return ie.space=function(V){var Y=this.rules.block.newline.exec(V);if(Y)return Y[0].length>1?{type:"space",raw:Y[0]}:{raw:`
|
|
`}},ie.code=function(V,Y){var J=this.rules.block.code.exec(V);if(J){var q=Y[Y.length-1];if(q&&q.type==="paragraph")return{raw:J[0],text:J[0].trimRight()};var fe=J[0].replace(/^ {4}/gm,"");return{type:"code",raw:J[0],codeBlockStyle:"indented",text:this.options.pedantic?fe:C(fe,`
|
|
`)}}},ie.fences=function(V){var Y=this.rules.block.fences.exec(V);if(Y){var J=Y[0],q=pe(J,Y[3]||"");return{type:"code",raw:J,lang:Y[2]?Y[2].trim():Y[2],text:q}}},ie.heading=function(V){var Y=this.rules.block.heading.exec(V);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},ie.nptable=function(V){var Y=this.rules.block.nptable.exec(V);if(Y){var J={type:"table",header:H(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Y[0]};if(J.header.length===J.align.length){var q=J.align.length,fe;for(fe=0;fe<q;fe++)/^ *-+: *$/.test(J.align[fe])?J.align[fe]="right":/^ *:-+: *$/.test(J.align[fe])?J.align[fe]="center":/^ *:-+ *$/.test(J.align[fe])?J.align[fe]="left":J.align[fe]=null;for(q=J.cells.length,fe=0;fe<q;fe++)J.cells[fe]=H(J.cells[fe],J.header.length);return J}}},ie.hr=function(V){var Y=this.rules.block.hr.exec(V);if(Y)return{type:"hr",raw:Y[0]}},ie.blockquote=function(V){var Y=this.rules.block.blockquote.exec(V);if(Y){var J=Y[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Y[0],text:J}}},ie.list=function(V){var Y=this.rules.block.list.exec(V);if(Y){for(var J=Y[0],q=Y[2],fe=q.length>1,ge=q[q.length-1]===")",Re={type:"list",raw:J,ordered:fe,start:fe?+q.slice(0,-1):"",loose:!1,items:[]},We=Y[0].match(this.rules.block.item),Xe=!1,He,$e,Ze,ze,it,rt,dt,ut=We.length,qe=0;qe<ut;qe++)He=We[qe],J=He,$e=He.length,He=He.replace(/^ *([*+-]|\d+[.)]) */,""),~He.indexOf(`
|
|
`)&&($e-=He.length,He=this.options.pedantic?He.replace(/^ {1,4}/gm,""):He.replace(new RegExp("^ {1,"+$e+"}","gm"),"")),qe!==ut-1&&(Ze=this.rules.block.bullet.exec(We[qe+1])[0],(fe?Ze.length===1||!ge&&Ze[Ze.length-1]===")":Ze.length>1||this.options.smartLists&&Ze!==q)&&(ze=We.slice(qe+1).join(`
|
|
`),Re.raw=Re.raw.substring(0,Re.raw.length-ze.length),qe=ut-1)),it=Xe||/\n\n(?!\s*$)/.test(He),qe!==ut-1&&(Xe=He.charAt(He.length-1)===`
|
|
`,it||(it=Xe)),it&&(Re.loose=!0),rt=/^\[[ xX]\] /.test(He),dt=void 0,rt&&(dt=He[1]!==" ",He=He.replace(/^\[[ xX]\] +/,"")),Re.items.push({type:"list_item",raw:J,task:rt,checked:dt,loose:it,text:He});return Re}},ie.html=function(V){var Y=this.rules.block.html.exec(V);if(Y)return{type:this.options.sanitize?"paragraph":"html",raw:Y[0],pre:!this.options.sanitizer&&(Y[1]==="pre"||Y[1]==="script"||Y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):z(Y[0]):Y[0]}},ie.def=function(V){var Y=this.rules.block.def.exec(V);if(Y){Y[3]&&(Y[3]=Y[3].substring(1,Y[3].length-1));var J=Y[1].toLowerCase().replace(/\s+/g," ");return{tag:J,raw:Y[0],href:Y[2],title:Y[3]}}},ie.table=function(V){var Y=this.rules.block.table.exec(V);if(Y){var J={type:"table",header:H(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
|
|
`):[]};if(J.header.length===J.align.length){J.raw=Y[0];var q=J.align.length,fe;for(fe=0;fe<q;fe++)/^ *-+: *$/.test(J.align[fe])?J.align[fe]="right":/^ *:-+: *$/.test(J.align[fe])?J.align[fe]="center":/^ *:-+ *$/.test(J.align[fe])?J.align[fe]="left":J.align[fe]=null;for(q=J.cells.length,fe=0;fe<q;fe++)J.cells[fe]=H(J.cells[fe].replace(/^ *\| *| *\| *$/g,""),J.header.length);return J}}},ie.lheading=function(V){var Y=this.rules.block.lheading.exec(V);if(Y)return{type:"heading",raw:Y[0],depth:Y[2].charAt(0)==="="?1:2,text:Y[1]}},ie.paragraph=function(V){var Y=this.rules.block.paragraph.exec(V);if(Y)return{type:"paragraph",raw:Y[0],text:Y[1].charAt(Y[1].length-1)===`
|
|
`?Y[1].slice(0,-1):Y[1]}},ie.text=function(V,Y){var J=this.rules.block.text.exec(V);if(J){var q=Y[Y.length-1];return q&&q.type==="text"?{raw:J[0],text:J[0]}:{type:"text",raw:J[0],text:J[0]}}},ie.escape=function(V){var Y=this.rules.inline.escape.exec(V);if(Y)return{type:"escape",raw:Y[0],text:z(Y[1])}},ie.tag=function(V,Y,J){var q=this.rules.inline.tag.exec(V);if(q)return!Y&&/^<a /i.test(q[0])?Y=!0:Y&&/^<\/a>/i.test(q[0])&&(Y=!1),!J&&/^<(pre|code|kbd|script)(\s|>)/i.test(q[0])?J=!0:J&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(q[0])&&(J=!1),{type:this.options.sanitize?"text":"html",raw:q[0],inLink:Y,inRawBlock:J,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):z(q[0]):q[0]}},ie.link=function(V){var Y=this.rules.inline.link.exec(V);if(Y){var J=Z(Y[2],"()");if(J>-1){var q=Y[0].indexOf("!")===0?5:4,fe=q+Y[1].length+J;Y[2]=Y[2].substring(0,J),Y[0]=Y[0].substring(0,fe).trim(),Y[3]=""}var ge=Y[2],Re="";if(this.options.pedantic){var We=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ge);We?(ge=We[1],Re=We[3]):Re=""}else Re=Y[3]?Y[3].slice(1,-1):"";ge=ge.trim().replace(/^<([\s\S]*)>$/,"$1");var Xe=Q(Y,{href:ge&&ge.replace(this.rules.inline._escapes,"$1"),title:Re&&Re.replace(this.rules.inline._escapes,"$1")},Y[0]);return Xe}},ie.reflink=function(V,Y){var J;if((J=this.rules.inline.reflink.exec(V))||(J=this.rules.inline.nolink.exec(V))){var q=(J[2]||J[1]).replace(/\s+/g," ");if(q=Y[q.toLowerCase()],!q||!q.href){var fe=J[0].charAt(0);return{type:"text",raw:fe,text:fe}}var ge=Q(J,q,J[0]);return ge}},ie.strong=function(V,Y,J){J===void 0&&(J="");var q=this.rules.inline.strong.start.exec(V);if(q&&(!q[1]||q[1]&&(J===""||this.rules.inline.punctuation.exec(J)))){Y=Y.slice(-1*V.length);var fe=q[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;fe.lastIndex=0;for(var ge;(q=fe.exec(Y))!=null;)if(ge=this.rules.inline.strong.middle.exec(Y.slice(0,q.index+3)),ge)return{type:"strong",raw:V.slice(0,ge[0].length),text:V.slice(2,ge[0].length-2)}}},ie.em=function(V,Y,J){J===void 0&&(J="");var q=this.rules.inline.em.start.exec(V);if(q&&(!q[1]||q[1]&&(J===""||this.rules.inline.punctuation.exec(J)))){Y=Y.slice(-1*V.length);var fe=q[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;fe.lastIndex=0;for(var ge;(q=fe.exec(Y))!=null;)if(ge=this.rules.inline.em.middle.exec(Y.slice(0,q.index+2)),ge)return{type:"em",raw:V.slice(0,ge[0].length),text:V.slice(1,ge[0].length-1)}}},ie.codespan=function(V){var Y=this.rules.inline.code.exec(V);if(Y){var J=Y[2].replace(/\n/g," "),q=/[^ ]/.test(J),fe=J.startsWith(" ")&&J.endsWith(" ");return q&&fe&&(J=J.substring(1,J.length-1)),J=z(J,!0),{type:"codespan",raw:Y[0],text:J}}},ie.br=function(V){var Y=this.rules.inline.br.exec(V);if(Y)return{type:"br",raw:Y[0]}},ie.del=function(V){var Y=this.rules.inline.del.exec(V);if(Y)return{type:"del",raw:Y[0],text:Y[1]}},ie.autolink=function(V,Y){var J=this.rules.inline.autolink.exec(V);if(J){var q,fe;return J[2]==="@"?(q=z(this.options.mangle?Y(J[1]):J[1]),fe="mailto:"+q):(q=z(J[1]),fe=q),{type:"link",raw:J[0],text:q,href:fe,tokens:[{type:"text",raw:q,text:q}]}}},ie.url=function(V,Y){var J;if(J=this.rules.inline.url.exec(V)){var q,fe;if(J[2]==="@")q=z(this.options.mangle?Y(J[0]):J[0]),fe="mailto:"+q;else{var ge;do ge=J[0],J[0]=this.rules.inline._backpedal.exec(J[0])[0];while(ge!==J[0]);q=z(J[0]),J[1]==="www."?fe="http://"+q:fe=q}return{type:"link",raw:J[0],text:q,href:fe,tokens:[{type:"text",raw:q,text:q}]}}},ie.inlineText=function(V,Y,J){var q=this.rules.inline.text.exec(V);if(q){var fe;return Y?fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):z(q[0]):q[0]:fe=z(this.options.smartypants?J(q[0]):q[0]),{type:"text",raw:q[0],text:fe}}},ae}(),de=P.noopTest,ce=P.edit,me=P.merge,te={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:de,table:de,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,te.def=ce(te.def).replace("label",te._label).replace("title",te._title).getRegex(),te.bullet=/(?:[*+-]|\d{1,9}[.)])/,te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,te.item=ce(te.item,"gm").replace(/bull/g,te.bullet).getRegex(),te.list=ce(te.list).replace(/bull/g,te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+te.def.source+")").getRegex(),te._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",te._comment=/<!--(?!-?>)[\s\S]*?-->/,te.html=ce(te.html,"i").replace("comment",te._comment).replace("tag",te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),te.paragraph=ce(te._paragraph).replace("hr",te.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",te._tag).getRegex(),te.blockquote=ce(te.blockquote).replace("paragraph",te.paragraph).getRegex(),te.normal=me({},te),te.gfm=me({},te.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*|$)"}),te.gfm.nptable=ce(te.gfm.nptable).replace("hr",te.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",te._tag).getRegex(),te.gfm.table=ce(te.gfm.table).replace("hr",te.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",te._tag).getRegex(),te.pedantic=me({},te.normal,{html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",te._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:de,paragraph:ce(te.normal._paragraph).replace("hr",te.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var $={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:de,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:de,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};$._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",$.punctuation=ce($.punctuation).replace(/punctuation/g,$._punctuation).getRegex(),$._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",$._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",$.em.start=ce($.em.start).replace(/punctuation/g,$._punctuation).getRegex(),$.em.middle=ce($.em.middle).replace(/punctuation/g,$._punctuation).replace(/overlapSkip/g,$._overlapSkip).getRegex(),$.em.endAst=ce($.em.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.em.endUnd=ce($.em.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.strong.start=ce($.strong.start).replace(/punctuation/g,$._punctuation).getRegex(),$.strong.middle=ce($.strong.middle).replace(/punctuation/g,$._punctuation).replace(/blockSkip/g,$._blockSkip).getRegex(),$.strong.endAst=ce($.strong.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.strong.endUnd=ce($.strong.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.blockSkip=ce($._blockSkip,"g").getRegex(),$.overlapSkip=ce($._overlapSkip,"g").getRegex(),$._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,$._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])?)+(?![-_])/,$.autolink=ce($.autolink).replace("scheme",$._scheme).replace("email",$._email).getRegex(),$._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,$.tag=ce($.tag).replace("comment",te._comment).replace("attribute",$._attribute).getRegex(),$._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,$._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,$.link=ce($.link).replace("label",$._label).replace("href",$._href).replace("title",$._title).getRegex(),$.reflink=ce($.reflink).replace("label",$._label).getRegex(),$.reflinkSearch=ce($.reflinkSearch,"g").replace("reflink",$.reflink).replace("nolink",$.nolink).getRegex(),$.normal=me({},$),$.pedantic=me({},$.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:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",$._label).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$._label).getRegex()}),$.gfm=me({},$.normal,{escape:ce($.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),$.gfm.url=ce($.gfm.url,"i").replace("email",$.gfm._extended_email).getRegex(),$.breaks=me({},$.gfm,{br:ce($.br).replace("{2,}","*").getRegex(),text:ce($.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var _e={block:te,inline:$},Oe=j.defaults,Ce=_e.block,Ae=_e.inline;function Pe(ae){return ae.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 ye(ae){var ie="",ne,V,Y=ae.length;for(ne=0;ne<Y;ne++)V=ae.charCodeAt(ne),Math.random()>.5&&(V="x"+V.toString(16)),ie+="&#"+V+";";return ie}var Ee=function(){function ae(ne){this.tokens=[],this.tokens.links=Object.create(null),this.options=ne||Oe,this.options.tokenizer=this.options.tokenizer||new le,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var V={block:Ce.normal,inline:Ae.normal};this.options.pedantic?(V.block=Ce.pedantic,V.inline=Ae.pedantic):this.options.gfm&&(V.block=Ce.gfm,this.options.breaks?V.inline=Ae.breaks:V.inline=Ae.gfm),this.tokenizer.rules=V}ae.lex=function(V,Y){var J=new ae(Y);return J.lex(V)};var ie=ae.prototype;return ie.lex=function(V){return V=V.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(V,this.tokens,!0),this.inline(this.tokens),this.tokens},ie.blockTokens=function(V,Y,J){Y===void 0&&(Y=[]),J===void 0&&(J=!0),V=V.replace(/^ +$/gm,"");for(var q,fe,ge,Re;V;){if(q=this.tokenizer.space(V)){V=V.substring(q.raw.length),q.type&&Y.push(q);continue}if(q=this.tokenizer.code(V,Y)){V=V.substring(q.raw.length),q.type?Y.push(q):(Re=Y[Y.length-1],Re.raw+=`
|
|
`+q.raw,Re.text+=`
|
|
`+q.text);continue}if(q=this.tokenizer.fences(V)){V=V.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.heading(V)){V=V.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.nptable(V)){V=V.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.hr(V)){V=V.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.blockquote(V)){V=V.substring(q.raw.length),q.tokens=this.blockTokens(q.text,[],J),Y.push(q);continue}if(q=this.tokenizer.list(V)){for(V=V.substring(q.raw.length),ge=q.items.length,fe=0;fe<ge;fe++)q.items[fe].tokens=this.blockTokens(q.items[fe].text,[],!1);Y.push(q);continue}if(q=this.tokenizer.html(V)){V=V.substring(q.raw.length),Y.push(q);continue}if(J&&(q=this.tokenizer.def(V))){V=V.substring(q.raw.length),this.tokens.links[q.tag]||(this.tokens.links[q.tag]={href:q.href,title:q.title});continue}if(q=this.tokenizer.table(V)){V=V.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.lheading(V)){V=V.substring(q.raw.length),Y.push(q);continue}if(J&&(q=this.tokenizer.paragraph(V))){V=V.substring(q.raw.length),Y.push(q);continue}if(q=this.tokenizer.text(V,Y)){V=V.substring(q.raw.length),q.type?Y.push(q):(Re=Y[Y.length-1],Re.raw+=`
|
|
`+q.raw,Re.text+=`
|
|
`+q.text);continue}if(V){var We="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(We);break}else throw new Error(We)}}return Y},ie.inline=function(V){var Y,J,q,fe,ge,Re,We=V.length;for(Y=0;Y<We;Y++){Re=V[Y];switch(Re.type){case"paragraph":case"text":case"heading":{Re.tokens=[],this.inlineTokens(Re.text,Re.tokens);break}case"table":{for(Re.tokens={header:[],cells:[]},fe=Re.header.length,J=0;J<fe;J++)Re.tokens.header[J]=[],this.inlineTokens(Re.header[J],Re.tokens.header[J]);for(fe=Re.cells.length,J=0;J<fe;J++)for(ge=Re.cells[J],Re.tokens.cells[J]=[],q=0;q<ge.length;q++)Re.tokens.cells[J][q]=[],this.inlineTokens(ge[q],Re.tokens.cells[J][q]);break}case"blockquote":{this.inline(Re.tokens);break}case"list":{for(fe=Re.items.length,J=0;J<fe;J++)this.inline(Re.items[J].tokens);break}}}return V},ie.inlineTokens=function(V,Y,J,q,fe){Y===void 0&&(Y=[]),J===void 0&&(J=!1),q===void 0&&(q=!1),fe===void 0&&(fe="");var ge,Re=V,We;if(this.tokens.links){var Xe=Object.keys(this.tokens.links);if(Xe.length>0)for(;(We=this.tokenizer.rules.inline.reflinkSearch.exec(Re))!=null;)Xe.includes(We[0].slice(We[0].lastIndexOf("[")+1,-1))&&(Re=Re.slice(0,We.index)+"["+"a".repeat(We[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(We=this.tokenizer.rules.inline.blockSkip.exec(Re))!=null;)Re=Re.slice(0,We.index)+"["+"a".repeat(We[0].length-2)+"]"+Re.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;V;){if(ge=this.tokenizer.escape(V)){V=V.substring(ge.raw.length),Y.push(ge);continue}if(ge=this.tokenizer.tag(V,J,q)){V=V.substring(ge.raw.length),J=ge.inLink,q=ge.inRawBlock,Y.push(ge);continue}if(ge=this.tokenizer.link(V)){V=V.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,q)),Y.push(ge);continue}if(ge=this.tokenizer.reflink(V,this.tokens.links)){V=V.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,q)),Y.push(ge);continue}if(ge=this.tokenizer.strong(V,Re,fe)){V=V.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],J,q),Y.push(ge);continue}if(ge=this.tokenizer.em(V,Re,fe)){V=V.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],J,q),Y.push(ge);continue}if(ge=this.tokenizer.codespan(V)){V=V.substring(ge.raw.length),Y.push(ge);continue}if(ge=this.tokenizer.br(V)){V=V.substring(ge.raw.length),Y.push(ge);continue}if(ge=this.tokenizer.del(V)){V=V.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],J,q),Y.push(ge);continue}if(ge=this.tokenizer.autolink(V,ye)){V=V.substring(ge.raw.length),Y.push(ge);continue}if(!J&&(ge=this.tokenizer.url(V,ye))){V=V.substring(ge.raw.length),Y.push(ge);continue}if(ge=this.tokenizer.inlineText(V,q,Pe)){V=V.substring(ge.raw.length),fe=ge.raw.slice(-1),Y.push(ge);continue}if(V){var He="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(He);break}else throw new Error(He)}}return Y},W(ae,null,[{key:"rules",get:function(){return{block:Ce,inline:Ae}}}]),ae}(),Ie=j.defaults,X=P.cleanUrl,se=P.escape,ue=function(){function ae(ne){this.options=ne||Ie}var ie=ae.prototype;return ie.code=function(V,Y,J){var q=(Y||"").match(/\S*/)[0];if(this.options.highlight){var fe=this.options.highlight(V,q);fe!=null&&fe!==V&&(J=!0,V=fe)}return q?'<pre><code class="'+this.options.langPrefix+se(q,!0)+'">'+(J?V:se(V,!0))+`</code></pre>
|
|
`:"<pre><code>"+(J?V:se(V,!0))+`</code></pre>
|
|
`},ie.blockquote=function(V){return`<blockquote>
|
|
`+V+`</blockquote>
|
|
`},ie.html=function(V){return V},ie.heading=function(V,Y,J,q){return this.options.headerIds?"<h"+Y+' id="'+this.options.headerPrefix+q.slug(J)+'">'+V+"</h"+Y+`>
|
|
`:"<h"+Y+">"+V+"</h"+Y+`>
|
|
`},ie.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ie.list=function(V,Y,J){var q=Y?"ol":"ul",fe=Y&&J!==1?' start="'+J+'"':"";return"<"+q+fe+`>
|
|
`+V+"</"+q+`>
|
|
`},ie.listitem=function(V){return"<li>"+V+`</li>
|
|
`},ie.checkbox=function(V){return"<input "+(V?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ie.paragraph=function(V){return"<p>"+V+`</p>
|
|
`},ie.table=function(V,Y){return Y&&(Y="<tbody>"+Y+"</tbody>"),`<table>
|
|
<thead>
|
|
`+V+`</thead>
|
|
`+Y+`</table>
|
|
`},ie.tablerow=function(V){return`<tr>
|
|
`+V+`</tr>
|
|
`},ie.tablecell=function(V,Y){var J=Y.header?"th":"td",q=Y.align?"<"+J+' align="'+Y.align+'">':"<"+J+">";return q+V+"</"+J+`>
|
|
`},ie.strong=function(V){return"<strong>"+V+"</strong>"},ie.em=function(V){return"<em>"+V+"</em>"},ie.codespan=function(V){return"<code>"+V+"</code>"},ie.br=function(){return this.options.xhtml?"<br/>":"<br>"},ie.del=function(V){return"<del>"+V+"</del>"},ie.link=function(V,Y,J){if(V=X(this.options.sanitize,this.options.baseUrl,V),V===null)return J;var q='<a href="'+se(V)+'"';return Y&&(q+=' title="'+Y+'"'),q+=">"+J+"</a>",q},ie.image=function(V,Y,J){if(V=X(this.options.sanitize,this.options.baseUrl,V),V===null)return J;var q='<img src="'+V+'" alt="'+J+'"';return Y&&(q+=' title="'+Y+'"'),q+=this.options.xhtml?"/>":">",q},ie.text=function(V){return V},ae}(),he=function(){function ae(){}var ie=ae.prototype;return ie.strong=function(V){return V},ie.em=function(V){return V},ie.codespan=function(V){return V},ie.del=function(V){return V},ie.html=function(V){return V},ie.text=function(V){return V},ie.link=function(V,Y,J){return""+J},ie.image=function(V,Y,J){return""+J},ie.br=function(){return""},ae}(),xe=function(){function ae(){this.seen={}}var ie=ae.prototype;return ie.slug=function(V){var Y=V.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Y)){var J=Y;do this.seen[J]++,Y=J+"-"+this.seen[J];while(this.seen.hasOwnProperty(Y))}return this.seen[Y]=0,Y},ae}(),we=j.defaults,Me=P.unescape,De=function(){function ae(ne){this.options=ne||we,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new he,this.slugger=new xe}ae.parse=function(V,Y){var J=new ae(Y);return J.parse(V)};var ie=ae.prototype;return ie.parse=function(V,Y){Y===void 0&&(Y=!0);var J="",q,fe,ge,Re,We,Xe,He,$e,Ze,ze,it,rt,dt,ut,qe,vt,At,Ve,Rt=V.length;for(q=0;q<Rt;q++){ze=V[q];switch(ze.type){case"space":continue;case"hr":{J+=this.renderer.hr();continue}case"heading":{J+=this.renderer.heading(this.parseInline(ze.tokens),ze.depth,Me(this.parseInline(ze.tokens,this.textRenderer)),this.slugger);continue}case"code":{J+=this.renderer.code(ze.text,ze.lang,ze.escaped);continue}case"table":{for($e="",He="",Re=ze.header.length,fe=0;fe<Re;fe++)He+=this.renderer.tablecell(this.parseInline(ze.tokens.header[fe]),{header:!0,align:ze.align[fe]});for($e+=this.renderer.tablerow(He),Ze="",Re=ze.cells.length,fe=0;fe<Re;fe++){for(Xe=ze.tokens.cells[fe],He="",We=Xe.length,ge=0;ge<We;ge++)He+=this.renderer.tablecell(this.parseInline(Xe[ge]),{header:!1,align:ze.align[ge]});Ze+=this.renderer.tablerow(He)}J+=this.renderer.table($e,Ze);continue}case"blockquote":{Ze=this.parse(ze.tokens),J+=this.renderer.blockquote(Ze);continue}case"list":{for(it=ze.ordered,rt=ze.start,dt=ze.loose,Re=ze.items.length,Ze="",fe=0;fe<Re;fe++)qe=ze.items[fe],vt=qe.checked,At=qe.task,ut="",qe.task&&(Ve=this.renderer.checkbox(vt),dt?qe.tokens.length>0&&qe.tokens[0].type==="text"?(qe.tokens[0].text=Ve+" "+qe.tokens[0].text,qe.tokens[0].tokens&&qe.tokens[0].tokens.length>0&&qe.tokens[0].tokens[0].type==="text"&&(qe.tokens[0].tokens[0].text=Ve+" "+qe.tokens[0].tokens[0].text)):qe.tokens.unshift({type:"text",text:Ve}):ut+=Ve),ut+=this.parse(qe.tokens,dt),Ze+=this.renderer.listitem(ut,At,vt);J+=this.renderer.list(Ze,it,rt);continue}case"html":{J+=this.renderer.html(ze.text);continue}case"paragraph":{J+=this.renderer.paragraph(this.parseInline(ze.tokens));continue}case"text":{for(Ze=ze.tokens?this.parseInline(ze.tokens):ze.text;q+1<Rt&&V[q+1].type==="text";)ze=V[++q],Ze+=`
|
|
`+(ze.tokens?this.parseInline(ze.tokens):ze.text);J+=Y?this.renderer.paragraph(Ze):Ze;continue}default:{var Je='Token with "'+ze.type+'" type was not found.';if(this.options.silent){console.error(Je);return}else throw new Error(Je)}}}return J},ie.parseInline=function(V,Y){Y=Y||this.renderer;var J="",q,fe,ge=V.length;for(q=0;q<ge;q++){fe=V[q];switch(fe.type){case"escape":{J+=Y.text(fe.text);break}case"html":{J+=Y.html(fe.text);break}case"link":{J+=Y.link(fe.href,fe.title,this.parseInline(fe.tokens,Y));break}case"image":{J+=Y.image(fe.href,fe.title,fe.text);break}case"strong":{J+=Y.strong(this.parseInline(fe.tokens,Y));break}case"em":{J+=Y.em(this.parseInline(fe.tokens,Y));break}case"codespan":{J+=Y.codespan(fe.text);break}case"br":{J+=Y.br();break}case"del":{J+=Y.del(this.parseInline(fe.tokens,Y));break}case"text":{J+=Y.text(fe.text);break}default:{var Re='Token with "'+fe.type+'" type was not found.';if(this.options.silent){console.error(Re);return}else throw new Error(Re)}}}return J},ae}(),ke=P.merge,Ne=P.checkSanitizeDeprecation,Ue=P.escape,Le=j.getDefaults,Fe=j.changeDefaults,je=j.defaults;function ve(ae,ie,ne){if(typeof ae=="undefined"||ae===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ae!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ae)+", string expected");if(typeof ie=="function"&&(ne=ie,ie=null),ie=ke({},ve.defaults,ie||{}),Ne(ie),ne){var V=ie.highlight,Y;try{Y=Ee.lex(ae,ie)}catch(ge){return ne(ge)}var J=function(Re){var We;if(!Re)try{We=De.parse(Y,ie)}catch(Xe){Re=Xe}return ie.highlight=V,Re?ne(Re):ne(null,We)};if(!V||V.length<3)return J();if(delete ie.highlight,!Y.length)return J();var q=0;ve.walkTokens(Y,function(ge){ge.type==="code"&&(q++,setTimeout(function(){V(ge.text,ge.lang,function(Re,We){if(Re)return J(Re);We!=null&&We!==ge.text&&(ge.text=We,ge.escaped=!0),q--,q===0&&J()})},0))}),q===0&&J();return}try{var fe=Ee.lex(ae,ie);return ie.walkTokens&&ve.walkTokens(fe,ie.walkTokens),De.parse(fe,ie)}catch(ge){if(ge.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ie.silent)return"<p>An error occurred:</p><pre>"+Ue(ge.message+"",!0)+"</pre>";throw ge}}ve.options=ve.setOptions=function(ae){return ke(ve.defaults,ae),Fe(ve.defaults),ve},ve.getDefaults=Le,ve.defaults=je,ve.use=function(ae){var ie=ke({},ae);if(ae.renderer&&function(){var V=ve.defaults.renderer||new ue,Y=function(fe){var ge=V[fe];V[fe]=function(){for(var Re=arguments.length,We=new Array(Re),Xe=0;Xe<Re;Xe++)We[Xe]=arguments[Xe];var He=ae.renderer[fe].apply(V,We);return He===!1&&(He=ge.apply(V,We)),He}};for(var J in ae.renderer)Y(J);ie.renderer=V}(),ae.tokenizer&&function(){var V=ve.defaults.tokenizer||new le,Y=function(fe){var ge=V[fe];V[fe]=function(){for(var Re=arguments.length,We=new Array(Re),Xe=0;Xe<Re;Xe++)We[Xe]=arguments[Xe];var He=ae.tokenizer[fe].apply(V,We);return He===!1&&(He=ge.apply(V,We)),He}};for(var J in ae.tokenizer)Y(J);ie.tokenizer=V}(),ae.walkTokens){var ne=ve.defaults.walkTokens;ie.walkTokens=function(V){ae.walkTokens(V),ne&&ne(V)}}ve.setOptions(ie)},ve.walkTokens=function(ae,ie){for(var ne=L(ae),V;!(V=ne()).done;){var Y=V.value;ie(Y);switch(Y.type){case"table":{for(var J=L(Y.tokens.header),q;!(q=J()).done;){var fe=q.value;ve.walkTokens(fe,ie)}for(var ge=L(Y.tokens.cells),Re;!(Re=ge()).done;)for(var We=Re.value,Xe=L(We),He;!(He=Xe()).done;){var $e=He.value;ve.walkTokens($e,ie)}break}case"list":{ve.walkTokens(Y.items,ie);break}default:Y.tokens&&ve.walkTokens(Y.tokens,ie)}}},ve.Parser=De,ve.parser=De.parse,ve.Renderer=ue,ve.TextRenderer=he,ve.Lexer=Ee,ve.lexer=Ee.lex,ve.Tokenizer=le,ve.Slugger=xe,ve.parse=ve;var be=ve;return be})},EjUQ:function(Ge,oe,K){"use strict";K.r(oe);var ee=K("DjyN"),W=K("NUBc"),R=K("cWXX"),F=K("/ezw"),L=K("/zsF"),D=K("PArb"),j=K("14J3"),U=K("BMrR"),e=K("jCWc"),A=K("kPKH"),d=K("k1fw"),f=K("tJVT"),o=K("PpiC"),n=K("B9cy"),a=K("Ol7k"),h=K("lUTK"),s=K("BvKs"),r=K("q1tI"),t=K.n(r),i=K("9kvl"),b=K("wd/R"),m=K.n(b),_=K("m3rI"),x=K("BdwD"),E=K("2qtc"),y=K("kLXV"),c=K("5NDa"),u=K("5rEg"),l=K("jrin"),v=K("miYZ"),g=K("tsqr"),w=K("9og8"),O=K("y8nQ"),I=K("Vl3Y"),S=K("WmNS"),P=K.n(S),B=K("5WQS"),C=K("Ty5D"),H=K("NDqe"),z=K.n(H),Z=function(Oe){var Ce,Ae=Oe.messages,Pe=Oe.loading,ye=Oe.user,Ee=Oe.dispatch,Ie=Object(C.i)(),X=Object(C.h)(),se=Ae.actionTabs,ue=I.a.useForm(),he=Object(f.a)(ue,1),xe=he[0],we=Ae.recentContacts,Me=Object(r.useState)(""),De=Object(f.a)(Me,2),ke=De[0],Ne=De[1],Ue=Object(r.useState)([]),Le=Object(f.a)(Ue,2),Fe=Le[0],je=Le[1],ve=Object(r.useState)(!1),be=Object(f.a)(ve,2),ae=be[0],ie=be[1],ne=Object(r.useState)(),V=Object(f.a)(ne,2),Y=V[0],J=V[1];Object(r.useEffect)(function(){Ae.actionTabs.key==="\u5199\u79C1\u4FE1"&&q()},[Ae.actionTabs.key]);var q=function(){var ge=Object(w.a)(P.a.mark(function Re(){var We,Xe;return P.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return $e.next=2,Ee({type:"messages/getRecentContacts",payload:{id:ye==null||((We=ye.userInfo)===null||We===void 0)?void 0:We.user_id,keyword:ke}});case 2:Xe=$e.sent,je(Object(d.a)({},Xe));case 4:case"end":return $e.stop()}},Re)}));return function(){return ge.apply(this,arguments)}}(),fe=function(){var ge=Object(w.a)(P.a.mark(function Re(){var We;return P.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:if(!(ke!=="")){He.next=5;break}return He.next=3,Ee({type:"messages/getUsersForPrivateMessages",payload:{keyword:ke}});case 3:We=He.sent,je(Object(d.a)({},We));case 5:case"end":return He.stop()}},Re)}));return function(){return ge.apply(this,arguments)}}();return Object(r.useEffect)(function(){fe()},[ke]),t.a.createElement(y.a,{centered:!0,title:"\u5199\u79C1\u4FE1",visible:Ae.actionTabs.key==="\u5199\u79C1\u4FE1",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{height:320},onOk:Object(w.a)(P.a.mark(function ge(){var Re,We,Xe,He,$e,Ze;return P.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return it.next=2,xe.validateFields();case 2:return We=xe.getFieldValue(),Xe="/api/course_modules/".concat(Ie.categoryId,"/add_second_category.json"),it.next=6,Object(B.g)({content:We.content,target_id:Y,userId:ye==null||((Re=ye.userInfo)===null||Re===void 0)?void 0:Re.user_id});case 6:He=it.sent,He.status===0&&(g.b.success("\u6DFB\u52A0\u6210\u529F"),Ee({type:"messages/setActionTabs",payload:{}}),i.d.push("/messages/".concat(ye==null||(($e=ye.userInfo)===null||$e===void 0)?void 0:$e.login,"/message_detail?target_ids=").concat(He==null||((Ze=He.private_message)===null||Ze===void 0)?void 0:Ze.receiver_id)));case 8:case"end":return it.stop()}},ge)})),onCancel:function(){Ee({type:"messages/setActionTabs",payload:{}})}},t.a.createElement(I.a,{form:xe,initialValues:Object(l.a)({},"name","")},t.a.createElement(I.a.Item,{name:"users",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u53D1\u9001\u5BF9\u8C61"}]},t.a.createElement(u.a.Search,{onFocus:function(){return ie(!0)},onSearch:function(Re){Ne(Re)},placeholder:"\u53D1\u9001\u7ED9..."})),ae&&t.a.createElement(F.a,{loading:Pe["messages/getUsersForPrivateMessages"]},t.a.createElement("aside",{className:z.a.searchWrp,style:{maxHeight:260,overflow:"auto"}},t.a.createElement("p",{className:"c-light-black mt10"},ke===""?"\u6700\u8FD1\u8054\u7CFB\u4EBA":"\u641C\u7D22\u7ED3\u679C"),Fe==null||((Ce=Fe.users)===null||Ce===void 0)?void 0:Ce.map(function(ge,Re){return t.a.createElement(U.a,{key:Re,align:"middle",className:"mt15 current",onClick:function(){J(ge.id),xe.setFieldsValue({users:ge.name}),ie(!1)}},t.a.createElement(A.a,{flex:"58px"},t.a.createElement("img",{style:{width:48,borderRadius:48},src:_.a.IMG_SERVER+"/images/"+(ge==null?void 0:ge.image_url),alt:""})),t.a.createElement(A.a,null,ge.name))}))),t.a.createElement(I.a.Item,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u53D1\u9001\u5185\u5BB9"}],className:ae&&"hide",name:"content"},t.a.createElement(u.a.TextArea,{rows:10,maxLength:200}))))},Q=Object(i.a)(function(_e){var Oe=_e.messages,Ce=_e.loading,Ae=_e.user;return{messages:Oe,user:Ae,loading:Ce.effects}})(Z),pe=K("9Bee"),le=K("30zm"),de=s.a.SubMenu,ce=a.a.Sider,me=a.a.Content,te=function(Oe){var Ce,Ae,Pe=Oe.messages,ye=Oe.globalSetting,Ee=Oe.loading,Ie=Oe.user,X=Oe.dispatch,se=Object(o.a)(Oe,["messages","globalSetting","loading","user","dispatch"]),ue=se.match.params,he=Ie.userInfo,xe=Pe.tidingsList,we=Pe.privateMessage,Me=Object(r.useState)({per_page:10,page:1}),De=Object(f.a)(Me,2),ke=De[0],Ne=De[1];Object(r.useEffect)(function(){ke.page=1,Ue()},[ue.userId]);var Ue=function(){X({type:"messages/getPrivateMessages",payload:Object(d.a)(Object(d.a)({},ke),ue)})},Le=function(be){var ae,ie;se.history.push("/messages/".concat(Ie==null||((ae=Ie.userInfo)===null||ae===void 0)?void 0:ae.login,"/message_detail?target_ids=").concat(be==null||((ie=be.target)===null||ie===void 0)?void 0:ie.id))},Fe=function(be){var ae;se.history.push("/users/".concat(be==null||((ae=be.target)===null||ae===void 0)?void 0:ae.login))},je=Object(r.useMemo)(function(){return(he==null?void 0:he.is_teacher)&&(he==null?void 0:he.professional_certification)},[he]);return t.a.createElement("section",{className:z.a.bg},t.a.createElement("div",{className:z.a.warp},t.a.createElement(le.a,null),t.a.createElement("div",{className:z.a.rightWarp},t.a.createElement("aside",{className:z.a.topWarp},t.a.createElement("aside",{className:"pt30 pl30 pr30 font16"},t.a.createElement(U.a,null,t.a.createElement(A.a,{flex:"1"},"\u5168\u90E8\u79C1\u4FE1"),je&&t.a.createElement(A.a,null,t.a.createElement("span",{className:"c-blue current",onClick:function(){var be;X({type:"messages/setActionTabs",payload:{key:"\u5199\u79C1\u4FE1",bodyParams:Object(d.a)(Object(d.a)({},ke),{},{user_id:Ie==null||((be=Ie.userInfo)===null||be===void 0)?void 0:be.user_id})}})}},"\u5199\u79C1\u4FE1")))),t.a.createElement(D.a,null),t.a.createElement("aside",{className:z.a.list},t.a.createElement(F.a,{active:!0,avatar:{size:40},paragraph:{rows:5},loading:Ee["messages/getPrivateMessages"]},!(we!=null&&(Ce=we.private_messages)!==null&&Ce!==void 0&&Ce.length)&&t.a.createElement(x.a,null),we==null||((Ae=we.private_messages)===null||Ae===void 0)?void 0:Ae.map(function(ve,be){var ae,ie;return t.a.createElement("aside",null,t.a.createElement(U.a,null,t.a.createElement(A.a,{flex:"58px",onClick:function(){return Fe(ve)}},t.a.createElement("img",{src:_.a.IMG_SERVER+"/images/"+(ve==null||((ae=ve.target)===null||ae===void 0)?void 0:ae.image_url),alt:""})),t.a.createElement(A.a,{flex:1},t.a.createElement(U.a,null,t.a.createElement(A.a,{span:24,style:{marginTop:1}},t.a.createElement(U.a,null,t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{onClick:function(){return Fe(ve)}},ve==null||((ie=ve.target)===null||ie===void 0)?void 0:ie.name),t.a.createElement("span",{className:"ml15"},"\u4E0E\u4F60\u7684\u79C1\u4FE1"),t.a.createElement("span",{className:"c-light-black mr15"},"[",ve==null?void 0:ve.message_count,"\u6761]"),t.a.createElement("span",{className:"ml15 c-light-black"},m()(ve.send_time).fromNow())),t.a.createElement(A.a,null,(ve==null?void 0:ve.unread)&&t.a.createElement("span",{className:z.a.newlight})))),t.a.createElement(A.a,{span:24,onClick:function(){return Le(ve)}},t.a.createElement("div",{className:"mt15"},t.a.createElement(pe.a,{value:ve.content||""})))))))})))),t.a.createElement("aside",{className:"tc",style:{margin:"20px 30px"}},!Ee["messages/getTidings"]&&t.a.createElement(W.a,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:function(be){ke.page=be,Ne(Object(d.a)({},ke)),Ue()},current:ke.page||1,total:we==null?void 0:we.count}))),t.a.createElement(Q,null)))},$=oe.default=Object(i.a)(function(_e){var Oe=_e.messages,Ce=_e.loading,Ae=_e.user,Pe=_e.globalSetting;return{messages:Oe,globalSetting:Pe,user:Ae,loading:Ce.effects}})(te)},FOrL:function(Ge,oe,K){Ge.exports=K.p+"static/nodata.a6b3f948.png"},FWmy:function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return ee});function ee(W,R){if(!W)throw new Error(R?`Assertion failed (${R})`:"Assertion Failed")}},JYp7:function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return ee});var ee;(function(W){function R(i){return i&&typeof i=="object"&&typeof i[Symbol.iterator]=="function"}W.is=R;const F=Object.freeze([]);function L(){return F}W.empty=L;function*D(i){yield i}W.single=D;function j(i){return i||F}W.from=j;function U(i){return!i||i[Symbol.iterator]().next().done===!0}W.isEmpty=U;function e(i){return i[Symbol.iterator]().next().value}W.first=e;function A(i,b){for(const m of i)if(b(m))return!0;return!1}W.some=A;function d(i,b){for(const m of i)if(b(m))return m;return}W.find=d;function*f(i,b){for(const m of i)b(m)&&(yield m)}W.filter=f;function*o(i,b){let m=0;for(const _ of i)yield b(_,m++)}W.map=o;function*n(...i){for(const b of i)for(const m of b)yield m}W.concat=n;function*a(i){for(const b of i)for(const m of b)yield m}W.concatNested=a;function h(i,b,m){let _=m;for(const x of i)_=b(_,x);return _}W.reduce=h;function*s(i,b,m=i.length){for(b<0&&(b+=i.length),m<0?m+=i.length:m>i.length&&(m=i.length);b<m;b++)yield i[b]}W.slice=s;function r(i,b=Number.POSITIVE_INFINITY){const m=[];if(b===0)return[m,i];const _=i[Symbol.iterator]();for(let x=0;x<b;x++){const E=_.next();if(E.done)return[m,W.empty()];m.push(E.value)}return[m,{[Symbol.iterator](){return _}}]}W.consume=r;function t(i,b,m=(_,x)=>_===x){const _=i[Symbol.iterator](),x=b[Symbol.iterator]();for(;;){const E=_.next(),y=x.next();if(E.done!==y.done)return!1;if(E.done)return!0;if(!m(E.value,y.value))return!1}}W.equals=t})(ee||(ee={}))},LdHM:function(Ge,oe,K){"use strict";K.d(oe,"b",function(){return i}),K.d(oe,"a",function(){return m});var ee=K("1OyB"),W=K("vuIU"),R=K("Ji7U"),F=K("LK+K"),L=K("q1tI"),D=K("rePB"),j=K("Ff2n"),U=K("ODXe"),e=K("4IlW"),A=K("bX4T"),d=K("YrtM"),f=K("TSYQ"),o=K.n(f),n=K("+nKL"),a=K("8OUc"),h=function(H,z){var Z=H.prefixCls,Q=H.id,pe=H.flattenOptions,le=H.childrenAsData,de=H.values,ce=H.searchValue,me=H.multiple,te=H.defaultActiveFirstOption,$=H.height,_e=H.itemHeight,Oe=H.notFoundContent,Ce=H.open,Ae=H.menuItemSelectedIcon,Pe=H.virtual,ye=H.onSelect,Ee=H.onToggleOpen,Ie=H.onActiveValue,X=H.onScroll,se=H.onMouseEnter,ue="".concat(Z,"-item"),he=Object(d.a)(function(){return pe},[Ce,pe],function(be,ae){return ae[0]&&be[1]!==ae[1]}),xe=L.useRef(null),we=function(ae){ae.preventDefault()},Me=function(ae){xe.current&&xe.current.scrollTo({index:ae})},De=function(ae){for(var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ne=he.length,V=0;V<ne;V+=1){var Y=(ae+V*ie+ne)%ne,J=he[Y],q=J.group,fe=J.data;if(!q&&!fe.disabled)return Y}return-1},ke=L.useState(function(){return De(0)}),Ne=Object(U.a)(ke,2),Ue=Ne[0],Le=Ne[1],Fe=function(ae){Le(ae);var ie=he[ae];if(!ie){Ie(null,-1);return}Ie(ie.data.value,ae)};L.useEffect(function(){Fe(te!==!1?De(0):-1)},[he.length,ce]),L.useEffect(function(){var be=setTimeout(function(){if(!me&&Ce&&de.size===1){var ae=Array.from(de)[0],ie=he.findIndex(function(ne){var V=ne.data;return V.value===ae});Fe(ie),Me(ie)}});return function(){return clearTimeout(be)}},[Ce]);var je=function(ae){ae!==void 0&&ye(ae,{selected:!de.has(ae)}),me||Ee(!1)};if(L.useImperativeHandle(z,function(){return{onKeyDown:function(ae){var ie=ae.which;switch(ie){case e.a.UP:case e.a.DOWN:{var ne=0;if(ie===e.a.UP?ne=-1:ie===e.a.DOWN&&(ne=1),ne!==0){var V=De(Ue+ne,ne);Me(V),Fe(V)}break}case e.a.ENTER:{var Y=he[Ue];Y&&!Y.data.disabled?je(Y.data.value):je(void 0),Ce&&ae.preventDefault();break}case e.a.ESC:Ee(!1)}},onKeyUp:function(){},scrollTo:function(ae){Me(ae)}}}),he.length===0)return L.createElement("div",{role:"listbox",id:"".concat(Q,"_list"),className:"".concat(ue,"-empty"),onMouseDown:we},Oe);function ve(be){var ae=he[be];if(!ae)return null;var ie=ae.data||{},ne=ie.value,V=ie.label,Y=ie.children,J=Object(A.a)(ie,!0),q=le?Y:V;return ae?L.createElement("div",Object.assign({"aria-label":typeof q=="string"?q:null},J,{key:be,role:"option",id:"".concat(Q,"_list_").concat(be),"aria-selected":de.has(ne)}),ne):null}return L.createElement(L.Fragment,null,L.createElement("div",{role:"listbox",id:"".concat(Q,"_list"),style:{height:0,width:0,overflow:"hidden"}},ve(Ue-1),ve(Ue),ve(Ue+1)),L.createElement(n.a,{itemKey:"key",ref:xe,data:he,height:$,itemHeight:_e,fullHeight:!1,onMouseDown:we,onScroll:X,virtual:Pe,onMouseEnter:se},function(be,ae){var ie,ne=be.group,V=be.groupOption,Y=be.data,J=Y.label,q=Y.key;if(ne)return L.createElement("div",{className:o()(ue,"".concat(ue,"-group"))},J!==void 0?J:q);var fe=Y.disabled,ge=Y.value,Re=Y.title,We=Y.children,Xe=Y.style,He=Y.className,$e=Object(j.a)(Y,["disabled","value","title","children","style","className"]),Ze=de.has(ge),ze="".concat(ue,"-option"),it=o()(ue,ze,He,(ie={},Object(D.a)(ie,"".concat(ze,"-grouped"),V),Object(D.a)(ie,"".concat(ze,"-active"),Ue===ae&&!fe),Object(D.a)(ie,"".concat(ze,"-disabled"),fe),Object(D.a)(ie,"".concat(ze,"-selected"),Ze),ie)),rt=le?We:J,dt=!Ae||typeof Ae=="function"||Ze;return L.createElement("div",Object.assign({},$e,{"aria-selected":Ze,className:it,title:Re,onMouseMove:function(){if(Ue===ae||fe)return;Fe(ae)},onClick:function(){fe||je(ge)},style:Xe}),L.createElement("div",{className:"".concat(ze,"-content")},rt||ge),L.isValidElement(Ae)||Ze,dt&&L.createElement(a.a,{className:"".concat(ue,"-option-state"),customizeIcon:Ae,customizeIconProps:{isSelected:Ze}},Ze?"\u2713":null))}))},s=L.forwardRef(h);s.displayName="OptionList";var r=s,t=function(){return null};t.isSelectOption=!0;var i=t,b=function(){return null};b.isSelectOptGroup=!0;var m=b,_=K("VTBJ"),x=K("Zm9Q");function E(C){var H=C.key,z=C.props,Z=z.children,Q=z.value,pe=Object(j.a)(z,["children","value"]);return Object(_.a)({key:H,value:Q!==void 0?Q:H,children:Z},pe)}function y(C){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(x.a)(C).map(function(z,Z){if(!L.isValidElement(z)||!z.type)return null;var Q=z.type.isSelectOptGroup,pe=z.key,le=z.props,de=le.children,ce=Object(j.a)(le,["children"]);return H||!Q?E(z):Object(_.a)(Object(_.a)({key:"__RC_SELECT_GRP__".concat(pe===null?Z:pe,"__"),label:pe},ce),{},{options:y(de)})}).filter(function(z){return z})}var c=K("2Qr1"),u=K("qNPg"),l=K("U8pU"),v=K("Kwbf"),g=K("WKfj");function w(C){var H=C.mode,z=C.options,Z=C.children,Q=C.backfill,pe=C.allowClear,le=C.placeholder,de=C.getInputElement,ce=C.showSearch,me=C.onSearch,te=C.defaultOpen,$=C.autoFocus,_e=C.labelInValue,Oe=C.value,Ce=C.inputValue,Ae=C.optionLabelProp,Pe=H==="multiple"||H==="tags",ye=ce!==void 0?ce:Pe||H==="combobox",Ee=z||y(Z);if(Object(v.a)(H!=="tags"||Ee.every(function(ue){return!ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var Ie=Ee.some(function(ue){return ue.options?ue.options.some(function(he){return typeof("value"in he?he.value:he.key)=="number"}):typeof("value"in ue?ue.value:ue.key)=="number"});Object(v.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(H!=="combobox"||!Ae,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(H==="combobox"||!Q,"`backfill` only works with `combobox` mode."),Object(v.a)(H==="combobox"||!de,"`getInputElement` only work with `combobox` mode."),Object(v.b)(H!=="combobox"||!de||!pe||!le,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),me&&!ye&&H!=="combobox"&&H!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!te||$,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Oe!=null){var X=Object(g.d)(Oe);Object(v.a)(!_e||X.every(function(ue){return Object(l.a)(ue)==="object"&&("key"in ue||"value"in ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!Pe||Array.isArray(Oe),"`value` should be array when `mode` is `multiple` or `tags`")}if(Z){var se=null;Object(x.a)(Z).some(function(ue){if(!L.isValidElement(ue)||!ue.type)return!1;var he=ue.type;if(he.isSelectOption)return!1;if(he.isSelectOptGroup){var xe=Object(x.a)(ue.props.children).every(function(we){return!L.isValidElement(we)||!ue.type||we.type.isSelectOption?!0:(se=we.type,!1)});return!xe}return se=he,!0}),se&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(se.displayName||se.name||se,"`.")),Object(v.a)(Ce===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var O=w,I=Object(u.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:y,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:O,fillOptionsWithMissingValue:c.a}),S=function(C){Object(R.a)(z,C);var H=Object(F.a)(z);function z(){var Z;return Object(ee.a)(this,z),Z=H.apply(this,arguments),Z.selectRef=L.createRef(),Z.focus=function(){Z.selectRef.current.focus()},Z.blur=function(){Z.selectRef.current.blur()},Z}return Object(W.a)(z,[{key:"render",value:function(){return L.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),z}(L.Component);S.Option=i,S.OptGroup=m;var P=S,B=oe.c=P},MI8n:function(Ge,oe,K){"use strict";K.d(oe,"c",function(){return L}),K.d(oe,"b",function(){return e}),K.d(oe,"e",function(){return A}),K.d(oe,"a",function(){return d}),K.d(oe,"d",function(){return f}),K.d(oe,"f",function(){return o});var ee=K("/cxE"),W=K("pmY6"),R=K("24hK"),F=K("5Y4S"),L;(function(n){n.None=()=>W.a.None;function a(w){return(O,I=null,S)=>{let P=!1,B;return B=w(C=>P?void 0:(B?B.dispose():P=!0,O.call(I,C)),null,S),P&&B.dispose(),B}}n.once=a;function h(w,O){return m((I,S=null,P)=>w(B=>I.call(S,O(B)),null,P))}n.map=h;function s(w,O){return m((I,S=null,P)=>w(B=>{O(B),I.call(S,B)},null,P))}n.forEach=s;function r(w,O){return m((I,S=null,P)=>w(B=>O(B)&&I.call(S,B),null,P))}n.filter=r;function t(w){return w}n.signal=t;function i(...w){return(O,I=null,S)=>Object(W.e)(...w.map(P=>P(B=>O.call(I,B),null,S)))}n.any=i;function b(w,O,I){let S=I;return h(w,P=>(S=O(S,P),S))}n.reduce=b;function m(w){let O;const I=new e({onFirstListenerAdd(){O=w(I.fire,I)},onLastListenerRemove(){O.dispose()}});return I.event}function _(w,O,I=100,S=!1,P){let B,C,H,z=0;const Z=new e({leakWarningThreshold:P,onFirstListenerAdd(){B=w(Q=>{z++,C=O(C,Q),S&&!H&&(Z.fire(C),C=void 0),clearTimeout(H),H=setTimeout(()=>{const pe=C;C=void 0,H=void 0,(!S||z>1)&&Z.fire(pe),z=0},I)})},onLastListenerRemove(){B.dispose()}});return Z.event}n.debounce=_;function x(w,O=(I,S)=>I===S){let I=!0,S;return r(w,P=>{const B=I||!O(P,S);return I=!1,S=P,B})}n.latch=x;function E(w,O){return[n.filter(w,O),n.filter(w,I=>!O(I))]}n.split=E;function y(w,O=!1,I=[]){let S=I.slice(),P=w(H=>{S?S.push(H):C.fire(H)});const B=()=>{S&&S.forEach(H=>C.fire(H)),S=null},C=new e({onFirstListenerAdd(){P||(P=w(H=>C.fire(H)))},onFirstListenerDidAdd(){S&&(O?setTimeout(B):B())},onLastListenerRemove(){P&&P.dispose(),P=null}});return C.event}n.buffer=y;class c{constructor(w){this.event=w}map(w){return new c(h(this.event,w))}forEach(w){return new c(s(this.event,w))}filter(w){return new c(r(this.event,w))}reduce(w,O){return new c(b(this.event,w,O))}latch(){return new c(x(this.event))}debounce(w,O=100,I=!1,S){return new c(_(this.event,w,O,I,S))}on(w,O,I){return this.event(w,O,I)}once(w,O,I){return a(this.event)(w,O,I)}}function u(w){return new c(w)}n.chain=u;function l(w,O,I=S=>S){const S=(...H)=>C.fire(I(...H)),P=()=>w.on(O,S),B=()=>w.removeListener(O,S),C=new e({onFirstListenerAdd:P,onLastListenerRemove:B});return C.event}n.fromNodeEventEmitter=l;function v(w,O,I=S=>S){const S=(...H)=>C.fire(I(...H)),P=()=>w.addEventListener(O,S),B=()=>w.removeEventListener(O,S),C=new e({onFirstListenerAdd:P,onLastListenerRemove:B});return C.event}n.fromDOMEventEmitter=v;function g(w){return new Promise(O=>a(w)(O))}n.toPromise=g})(L||(L={}));class D{constructor(n){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${n}_${D._idPool++}`}start(n){this._stopWatch=new F.a(!0),this._listenerCount=n}stop(){if(this._stopWatch){const n=this._stopWatch.elapsed();this._elapsedOverall+=n,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${n.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}D._idPool=0;let j=-1;class U{constructor(n,a=Math.random().toString(18).slice(2,5)){this.customThreshold=n,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(n){let a=j;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||n<a)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=a*.5;let r,t=0;for(const[i,b]of this._stacks)(!r||t<b)&&(r=i,t=b);console.warn(`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${t}):`),console.warn(r)}return()=>{const r=this._stacks.get(h)||0;this._stacks.set(h,r-1)}}}class e{constructor(n){var a;this._disposed=!1,this._options=n,this._leakageMon=j>0?new U(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new D(this._options._profName):void 0}get event(){return this._event||(this._event=(n,a,h)=>{var s;this._listeners||(this._listeners=new R.a);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const t=this._listeners.push(a?[n,a]:n);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,n,a);const i=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),b=Object(W.i)(()=>{if(i&&i(),!this._disposed&&(t(),this._options&&this._options.onLastListenerRemove)){const m=this._listeners&&!this._listeners.isEmpty();m||this._options.onLastListenerRemove(this)}});return h instanceof W.b?h.add(b):Array.isArray(h)&&h.push(b),b}),this._event}fire(n){var a,h;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new R.a);for(let s of this._listeners)this._deliveryQueue.push([s,n]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,r]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,r):s[0].call(s[1],r)}catch(t){Object(ee.f)(t)}}(h=this._perfMon)===null||h===void 0||h.stop()}}dispose(){var n,a,h,s,r;this._disposed||(this._disposed=!0,(n=this._listeners)===null||n===void 0||n.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(s=(h=this._options)===null||h===void 0?void 0:h.onLastListenerRemove)===null||s===void 0||s.call(h),(r=this._leakageMon)===null||r===void 0||r.dispose())}}class A extends e{constructor(n){super(n);this._isPaused=0,this._eventQueue=new R.a,this._mergeFn=n==null?void 0:n.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const n=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(n))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(n){this._listeners&&(this._isPaused!==0?this._eventQueue.push(n):super.fire(n))}}class d extends A{constructor(n){var a;super(n);this._delay=(a=n.delay)!==null&&a!==void 0?a:100}fire(n){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(n)}}class f{constructor(){this.buffers=[]}wrapEvent(n){return(a,h,s)=>n(r=>{const t=this.buffers[this.buffers.length-1];t?t.push(()=>a.call(h,r)):a.call(h,r)},void 0,s)}bufferEvents(n){const a=[];this.buffers.push(a);const h=n();return this.buffers.pop(),a.forEach(s=>s()),h}}class o{constructor(){this.listening=!1,this.inputEvent=L.None,this.inputEventListener=W.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(n){this.inputEvent=n,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=n(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Ge,oe,K){"use strict";(function(ee,W){K.d(oe,"b",function(){return h}),K.d(oe,"i",function(){return i}),K.d(oe,"f",function(){return b}),K.d(oe,"d",function(){return m}),K.d(oe,"g",function(){return _}),K.d(oe,"h",function(){return x}),K.d(oe,"c",function(){return E}),K.d(oe,"k",function(){return y}),K.d(oe,"j",function(){return c}),K.d(oe,"a",function(){return u}),K.d(oe,"e",function(){return g});var R;const F="en";let L=!1,D=!1,j=!1,U=!1,e=!1,A=!1,d=!1,f,o=F,n,a;const h=typeof self=="object"?self:typeof ee=="object"?ee:{};let s;typeof h.vscode!="undefined"&&typeof h.vscode.process!="undefined"?s=h.vscode.process:typeof W!="undefined"&&(s=W);const r=typeof((R=s==null?void 0:s.versions)===null||R===void 0?void 0:R.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!r)a=navigator.userAgent,L=a.indexOf("Windows")>=0,D=a.indexOf("Macintosh")>=0,d=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,j=a.indexOf("Linux")>=0,A=!0,f=navigator.language,o=f;else if(typeof s=="object"){L=s.platform==="win32",D=s.platform==="darwin",j=s.platform==="linux",U=j&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,f=F,o=F;const w=s.env.VSCODE_NLS_CONFIG;if(w)try{const O=JSON.parse(w),I=O.availableLanguages["*"];f=O.locale,o=I||F,n=O._translationsConfigFile}catch(O){}e=!0}else console.error("Unable to resolve platform.");let t=0;D?t=1:L?t=3:j&&(t=2);const i=L,b=D,m=j,_=e,x=A,E=d,y=a,c=function(){if(h.setImmediate)return h.setImmediate.bind(h);if(typeof h.postMessage=="function"&&!h.importScripts){let I=[];h.addEventListener("message",P=>{if(P.data&&P.data.vscodeSetImmediateId)for(let B=0,C=I.length;B<C;B++){const H=I[B];if(H.id===P.data.vscodeSetImmediateId){I.splice(B,1),H.callback();return}}});let S=0;return P=>{const B=++S;I.push({id:B,callback:P}),h.postMessage({vscodeSetImmediateId:B},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const O=Promise.resolve();return I=>O.then(I)}(),u=D||d?2:L?1:3;let l=!0,v=!1;function g(){if(!v){v=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2;const O=new Uint16Array(w.buffer);l=O[0]===(2<<8)+1}return l}}).call(this,K("IyRk"),K("Q2Ig"))},N0LK:function(Ge,oe,K){"use strict";K.d(oe,"C",function(){return ee}),K.d(oe,"v",function(){return R}),K.d(oe,"s",function(){return F}),K.d(oe,"t",function(){return L}),K.d(oe,"U",function(){return D}),K.d(oe,"J",function(){return j}),K.d(oe,"O",function(){return U}),K.d(oe,"p",function(){return e}),K.d(oe,"T",function(){return A}),K.d(oe,"q",function(){return d}),K.d(oe,"N",function(){return f}),K.d(oe,"M",function(){return o}),K.d(oe,"Q",function(){return n}),K.d(oe,"u",function(){return a}),K.d(oe,"x",function(){return h}),K.d(oe,"I",function(){return s}),K.d(oe,"f",function(){return r}),K.d(oe,"h",function(){return t}),K.d(oe,"g",function(){return i}),K.d(oe,"i",function(){return b}),K.d(oe,"G",function(){return m}),K.d(oe,"H",function(){return _}),K.d(oe,"r",function(){return x}),K.d(oe,"R",function(){return E}),K.d(oe,"d",function(){return y}),K.d(oe,"e",function(){return c}),K.d(oe,"E",function(){return u}),K.d(oe,"F",function(){return l}),K.d(oe,"j",function(){return v}),K.d(oe,"z",function(){return g}),K.d(oe,"K",function(){return O}),K.d(oe,"L",function(){return I}),K.d(oe,"m",function(){return P}),K.d(oe,"k",function(){return C}),K.d(oe,"A",function(){return z}),K.d(oe,"a",function(){return Z}),K.d(oe,"n",function(){return Q}),K.d(oe,"l",function(){return pe}),K.d(oe,"D",function(){return le}),K.d(oe,"B",function(){return de}),K.d(oe,"b",function(){return ce}),K.d(oe,"S",function(){return me}),K.d(oe,"o",function(){return te}),K.d(oe,"P",function(){return $}),K.d(oe,"w",function(){return _e}),K.d(oe,"c",function(){return Oe}),K.d(oe,"y",function(){return Pe});function ee(X){return!X||typeof X!="string"?!0:X.trim().length===0}const W=/{(\d+)}/g;function R(X,...se){return se.length===0?X:X.replace(W,function(ue,he){const xe=parseInt(he,10);return isNaN(xe)||xe<0||xe>=se.length?ue:se[xe]})}function F(X){return X.replace(/[<>&]/g,function(se){switch(se){case"<":return"<";case">":return">";case"&":return"&";default:return se}})}function L(X){return X.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function D(X,se=" "){const ue=j(X,se);return U(ue,se)}function j(X,se){if(!X||!se)return X;const ue=se.length;if(ue===0||X.length===0)return X;let he=0;for(;X.indexOf(se,he)===he;)he=he+ue;return X.substring(he)}function U(X,se){if(!X||!se)return X;const ue=se.length,he=X.length;if(ue===0||he===0)return X;let xe=he,we=-1;for(;!(we=X.lastIndexOf(se,xe-1),we===-1||we+ue!==xe);){if(we===0)return"";xe=we}return X.substring(0,xe)}function e(X){return X.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function A(X){return X.replace(/\*/g,"")}function d(X,se,ue={}){if(!X)throw new Error("Cannot create regex from empty string");se||(X=L(X)),ue.wholeWord&&(/\B/.test(X.charAt(0))||(X="\\b"+X),/\B/.test(X.charAt(X.length-1))||(X=X+"\\b"));let he="";return ue.global&&(he+="g"),ue.matchCase||(he+="i"),ue.multiline&&(he+="m"),ue.unicode&&(he+="u"),new RegExp(X,he)}function f(X){if(X.source==="^"||X.source==="^$"||X.source==="$"||X.source==="^\\s*$")return!1;const se=X.exec("");return!!(se&&X.lastIndex===0)}function o(X){return(X.global?"g":"")+(X.ignoreCase?"i":"")+(X.multiline?"m":"")+(X.unicode?"u":"")}function n(X){return X.split(/\r\n|\r|\n/)}function a(X){for(let se=0,ue=X.length;se<ue;se++){const he=X.charCodeAt(se);if(he!==32&&he!==9)return se}return-1}function h(X,se=0,ue=X.length){for(let he=se;he<ue;he++){const xe=X.charCodeAt(he);if(xe!==32&&xe!==9)return X.substring(se,he)}return X.substring(se,ue)}function s(X,se=X.length-1){for(let ue=se;ue>=0;ue--){const he=X.charCodeAt(ue);if(he!==32&&he!==9)return ue}return-1}function r(X,se){return X<se?-1:X>se?1:0}function t(X,se,ue=0,he=X.length,xe=0,we=se.length){for(;ue<he&&xe<we;ue++,xe++){let ke=X.charCodeAt(ue),Ne=se.charCodeAt(xe);if(ke<Ne)return-1;if(ke>Ne)return 1}const Me=he-ue,De=we-xe;return Me<De?-1:Me>De?1:0}function i(X,se){return b(X,se,0,X.length,0,se.length)}function b(X,se,ue=0,he=X.length,xe=0,we=se.length){for(;ue<he&&xe<we;ue++,xe++){let ke=X.charCodeAt(ue),Ne=se.charCodeAt(xe);if(ke===Ne)continue;if(ke>=128||Ne>=128)return t(X.toLowerCase(),se.toLowerCase(),ue,he,xe,we);m(ke)&&(ke-=32),m(Ne)&&(Ne-=32);const Ue=ke-Ne;if(Ue===0)continue;return Ue}const Me=he-ue,De=we-xe;return Me<De?-1:Me>De?1:0}function m(X){return X>=97&&X<=122}function _(X){return X>=65&&X<=90}function x(X,se){return X.length===se.length&&b(X,se)===0}function E(X,se){const ue=se.length;return se.length>X.length?!1:b(X,se,0,ue)===0}function y(X,se){let ue,he=Math.min(X.length,se.length);for(ue=0;ue<he;ue++)if(X.charCodeAt(ue)!==se.charCodeAt(ue))return ue;return he}function c(X,se){let ue,he=Math.min(X.length,se.length);const xe=X.length-1,we=se.length-1;for(ue=0;ue<he;ue++)if(X.charCodeAt(xe-ue)!==se.charCodeAt(we-ue))return ue;return he}function u(X){return 55296<=X&&X<=56319}function l(X){return 56320<=X&&X<=57343}function v(X,se){return(X-55296<<10)+(se-56320)+65536}function g(X,se,ue){const he=X.charCodeAt(ue);if(u(he)&&ue+1<se){const xe=X.charCodeAt(ue+1);if(l(xe))return v(he,xe)}return he}function w(X,se){const ue=X.charCodeAt(se-1);if(l(ue)&&se>1){const he=X.charCodeAt(se-2);if(u(he))return v(he,ue)}return ue}function O(X,se){const ue=Ce.getInstance(),he=se,xe=X.length,we=g(X,xe,se);se+=we>=65536?2:1;let Me=ue.getGraphemeBreakType(we);for(;se<xe;){const De=g(X,xe,se),ke=ue.getGraphemeBreakType(De);if(Oe(Me,ke))break;se+=De>=65536?2:1,Me=ke}return se-he}function I(X,se){const ue=Ce.getInstance(),he=se,xe=w(X,se);se-=xe>=65536?2:1;let we=ue.getGraphemeBreakType(xe);for(;se>0;){const Me=w(X,se),De=ue.getGraphemeBreakType(Me);if(Oe(De,we))break;se-=Me>=65536?2:1,we=De}return he-se}const S=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function P(X){return S.test(X)}const B=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function C(X){return B.test(X)}const H=/^[\t\n\r\x20-\x7E]*$/;function z(X){return H.test(X)}const Z=/[\u2028\u2029]/;function Q(X){return Z.test(X)}function pe(X){for(let se=0,ue=X.length;se<ue;se++)if(le(X.charCodeAt(se)))return!0;return!1}function le(X){return X=+X,X>=11904&&X<=55215||X>=63744&&X<=64255||X>=65281&&X<=65374}function de(X){return X>=127462&&X<=127487||X===8986||X===8987||X===9200||X===9203||X>=9728&&X<=10175||X===11088||X===11093||X>=127744&&X<=128591||X>=128640&&X<=128764||X>=128992&&X<=129003||X>=129280&&X<=129535||X>=129648&&X<=129750}const ce=String.fromCharCode(65279);function me(X){return!!(X&&X.length>0&&X.charCodeAt(0)===65279)}function te(X,se=!1){return X?(se&&(X=X.replace(/\\./g,"")),X.toLowerCase()!==X):!1}function $(X){const se=90-65+1;return X=X%(2*se),X<se?String.fromCharCode(97+X):String.fromCharCode(65+X-se)}function _e(X){const se=Ce.getInstance();return se.getGraphemeBreakType(X)}function Oe(X,se){return X===0?se!==5&&se!==7:X===2&&se===3?!1:X===4||X===2||X===3||(se===4||se===2||se===3)?!0:X===8&&(se===8||se===9||se===11||se===12)||((X===11||X===9)&&(se===9||se===10)||((X===12||X===10)&&se===10||(se===5||se===13||(se===7||(X===1||X===13&&se===14)))))?!1:!(X===6&&se===6)}class Ce{constructor(){this._data=Ae()}static getInstance(){return Ce._INSTANCE||(Ce._INSTANCE=new Ce),Ce._INSTANCE}getGraphemeBreakType(X){if(X<32)return X===10?3:X===13?2:4;if(X<127)return 0;const se=this._data,ue=se.length/3;let he=1;for(;he<=ue;)if(X<se[3*he])he=2*he;else if(X>se[3*he+1])he=2*he+1;else return se[3*he+2];return 0}}Ce._INSTANCE=null;function Ae(){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 Pe(X,se){if(X===0)return 0;const ue=ye(X,se);if(ue!==void 0)return ue;const he=w(se,X);return X-=Ee(he),X}function ye(X,se){let ue=w(se,X);for(X-=Ee(ue);Ie(ue)||ue===65039||ue===8419;){if(X===0)return;ue=w(se,X),X-=Ee(ue)}if(!de(ue))return;if(X>=0){const he=w(se,X);he===8205&&(X-=Ee(he))}return X}function Ee(X){return X>=65536?2:1}function Ie(X){return 127995<=X&&X<=127999}},NDqe:function(Ge,oe,K){Ge.exports={flex_box_center:"flex_box_center___3oYZ2",flex_space_between:"flex_space_between___1FifH",flex_box_vertical_center:"flex_box_vertical_center___2iDXN",flex_box_center_end:"flex_box_center_end___2rJ_G",flex_box_column:"flex_box_column___3ucki",bg:"bg___jVvhH",warp:"warp___2nRwz",rightWarp:"rightWarp___2qLI4",tabs:"tabs___3aVAD",active:"active___1eCl8",list:"list___2weuP",tags:"tags___10O8v",searchWrp:"searchWrp___xsrqM",newlight:"newlight___1S7Yv"}},SJMd:function(Ge,oe){/**
|
|
* @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 K,ee,W,R=!1,F,L;window.PR_SHOULD_USE_CONTINUATION=!0;var D,j;(function(){var U=window,e=["break,continue,do,else,for,if,return,while"],A=[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"],d=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[d,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],o=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],n=[d,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],a="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=[d,"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",r=[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"],t=[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"],i=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],b=[f,n,o,h,s,r,t,i],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,_="str",x="kwd",E="com",y="typ",c="lit",u="pun",l="pln",v="tag",g="dec",w="src",O="atn",I="atv",S="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(ye){for(var Ee=0,Ie=!1,X=!1,se=0,ue=ye.length;se<ue;++se){var he=ye[se];if(he.ignoreCase)X=!0;else if(/[a-z]/i.test(he.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,X=!1;break}}var xe={b:8,t:9,n:10,v:11,f:12,r:13};function we(Ue){var Le=Ue.charCodeAt(0);if(Le!==92)return Le;var Fe=Ue.charAt(1);return Le=xe[Fe],Le||("0"<=Fe&&Fe<="7"?parseInt(Ue.substring(1),8):Fe==="u"||Fe==="x"?parseInt(Ue.substring(2),16):Ue.charCodeAt(1))}function Me(Ue){if(Ue<32)return(Ue<16?"\\x0":"\\x")+Ue.toString(16);var Le=String.fromCharCode(Ue);return Le==="\\"||Le==="-"||Le==="]"||Le==="^"?"\\"+Le:Le}function De(Ue){var Le=Ue.substring(1,Ue.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")),Fe=[],je=Le[0]==="^",ve=["["];je&&ve.push("^");for(var be=je?1:0,ae=Le.length;be<ae;++be){var ie=Le[be];if(/\\[bdsw]/i.test(ie))ve.push(ie);else{var ne=we(ie),V;be+2<ae&&Le[be+1]==="-"?(V=we(Le[be+2]),be+=2):V=ne,Fe.push([ne,V]),V<65||ne>122||(V<65||ne>90||Fe.push([Math.max(65,ne)|32,Math.min(V,90)|32]),V<97||ne>122||Fe.push([Math.max(97,ne)&~32,Math.min(V,122)&~32]))}}Fe.sort(function(fe,ge){return fe[0]-ge[0]||ge[1]-fe[1]});for(var Y=[],J=[],be=0;be<Fe.length;++be){var q=Fe[be];q[0]<=J[1]+1?J[1]=Math.max(J[1],q[1]):Y.push(J=q)}for(var be=0;be<Y.length;++be){var q=Y[be];ve.push(Me(q[0])),q[1]>q[0]&&(q[1]+1>q[0]&&ve.push("-"),ve.push(Me(q[1])))}return ve.push("]"),ve.join("")}function ke(Ue){for(var Le=Ue.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")),Fe=Le.length,je=[],ve=0,be=0;ve<Fe;++ve){var ae=Le[ve];if(ae==="(")++be;else if(ae.charAt(0)==="\\"){var ie=+ae.substring(1);ie&&(ie<=be?je[ie]=-1:Le[ve]=Me(ie))}}for(var ve=1;ve<je.length;++ve)je[ve]===-1&&(je[ve]=++Ee);for(var ve=0,be=0;ve<Fe;++ve){var ae=Le[ve];if(ae==="(")++be,je[be]||(Le[ve]="(?:");else if(ae.charAt(0)==="\\"){var ie=+ae.substring(1);ie&&ie<=be&&(Le[ve]="\\"+je[ie])}}for(var ve=0;ve<Fe;++ve)Le[ve]==="^"&&Le[ve+1]!=="^"&&(Le[ve]="");if(Ue.ignoreCase&&Ie)for(var ve=0;ve<Fe;++ve){var ae=Le[ve],ne=ae.charAt(0);ae.length>=2&&ne==="["?Le[ve]=De(ae):ne!=="\\"&&(Le[ve]=ae.replace(/[a-zA-Z]/g,function(J){var q=J.charCodeAt(0);return"["+String.fromCharCode(q&~32,q|32)+"]"}))}return Le.join("")}for(var Ne=[],se=0,ue=ye.length;se<ue;++se){var he=ye[se];if(he.global||he.multiline)throw new Error(""+he);Ne.push("(?:"+ke(he)+")")}return new RegExp(Ne.join("|"),X?"gi":"g")}function C(ye,Ee){var Ie=/(?:^|\s)nocode(?:\s|$)/,X=[],se=0,ue=[],he=0;function xe(we){var Me=we.nodeType;if(Me==1){if(Ie.test(we.className))return;for(var De=we.firstChild;De;De=De.nextSibling)xe(De);var ke=we.nodeName.toLowerCase();(ke==="br"||ke==="li")&&(X[he]=`
|
|
`,ue[he<<1]=se++,ue[he++<<1|1]=we)}else if(Me==3||Me==4){var Ne=we.nodeValue;Ne.length&&(Ee?Ne=Ne.replace(/\r\n?/g,`
|
|
`):Ne=Ne.replace(/[ \t\r\n]+/g," "),X[he]=Ne,ue[he<<1]=se,se+=Ne.length,ue[he++<<1|1]=we)}}return xe(ye),{sourceCode:X.join("").replace(/\n$/,""),spans:ue}}function H(ye,Ee,Ie,X,se){if(!Ie)return;var ue={sourceNode:ye,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:Ee,decorations:null};X(ue),se.push.apply(se,ue.decorations)}var z=/\S/;function Z(ye){for(var Ee=void 0,Ie=ye.firstChild;Ie;Ie=Ie.nextSibling){var X=Ie.nodeType;Ee=X===1?Ee?ye:Ie:X===3&&z.test(Ie.nodeValue)?ye:Ee}return Ee===ye?void 0:Ee}function Q(ye,Ee){var Ie={},X;(function(){for(var he=ye.concat(Ee),xe=[],we={},Me=0,De=he.length;Me<De;++Me){var ke=he[Me],Ne=ke[3];if(Ne)for(var Ue=Ne.length;--Ue>=0;)Ie[Ne.charAt(Ue)]=ke;var Le=ke[1],Fe=""+Le;we.hasOwnProperty(Fe)||(xe.push(Le),we[Fe]=null)}xe.push(/[\0-\uffff]/),X=B(xe)})();var se=Ee.length,ue=function(he){for(var xe=he.sourceCode,we=he.basePos,Me=he.sourceNode,De=[we,l],ke=0,Ne=xe.match(X)||[],Ue={},Le=0,Fe=Ne.length;Le<Fe;++Le){var je=Ne[Le],ve=Ue[je],be=void 0,ae;if(typeof ve=="string")ae=!1;else{var ie=Ie[je.charAt(0)];if(ie)be=je.match(ie[1]),ve=ie[0];else{for(var ne=0;ne<se;++ne)if(ie=Ee[ne],be=je.match(ie[1]),be){ve=ie[0];break}be||(ve=l)}ae=ve.length>=5&&ve.substring(0,5)==="lang-",ae&&!(be&&typeof be[1]=="string")&&(ae=!1,ve=w),ae||(Ue[je]=ve)}var V=ke;if(ke+=je.length,!ae)De.push(we+V,ve);else{var Y=be[1],J=je.indexOf(Y),q=J+Y.length;be[2]&&(q=je.length-be[2].length,J=q-Y.length);var fe=ve.substring(5);H(Me,we+V,je.substring(0,J),ue,De),H(Me,we+V+J,Y,$(fe,Y),De),H(Me,we+V+q,je.substring(q),ue,De)}}he.decorations=De};return ue}function pe(ye){var Ee=[],Ie=[];ye.tripleQuotedStrings?Ee.push([_,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?Ee.push([_,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ee.push([_,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&Ie.push([_,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var X=ye.hashComments;X&&(ye.cStyleComments?(X>1?Ee.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ee.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([_,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ee.push([E,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(Ie.push([E,/^\/\/[^\r\n]*/,null]),Ie.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var se=ye.regexLiterals;if(se){var ue=se>1?"":`
|
|
\r`,he=ue?".":"[\\S\\s]",xe="/(?=[^/*"+ue+"])(?:[^/\\x5B\\x5C"+ue+"]|\\x5C"+he+"|\\x5B(?:[^\\x5C\\x5D"+ue+"]|\\x5C"+he+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+P+"("+xe+")")])}var we=ye.types;we&&Ie.push([y,we]);var Me=(""+ye.keywords).replace(/^ | $/g,"");Me.length&&Ie.push([x,new RegExp("^(?:"+Me.replace(/[\s,]+/g,"|")+")\\b"),null]),Ee.push([l,/^\s+/,null,` \r
|
|
\xA0`]);var De="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(De+="(?!s*/)"),Ie.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(De),null]),Q(Ee,Ie)}var le=pe({keywords:b,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function de(ye,Ee,Ie){for(var X=/(?:^|\s)nocode(?:\s|$)/,se=/\r\n?|\n/,ue=ye.ownerDocument,he=ue.createElement("li");ye.firstChild;)he.appendChild(ye.firstChild);var xe=[he];function we(Le){var Fe=Le.nodeType;if(Fe==1&&!X.test(Le.className))if(Le.nodeName==="br")Me(Le),Le.parentNode&&Le.parentNode.removeChild(Le);else for(var je=Le.firstChild;je;je=je.nextSibling)we(je);else if((Fe==3||Fe==4)&&Ie){var ve=Le.nodeValue,be=ve.match(se);if(be){var ae=ve.substring(0,be.index);Le.nodeValue=ae;var ie=ve.substring(be.index+be[0].length);if(ie){var ne=Le.parentNode;ne.insertBefore(ue.createTextNode(ie),Le.nextSibling)}Me(Le),ae||Le.parentNode.removeChild(Le)}}}function Me(Le){for(;!Le.nextSibling;)if(Le=Le.parentNode,!Le)return;function Fe(be,ae){var ie=ae?be.cloneNode(!1):be,ne=be.parentNode;if(ne){var V=Fe(ne,1),Y=be.nextSibling;V.appendChild(ie);for(var J=Y;J;J=Y)Y=J.nextSibling,V.appendChild(J)}return ie}for(var je=Fe(Le.nextSibling,0),ve;(ve=je.parentNode)&&ve.nodeType===1;)je=ve;xe.push(je)}for(var De=0;De<xe.length;++De)we(xe[De]);Ee===(Ee|0)&&xe[0].setAttribute("value",Ee);var ke=ue.createElement("ol");ke.className="linenums";for(var Ne=Math.max(0,Ee-1|0)||0,De=0,Ue=xe.length;De<Ue;++De)he=xe[De],he.className="L"+(De+Ne)%10,he.firstChild||he.appendChild(ue.createTextNode("\xA0")),ke.appendChild(he);ye.appendChild(ke)}function ce(ye){var Ee=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ee=Ee&&+Ee[1]<=8;var Ie=/\n/g,X=ye.sourceCode,se=X.length,ue=0,he=ye.spans,xe=he.length,we=0,Me=ye.decorations,De=Me.length,ke=0;Me[De]=se;var Ne,Ue;for(Ue=Ne=0;Ue<De;)Me[Ue]!==Me[Ue+2]?(Me[Ne++]=Me[Ue++],Me[Ne++]=Me[Ue++]):Ue+=2;for(De=Ne,Ue=Ne=0;Ue<De;){for(var Le=Me[Ue],Fe=Me[Ue+1],je=Ue+2;je+2<=De&&Me[je+1]===Fe;)je+=2;Me[Ne++]=Le,Me[Ne++]=Fe,Ue=je}De=Me.length=Ne;var ve=ye.sourceNode,be="";ve&&(be=ve.style.display,ve.style.display="none");try{for(var ae=null;we<xe;){var ie=he[we],ne=he[we+2]||se,V=Me[ke+2]||se,je=Math.min(ne,V),Y=he[we+1],J;if(Y.nodeType!==1&&(J=X.substring(ue,je))){Ee&&(J=J.replace(Ie,"\r")),Y.nodeValue=J;var q=Y.ownerDocument,fe=q.createElement("span");fe.className=Me[ke+1];var ge=Y.parentNode;ge.replaceChild(fe,Y),fe.appendChild(Y),ue<ne&&(he[we+1]=Y=q.createTextNode(X.substring(je,ne)),ge.insertBefore(Y,fe.nextSibling))}ue=je,ue>=ne&&(we+=2),ue>=V&&(ke+=2)}}finally{ve&&(ve.style.display=be)}}var me={};function te(ye,Ee){for(var Ie=Ee.length;--Ie>=0;){var X=Ee[Ie];me.hasOwnProperty(X)?U.console&&console.warn("cannot override language handler %s",X):me[X]=ye}}function $(ye,Ee){return ye&&me.hasOwnProperty(ye)||(ye=/^\s*</.test(Ee)?"default-markup":"default-code"),me[ye]}te(le,["default-code"]),te(Q([],[[l,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[E,/^<\!--[\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"]),te(Q([[l,/^[\s]+/,null,` \r
|
|
`],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[O,/^(?!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"]),te(Q([],[[I,/^[\s\S]+/]]),["uq.val"]),te(pe({keywords:f,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),te(pe({keywords:"null,true,false"}),["json"]),te(pe({keywords:n,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),te(pe({keywords:o,cStyleComments:!0}),["java"]),te(pe({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),te(pe({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),te(pe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),te(pe({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),te(pe({keywords:h,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),te(pe({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),te(Q([],[[_,/^[\s\S]+/]]),["regex"]);function _e(ye){var Ee=ye.langExtension;try{var Ie=C(ye.sourceNode,ye.pre),X=Ie.sourceCode;ye.sourceCode=X,ye.spans=Ie.spans,ye.basePos=0,$(Ee,X)(ye),ce(ye)}catch(se){U.console&&console.log(se&&se.stack||se)}}function Oe(ye,Ee,Ie){var X=Ie||!1,se=Ee||null,ue=document.createElement("div");ue.innerHTML="<pre>"+ye+"</pre>",ue=ue.firstChild,X&&de(ue,X,!0);var he={langExtension:se,numberLines:X,sourceNode:ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return _e(he),ue.innerHTML}function Ce(ye,Ee){var Ie=Ee||document.body,X=Ie.ownerDocument||document;function se(ie){return Ie.getElementsByTagName(ie)}for(var ue=[se("pre"),se("code"),se("xmp")],he=[],xe=0;xe<ue.length;++xe)for(var we=0,Me=ue[xe].length;we<Me;++we)he.push(ue[xe][we]);ue=null;var De=Date;De.now||(De={now:function(){return+new Date}});var ke=0,Ne=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ue=/\bprettyprint\b/,Le=/\bprettyprinted\b/,Fe=/pre|xmp/i,je=/^code$/i,ve=/^(?:pre|code|xmp)$/i,be={};function ae(){for(var ie=U.PR_SHOULD_USE_CONTINUATION?De.now()+250:Infinity;ke<he.length&&De.now()<ie;ke++){for(var ne=he[ke],V=be,Y=ne;Y=Y.previousSibling;){var J=Y.nodeType,q=(J===7||J===8)&&Y.nodeValue;if(q?!/^\??prettify\b/.test(q):J!==3||/\S/.test(Y.nodeValue))break;if(q){V={},q.replace(/\b(\w+)=([\w:.%+-]+)/g,function(ut,qe,vt){V[qe]=vt});break}}var fe=ne.className;if((V!==be||Ue.test(fe))&&!Le.test(fe)){for(var ge=!1,Re=ne.parentNode;Re;Re=Re.parentNode){var We=Re.tagName;if(ve.test(We)&&Re.className&&Ue.test(Re.className)){ge=!0;break}}if(!ge){ne.className+=" prettyprinted";var Xe=V.lang;if(!Xe){Xe=fe.match(Ne);var He;!Xe&&(He=Z(ne))&&je.test(He.tagName)&&(Xe=He.className.match(Ne)),Xe&&(Xe=Xe[1])}var $e;if(Fe.test(ne.tagName))$e=1;else{var Ze=ne.currentStyle,ze=X.defaultView,it=Ze?Ze.whiteSpace:ze&&ze.getComputedStyle?ze.getComputedStyle(ne,null).getPropertyValue("white-space"):0;$e=it&&it.substring(0,3)==="pre"}var rt=V.linenums;(rt=rt==="true"||+rt)||(rt=fe.match(/\blinenums\b(?::(\d+))?/),rt=rt?rt[1]&&rt[1].length?+rt[1]:!0:!1),rt&&de(ne,rt,$e);var dt={langExtension:Xe,sourceNode:ne,numberLines:rt,pre:$e,sourceCode:null,basePos:null,spans:null,decorations:null};_e(dt)}}}ke<he.length?U.setTimeout(ae,250):typeof ye=="function"&&ye()}ae()}var Ae=U.PR={createSimpleLexer:Q,registerLangHandler:te,sourceDecorator:pe,PR_ATTRIB_NAME:O,PR_ATTRIB_VALUE:I,PR_COMMENT:E,PR_DECLARATION:g,PR_KEYWORD:x,PR_LITERAL:c,PR_NOCODE:S,PR_PLAIN:l,PR_PUNCTUATION:u,PR_SOURCE:w,PR_STRING:_,PR_TAG:v,PR_TYPE:y,prettyPrintOne:R?U.prettyPrintOne=Oe:D=Oe,prettyPrint:j=R?U.prettyPrint=Ce:j=Ce},Pe=U.define;typeof Pe=="function"&&Pe.amd&&Pe("google-code-prettify",[],function(){return Ae})})()},T8No:function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return j}),K.d(oe,"e",function(){return U}),K.d(oe,"c",function(){return u}),K.d(oe,"b",function(){return l}),K.d(oe,"d",function(){return v}),K.d(oe,"f",function(){return O});var ee=K("MNsG"),W=K("N0LK"),R=K("Cg/j");let F=ee.k||"";const L=new Map;L.set("false",!1),L.set("true",!0),L.set("isMac",ee.f),L.set("isLinux",ee.d),L.set("isWindows",ee.i),L.set("isWeb",ee.h),L.set("isMacNative",ee.f&&!ee.h),L.set("isEdge",F.indexOf("Edg/")>=0),L.set("isFirefox",F.indexOf("Firefox")>=0),L.set("isChrome",F.indexOf("Chrome")>=0),L.set("isSafari",F.indexOf("Safari")>=0);const D=Object.prototype.hasOwnProperty;class j{static has(S){return f.create(S)}static equals(S,P){return o.create(S,P)}static regex(S,P){return _.create(S,P)}static not(S){return s.create(S)}static and(...S){return y.create(S,null)}static or(...S){return c.create(S,null,!0)}static deserialize(S,P=!1){return S?this._deserializeOrExpression(S,P):void 0}static _deserializeOrExpression(S,P){let B=S.split("||");return c.create(B.map(C=>this._deserializeAndExpression(C,P)),null,!0)}static _deserializeAndExpression(S,P){let B=S.split("&&");return y.create(B.map(C=>this._deserializeOne(C,P)),null)}static _deserializeOne(S,P){if(S=S.trim(),S.indexOf("!=")>=0){let B=S.split("!=");return h.create(B[0].trim(),this._deserializeValue(B[1],P))}if(S.indexOf("==")>=0){let B=S.split("==");return o.create(B[0].trim(),this._deserializeValue(B[1],P))}if(S.indexOf("=~")>=0){let B=S.split("=~");return _.create(B[0].trim(),this._deserializeRegexValue(B[1],P))}if(S.indexOf(" in ")>=0){let B=S.split(" in ");return n.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(S)){const B=S.split(">=");return i.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(S)){const B=S.split(">");return t.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(S)){const B=S.split("<=");return m.create(B[0].trim(),B[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(S)){const B=S.split("<");return b.create(B[0].trim(),B[1].trim())}return/^\!\s*/.test(S)?s.create(S.substr(1).trim()):f.create(S)}static _deserializeValue(S,P){if(S=S.trim(),S==="true")return!0;if(S==="false")return!1;let B=/^'([^']*)'$/.exec(S);return B?B[1].trim():S}static _deserializeRegexValue(S,P){if(Object(W.C)(S)){if(P)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let B=S.indexOf("/"),C=S.lastIndexOf("/");if(B===C||B<0){if(P)throw new Error(`bad regexp-value '${S}', missing /-enclosure`);return console.warn(`bad regexp-value '${S}', missing /-enclosure`),null}let H=S.slice(B+1,C),z=S[C+1]==="i"?"i":"";try{return new RegExp(H,z)}catch(Z){if(P)throw new Error(`bad regexp-value '${S}', parse error: ${Z}`);return console.warn(`bad regexp-value '${S}', parse error: ${Z}`),null}}}function U(S,P){const B=S?S.substituteConstants():void 0,C=P?P.substituteConstants():void 0;return!B&&!C?!0:!B||!C?!1:B.equals(C)}function e(S,P){return S.cmp(P)}class A{constructor(){this.type=0}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!1}serialize(){return"false"}keys(){return[]}negate(){return d.INSTANCE}}A.INSTANCE=new A;class d{constructor(){this.type=1}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!0}serialize(){return"true"}keys(){return[]}negate(){return A.INSTANCE}}d.INSTANCE=new d;class f{constructor(S,P){this.key=S,this.negated=P,this.type=2}static create(S,P=null){const B=L.get(S);return typeof B=="boolean"?B?d.INSTANCE:A.INSTANCE:new f(S,P)}cmp(S){return S.type!==this.type?this.type-S.type:g(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=L.get(this.key);return typeof S=="boolean"?S?d.INSTANCE:A.INSTANCE:this}evaluate(S){return!!S.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(S,P,B){this.key=S,this.value=P,this.negated=B,this.type=4}static create(S,P,B=null){if(typeof P=="boolean")return P?f.create(S,B):s.create(S,B);const C=L.get(S);if(typeof C=="boolean"){const H=C?"true":"false";return P===H?d.INSTANCE:A.INSTANCE}return new o(S,P,B)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=L.get(this.key);if(typeof S=="boolean"){const P=S?"true":"false";return this.value===P?d.INSTANCE:A.INSTANCE}return this}evaluate(S){return S.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class n{constructor(S,P){this.key=S,this.valueKey=P,this.type=10,this.negated=null}static create(S,P){return new n(S,P)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.valueKey,S.key,S.valueKey)}equals(S){return S.type===this.type?this.key===S.key&&this.valueKey===S.valueKey:!1}substituteConstants(){return this}evaluate(S){const P=S.getValue(this.valueKey),B=S.getValue(this.key);return Array.isArray(P)?P.indexOf(B)>=0:typeof B=="string"&&typeof P=="object"&&P!==null?D.call(P,B):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(S){this._actual=S,this.type=11}static create(S){return new a(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class h{constructor(S,P,B){this.key=S,this.value=P,this.negated=B,this.type=5}static create(S,P,B=null){if(typeof P=="boolean")return P?s.create(S,B):f.create(S,B);const C=L.get(S);if(typeof C=="boolean"){const H=C?"true":"false";return P===H?A.INSTANCE:d.INSTANCE}return new h(S,P,B)}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=L.get(this.key);if(typeof S=="boolean"){const P=S?"true":"false";return this.value===P?A.INSTANCE:d.INSTANCE}return this}evaluate(S){return S.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class s{constructor(S,P){this.key=S,this.negated=P,this.type=3}static create(S,P=null){const B=L.get(S);return typeof B=="boolean"?B?A.INSTANCE:d.INSTANCE:new s(S,P)}cmp(S){return S.type!==this.type?this.type-S.type:g(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=L.get(this.key);return typeof S=="boolean"?S?A.INSTANCE:d.INSTANCE:this}evaluate(S){return!S.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function r(S,P){if(typeof S=="string"){const B=parseFloat(S);isNaN(B)||(S=B)}return typeof S=="string"||typeof S=="number"?P(S):A.INSTANCE}class t{constructor(S,P,B){this.key=S,this.value=P,this.negated=B,this.type=12}static create(S,P,B=null){return r(P,C=>new t(S,C,B))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class i{constructor(S,P,B){this.key=S,this.value=P,this.negated=B,this.type=13}static create(S,P,B=null){return r(P,C=>new i(S,C,B))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}class b{constructor(S,P,B){this.key=S,this.value=P,this.negated=B,this.type=14}static create(S,P,B=null){return r(P,C=>new b(S,C,B))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class m{constructor(S,P,B){this.key=S,this.value=P,this.negated=B,this.type=15}static create(S,P,B=null){return r(P,C=>new m(S,C,B))}cmp(S){return S.type!==this.type?this.type-S.type:w(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class _{constructor(S,P){this.key=S,this.regexp=P,this.type=7,this.negated=null}static create(S,P){return new _(S,P)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.key<S.key)return-1;if(this.key>S.key)return 1;const P=this.regexp?this.regexp.source:"",B=S.regexp?S.regexp.source:"";return P<B?-1:P>B?1:0}equals(S){if(S.type===this.type){const P=this.regexp?this.regexp.source:"",B=S.regexp?S.regexp.source:"";return this.key===S.key&&P===B}return!1}substituteConstants(){return this}evaluate(S){let P=S.getValue(this.key);return this.regexp?this.regexp.test(P):!1}serialize(){const S=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${S}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=x.create(this)),this.negated}}class x{constructor(S){this._actual=S,this.type=8}static create(S){return new x(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function E(S){let P=null;for(let B=0,C=S.length;B<C;B++){const H=S[B].substituteConstants();if(S[B]!==H&&P===null){P=[];for(let z=0;z<B;z++)P[z]=S[z]}P!==null&&(P[B]=H)}return P===null?S:P}class y{constructor(S,P){this.expr=S,this.negated=P,this.type=6}static create(S,P){return y._normalizeArr(S,P)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let P=0,B=this.expr.length;P<B;P++){const C=e(this.expr[P],S.expr[P]);if(C!==0)return C}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let P=0,B=this.expr.length;P<B;P++)if(!this.expr[P].equals(S.expr[P]))return!1;return!0}return!1}substituteConstants(){const S=E(this.expr);return S===this.expr?this:y.create(S,this.negated)}evaluate(S){for(let P=0,B=this.expr.length;P<B;P++)if(!this.expr[P].evaluate(S))return!1;return!0}static _normalizeArr(S,P){const B=[];let C=!1;for(const H of S){if(!H)continue;if(H.type===1){C=!0;continue}if(H.type===0)return A.INSTANCE;if(H.type===6){B.push(...H.expr);continue}B.push(H)}if(B.length===0&&C)return d.INSTANCE;if(B.length===0)return;if(B.length===1)return B[0];B.sort(e);for(let H=1;H<B.length;H++)B[H-1].equals(B[H])&&(B.splice(H,1),H--);if(B.length===1)return B[0];for(;B.length>1;){const H=B[B.length-1];if(H.type!==9)break;B.pop();const z=B.pop(),Z=B.length===0,Q=c.create(H.expr.map(pe=>y.create([pe,z],null)),null,Z);Q&&(B.push(Q),B.sort(e))}return B.length===1?B[0]:new y(B,P)}serialize(){return this.expr.map(S=>S.serialize()).join(" && ")}keys(){const S=[];for(let P of this.expr)S.push(...P.keys());return S}negate(){if(!this.negated){const S=[];for(let P of this.expr)S.push(P.negate());this.negated=c.create(S,this,!0)}return this.negated}}class c{constructor(S,P){this.expr=S,this.negated=P,this.type=9}static create(S,P,B){return c._normalizeArr(S,P,B)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let P=0,B=this.expr.length;P<B;P++){const C=e(this.expr[P],S.expr[P]);if(C!==0)return C}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let P=0,B=this.expr.length;P<B;P++)if(!this.expr[P].equals(S.expr[P]))return!1;return!0}return!1}substituteConstants(){const S=E(this.expr);return S===this.expr?this:c.create(S,this.negated,!1)}evaluate(S){for(let P=0,B=this.expr.length;P<B;P++)if(this.expr[P].evaluate(S))return!0;return!1}static _normalizeArr(S,P,B){let C=[],H=!1;if(S){for(let z=0,Z=S.length;z<Z;z++){const Q=S[z];if(!Q)continue;if(Q.type===0){H=!0;continue}if(Q.type===1)return d.INSTANCE;if(Q.type===9){C=C.concat(Q.expr);continue}C.push(Q)}if(C.length===0&&H)return A.INSTANCE;C.sort(e)}if(C.length===0)return;if(C.length===1)return C[0];for(let z=1;z<C.length;z++)C[z-1].equals(C[z])&&(C.splice(z,1),z--);if(C.length===1)return C[0];if(B){for(let z=0;z<C.length;z++)for(let Z=z+1;Z<C.length;Z++)O(C[z],C[Z])&&(C.splice(Z,1),Z--);if(C.length===1)return C[0]}return new c(C,P)}serialize(){return this.expr.map(S=>S.serialize()).join(" || ")}keys(){const S=[];for(let P of this.expr)S.push(...P.keys());return S}negate(){if(!this.negated){let S=[];for(let P of this.expr)S.push(P.negate());for(;S.length>1;){const P=S.shift(),B=S.shift(),C=[];for(const z of I(P))for(const Z of I(B))C.push(y.create([z,Z],null));const H=S.length===0;S.unshift(c.create(C,null,H))}this.negated=S[0]}return this.negated}}class u extends f{constructor(S,P,B){super(S,null);this._defaultValue=P,typeof B=="object"?u._info.push(Object.assign(Object.assign({},B),{key:S})):B!==!0&&u._info.push({key:S,description:B,type:P!=null?typeof P:void 0})}static all(){return u._info.values()}bindTo(S){return S.createKey(this.key,this._defaultValue)}getValue(S){return S.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(S){return o.create(this.key,S)}}u._info=[];const l=Object(R.c)("contextKeyService"),v="setContext";function g(S,P){return S<P?-1:S>P?1:0}function w(S,P,B,C){return S<B?-1:S>B?1:P<C?-1:P>C?1:0}function O(S,P){if(P.type===6&&S.type!==9&&S.type!==6){for(const H of P.expr)if(S.equals(H))return!0}const B=S.negate(),C=I(B).concat(I(P));C.sort(e);for(let H=0;H<C.length;H++){const z=C[H],Z=z.negate();for(let Q=H+1;Q<C.length;Q++){const pe=C[Q];if(Z.equals(pe))return!0}}return!1}function I(S){return S.type===9?S.expr:[S]}},TXwP:function(Ge,oe,K){var ee,W;(function(){var R;(function(){"use strict";var L=[,,function(e){function A(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=[]}A.prototype.clone_empty=function(){var o=new A(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},A.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},A.prototype.has_match=function(o){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(o))return!0;return!1},A.prototype.set_indent=function(o,n){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.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)},A.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},A.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},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(o){this.__items.push(o);var n=o.lastIndexOf(`
|
|
`);n!==-1?this.__character_count=o.length-n:this.__character_count+=o.length},A.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.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 d(o,n){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)),n=n||"",o.indent_level>0&&(n=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}d.prototype.get_indent_size=function(o,n){var a=this.__base_string_length;return n=n||0,o<0&&(a=0),a+=o*this.__indent_size,a+=n,a},d.prototype.get_indent_string=function(o,n){var a=this.__base_string;return n=n||0,o<0&&(o=0,a=""),n+=o*this.__indent_size,this.__ensure_cache(n),a+=this.__cache[n],a},d.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var o=this.__cache.length,n=0,a="";this.__indent_size&&o>=this.__indent_size&&(n=Math.floor(o/this.__indent_size),o-=n*this.__indent_size,a=new Array(n+1).join(this.__indent_string)),o&&(a+=new Array(o+1).join(" ")),this.__cache.push(a)};function f(o,n){this.__indent_cache=new d(o,n),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 A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(o,n){return this.__indent_cache.get_indent_string(o,n)},f.prototype.get_indent_size=function(o,n){return this.__indent_cache.get_indent_size(o,n)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(o){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
|
|
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(a=a.replace(/[\n]/g,o)),a},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(o,n){return o=o||0,n=n||0,this.next_line.set_indent(o,n),this.__lines.length>1?(this.current_line.set_indent(o,n),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(o){for(var n=0;n<o.newlines;n++)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},f.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()},f.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(" "))},f.prototype.remove_indent=function(o){for(var n=this.__lines.length;o<n;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},f.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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(o,n){for(var a=this.__lines.length-2;a>=0;){var h=this.__lines[a];if(h.is_empty())break;if(h.item(0).indexOf(o)!==0&&h.item(-1)!==n){this.__lines.splice(a+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},e.exports.Output=f},,,,function(e){function A(o,n){this.raw_options=d(o,n),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"])}A.prototype._get_array=function(o,n){var a=this.raw_options[o],h=n||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(h=a.concat()):typeof a=="string"&&(h=a.split(/[^a-zA-Z0-9_\/\-]+/)),h},A.prototype._get_boolean=function(o,n){var a=this.raw_options[o],h=a===void 0?!!n:!!a;return h},A.prototype._get_characters=function(o,n){var a=this.raw_options[o],h=n||"";return typeof a=="string"&&(h=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),h},A.prototype._get_number=function(o,n){var a=this.raw_options[o];n=parseInt(n,10),isNaN(n)&&(n=0);var h=parseInt(a,10);return isNaN(h)&&(h=n),h},A.prototype._get_selection=function(o,n,a){var h=this._get_selection_list(o,n,a);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+n+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h[0]},A.prototype._get_selection_list=function(o,n,a){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[n[0]],!this._is_valid_selection(a,n))throw new Error("Invalid Default Value!");var h=this._get_array(o,a);if(!this._is_valid_selection(h,n))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+n+`
|
|
You passed in: '`+this.raw_options[o]+"'");return h},A.prototype._is_valid_selection=function(o,n){return o.length&&n.length&&!o.some(function(a){return n.indexOf(a)===-1})};function d(o,n){var a={};o=f(o);var h;for(h in o)h!==n&&(a[h]=o[h]);if(n&&o[n])for(h in o[n])a[h]=o[n][h];return a}function f(o){var n={},a;for(a in o){var h=a.replace(/-/g,"_");n[h]=o[a]}return n}e.exports.Options=A,e.exports.normalizeOpts=f,e.exports.mergeOpts=d},,function(e){var A=RegExp.prototype.hasOwnProperty("sticky");function d(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}d.prototype.restart=function(){this.__position=0},d.prototype.back=function(){this.__position>0&&(this.__position-=1)},d.prototype.hasNext=function(){return this.__position<this.__input_length},d.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},d.prototype.peek=function(f){var o=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(o=this.__input.charAt(f)),o},d.prototype.__match=function(f,o){f.lastIndex=o;var n=f.exec(this.__input);return n&&!(A&&f.sticky)&&(n.index!==o&&(n=null)),n},d.prototype.test=function(f,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(f,o):!1},d.prototype.testChar=function(f,o){var n=this.peek(o);return f.lastIndex=0,n!==null&&f.test(n)},d.prototype.match=function(f){var o=this.__match(f,this.__position);return o?this.__position+=o[0].length:o=null,o},d.prototype.read=function(f,o,n){var a="",h;return f&&(h=this.match(f),h&&(a+=h[0])),o&&(h||!f)&&(a+=this.readUntil(o,n)),a},d.prototype.readUntil=function(f,o){var n="",a=this.__position;f.lastIndex=this.__position;var h=f.exec(this.__input);return h?(a=h.index,o&&(a+=h[0].length)):a=this.__input_length,n=this.__input.substring(this.__position,a),this.__position=a,n},d.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},d.prototype.get_regexp=function(f,o){var n=null,a="g";return o&&A&&(a="y"),typeof f=="string"&&f!==""?n=new RegExp(f,a):f&&(n=new RegExp(f.source,a)),n},d.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},d.prototype.peekUntilAfter=function(f){var o=this.__position,n=this.readUntilAfter(f);return this.__position=o,n},d.prototype.lookBack=function(f){var o=this.__position-1;return o>=f.length&&this.__input.substring(o-f.length,o).toLowerCase()===f},e.exports.InputScanner=d},,,,,function(e){function A(d,f){d=typeof d=="string"?d:d.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(d+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(d+/\sbeautify\signore:end\s/.source+f,"g")}A.prototype.get_directives=function(d){if(!d.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(d);o;)f[o[1]]=o[2],o=this.__directive_pattern.exec(d);return f},A.prototype.readIgnored=function(d){return d.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=A},,function(e,A,d){var f=d(16).Beautifier,o=d(17).Options;function n(a,h){var s=new f(a,h);return s.beautify()}e.exports=n,e.exports.defaultOptions=function(){return new o}},function(e,A,d){var f=d(17).Options,o=d(2).Output,n=d(8).InputScanner,a=d(13).Directives,h=new a(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,t=/\s/,i=/(?:\s|\n)+/g,b=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function _(x,E){this._source_text=x||"",this._options=new f(E),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"]}_.prototype.eatString=function(x){var E="";for(this._ch=this._input.next();this._ch;){if(E+=this._ch,this._ch==="\\")E+=this._input.next();else if(x.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return E},_.prototype.eatWhitespace=function(x){for(var E=t.test(this._input.peek()),y=0;t.test(this._input.peek());)this._ch=this._input.next(),x&&this._ch===`
|
|
`&&((y===0||y<this._options.max_preserve_newlines)&&(y++,this._output.add_new_line(!0)));return E},_.prototype.foundNestedPseudoClass=function(){for(var x=0,E=1,y=this._input.peek(E);y;){if(y==="{")return!0;if(y==="(")x+=1;else if(y===")"){if(x===0)return!1;x-=1}else if(y===";"||y==="}")return!1;E++,y=this._input.peek(E)}return!1},_.prototype.print_string=function(x){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(x)},_.prototype.preserveSingleSpace=function(x){x&&(this._output.space_before_token=!0)},_.prototype.indent=function(){this._indentLevel++},_.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x=this._source_text,E=this._options.eol;E==="auto"&&(E=`
|
|
`,x&&s.test(x||"")&&(E=x.match(s)[0])),x=x.replace(r,`
|
|
`);var y=x.match(/^[\t ]*/)[0];this._output=new o(this._options,y),this._input=new n(x),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var c=0,u=!1,l=!1,v=!1,g=!1,w=!1,O=!1,I=this._ch,S=!1,P,B,C;P=this._input.read(i),B=P!=="",C=I,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),I=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(b),z=h.get_directives(H);z&&z.ignore==="start"&&(H+=h.readIgnored(this._input)),this.print_string(H),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(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var Z=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);Z.match(/[ :]$/)&&(Z=this.eatString(": ").replace(/\s$/,""),this.print_string(Z),this._output.space_before_token=!0),Z=Z.replace(/\s$/,""),Z==="extend"?g=!0:Z==="import"&&(w=!0),Z in this.NESTED_AT_RULE?(this._nestedLevel+=1,Z in this.CONDITIONAL_GROUP_RULE&&(v=!0)):!u&&c===0&&Z.indexOf(":")!==-1&&(l=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),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)):(C==="("?this._output.space_before_token=!1:C!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),C==="{"&&this._output.trim(!0),w=!1,g=!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 Q=0;Q<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Q++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Q])){S=!0;break}(u||v)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&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 pe=C==='"'||C==="'";this.preserveSingleSpace(pe||B),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")S=!1,c===0?(l&&(this.outdent(),l=!1),g=!1,w=!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 le=!1;this._input.lookBack("with")&&(le=!0),this.preserveSingleSpace(B||le),this.print_string(this._ch),l&&C==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),O=!0):(this.eatWhitespace(),c++,this.indent())}else if(this._ch===")")c&&(c--,this.outdent()),O&&this._input.peek()===";"&&this._options.selector_separator_newline&&(O=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!l||O)&&c===0&&!w&&!g?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&&t.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),t.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 de=C==='"'||C==="'";this.preserveSingleSpace(de||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&S&&this._output.add_new_line()}var ce=this._output.get_code(E);return ce},e.exports.Beautifier=_},function(e,A,d){var f=d(6).Options;function o(n){f.call(this,n,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;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 f,e.exports.Options=o}],D={};function j(e){var A=D[e];if(A!==void 0)return A.exports;var d=D[e]={exports:{}};return L[e](d,d.exports,j),d.exports}var U=j(15);R=U})();var F=R;!(ee=[],W=function(){return{css_beautify:F}}.apply(oe,ee),W!==void 0&&(Ge.exports=W))})()},Vhoy:function(Ge,oe,K){"use strict";K.d(oe,"d",function(){return F}),K.d(oe,"e",function(){return L}),K.d(oe,"c",function(){return D}),K.d(oe,"b",function(){return j}),K.d(oe,"a",function(){return U});var ee=K("MI8n");class W{constructor(){this._icons=new Map,this._onDidRegister=new ee.b}add(e){const A=this._icons.get(e.id);A?e.description?A.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 R=new W,F=R;function L(e,A){return new j(e,A)}function D(e){return e?e.replace(/\$\((.*?)\)/g,(A,d)=>` ${d} `).trim():""}class j{constructor(e,A,d){this.id=e,this.definition=A,this.description=d,R.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 A=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function d(n){if(n instanceof j)return["codicon","codicon-"+n.id];const a=A.exec(n.id);if(!a)return d(j.error);let[,h,s]=a;const r=["codicon","codicon-"+h];return s&&r.push("codicon-modifier-"+s.substr(1)),r}e.asClassNameArray=d;function f(n){return d(n).join(" ")}e.asClassName=f;function o(n){return"."+d(n).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"})}(j||(j={}))},Y1PL:function(Ge,oe,K){"use strict";K.r(oe),K.d(oe,"ResizableTextArea",function(){return Z});var ee=K("wx14"),W=K("1OyB"),R=K("vuIU"),F=K("Ji7U"),L=K("LK+K"),D=K("q1tI"),j=K("VTBJ"),U=K("rePB"),e=K("Zm9Q"),A=K("Kwbf"),d=K("c+Xe"),f=K("m+aA"),o=K("bdgK"),n=new Map;function a(le){le.forEach(function(de){var ce,me=de.target;(ce=n.get(me))===null||ce===void 0||ce.forEach(function(te){return te(me)})})}var h=new o.default(a),s=null,r=null;function t(le,de){n.has(le)||(n.set(le,new Set),h.observe(le)),n.get(le).add(de)}function i(le,de){n.has(le)&&(n.get(le).delete(de),n.get(le).size||(h.unobserve(le),n.delete(le)))}var b=function(le){Object(F.a)(ce,le);var de=Object(L.a)(ce);function ce(){return Object(W.a)(this,ce),de.apply(this,arguments)}return Object(R.a)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(D.Component),m=D.createContext(null);function _(le){var de=le.children,ce=le.onBatchResize,me=D.useRef(0),te=D.useRef([]),$=D.useContext(m),_e=D.useCallback(function(Oe,Ce,Ae){me.current+=1;var Pe=me.current;te.current.push({size:Oe,element:Ce,data:Ae}),Promise.resolve().then(function(){Pe===me.current&&(ce==null||ce(te.current),te.current=[])}),$==null||$(Oe,Ce,Ae)},[ce,$]);return D.createElement(m.Provider,{value:_e},de)}function x(le){var de=le.children,ce=le.disabled,me=D.useRef(null),te=D.useRef(null),$=D.useContext(m),_e=D.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Oe=D.isValidElement(de)&&Object(d.c)(de),Ce=Oe?de.ref:null,Ae=D.useMemo(function(){return Object(d.a)(Ce,me)},[Ce,me]),Pe=D.useRef(le);Pe.current=le;var ye=D.useCallback(function(Ee){var Ie=Pe.current,X=Ie.onResize,se=Ie.data,ue=Ee.getBoundingClientRect(),he=ue.width,xe=ue.height,we=Ee.offsetWidth,Me=Ee.offsetHeight,De=Math.floor(he),ke=Math.floor(xe);if(_e.current.width!==De||_e.current.height!==ke||_e.current.offsetWidth!==we||_e.current.offsetHeight!==Me){var Ne={width:De,height:ke,offsetWidth:we,offsetHeight:Me};_e.current=Ne;var Ue=we===Math.round(he)?he:we,Le=Me===Math.round(xe)?xe:Me,Fe=Object(j.a)(Object(j.a)({},Ne),{},{offsetWidth:Ue,offsetHeight:Le});$==null||$(Fe,Ee,se),X&&Promise.resolve().then(function(){X(Fe,Ee)})}},[]);return D.useEffect(function(){var Ee=Object(f.a)(me.current)||Object(f.a)(te.current);return Ee&&!ce&&t(Ee,ye),function(){return i(Ee,ye)}},[me.current,ce]),D.createElement(b,{ref:te},Oe?D.cloneElement(de,{ref:Ae}):de)}var E="rc-observer-key";function y(le){var de=le.children,ce=Object(e.a)(de);return ce.map(function(me,te){var $=(me==null?void 0:me.key)||"".concat(E,"-").concat(te);return D.createElement(x,Object(ee.a)({},le,{key:$}),me)})}y.Collection=_;var c=y,u=K("bT9E"),l=K("TSYQ"),v=K.n(l),g=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],O={},I;function S(le){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=le.getAttribute("id")||le.getAttribute("data-reactid")||le.getAttribute("name");if(de&&O[ce])return O[ce];var me=window.getComputedStyle(le),te=me.getPropertyValue("box-sizing")||me.getPropertyValue("-moz-box-sizing")||me.getPropertyValue("-webkit-box-sizing"),$=parseFloat(me.getPropertyValue("padding-bottom"))+parseFloat(me.getPropertyValue("padding-top")),_e=parseFloat(me.getPropertyValue("border-bottom-width"))+parseFloat(me.getPropertyValue("border-top-width")),Oe=w.map(function(Ae){return"".concat(Ae,":").concat(me.getPropertyValue(Ae))}).join(";"),Ce={sizingStyle:Oe,paddingSize:$,borderSize:_e,boxSizing:te};return de&&ce&&(O[ce]=Ce),Ce}function P(le){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),document.body.appendChild(I)),le.getAttribute("wrap")?I.setAttribute("wrap",le.getAttribute("wrap")):I.removeAttribute("wrap");var te=S(le,de),$=te.paddingSize,_e=te.borderSize,Oe=te.boxSizing,Ce=te.sizingStyle;I.setAttribute("style","".concat(Ce,";").concat(g)),I.value=le.value||le.placeholder||"";var Ae=Number.MIN_SAFE_INTEGER,Pe=Number.MAX_SAFE_INTEGER,ye=I.scrollHeight,Ee;if(Oe==="border-box"?ye+=_e:Oe==="content-box"&&(ye-=$),ce!==null||me!==null){I.value=" ";var Ie=I.scrollHeight-$;ce!==null&&(Ae=Ie*ce,Oe==="border-box"&&(Ae=Ae+$+_e),ye=Math.max(Ae,ye)),me!==null&&(Pe=Ie*me,Oe==="border-box"&&(Pe=Pe+$+_e),Ee=ye>Pe?"":"hidden",ye=Math.min(Pe,ye))}return{height:ye,minHeight:Ae,maxHeight:Pe,overflowY:Ee,resize:"none"}}var B=K("Gytx"),C=K.n(B),H;(function(le){le[le.NONE=0]="NONE",le[le.RESIZING=1]="RESIZING",le[le.RESIZED=2]="RESIZED"})(H||(H={}));var z=function(le){Object(F.a)(ce,le);var de=Object(L.a)(ce);function ce(me){var te;return Object(W.a)(this,ce),te=de.call(this,me),te.nextFrameActionId=void 0,te.resizeFrameId=void 0,te.textArea=void 0,te.saveTextArea=function($){te.textArea=$},te.handleResize=function($){var _e=te.state.resizeStatus,Oe=te.props,Ce=Oe.autoSize,Ae=Oe.onResize;if(_e!==H.NONE)return;typeof Ae=="function"&&Ae($),Ce&&te.resizeOnNextFrame()},te.resizeOnNextFrame=function(){cancelAnimationFrame(te.nextFrameActionId),te.nextFrameActionId=requestAnimationFrame(te.resizeTextarea)},te.resizeTextarea=function(){var $=te.props.autoSize;if(!$||!te.textArea)return;var _e=$.minRows,Oe=$.maxRows,Ce=P(te.textArea,!1,_e,Oe);te.setState({textareaStyles:Ce,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(te.resizeFrameId),te.resizeFrameId=requestAnimationFrame(function(){te.setState({resizeStatus:H.RESIZED},function(){te.resizeFrameId=requestAnimationFrame(function(){te.setState({resizeStatus:H.NONE}),te.fixFirefoxAutoScroll()})})})})},te.renderTextArea=function(){var $=te.props,_e=$.prefixCls,Oe=_e===void 0?"rc-textarea":_e,Ce=$.autoSize,Ae=$.onResize,Pe=$.className,ye=$.disabled,Ee=te.state,Ie=Ee.textareaStyles,X=Ee.resizeStatus,se=Object(u.a)(te.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ue=v()(Oe,Pe,Object(U.a)({},"".concat(Oe,"-disabled"),ye));"value"in se&&(se.value=se.value||"");var he=Object(j.a)(Object(j.a)(Object(j.a)({},te.props.style),Ie),X===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return D.createElement(c,{onResize:te.handleResize,disabled:!(Ce||Ae)},D.createElement("textarea",Object(ee.a)({},se,{className:ue,style:he,ref:te.saveTextArea})))},te.state={textareaStyles:{},resizeStatus:H.NONE},te}return Object(R.a)(ce,[{key:"componentDidUpdate",value:function(te){(te.value!==this.props.value||!C()(te.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var te=this.textArea.selectionStart,$=this.textArea.selectionEnd;this.textArea.setSelectionRange(te,$)}}catch(_e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ce}(D.Component),Z=z,Q=function(le){Object(F.a)(ce,le);var de=Object(L.a)(ce);function ce(me){var te;Object(W.a)(this,ce),te=de.call(this,me),te.resizableTextArea=void 0,te.focus=function(){te.resizableTextArea.textArea.focus()},te.saveTextArea=function(_e){te.resizableTextArea=_e},te.handleChange=function(_e){var Oe=te.props.onChange;te.setValue(_e.target.value,function(){te.resizableTextArea.resizeTextarea()}),Oe&&Oe(_e)},te.handleKeyDown=function(_e){var Oe=te.props,Ce=Oe.onPressEnter,Ae=Oe.onKeyDown;_e.keyCode===13&&Ce&&Ce(_e),Ae&&Ae(_e)};var $=typeof me.value=="undefined"||me.value===null?me.defaultValue:me.value;return te.state={value:$},te}return Object(R.a)(ce,[{key:"setValue",value:function(te,$){"value"in this.props||this.setState({value:te},$)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return D.createElement(Z,Object(ee.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(te){return"value"in te?{value:te.value}:null}}]),ce}(D.Component),pe=oe.default=Q},ZW9T:function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return B});var ee=K("k1fw"),W=K("oBTY"),R=K("miYZ"),F=K("tsqr"),L=K("rAM+"),D=K("tJVT"),j=K("PpiC"),U=K("q1tI"),e=K.n(U),A=K("bdgK"),d=K("9og8"),f=K("WmNS"),o=K.n(f),n={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"]},a={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(`
|
|
`)}]},r=K("5VLF"),t=K.n(r),i={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(H,z){return z.map(function(Z){return{label:Z,kind:H.languages.CompletionItemKind.Keyword,insertText:Z}})},m=function(H){return Object.keys(i.tables).map(function(z){return{label:z,kind:H.languages.CompletionItemKind.Variable,insertText:z}})},_=function(H,z){var Z=i.tables[H];return Z?Z.map(function(Q){return{label:Q,kind:z.languages.CompletionItemKind.Field,insertText:Q}}):[]};function x(C,H,z,Z,Q){var pe=H.getWordUntilPosition(z),le={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},de=Z.map(function(ce){return{label:ce,kind:C.languages.CompletionItemKind.Keyword,insertText:ce,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:le}});return Q.map(function(ce){de.push(Object(ee.a)(Object(ee.a)({},ce),{},{range:le}))}),de}var E=function(C){i.languages.map(function(Q){return C.languages.registerDocumentFormattingEditProvider(Q,{provideDocumentFormattingEdits:function(le,de,ce){return Object(d.a)(o.a.mark(function me(){var te;return o.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return te=t()(le.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}),_e.abrupt("return",[{range:le.getFullModelRange(),text:te}]);case 2:case"end":return _e.stop()}},me)}))()}}),Q});var H=h.quickKey.map(function(Q){return{label:Q.label,kind:C.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=s.quickKey.map(function(Q){return{label:Q.label,kind:C.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=a.quickKey.map(function(Q){return{label:Q.label,kind:C.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet}});C.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(pe,le){var de=pe.getWordUntilPosition(le),ce={startLineNumber:le.lineNumber,endLineNumber:le.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},me=pe.getLineContent(le.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[].concat(Object(W.a)(h.keywords.map(function(te){return{label:te,kind:C.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})),Object(W.a)(h.quickKey.map(function(te){return{label:te.label,kind:C.languages.CompletionItemKind.Function,documentation:te.content,insertText:me.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})))}}}),C.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(pe,le){var de=pe.getWordUntilPosition(le),ce={startLineNumber:le.lineNumber,endLineNumber:le.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn};return{suggestions:Object(W.a)(n.keywords.map(function(me){return{label:me,kind:C.languages.CompletionItemKind.Function,documentation:me,insertText:me,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}}))}}}),C.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(pe,le){var de=pe.getWordUntilPosition(le),ce={startLineNumber:le.lineNumber,endLineNumber:le.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},me=pe.getLineContent(le.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[].concat(Object(W.a)(a.keywords.map(function(te){return{label:te,kind:C.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})),Object(W.a)(a.quickKey.map(function(te){return{label:te.label,kind:C.languages.CompletionItemKind.Function,documentation:te.content,insertText:me.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})))}}}),C.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(pe,le){var de=pe.getWordUntilPosition(le),ce={startLineNumber:le.lineNumber,endLineNumber:le.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},me=pe.getLineContent(le.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[].concat(Object(W.a)(s.keywords.map(function(te){return{label:te,kind:C.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})),Object(W.a)(s.quickKey.map(function(te){return{label:te.label,kind:C.languages.CompletionItemKind.Function,documentation:te.content,insertText:me.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:C.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}})))}}})},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=K("fjLI"),u=K("LvDl"),l=K("+ua5");function v(C){return/^\d+$/.test(C)?"".concat(C,"px"):C}function g(){}var w=!1,O={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function I(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=C;if(Array.isArray(C)){for(var z=0;z<C.length;z++){var Z=O[C[z]];if(Z)return Z}return H[0]}return O[H]||H}var S=null,P=oe.b=function(C){var H=C.width,z=H===void 0?"100%":H,Z=C.height,Q=Z===void 0?"100%":Z,pe=C.value,le=C.language,de=le===void 0?"javascript":le,ce=C.style,me=ce===void 0?{}:ce,te=C.options,$=te===void 0?{}:te,_e=C.overrideServices,Oe=_e===void 0?{}:_e,Ce=C.theme,Ae=Ce===void 0?"vs-dark":Ce,Pe=C.onEditBlur,ye=C.onSave,Ee=C.autoHeight,Ie=Ee===void 0?!1:Ee,X=C.forbidCopy,se=X===void 0?!1:X,ue=C.onChange,he=ue===void 0?g:ue,xe=C.editorDidMount,we=xe===void 0?g:xe,Me=C.onFocus,De=Me===void 0?g:Me,ke=C.filename,Ne=ke===void 0?"educoder.txt":ke,Ue=C.errorLine,Le=C.errorContent,Fe=Le===void 0?"":Le,je=Object(j.a)(C,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ve=Object(U.useRef)(),be=Object(U.useRef)({}),ae=Object(U.useRef)(),ie=Object(U.useRef)(),ne=Object(U.useRef)(!1),V=Object(U.useRef)(),Y=Object(U.useState)(!1),J=Object(D.a)(Y,2),q=J[0],fe=J[1];function ge(){var Je;return ve.current&&(Je=new A.default(function(Ye){var at=Object(L.a)(Ye),ht;try{for(at.s();!(ht=at.n()).done;){var mt=ht.value;(mt.target.offsetHeight>0||mt.target.offsetWidth>0)&&be.current.instance.layout()}}catch(ct){at.e(ct)}finally{at.f()}}),Je.observe(ve.current)),Je}function Re(){F.b.warn(decodeURIComponent(y))}var We=function(){var Ye=be.current.instance;if(pe!=null&&Ye&&q){var at=Ye.getModel();at&&pe!==at.getValue()&&(w=!0,at.setValue(pe),Ye.layout(),w=!1)}};Object(U.useEffect)(function(){ie.current&&clearTimeout(ie.current),ie.current=setTimeout(function(){We()},500)},[pe,q,be.current]),Object(U.useEffect)(function(){if(Ue&&be.current&&be.current.instance){var Je=be.current.instance;Je.changeViewZones(function(at){var ht=document.createElement("div");ht.style.padding="10px 20px",ht.style.width="calc(100% - 20px)",ht.className="my-error-line-wrp",ht.innerHTML=Fe,at.addZone({afterLineNumber:Ue||11,heightInLines:3,domNode:ht})});var Ye={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Je.addOverlayWidget(Ye),Je.revealPositionInCenter({lineNumber:20,column:1})}},[Ue,be.current,q]);function Xe(){var Je=be.current.instance;if(Je){var Ye=Je.getSelection(),at=be.current.pastePos||{},ht=new S.Range(at.startLineNumber||Ye.endLineNumber,at.startColumn||Ye.endColumn,at.endLineNumber||Ye.endLineNumber,at.endColumn||Ye.endColumn);setTimeout(function(){Je.executeEdits("",[{range:ht,text:""}])},300)}}function He(Je){(window.navigator.platform.match("Mac")?Je.metaKey:Je.ctrlKey)&&Je.keyCode==83&&(Je.preventDefault(),ye())}var $e=function(){if(Ie&&be.current.instance){var Ye=be.current.instance.getContentHeight();Ve(Ye<Q?Q:Ye)}else Ve(Q)};function Ze(Je){var Ye=document.createEvent("MouseEvents");Ye.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Je.dispatchEvent(Ye)}function ze(Je,Ye){var at=window.URL||window.webkitURL||window,ht=new Blob([Ye]),mt=document.createElementNS("http://www.w3.org/1999/xhtml","a");mt.href=at.createObjectURL(ht),mt.download=Je,Ze(mt)}Object(U.useEffect)(function(){$e()},[$e]),Object(U.useEffect)(function(){ve.current&&!q&&Promise.all([K.e(17),K.e(28)]).then(K.t.bind(null,"M/lh",7)).then(function(Je){try{S=Je,be.current.instance=S.editor.create(ve.current,{value:pe,language:I(de),theme:Ae,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Oe);var Ye=be.current.instance,at=c.d._menuItems,ht=Object(W.a)(at).find(function(ot){return ot[0]._debugName=="EditorContext"}),mt=ht[1],ct=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Dt=function(bt,Et){var Tt=bt._first;do{var Ct,Ot,Ut=Et.includes((Ct=Tt.element)===null||Ct===void 0||((Ot=Ct.command)===null||Ot===void 0)?void 0:Ot.id);Ut&&bt._remove(Tt)}while(Tt=Tt.next)};if(we(Ye,S),setTimeout(function(){$e(),be.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ze(Ne||"educoder.txt",Ye.getValue())}}),Ye.getDomNode().addEventListener("input",function(){ae.current.autoFormat&&Ye.getAction("editor.action.formatDocument").run()})},500),be.current.subscription=Ye.onDidChangeModelContent(function(ot){ne.current?clearTimeout(V.current):($e(),he(Ye.getValue(),ot)),V.current=setTimeout(function(){ne.current=!1},500)}),window.Monaco||E(S,I(de)),se&&(Dt(mt,ct),ve.current.classList.add("noCopyPaste"),Ye.onKeyDown(function(ot){var bt=ot.keyCode,Et=ot.ctrlKey,Tt=ot.metaKey;(bt===33||bt===52)&&(Tt||Et)&&(Re(),ot.preventDefault())})),window.Monaco=S,Pe&&Ye.onDidBlurEditorWidget(function(){Pe(Ye.getValue())}),De&&Ye.onDidFocusEditorText(function(){De(Ye.getValue())}),se){Ye.addCommand(S.KeyMod.CtrlCmd|S.KeyCode.KEY_V,function(){return Re(),null}),Ye.onDidPaste(function(ot){be.current.pastePos=ot});try{window.addEventListener("paste",Xe)}catch(ot){}}var Pt=ge();return fe(!0),function(){var ot=be.current.instance;ot.dispose();var bt=ot.getModel();bt&&bt.dispose(),be.current.subscription&&be.current.subscription.dispose(),se&&window.removeEventListener("paste",Xe),Pt.unobserve(ve.current)}}catch(ot){}})},[]),Object(U.useEffect)(function(){var Je=be.current.instance;if(Je&&q)return document.addEventListener("keydown",He,!1),function(){document.removeEventListener("keydown",He)}},[ye,q]),Object(U.useEffect)(function(){var Je=be.current.instance;if(Je&&q){var Ye=I(de);S.editor.setModelLanguage(Je.getModel(),Ye),console.log("language:",de,Je.getModel(),Ye)}},[de,q]),Object(U.useEffect)(function(){var Je=be.current.instance;Je&&q&&S.editor.setTheme(Ae)},[Ae,q]),Object(U.useEffect)(function(){var Je=be.current.instance;ae.current=$,Je&&q&&(Je.updateOptions(Object(ee.a)({},$)),setTimeout(function(){Je.getModel().updateOptions(Object(ee.a)({},$))},200))},[JSON.stringify($),q]),Object(U.useEffect)(function(){var Je=be.current.instance;Je&&q&&Je.layout()},[z,Q,q]);var it=Object(U.useState)(v(z)),rt=Object(D.a)(it,2),dt=rt[0],ut=rt[1],qe=Object(U.useState)(v(Q)),vt=Object(D.a)(qe,2),At=vt[0],Ve=vt[1],Rt=Object(ee.a)(Object(ee.a)({},me),{},{width:dt,height:At});return e.a.createElement("div",{className:"my-monaco-editor",ref:ve,style:Rt})};function B(C){var H=C.width,z=H===void 0?"100%":H,Z=C.height,Q=Z===void 0?"100%":Z,pe=C.original,le=C.modified,de=C.language,ce=C.options,me=ce===void 0?{}:ce,te=Object(U.useRef)(),$=Object(U.useState)(null),_e=Object(D.a)($,2),Oe=_e[0],Ce=_e[1];function Ae(Ie){var X;return te.current&&(X=new A.default(function(se){var ue=Object(L.a)(se),he;try{for(ue.s();!(he=ue.n()).done;){var xe=he.value;(xe.target.offsetHeight>0||xe.target.offsetWidth>0)&&Ie.layout()}}catch(we){ue.e(we)}finally{ue.f()}}),X.observe(te.current)),X}Object(U.useEffect)(function(){te.current&&Promise.all([K.e(17),K.e(28)]).then(K.t.bind(null,"M/lh",7)).then(function(Ie){S=Ie;var X=S.editor.createDiffEditor(te.current,Object(ee.a)(Object(ee.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},me),{},{wordWrap:!0}));Ce(X);var se=Ae(X);return function(){X.dispose();var ue=X.getModel();ue&&ue.dispose(),se.unobserve(te.current)}})},[]),Object(U.useEffect)(function(){Oe&&Oe.setModel({original:S.editor.createModel(pe,de),modified:S.editor.createModel(le,de)})},[pe,le,de,Oe]);var Pe=v(z),ye=v(Q),Ee={width:Pe,height:ye};return e.a.createElement("div",{className:"my-diff-editor",ref:te,style:Ee})}},ZpRC:function(Ge,oe,K){"use strict";function ee(d){return typeof d=="object"&&d!=null&&d.nodeType===1}function W(d,f){return(!f||d!=="hidden")&&d!=="visible"&&d!=="clip"}function R(d,f){if(d.clientHeight<d.scrollHeight||d.clientWidth<d.scrollWidth){var o=getComputedStyle(d,null);return W(o.overflowY,f)||W(o.overflowX,f)||function(n){var a=function(h){if(!h.ownerDocument||!h.ownerDocument.defaultView)return null;try{return h.ownerDocument.defaultView.frameElement}catch(s){return null}}(n);return!!a&&(a.clientHeight<n.scrollHeight||a.clientWidth<n.scrollWidth)}(d)}return!1}function F(d,f,o,n,a,h,s,r){return h<d&&s>f||h>d&&s<f?0:h<=d&&r<=o||s>=f&&r>=o?h-d-n:s>f&&r<o||h<d&&r>o?s-f+a:0}var L=function(d,f){var o=window,n=f.scrollMode,a=f.block,h=f.inline,s=f.boundary,r=f.skipOverflowHiddenElements,t=typeof s=="function"?s:function(Ie){return Ie!==s};if(!ee(d))throw new TypeError("Invalid target");for(var i=document.scrollingElement||document.documentElement,b=[],m=d;ee(m)&&t(m);){if((m=m.parentElement)===i){b.push(m);break}m!=null&&m===document.body&&R(m)&&!R(document.documentElement)||m!=null&&R(m,r)&&b.push(m)}for(var _=o.visualViewport?o.visualViewport.width:innerWidth,x=o.visualViewport?o.visualViewport.height:innerHeight,E=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,c=d.getBoundingClientRect(),u=c.height,l=c.width,v=c.top,g=c.right,w=c.bottom,O=c.left,I=a==="start"||a==="nearest"?v:a==="end"?w:v+u/2,S=h==="center"?O+l/2:h==="end"?g:O,P=[],B=0;B<b.length;B++){var C=b[B],H=C.getBoundingClientRect(),z=H.height,Z=H.width,Q=H.top,pe=H.right,le=H.bottom,de=H.left;if(n==="if-needed"&&v>=0&&O>=0&&w<=x&&g<=_&&v>=Q&&w<=le&&O>=de&&g<=pe)return P;var ce=getComputedStyle(C),me=parseInt(ce.borderLeftWidth,10),te=parseInt(ce.borderTopWidth,10),$=parseInt(ce.borderRightWidth,10),_e=parseInt(ce.borderBottomWidth,10),Oe=0,Ce=0,Ae="offsetWidth"in C?C.offsetWidth-C.clientWidth-me-$:0,Pe="offsetHeight"in C?C.offsetHeight-C.clientHeight-te-_e:0;if(i===C)Oe=a==="start"?I:a==="end"?I-x:a==="nearest"?F(y,y+x,x,te,_e,y+I,y+I+u,u):I-x/2,Ce=h==="start"?S:h==="center"?S-_/2:h==="end"?S-_:F(E,E+_,_,me,$,E+S,E+S+l,l),Oe=Math.max(0,Oe+y),Ce=Math.max(0,Ce+E);else{Oe=a==="start"?I-Q-te:a==="end"?I-le+_e+Pe:a==="nearest"?F(Q,le,z,te,_e+Pe,I,I+u,u):I-(Q+z/2)+Pe/2,Ce=h==="start"?S-de-me:h==="center"?S-(de+Z/2)+Ae/2:h==="end"?S-pe+$+Ae:F(de,pe,Z,me,$+Ae,S,S+l,l);var ye=C.scrollLeft,Ee=C.scrollTop;I+=Ee-(Oe=Math.max(0,Math.min(Ee+Oe,C.scrollHeight-z+Pe))),S+=ye-(Ce=Math.max(0,Math.min(ye+Ce,C.scrollWidth-Z+Ae)))}P.push({el:C,top:Oe,left:Ce})}return P};function D(d){return d===Object(d)&&Object.keys(d).length!==0}function j(d,f){f===void 0&&(f="auto");var o="scrollBehavior"in document.body.style;d.forEach(function(n){var a=n.el,h=n.top,s=n.left;a.scroll&&o?a.scroll({top:h,left:s,behavior:f}):(a.scrollTop=h,a.scrollLeft=s)})}function U(d){return d===!1?{block:"end",inline:"nearest"}:D(d)?d:{block:"start",inline:"nearest"}}function e(d,f){var o=!d.ownerDocument.documentElement.contains(d);if(D(f)&&typeof f.behavior=="function")return f.behavior(o?[]:L(d,f));if(o)return;var n=U(f);return j(L(d,n),n.behavior)}var A=oe.a=e},bT9E:function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return W});var ee=K("VTBJ");function W(R,F){var L=Object(ee.a)({},R);return Array.isArray(F)&&F.forEach(function(D){delete L[D]}),L}},ccQJ:function(Ge,oe){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAqCAYAAABr9d/aAAAAAXNSR0IArs4c6QAAEZlJREFUeF7tnAl0FFW6x//Ve8wGhEXCYkDZGVoWkQe4gYOPUUAQiLLICKPoHBXckLgAggvqe4OIwwAKw6bmyWZAGYYAGjIiCISwPBEIELKQjaS7k15qrzn3VnV1d9JJOiHKnAOX0+d0qm/dqv5+/e23YNCEY86FtG4s6/kLL0ngZby4xj71TBMuf2OpMBJgmkIqi8+nxztE1zxOEp7jZMnMyxJ4SRRYSVoGKAs3DZjpaorr3FijpgSuCqCiKIZF57f/yScLb7Oi2IpXJHCSqL4IRFkCJ4tlvCK/MfTO5z97i2HkGxCaVgKNBvhB/s57WF5cykmCncDyQytiveAkCTEmQzWY4nEezKxjd8/JaNqvcH2v1mCAfyv6LqmKZT/gZWECSzVNpJrm4DkcdThQ6PUBioKWZhPaRVsARtHgqvPKnU6UF5dAFMTrXfJuAJfJiwGTxzBIjzEy37r+/IWjIYKJGOD64uPRlWLpXFYUX+Yk0aZqnQCvLOCY04XTLhdkWYEiyxQgeTGyjASbCbE2A0RIIMAFWYKiKHBVOFB5xaHOvzH8EhDBMJkGg7JMejZ1WyRiqRegoijMmtL9kzheeJ+VxXaqqVS16ecqFw5XVMAjCIACQINHocgqRHLMaABirIDRAigMOawADCCIAlwl5fC6qiK51+trDoMDRsY4R3zu8x/q+uJ1Avz8yoGBnMAv5SRxEPFrBBwBmO/zIqO8FGUsSyH5gSmKBi5IC3WYsgKTCYiKNsBkYSBrEBWGAe/xwVlyBYKPvb4gRfBtGTBLH2k79qVNEydK4aaHBbjFc6Qt7+Hf4yTxcU4SGT+4CoFFRnkZTle5dA3TTWaQ1ilE+2Q5xJwqkmpaGUWBxcbAFmcCjAxVXKKNRCuJJlaVVEAWr3P/WIMUkx4fZ53ofGKts/pHIQB3KuesQrnjRVYWXuNkKYZoHSsJ8EkCfqi4goOucvCCSIVNQASbymCQBCD5nGqnBq765wYosMSaYI23QDGoAIl5lSUZnnIHvOXajySCX+l1MuV0fJxtcHWIOsDdnl8SWa4qkxXFzn6NI37ueJUDu8uK4BR41cdpvs2vZcEm1O/z9GPUBwYFNsHna+bWYGJgbW6BMcasaiL9B0i8AGduEeTrPVoN+XUy6ePbjh0ZbE51gDscWXZO5LIJNBIt5vs8SCstwEWvO8Rc+jVvRZ+HkNz+d3R5ryggcfu7cI6bH3K5uC9ScHHUXCTExtPjq49n4IWj26nmkhdDlFTzl6YoI8ytomCMMkFWDSsc5wsgsfx1omCRfU3iE+VZX872zw4B6OZ92UT7ClgvluSegSJLWpDiN5fEj4FIHSvso0IBpr0N5yNvhQLcOBcXx6QEAGZnYPbRNN0/6mZYi2BJEBR1W3MYrEZqTp05DQMYZbJgSNtu2JN/Mqw0hnfojRm97qOfTdu9nKY0ZIzpPADJXf+Lvp+86xPNBtQu0Pva98Kz9hF0wvhvP6p3fmRoIp9lNBiH+qNTHeBWxyG7m+OzSZSZx7rxSe7ZoLTAn9epIMlrVd8xmNjBr4E82m5dBNfERdRnkmEzmhG3fg4ujn09FODhbZr2+U2rpoWaJhKAzE0mNVc8XxixBsaYbfhm9Bzcldgds/evx7Lju2pIZGbv+/G3YTPo8ejl0+ATVe1OGTAG7wx+lL43L5sMiZj3OsYTPe/F6vtn6vMPJi9Cj+btIicAIPPyLxiZtrhB5+iTGRxQnk8dQv7WAaaWZNq9kpStmk83VuTlVPN5wf5Pxqp+BGAfuqZX5NF2y0K4kt/GmnOHqJZO73on4ta9govj3ggAPPY9Zv9UHSABqUatxHfaujYHE2Wid+bKiRxgrxbt8Y8xc9E+NoHe0+IjaXjtQGqIgH4tgMcnvY+eCe0bBCOj4Gfct3VRg84JnmwwYhxJ9nWAG0oy7R6Bpz4wz+vG6rzzQVFmKDwi6JX9xiC5oz0AcPNbcCQvwp3fLKGR509jXkL82jnIHf9mEMDvMOvgVj3BDxcA2bonaAAZuBpoQltHxWPLgy9gSGI3el/rTmdgxp6Vas4JoLEAyY/j/o6qtVma/Q9U10BigpvbokNgdI5rjZQ7HqbHFh7agnx3ecjnRR4nduYeazRAMMx3yvNfDtMBri7JtPt4lmpgIevB2tzzgSRdiybV3E41pysHPBwK8KsF2HjXJKw9c4iq9bQuAzF571pcnDAvADCLANwcJocMVG2sPRLA3GSmrraqARrol4TFaELaQy/jgVvsWHEyHSk/pOKhTv3ox8QH/rHnPfQ9ActLar45unN/TOgyiL4nvpEAL/I4sK/g/9W5ve7Dp8Ofou+NH0+iawSb0HAmd2Cb20BMKxm3f/EqTlzJazys8GeKcWZDax3gioJ9dq/EZ5MvVch6sfHShZp5XlB5bOWAsUhOuj2ggf83DwMTOuKJ2wZSgGt++REHiy8gN3mBDvCzo/sw++CW0CRfSzP8AY2tZysw0SrAypxCyI2IQq1GM2b2Ho6Pj+9CzxbtcWrKhw0WXnreCTzw9XsRATQZjGgZFRtyjb6tkrB91Cv02ANfv4ufKwpDPi/1uvQgqsE3p51ggOFxHeDHBfvsrMDSKLTQ60bqpVwSboZqS1Aet/KOcSEAb/7iDVgNJpyfOA8MA3Ta+CY4UUDuo2+FAjywKSTBDyT7aoRr7dVKDWKIBp6/3CiAwQLp3jwRWY+pIIigyYsMcm9qxhl6nNUCm735pzBqhwq+Pg0kmr3r4ZQGcRj81TwcLD7XoHOqT2YYbNAB/m/BLjvLCdmky3CZdWNz7iXotU2tKB3ss2Z1G4qntdD7steFYd8uw6gOvfH5sGn0OpPT1yDtQja2D38S7WOb02MrT2Rgxc/7a5jQ4KqOtU9rMDdZqHCrcuoHSFKHv947vYYg0i4cAXkFj8b6wP9UgGDwvQ5w8YVddp/EZvOyiMusF1/nXtJrlyHdheDiNdXIQPto3T1TMLaTala3nj+Gx9PXgNFMJC2/6VUc9Rx13dAAyWq/GUy0CtAdAcB4y01wPL26BkASOCw4tPk3Bzhh50co8Tqp6V4x7E/0+tPTVyDHVYzOcW2wdsQz9FhTaCAYnNUBLryww86JAs0Di3xefJufH1LH9GsJEfrYDr3RM74NzDDAZDDAzBhgYgyY0uUOEI0gg+RYG04fpHZeEEWIWifj9JVCbP3lcKCW6k/itcqMxd4GiCGNYMB9jvhANa+sbUSbrdj98Gv6x3e0uZWayWsF8JY1z9KIM1wQ0zuhA05M/qApAbpDALp54gMlFPvc2HWpsGa4r0Wj0QYTPhn0CMYlqWlEpGPb2SN45p9rUcl6Q4rhgUK3Amu/RCjRZrqkh/hAX8NKaaVPrkTLqLjrAyCYKh3gq2e22nmJpwBLfF7sySsI6fUFitgB8zez22C8N3A0zFpgUBtIQRLx2v7NWJ61p0Z3IlizyTWsAxIBakIZeJsAIIkG46030Vsj+dqs20fS96QKQnYUkDGl21BM10psv9/2jl6JySq9iEre16Ag5jfWwIAJJQA9IvGBEkq9XnyXV1hrPy9YY/ontMf64X9Ehxg1UKk+CqoqMOWblfipMCesT6XtJhINam0ny4B2tH1PfKCX+sC6TWj161XXwMzxC/TEPlJL4Z83dNN8HCg6WwPg87f/N5bc/Th1E6QkN6JjHz0K/Y0BBoKYF8+k2j286gPLWB/+lVdUZz8vUIhWMPqW3+HzEWqNsfp4bPtybD+XpWseLQYoWidCgxYc3VoGtqc+kHTqfSQP9P3nAXx38KN4dcBoXHSV4tZ1s64ZQIZh1usm9LkzqXYvx1GAV1gfDlxSAdbXzyNzPhoyATN6DQ0LcPXx7/Hc7vVa6qBWcsI2g2k0C5jv7ADEWuilWWpCrw5grCWKBlhkpI16GUMTu4PkeBN3fqTf74t9H8TrA8fSv9t8OhOi1qUg5pNUWaqnEX///dN4vMfd+LHoLIZsmn/NABoMzFQd4MxTG+xeQcgmm3OveLw4XFASUonxJ9zBPsvfzzs7dRESY5pRAZypKKYmsVuLtvTvwioHuix/UdNmbVuH3g/0F7K17r0swzKoI5RYK41CfecuQ7kKE7ri5B7YTGbkVpahmTUaxLySCHV2xjpapfGP+roR1QGem7YEnePbYMPpTExLX36tAIaW0qYTgCQKlUQ4fCyy8kuD2j7+1o/WDwwC0KdFO/wwcS6Vxarj3yMlYxMF+O5d4zGz7zB6fPDf5+FYUW5Izkh8X41+oCzDPDgJiLPS83w5l6E0UgNXntyDe9r1wKpT+/BR9k5M7X4X1o34M12367oXaF4WKcDb4m/GkMSudPqRkgs4qZXmJu1ahtSzB64NwOrF7ClZq+2sLNJSmovjcOxSiR5Y+AvYodqnQk0Z8AdqPp9JX4fduadCqiwjknphxcgZ+CxrH97Zv00Hpnbjw/QDSVlraBKYGCvtynPnihqtgX44Oy4cxZhv/od2KcbeOhA5zmJ0Xf9CiLmvTwODJ//lrqmY3fcPkGQZrT59Ck7OUy/Ae7csxC2xLWkw9VTv4XS5/l+m4FgZKVc2btRoJyUTgBJHuxHk6SIXy6KwzAUv0QBSTdG3DKqC9wN4pf8DWH1iP8q9VTW7F4qMBGs0ZvS9D+9nfh12a4a6tgJDMxuMPVtDIRtI6d4YgMspapAGJthiUTD9r7Ca1DySRIlT/vkJTQVIr5CYz2XZuzBr/7pGASTVlexJi+k6W3IOgVRdyKgvCr0j9XXsG/cGiD8mw8G60frTmfU2jmtFG66h+2jW6sQqwfsvVpI6+Tfuku66s4qDq9wDSdC2V/gjx1o28QY2NAV12v1djJCdbFoJzmKEsVtrGNrEqLs1/BubeAnchRKy+zfin+ic/qOweMgkOr/Y48ToHR/CyXlxKHkRmttiUOatRL/UFBS6KxoMkPjQPWNfR7/WnWghvOfGl3GxsjQigKSdNP/OR/BgUj+cdRbhw6M7sOGXzIi/V/WJYbdUkEkjz31s9ZaIL3GylMLKQgypi5KthaQ/5nH54Cv30W1/1ZP64F3YwTli6O409Tz9c4aBIakZTEkJUIwkllJ7A2R9scwFsbxKvU4DRv/WnXH40XdwqjwfD6a9jwrOjcPJ76B7i3bU5N2/7W1kFJ6usWJ9JrSFLYZqUJ+Wt9BzFxzcjIU/bdHXMTCMXkL0CBw9/mv1A2vd1BT8rfrvX9KWE72LWVmYKsoSQ0wagahICjxlXnBOXwBEtX6eP/XwwwuY20BrytgmBsYuCYDNrO4HJRdnANHhBl/sBMSwm5AjQrlo0ER8kLUDVbyPzl885DHM6T8aL2VuwJJjO8OuUR9AI2PAquFP0k58OBMcbtFfB2Ad2wrD3USnvfMHKrKyVIEyiJo3rX8m+gS4L1dB8vBByb4aoVbvMJAdbLqfi7XA1KUVDPE2desgQ3ZmKxA9HITiCsjehtU9IyKq+ajdeSdqnX53ux7Uj5Hx5o9f1brLbFSn/thx8WhEl02Mbq7vgFt5ci9KfVf9jGvdG3truyvycEvnvQsmi4q0GGDaqRtvyT8GnMMLtrASCi+G7d77zSVjMcLcqTmMbeOgFs5UeDIvgitxQHJ6IhLK9Tspwq31dQmoz/EPox2lVSkwKC9JsmLz76KWRRlccSW4y1VQJDXQ0X0dA1g6NIOxYzPNz2lBiqyAv1IJvoxsn7/xeFldcm/Uwy11LZj03fwkQZI+lKGMp5u9tJBf4gRwl5wQSispRFNCNIydW8AQZdaeRFLNpeBygyt2QCFR7Y1RuwSa4vGyuuTbft+b9wiKshSKYvc/z0Cfaaj0UaUyNrMFUgJynOXBFlVA8tx4hKwOuTb9A551QZyvzDes2is9KTHyIllRWvmDfmoUtSqrJMsiV+IQ+fJK2w2FC5IAg6BHrJHPKIb0GDO++dUesa5L+J2PLI53uyrnSwyehQIz0UiZUUgb4RMmrtlbjgFzrzoEuwE/vATqfcS6IYJrue+NbrIiL1Egw8iYXrgy7O0b/9FPQwTYiLn/BnX/q1dppgJNAAAAAElFTkSuQmCC"},fjLI:function(Ge,oe,K){"use strict";K.d(oe,"f",function(){return o}),K.d(oe,"b",function(){return n}),K.d(oe,"a",function(){return a}),K.d(oe,"d",function(){return h}),K.d(oe,"e",function(){return s}),K.d(oe,"c",function(){return r});var ee=K("8HAY"),W=K("Vhoy"),R=K("MI8n"),F=K("JYp7"),L=K("pmY6"),D=K("24hK"),j=K("nnTU"),U=K("T8No"),e=K("Cg/j"),A=K("t9D7"),d=function(t,i,b,m){var _=arguments.length,x=_<3?i:m===null?m=Object.getOwnPropertyDescriptor(i,b):m,E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(t,i,b,m);else for(var y=t.length-1;y>=0;y--)(E=t[y])&&(x=(_<3?E(x):_>3?E(i,b,x):E(i,b))||x);return _>3&&x&&Object.defineProperty(i,b,x),x},f=function(t,i){return function(b,m){i(b,m,t)}};function o(t){return t.command!==void 0}class n{constructor(t){this.id=n._idPool++,this._debugName=t}}n._idPool=0,n.CommandPalette=new n("CommandPalette"),n.EditorContext=new n("EditorContext"),n.SimpleEditorContext=new n("SimpleEditorContext"),n.EditorContextCopy=new n("EditorContextCopy"),n.EditorContextPeek=new n("EditorContextPeek"),n.MenubarEditMenu=new n("MenubarEditMenu"),n.MenubarCopy=new n("MenubarCopy"),n.MenubarGoMenu=new n("MenubarGoMenu"),n.MenubarSelectionMenu=new n("MenubarSelectionMenu"),n.InlineCompletionsActions=new n("InlineCompletionsActions");const a=Object(e.c)("menuService"),h=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new R.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:t=>t===n.CommandPalette}}addCommand(t){return this.addCommands(F.a.single(t))}addCommands(t){for(const i of t)this._commands.set(i.id,i);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(L.i)(()=>{let i=!1;for(const b of t)i=this._commands.delete(b.id)||i;i&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(t){return this._commands.get(t)}getCommands(){const t=new Map;return this._commands.forEach((i,b)=>t.set(b,i)),t}appendMenuItem(t,i){return this.appendMenuItems(F.a.single({id:t,item:i}))}appendMenuItems(t){const i=new Set,b=new D.a;for(const{id:m,item:_}of t){let x=this._menuItems.get(m);x||(x=new D.a,this._menuItems.set(m,x)),b.push(x.push(_)),i.add(m)}return this._onDidChangeMenu.fire(i),Object(L.i)(()=>{if(b.size>0){for(let m of b)m();this._onDidChangeMenu.fire(i),b.clear()}})}getMenuItems(t){let i;return this._menuItems.has(t)?i=[...this._menuItems.get(t)]:i=[],t===n.CommandPalette&&this._appendImplicitItems(i),i}_appendImplicitItems(t){const i=new Set;for(const b of t)o(b)&&(i.add(b.command.id),b.alt&&i.add(b.alt.id));this._commands.forEach((b,m)=>{i.has(m)||t.push({command:b})})}};class s extends ee.e{constructor(t,i,b,m){super(`submenuitem.${t.submenu.id}`,typeof t.title=="string"?t.title:t.title.value,[],"submenu");this.item=t,this._menuService=i,this._contextKeyService=b,this._options=m}get actions(){const t=[],i=this._menuService.createMenu(this.item.submenu,this._contextKeyService),b=i.getActions(this._options);i.dispose();for(const[,m]of b)m.length>0&&(t.push(...m),t.push(new ee.d));return t.length&&t.pop(),t}}let r=class t{constructor(i,b,m,_,x){var E,y;if(this._commandService=x,this.id=i.id,this.label=(m==null?void 0:m.renderShortTitle)&&i.shortTitle?typeof i.shortTitle=="string"?i.shortTitle:i.shortTitle.value:typeof i.title=="string"?i.title:i.title.value,this.tooltip=(y=typeof i.tooltip=="string"?i.tooltip:(E=i.tooltip)===null||E===void 0?void 0:E.value)!==null&&y!==void 0?y:"",this.enabled=!i.precondition||_.contextMatchesRules(i.precondition),this.checked=void 0,i.toggled){const c=i.toggled.condition?i.toggled:{condition:i.toggled};this.checked=_.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=i,this.alt=b?new t(b,void 0,m,_,x):void 0,this._options=m,A.d.isThemeIcon(i.icon)&&(this.class=W.a.asClassName(i.icon))}dispose(){}run(...i){var b,m;let _=[];return((b=this._options)===null||b===void 0?void 0:b.arg)&&(_=[..._,this._options.arg]),((m=this._options)===null||m===void 0?void 0:m.shouldForwardArgs)&&(_=[..._,...i]),this._commandService.executeCommand(this.id,..._)}};r=d([f(3,U.b),f(4,j.b)],r)},ic2d:function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return F});var ee=K("FWmy"),W=K("746U");class R{constructor(){this.data=new Map}add(L,D){ee.a(W.l(L)),ee.a(W.k(D)),ee.a(!this.data.has(L),"There is already an extension with this id"),this.data.set(L,D)}as(L){return this.data.get(L)||null}}const F=new R},kzJb:function(Ge,oe,K){Ge.exports={wrap:"wrap___1_zGE",avatarWrap:"avatarWrap___1PHMh",avatar:"avatar___3tqlX",updateAvatarWrap:"updateAvatarWrap___z2gMm",img:"img___2NUme",updateAvatar:"updateAvatar___3wWy1",name_role:"name_role___3grmk",name:"name___2jxfA",role:"role___2C0k4",manage:"manage___2eiWG",colorGary:"colorGary___2ozEK",colorGreen:"colorGreen___14gmo",colorRed:"colorRed___2eVnN",item:"item___3nPxu",active:"active___3T4Rf",newTip:"newTip___1Ta-b"}},nEHx:function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return ee});var ee;(function(W){W.DARK="dark",W.LIGHT="light",W.HIGH_CONTRAST="hc"})(ee||(ee={}))},nnTU:function(Ge,oe,K){"use strict";K.d(oe,"b",function(){return j}),K.d(oe,"a",function(){return U});var ee=K("MI8n"),W=K("JYp7"),R=K("pmY6"),F=K("24hK"),L=K("746U"),D=K("Cg/j");const j=Object(D.c)("commandService"),U=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ee.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,A){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!A)throw new Error("invalid command");return this.registerCommand({id:e,handler:A})}if(e.description){const a=[];for(let s of e.description.args)a.push(s.constraint);const h=e.handler;e.handler=function(s,...r){return Object(L.o)(r,a),h(s,...r)}}const{id:d}=e;let f=this._commands.get(d);f||(f=new F.a,this._commands.set(d,f));let o=f.unshift(e),n=Object(R.i)(()=>{o();const a=this._commands.get(d);(a==null?void 0:a.isEmpty())&&this._commands.delete(d)});return this._onDidRegisterCommand.fire(d),n}registerCommandAlias(e,A){return U.registerCommand(e,(d,...f)=>d.get(j).executeCommand(A,...f))}getCommand(e){const A=this._commands.get(e);return!A||A.isEmpty()?void 0:W.a.first(A)}getCommands(){const e=new Map;for(const A of this._commands.keys()){const d=this.getCommand(A);d&&e.set(A,d)}return e}};U.registerCommand("noop",()=>{})},p5ED:function(Ge,oe,K){"use strict";var ee=K("+L6B"),W=K("2/Rp"),R=K("5Dmo"),F=K("3S7+"),L=K("k1fw"),D=K("9og8"),j=K("tJVT"),U=K("WmNS"),e=K.n(U),A=K("q1tI"),d=K.n(A),f=K("vHTk"),o=K.n(f),n=K("yEEn"),a=K("ZW9T"),h=K("1vsH"),s=K("V0Rq"),r=K("m3rI");oe.a=function(t){var i,b,m,_,x,E,y,c=t.editOffice,u=c===void 0?"view":c,l=t.data,v=t.theme,g=t.type,w=t.filename,O=t.monacoEditor,I=t.className,S=t.style,P=t.close,B=t.onClose,C=t.hasMask,H=t.disabledDownload,z=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Z=Object(j.a)(z,2),Q=Z[0],pe=Z[1],le=Object(A.useState)(""),de=Object(j.a)(le,2),ce=de[0],me=de[1],te=Object(A.useState)(),$=Object(j.a)(te,2),_e=$[0],Oe=$[1],Ce=window.ENV==="build"?"/react/build":"",Ae=r.a.PROXY_SERVER||location.origin,Pe,ye=1024*1024,Ee=10*ye,Ie=Object(A.useRef)();(i=l)!==null&&i!==void 0&&i.startsWith("/api")&&g!=="txt"&&(l=r.a.API_SERVER+l),g==="office"&&(Pe=Object(h.U)(l).filesize,Pe>Ee&&(g="other")),w&&O&&(O.filename=w),Object(A.useEffect)(function(){var he,xe,we=(he=document.cookie)===null||he===void 0||((xe=he.replace(/\s/g,""))===null||xe===void 0)?void 0:xe.split(";");we==null||we.map(function(Me){var De=Me.split("=");De[0]==="_educoder_session"&&me(De[1])})},[]),Object(A.useEffect)(function(){g==="office"&&X()},[g,l]);var X=function(){var he=Object(D.a)(e.a.mark(function xe(){var we,Me,De;return e.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return console.log("data:",l),we=l,l.startsWith("http")||(we=location.origin+we),Me=new URL(we).pathname.split("/").pop(),Ne.next=6,Object(s.V)({attachment_id:Me});case 6:De=Ne.sent,Oe(De);case 8:case"end":return Ne.stop()}},xe)}));return function(){return he.apply(this,arguments)}}(),se=function(){if(l.startsWith("http")||l.startsWith("blob:")){ue();return}Object(h.z)(w||"educoder",l,w)},ue=function(){Object(h.x)(w||"educoder",decodeURIComponent(l))};return d.a.createElement("div",{style:Object(L.a)({},S||{}),className:"".concat(C&&o.a.bgBlack," ").concat(g?o.a.wrp:"hide")},P&&d.a.createElement("div",{className:o.a.close,ref:Ie},!H&&d.a.createElement(F.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ie.current}},d.a.createElement("span",{onClick:ue},d.a.createElement("i",{className:"icon-quxiaozhiding"}))),d.a.createElement(F.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ie.current}},d.a.createElement("span",{className:"",onClick:B},d.a.createElement("i",{className:"icon-guanbi1"})))),d.a.createElement("div",{className:"".concat(o.a[I]," ").concat(I," ").concat(o.a.monaco," ").concat(g==="txt"?"show":"hide")},g==="txt"&&d.a.createElement(a.b,O)),g==="audio"&&d.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}),g==="video"&&d.a.createElement(d.a.Fragment,null,((_=l)===null||_===void 0?void 0:_.indexOf("http"))>-1?d.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):d.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),g==="office"&&_e&&d.a.createElement("iframe",{src:"".concat(Ce,"/office.html?key=").concat(_e.key,"&url=").concat(Ae+_e.url,"&callbackUrl=").concat(Ae+_e.callbackUrl,"&fileType=").concat(_e.fileType,"&title=").concat(_e.title,"&model=").concat(u,"&officeServer=").concat(r.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),g==="html"&&d.a.createElement("iframe",{src:l+"&disposition=inline"}),g==="pdf"&&d.a.createElement("iframe",{src:"".concat(Ce,"/js/pdfview/index.html?url=").concat(l,"&disabledDownload=").concat(!!H)}),g==="image"&&d.a.createElement("img",{src:"".concat(((x=l)===null||x===void 0?void 0:x.indexOf("http://"))>-1||((E=l)===null||E===void 0?void 0:E.indexOf("https://"))>-1||(y=l)!==null&&y!==void 0&&y.startsWith("/api")?"":"data:image/png;base64,").concat(l)}),g==="other"&&d.a.createElement("div",null,d.a.createElement(W.a,{type:"primary",size:"large",onClick:se},d.a.createElement(n.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),g==="download"&&d.a.createElement(W.a,{type:"primary",size:"large",onClick:se},d.a.createElement(n.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Ge,oe,K){"use strict";K.d(oe,"h",function(){return A}),K.d(oe,"g",function(){return f}),K.d(oe,"f",function(){return o}),K.d(oe,"e",function(){return n}),K.d(oe,"i",function(){return a}),K.d(oe,"b",function(){return h}),K.d(oe,"a",function(){return s}),K.d(oe,"d",function(){return r}),K.d(oe,"c",function(){return t});var ee=K("C/vA"),W=K("JYp7");const R=!1;let F=null;function L(i){F=i}if(R){const i="__is_disposable_tracked__";L(new class{trackDisposable(b){const m=new Error("Potentially leaked disposable").stack;setTimeout(()=>{b[i]||console.log(m)},3e3)}setParent(b,m){if(b&&b!==s.None)try{b[i]=!0}catch(_){}}markAsDisposed(b){if(b&&b!==s.None)try{b[i]=!0}catch(m){}}markAsSingleton(b){}})}function D(i){return F==null||F.trackDisposable(i),i}function j(i){F==null||F.markAsDisposed(i)}function U(i,b){F==null||F.setParent(i,b)}function e(i,b){if(!F)return;for(const m of i)F.setParent(m,b)}function A(i){return F==null||F.markAsSingleton(i),i}class d extends Error{constructor(i){super(`Encountered errors while disposing of store. Errors: [${i.join(", ")}]`);this.errors=i}}function f(i){return typeof i.dispose=="function"&&i.dispose.length===0}function o(i){if(W.a.is(i)){let b=[];for(const m of i)if(m)try{m.dispose()}catch(_){b.push(_)}if(b.length===1)throw b[0];if(b.length>1)throw new d(b);return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function n(...i){const b=a(()=>o(i));return e(i,b),b}function a(i){const b=D({dispose:Object(ee.a)(()=>{j(b),i()})});return b}class h{constructor(){this._toDispose=new Set,this._isDisposed=!1,D(this)}dispose(){if(this._isDisposed)return;j(this),this._isDisposed=!0,this.clear()}clear(){try{o(this._toDispose.values())}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return U(i,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(i),i}}h.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new h,D(this),U(this._store,this)}dispose(){j(this),this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}}s.None=Object.freeze({dispose(){}});class r{constructor(){this._isDisposed=!1,D(this)}get value(){return this._isDisposed?void 0:this._value}set value(i){var b;if(this._isDisposed||i===this._value)return;(b=this._value)===null||b===void 0||b.dispose(),i&&U(i,this),this._value=i}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,j(this),(i=this._value)===null||i===void 0||i.dispose(),this._value=void 0}clearAndLeak(){const i=this._value;return this._value=void 0,i&&U(i,null),i}}class t{constructor(i){this.object=i}dispose(){}}},psGv:function(Ge,oe,K){var ee,W;(function(){var R;(function(){"use strict";var j=[,,function(d){function f(a){this.__parent=a,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=[]}f.prototype.clone_empty=function(){var a=new f(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},f.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},f.prototype.has_match=function(a){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(a))return!0;return!1},f.prototype.set_indent=function(a,h){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.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)},f.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},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(a){this.__items.push(a);var h=a.lastIndexOf(`
|
|
`);h!==-1?this.__character_count=a.length-h:this.__character_count+=a.length},f.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function o(a,h){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),h=h||"",a.indent_level>0&&(h=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}o.prototype.get_indent_size=function(a,h){var s=this.__base_string_length;return h=h||0,a<0&&(s=0),s+=a*this.__indent_size,s+=h,s},o.prototype.get_indent_string=function(a,h){var s=this.__base_string;return h=h||0,a<0&&(a=0,s=""),h+=a*this.__indent_size,this.__ensure_cache(h),s+=this.__cache[h],s},o.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var a=this.__cache.length,h=0,s="";this.__indent_size&&a>=this.__indent_size&&(h=Math.floor(a/this.__indent_size),a-=h*this.__indent_size,s=new Array(h+1).join(this.__indent_string)),a&&(s+=new Array(a+1).join(" ")),this.__cache.push(s)};function n(a,h){this.__indent_cache=new o(a,h),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(a,h){return this.__indent_cache.get_indent_string(a,h)},n.prototype.get_indent_size=function(a,h){return this.__indent_cache.get_indent_size(a,h)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(a){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 a!==`
|
|
`&&(s=s.replace(/[\n]/g,a)),s},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(a,h){return a=a||0,h=h||0,this.next_line.set_indent(a,h),this.__lines.length>1?(this.current_line.set_indent(a,h),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(a){for(var h=0;h<a.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(a){for(var h=this.__lines.length;a<h;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(a,h){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(a)!==0&&r.item(-1)!==h){this.__lines.splice(s+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},d.exports.Output=n},function(d){function f(o,n,a,h){this.type=o,this.text=n,this.comments_before=null,this.newlines=a||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}d.exports.Token=f},,,function(d){function f(a,h){this.raw_options=o(a,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"])}f.prototype._get_array=function(a,h){var s=this.raw_options[a],r=h||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},f.prototype._get_boolean=function(a,h){var s=this.raw_options[a],r=s===void 0?!!h:!!s;return r},f.prototype._get_characters=function(a,h){var s=this.raw_options[a],r=h||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),r},f.prototype._get_number=function(a,h){var s=this.raw_options[a];h=parseInt(h,10),isNaN(h)&&(h=0);var r=parseInt(s,10);return isNaN(r)&&(r=h),r},f.prototype._get_selection=function(a,h,s){var r=this._get_selection_list(a,h,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[a]+"'");return r[0]},f.prototype._get_selection_list=function(a,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 r=this._get_array(a,s);if(!this._is_valid_selection(r,h))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
|
|
`+h+`
|
|
You passed in: '`+this.raw_options[a]+"'");return r},f.prototype._is_valid_selection=function(a,h){return a.length&&h.length&&!a.some(function(s){return h.indexOf(s)===-1})};function o(a,h){var s={};a=n(a);var r;for(r in a)r!==h&&(s[r]=a[r]);if(h&&a[h])for(r in a[h])s[r]=a[h][r];return s}function n(a){var h={},s;for(s in a){var r=s.replace(/-/g,"_");h[r]=a[s]}return h}d.exports.Options=f,d.exports.normalizeOpts=n,d.exports.mergeOpts=o},,function(d){var f=RegExp.prototype.hasOwnProperty("sticky");function o(n){this.__input=n||"",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 n=null;return this.hasNext()&&(n=this.__input.charAt(this.__position),this.__position+=1),n},o.prototype.peek=function(n){var a=null;return n=n||0,n+=this.__position,n>=0&&n<this.__input_length&&(a=this.__input.charAt(n)),a},o.prototype.__match=function(n,a){n.lastIndex=a;var h=n.exec(this.__input);return h&&!(f&&n.sticky)&&(h.index!==a&&(h=null)),h},o.prototype.test=function(n,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(n,a):!1},o.prototype.testChar=function(n,a){var h=this.peek(a);return n.lastIndex=0,h!==null&&n.test(h)},o.prototype.match=function(n){var a=this.__match(n,this.__position);return a?this.__position+=a[0].length:a=null,a},o.prototype.read=function(n,a,h){var s="",r;return n&&(r=this.match(n),r&&(s+=r[0])),a&&(r||!n)&&(s+=this.readUntil(a,h)),s},o.prototype.readUntil=function(n,a){var h="",s=this.__position;n.lastIndex=this.__position;var r=n.exec(this.__input);return r?(s=r.index,a&&(s+=r[0].length)):s=this.__input_length,h=this.__input.substring(this.__position,s),this.__position=s,h},o.prototype.readUntilAfter=function(n){return this.readUntil(n,!0)},o.prototype.get_regexp=function(n,a){var h=null,s="g";return a&&f&&(s="y"),typeof n=="string"&&n!==""?h=new RegExp(n,s):n&&(h=new RegExp(n.source,s)),h},o.prototype.get_literal_regexp=function(n){return RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(n){var a=this.__position,h=this.readUntilAfter(n);return this.__position=a,h},o.prototype.lookBack=function(n){var a=this.__position-1;return a>=n.length&&this.__input.substring(a-n.length,a).toLowerCase()===n},d.exports.InputScanner=o},function(d,f,o){var n=o(8).InputScanner,a=o(3).Token,h=o(10).TokenStream,s=o(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},t=function(i,b){this._input=new n(i),this._options=b||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};t.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var i,b=new a(r.START,""),m=null,_=[],x=new h;b.type!==r.EOF;){for(i=this._get_next_token(b,m);this._is_comment(i);)x.add(i),i=this._get_next_token(b,m);x.isEmpty()||(i.comments_before=x,x=new h),i.parent=m,this._is_opening(i)?(_.push(m),m=i):m&&this._is_closing(i,m)&&(i.opened=m,m.closed=i,m=_.pop(),i.parent=m),i.previous=b,b.next=i,this.__tokens.add(i),b=i}return this.__tokens},t.prototype._is_first_token=function(){return this.__tokens.isEmpty()},t.prototype._reset=function(){},t.prototype._get_next_token=function(i,b){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(r.RAW,m):this._create_token(r.EOF,"")},t.prototype._is_comment=function(i){return!1},t.prototype._is_opening=function(i){return!1},t.prototype._is_closing=function(i,b){return!1},t.prototype._create_token=function(i,b){var m=new a(i,b,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},t.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},d.exports.Tokenizer=t,d.exports.TOKEN=r},function(d){function f(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},f.prototype.peek=function(o){var n=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(n=this.__tokens[o]),n},f.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},d.exports.TokenStream=f},function(d,f,o){var n=o(12).Pattern;function a(h,s){n.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=""}a.prototype=new n,a.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+"]")},a.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},a.prototype.matching=function(h,s){var r=this._create();return r.__set_whitespace_patterns(h,s),r._update(),r},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(h,s){h.lastIndex=0;for(var r=0,t=[],i=h.exec(s);i;)t.push(s.substring(r,i.index)),r=i.index+i[0].length,i=h.exec(s);return r<s.length?t.push(s.substring(r,s.length)):t.push(""),t},d.exports.WhitespacePattern=a},function(d){function f(o,n){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,n&&(this._starting_pattern=this._input.get_regexp(n._starting_pattern,!0),this._match_pattern=this._input.get_regexp(n._match_pattern,!0),this._until_pattern=this._input.get_regexp(n._until_pattern),this._until_after=n._until_after)}f.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},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(o){var n=this._create();return n._until_after=!0,n._until_pattern=this._input.get_regexp(o),n._update(),n},f.prototype.until=function(o){var n=this._create();return n._until_after=!1,n._until_pattern=this._input.get_regexp(o),n._update(),n},f.prototype.starting_with=function(o){var n=this._create();return n._starting_pattern=this._input.get_regexp(o,!0),n._update(),n},f.prototype.matching=function(o){var n=this._create();return n._match_pattern=this._input.get_regexp(o,!0),n._update(),n},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},d.exports.Pattern=f},function(d){function f(o,n){o=typeof o=="string"?o:o.source,n=typeof n=="string"?n:n.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+n,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+n,"g")}f.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var n={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(o);a;)n[a[1]]=a[2],a=this.__directive_pattern.exec(o);return n},f.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},d.exports.Directives=f},function(d,f,o){var n=o(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(s,r){n.call(this,s,r),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var t=new n(s);this.__patterns={handlebars_comment:t.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:t.starting_with(/{{{/).until_after(/}}}/),handlebars:t.starting_with(/{{/).until_after(/}}/),php:t.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:t.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:t.starting_with(/{%/).until_after(/%}/),django_value:t.starting_with(/{{/).until_after(/}}/),django_comment:t.starting_with(/{#/).until_after(/#}/),smarty:t.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:t.starting_with(/{\*/).until_after(/\*}/),smarty_literal:t.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new n,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},h.prototype.read_options=function(s){var r=this._create();for(var t in a)r._disabled[t]=s.templating.indexOf(t)===-1;return r._update(),r},h.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},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 r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),s+=r,r=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="",r=this._input.peek();if(r==="<"){var t=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&t==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&t==="%"&&(s=s||this.__patterns.erb.read())}else r==="{"&&(!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},d.exports.TemplatablePattern=h},,,,function(d,f,o){var n=o(19).Beautifier,a=o(20).Options;function h(s,r,t,i){var b=new n(s,r,t,i);return b.beautify()}d.exports=h,d.exports.defaultOptions=function(){return new a}},function(d,f,o){var n=o(20).Options,a=o(2).Output,h=o(21).Tokenizer,s=o(21).TOKEN,r=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,i=function(v,g){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 a(v,g)};i.prototype.current_line_has_match=function(v){return this._output.current_line.has_match(v)},i.prototype.set_space_before_token=function(v,g){this._output.space_before_token=v,this._output.non_breaking_space=g},i.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},i.prototype.add_raw_token=function(v){this._output.add_raw_token(v)},i.prototype.print_preserved_newlines=function(v){var g=0;v.type!==s.TEXT&&v.previous.type!==s.TEXT&&(g=v.newlines?1:0),this.preserve_newlines&&(g=v.newlines<this.max_preserve_newlines+1?v.newlines:this.max_preserve_newlines+1);for(var w=0;w<g;w++)this.print_newline(w>0);return g!==0},i.prototype.traverse_whitespace=function(v){return v.whitespace_before||v.newlines?(this.print_preserved_newlines(v)||(this._output.space_before_token=!0),!0):!1},i.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},i.prototype.print_newline=function(v){this._output.add_new_line(v)},i.prototype.print_token=function(v){v.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(v.text))},i.prototype.indent=function(){this.indent_level++},i.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 g=null,w=v.next;w.type!==s.EOF&&v.closed!==w;){if(w.type===s.ATTRIBUTE&&w.text==="type"){w.next&&w.next.type===s.EQUALS&&w.next.next&&w.next.next.type===s.VALUE&&(g=w.next.next.text);break}w=w.next}return g},m=function(v,g){var w=null,O=null;return g.closed?(v==="script"?w="text/javascript":v==="style"&&(w="text/css"),w=b(g)||w,w.search("text/css")>-1?O="css":w.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?O="javascript":w.search(/(text|application|dojo)\/(x-)?(html)/)>-1?O="html":w.search(/test\/null/)>-1&&(O="null"),O):null};function _(v,g){return g.indexOf(v)!==-1}function x(v,g,w){this.parent=v||null,this.tag=g?g.tag_name:"",this.indent_level=w||0,this.parser_token=g||null}function E(v){this._printer=v,this._current_frame=null}E.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},E.prototype.record_tag=function(v){var g=new x(this._current_frame,v,this._printer.indent_level);this._current_frame=g},E.prototype._try_pop_frame=function(v){var g=null;return v&&(g=v.parser_token,this._printer.indent_level=v.indent_level,this._current_frame=v.parent),g},E.prototype._get_frame=function(v,g){for(var w=this._current_frame;w&&!(v.indexOf(w.tag)!==-1);){if(g&&g.indexOf(w.tag)!==-1){w=null;break}w=w.parent}return w},E.prototype.try_pop=function(v,g){var w=this._get_frame([v],g);return this._try_pop_frame(w)},E.prototype.indent_to_tag=function(v){var g=this._get_frame(v);g&&(this._printer.indent_level=g.indent_level)};function y(v,g,w,O){this._source_text=v||"",g=g||{},this._js_beautify=w,this._css_beautify=O,this._tag_stack=null;var I=new n(g,"html");this._options=I,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,g=this._options.eol;this._options.eol==="auto"&&(g=`
|
|
`,v&&r.test(v)&&(g=v.match(r)[0])),v=v.replace(t,`
|
|
`);var w=v.match(/^[\t ]*/)[0],O={text:"",type:""},I=new c,S=new i(this._options,w),P=new h(v,this._options).tokenize();this._tag_stack=new E(S);for(var B=null,C=P.next();C.type!==s.EOF;)C.type===s.TAG_OPEN||C.type===s.COMMENT?(B=this._handle_tag_open(S,C,I,O),I=B):C.type===s.ATTRIBUTE||C.type===s.EQUALS||C.type===s.VALUE||C.type===s.TEXT&&!I.tag_complete?B=this._handle_inside_tag(S,C,I,P):C.type===s.TAG_CLOSE?B=this._handle_tag_close(S,C,I):C.type===s.TEXT?B=this._handle_text(S,C,I):S.add_raw_token(C),O=B,C=P.next();var H=S._output.get_code(g);return H},y.prototype._handle_tag_close=function(v,g,w){var O={text:g.text,type:g.type};return v.alignment_size=0,w.tag_complete=!0,v.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),w.is_unformatted?v.add_raw_token(g):(w.tag_start_char==="<"&&(v.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&w.has_wrapped_attrs&&v.print_newline(!1)),v.print_token(g)),w.indent_content&&!(w.is_unformatted||w.is_content_unformatted)&&(v.indent(),w.indent_content=!1),!w.is_inline_element&&!(w.is_unformatted||w.is_content_unformatted)&&v.set_wrap_point(),O},y.prototype._handle_inside_tag=function(v,g,w,O){var I=w.has_wrapped_attrs,S={text:g.text,type:g.type};if(v.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),w.is_unformatted)v.add_raw_token(g);else if(w.tag_start_char==="{"&&g.type===s.TEXT)v.print_preserved_newlines(g)?(g.newlines=0,v.add_raw_token(g)):v.print_token(g);else{if(g.type===s.ATTRIBUTE?(v.set_space_before_token(!0),w.attr_count+=1):(g.type===s.EQUALS||g.type===s.VALUE&&g.previous.type===s.EQUALS)&&v.set_space_before_token(!1),g.type===s.ATTRIBUTE&&w.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(v.traverse_whitespace(g),I=I||g.newlines!==0),this._is_wrap_attributes_force)){var P=w.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&w.attr_count===1){var B=!0,C=0,H;do{if(H=O.peek(C),H.type===s.ATTRIBUTE){B=!1;break}C+=1}while(C<4&&H.type!==s.EOF&&H.type!==s.TAG_CLOSE);P=!B}P&&(v.print_newline(!1),I=!0)}v.print_token(g),I=I||v.previous_token_wrapped(),w.has_wrapped_attrs=I}return S},y.prototype._handle_text=function(v,g,w){var O={text:g.text,type:"TK_CONTENT"};return w.custom_beautifier_name?this._print_custom_beatifier_text(v,g,w):w.is_unformatted||w.is_content_unformatted?v.add_raw_token(g):(v.traverse_whitespace(g),v.print_token(g)),O},y.prototype._print_custom_beatifier_text=function(v,g,w){var O=this;if(g.text!==""){var I=g.text,S,P=1,B="",C="";w.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?S=this._js_beautify:w.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?S=this._css_beautify:w.custom_beautifier_name==="html"&&(S=function(le,de){var ce=new y(le,de,O._js_beautify,O._css_beautify);return ce.beautify()}),this._options.indent_scripts==="keep"?P=0:this._options.indent_scripts==="separate"&&(P=-v.indent_level);var H=v.get_full_indent(P);if(I=I.replace(/\n[ \t]*$/,""),w.custom_beautifier_name!=="html"&&I[0]==="<"&&I.match(/^(<!--|<!\[CDATA\[)/)){var z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(I);if(!z){v.add_raw_token(g);return}B=H+z[1]+`
|
|
`,I=z[4],z[5]&&(C=H+z[5]),I=I.replace(/\n[ \t]*$/,""),(z[2]||z[3].indexOf(`
|
|
`)!==-1)&&(z=z[3].match(/[ \t]+$/),z&&(g.whitespace_before=z[0]))}if(I)if(S){var Z=function(){this.eol=`
|
|
`};Z.prototype=this._options.raw_options;var Q=new Z;I=S(H+I,Q)}else{var pe=g.whitespace_before;pe&&(I=I.replace(new RegExp(`
|
|
(`+pe+")?","g"),`
|
|
`)),I=H+I.replace(/\n/g,`
|
|
`+H)}B&&(I?I=B+I+`
|
|
`+C:I=B+C),v.print_newline(!1),I&&(g.text=I,g.whitespace_before="",g.newlines=0,v.add_raw_token(g),v.print_newline(!0))}},y.prototype._handle_tag_open=function(v,g,w,O){var I=this._get_tag_open_token(g);return(w.is_unformatted||w.is_content_unformatted)&&!w.is_empty_element&&g.type===s.TAG_OPEN&&g.text.indexOf("</")===0?(v.add_raw_token(g),I.start_tag_token=this._tag_stack.try_pop(I.tag_name)):(v.traverse_whitespace(g),this._set_tag_position(v,g,I,w,O),I.is_inline_element||v.set_wrap_point(),v.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(I.alignment_size=g.text.length+1),!I.tag_complete&&!I.is_unformatted&&(v.alignment_size=I.alignment_size),I};var c=function(v,g){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="",!g)this.tag_complete=!0;else{var w;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(w=g.text.match(/^<([^\s>]*)/),this.tag_check=w?w[1]:""):(w=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=w?w[1]:"",(g.text.startsWith("{{#>")||g.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&g.next!==null?this.tag_check=g.next.text.split(" ")[0]:this.tag_check=g.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),g.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||g.closed&&g.closed.text==="/>";var O=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(O=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(O)))}};y.prototype._get_tag_open_token=function(v){var g=new c(this._tag_stack.get_parser_token(),v);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||_(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&_(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&_(g.tag_check,this._options.content_unformatted),g.is_inline_element=_(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},y.prototype._set_tag_position=function(v,g,w,O,I){if(w.is_empty_element||(w.is_end_tag?w.start_tag_token=this._tag_stack.try_pop(w.tag_name):(this._do_optional_end_element(w)&&(w.is_inline_element||v.print_newline(!1)),this._tag_stack.record_tag(w),(w.tag_name==="script"||w.tag_name==="style")&&!(w.is_unformatted||w.is_content_unformatted)&&(w.custom_beautifier_name=m(w.tag_check,g)))),_(w.tag_check,this._options.extra_liners)&&(v.print_newline(!1),v._output.just_added_blankline()||v.print_newline(!0)),w.is_empty_element){if(w.tag_start_char==="{"&&w.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),w.indent_content=!0;var S=v.current_line_has_match(/{{#if/);S||v.print_newline(!1)}w.tag_name==="!--"&&I.type===s.TAG_CLOSE&&O.is_end_tag&&w.text.indexOf(`
|
|
`)===-1||(w.is_inline_element||w.is_unformatted||v.print_newline(!1),this._calcluate_parent_multiline(v,w))}else if(w.is_end_tag){var P=!1;P=w.start_tag_token&&w.start_tag_token.multiline_content,P=P||!w.is_inline_element&&!(O.is_inline_element||O.is_unformatted)&&!(I.type===s.TAG_CLOSE&&w.start_tag_token===O)&&I.type!=="TK_CONTENT",(w.is_content_unformatted||w.is_unformatted)&&(P=!1),P&&v.print_newline(!1)}else w.indent_content=!w.custom_beautifier_name,w.tag_start_char==="<"&&(w.tag_name==="html"?w.indent_content=this._options.indent_inner_html:w.tag_name==="head"?w.indent_content=this._options.indent_head_inner_html:w.tag_name==="body"&&(w.indent_content=this._options.indent_body_inner_html)),!(w.is_inline_element||w.is_unformatted)&&(I.type!=="TK_CONTENT"||w.is_content_unformatted)&&v.print_newline(!1),this._calcluate_parent_multiline(v,w)},y.prototype._calcluate_parent_multiline=function(v,g){g.parent&&v._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.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 g=null;if(v.is_empty_element||!v.is_start_tag||!v.parent)return;if(v.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(v.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(v.tag_name==="dd"||v.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(v.parent.tag_name==="p"&&u.indexOf(v.tag_name)!==-1){var w=v.parent.parent;(!w||l.indexOf(w.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else v.tag_name==="rp"||v.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):v.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):v.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):v.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):v.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):v.tag_name==="tbody"||v.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):v.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(v.tag_name==="th"||v.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return v.parent=this._tag_stack.get_parser_token(),g},d.exports.Beautifier=y},function(d,f,o){var n=o(6).Options;function a(h){n.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"])}a.prototype=new n,d.exports.Options=a},function(d,f,o){var n=o(9).Tokenizer,a=o(9).TOKEN,h=o(13).Directives,s=o(14).TemplatablePattern,r=o(12).Pattern,t={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:a.START,RAW:a.RAW,EOF:a.EOF},i=new h(/<\!--/,/-->/),b=function(m,_){n.call(this,m,_),this._current_tag_name="";var x=new s(this._input).read_options(this._options),E=new r(this._input);if(this.__patterns={word:x.until(/[\n\r\t <]/),single_quote:x.until_after(/'/),double_quote:x.until_after(/"/),attribute:x.until(/[\n\r\t =>]|\/>/),element_name:x.until(/[\n\r\t >\/]/),handlebars_comment:E.starting_with(/{{!--/).until_after(/--}}/),handlebars:E.starting_with(/{{/).until_after(/}}/),handlebars_open:E.until(/[\n\r\t }]/),handlebars_raw_close:E.until(/}}/),comment:E.starting_with(/<!--/).until_after(/-->/),cdata:E.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:E.starting_with(/<!\[/).until_after(/]>/),processing:E.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=E.matching(y).until_after(y)}};b.prototype=new n,b.prototype._is_comment=function(m){return!1},b.prototype._is_opening=function(m){return m.type===t.TAG_OPEN},b.prototype._is_closing=function(m,_){return m.type===t.TAG_CLOSE&&_&&((m.text===">"||m.text==="/>")&&_.text[0]==="<"||m.text==="}}"&&_.text[0]==="{"&&_.text[1]==="{")},b.prototype._reset=function(){this._current_tag_name=""},b.prototype._get_next_token=function(m,_){var x=null;this._readWhitespace();var E=this._input.peek();return E===null?this._create_token(t.EOF,""):(x=x||this._read_open_handlebars(E,_),x=x||this._read_attribute(E,m,_),x=x||this._read_close(E,_),x=x||this._read_raw_content(E,m,_),x=x||this._read_content_word(E),x=x||this._read_comment_or_cdata(E),x=x||this._read_processing(E),x=x||this._read_open(E,_),x=x||this._create_token(t.UNKNOWN,this._input.next()),x)},b.prototype._read_comment_or_cdata=function(m){var _=null,x=null,E=null;if(m==="<"){var y=this._input.peek(1);y==="!"&&(x=this.__patterns.comment.read(),x?(E=i.get_directives(x),E&&E.ignore==="start"&&(x+=i.readIgnored(this._input))):x=this.__patterns.cdata.read()),x&&(_=this._create_token(t.COMMENT,x),_.directives=E)}return _},b.prototype._read_processing=function(m){var _=null,x=null,E=null;if(m==="<"){var y=this._input.peek(1);(y==="!"||y==="?")&&(x=this.__patterns.conditional_comment.read(),x=x||this.__patterns.processing.read()),x&&(_=this._create_token(t.COMMENT,x),_.directives=E)}return _},b.prototype._read_open=function(m,_){var x=null,E=null;return _||m==="<"&&(x=this._input.next(),this._input.peek()==="/"&&(x+=this._input.next()),x+=this.__patterns.element_name.read(),E=this._create_token(t.TAG_OPEN,x)),E},b.prototype._read_open_handlebars=function(m,_){var x=null,E=null;return _||this._options.indent_handlebars&&m==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(x=this.__patterns.handlebars_comment.read(),x=x||this.__patterns.handlebars.read(),E=this._create_token(t.COMMENT,x)):(x=this.__patterns.handlebars_open.read(),E=this._create_token(t.TAG_OPEN,x))),E},b.prototype._read_close=function(m,_){var x=null,E=null;return _&&(_.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(x=this._input.next(),m==="/"&&(x+=this._input.next()),E=this._create_token(t.TAG_CLOSE,x)):_.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),E=this._create_token(t.TAG_CLOSE,"}}"))),E},b.prototype._read_attribute=function(m,_,x){var E=null,y="";if(x&&x.text[0]==="<")if(m==="=")E=this._create_token(t.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(),E=this._create_token(t.VALUE,c)}else y=this.__patterns.attribute.read(),y&&(_.type===t.EQUALS?E=this._create_token(t.VALUE,y):E=this._create_token(t.ATTRIBUTE,y));return E},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,_,x){var E="";if(x&&x.text[0]==="{")E=this.__patterns.handlebars_raw_close.read();else if(_.type===t.TAG_CLOSE&&_.opened.text[0]==="<"&&_.text[0]!=="/"){var y=_.opened.text.substr(1).toLowerCase();if(y==="script"||y==="style"){var c=this._read_comment_or_cdata(m);if(c)return c.type=t.TEXT,c;E=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(y)&&(E=this._input.readUntil(new RegExp("</"+y+"[\\n\\r\\t ]*?>","ig")))}return E?this._create_token(t.TEXT,E):null},b.prototype._read_content_word=function(m){var _="";if(this._options.unformatted_content_delimiter&&(m===this._options.unformatted_content_delimiter[0]&&(_=this.__patterns.unformatted_content_delimiter.read())),_||(_=this.__patterns.word.read()),_)return this._create_token(t.TEXT,_)},d.exports.Tokenizer=b,d.exports.TOKEN=t}],U={};function e(d){var f=U[d];if(f!==void 0)return f.exports;var o=U[d]={exports:{}};return j[d](o,o.exports,e),o.exports}var A=e(18);R=A})();var F=R;if(!0)!(ee=[K,K("6UM0"),K("TXwP")],W=function(j){var U=K("6UM0"),e=K("TXwP");return{html_beautify:function(A,d){return F(A,d,U.js_beautify,e.css_beautify)}}}.apply(oe,ee),W!==void 0&&(Ge.exports=W));else var L,D})()},"rAM+":function(Ge,oe,K){"use strict";K.d(oe,"a",function(){return W});var ee=K("Qw5x");function W(R,F){var L;if(typeof Symbol=="undefined"||R[Symbol.iterator]==null){if(Array.isArray(R)||(L=Object(ee.a)(R))||F&&R&&typeof R.length=="number"){L&&(R=L);var D=0,j=function(){};return{s:j,n:function(){return D>=R.length?{done:!0}:{done:!1,value:R[D++]}},e:function(f){throw f},f:j}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,e=!1,A;return{s:function(){L=R[Symbol.iterator]()},n:function(){var f=L.next();return U=f.done,f},e:function(f){e=!0,A=f},f:function(){try{!U&&L.return!=null&&L.return()}finally{if(e)throw A}}}}},rUJ1:function(Ge,oe){const K=/[&<>"']/,ee=/[&<>"']/g,W=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,F={"&":"&","<":"<",">":">",'"':""","'":"'"},L=E=>F[E];function D(E,y){if(y){if(K.test(E))return E.replace(ee,L)}else if(W.test(E))return E.replace(R,L);return E}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(E){return E.replace(j,(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 A(E,y){E=E.source||E,y=y||"";const c={replace:(u,l)=>(l=l.source||l,l=l.replace(e,"$1"),E=E.replace(u,l),c),getRegex:()=>new RegExp(E,y)};return c}const d=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function o(E,y,c){if(E){let u;try{u=decodeURIComponent(U(c)).replace(d,"").toLowerCase()}catch(l){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}y&&!f.test(c)&&(c=r(y,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch(u){return null}return c}const n={},a=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(E,y){n[" "+E]||(a.test(E)?n[" "+E]=E+"/":n[" "+E]=m(E,"/",!0)),E=n[" "+E];const c=E.indexOf(":")===-1;return y.substring(0,2)==="//"?c?y:E.replace(h,"$1")+y:y.charAt(0)==="/"?c?y:E.replace(s,"$1")+y:E+y}const t={exec:function(){}};function i(E){let y=1,c,u;for(;y<arguments.length;y++){c=arguments[y];for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(E[u]=c[u])}return E}function b(E,y){const c=E.replace(/\|/g,(v,g,w)=>{let O=!1,I=g;for(;--I>=0&&w[I]==="\\";)O=!O;return O?"|":" |"}),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(E,y,c){const u=E.length;if(u===0)return"";let l=0;for(;l<u;){const v=E.charAt(u-l-1);if(v===y&&!c)l++;else if(v!==y&&c)l++;else break}return E.substr(0,u-l)}function _(E,y){if(E.indexOf(y[1])===-1)return-1;const c=E.length;let u=0,l=0;for(;l<c;l++)if(E[l]==="\\")l++;else if(E[l]===y[0])u++;else if(E[l]===y[1]&&(u--,u<0))return l;return-1}function x(E){E&&E.sanitize&&!E.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")}Ge.exports={escape:D,unescape:U,edit:A,cleanUrl:o,resolveUrl:r,noopTest:t,merge:i,splitCells:b,rtrim:m,findClosingBracket:_,checkSanitizeDeprecation:x}},t9D7:function(Ge,oe,K){"use strict";K.d(oe,"b",function(){return j}),K.d(oe,"g",function(){return e}),K.d(oe,"d",function(){return A}),K.d(oe,"e",function(){return d}),K.d(oe,"a",function(){return f}),K.d(oe,"f",function(){return a}),K.d(oe,"c",function(){return h});var ee=K("Vhoy"),W=K("MI8n"),R=K("pmY6"),F=K("Cg/j"),L=K("ic2d"),D=K("nEHx");const j=Object(F.c)("themeService");var U;(function(s){function r(t){return t&&typeof t=="object"&&typeof t.id=="string"}s.isThemeColor=r})(U||(U={}));function e(s){return{id:s}}var A;(function(s){function r(x){return x&&typeof x=="object"&&typeof x.id=="string"&&(typeof x.color=="undefined"||U.isThemeColor(x.color))}s.isThemeIcon=r;const t=new RegExp(`^\\$\\((${ee.a.iconNameExpression}(?:${ee.a.iconModifierExpression})?)\\)$`);function i(x){const E=t.exec(x);if(!E)return;let[,y]=E;return{id:y}}s.fromString=i;function b(x,E){let y=x.id;const c=y.lastIndexOf("~");return c!==-1&&(y=y.substring(0,c)),E&&(y=`${y}~${E}`),{id:y}}s.modify=b;function m(x,E){var y,c;return x.id===E.id&&((y=x.color)===null||y===void 0?void 0:y.id)===((c=E.color)===null||c===void 0?void 0:c.id)}s.isEqual=m;function _(x,E){return{id:x.id,color:E?e(E):void 0}}s.asThemeIcon=_,s.asClassNameArray=ee.a.asClassNameArray,s.asClassName=ee.a.asClassName,s.asCSSSelector=ee.a.asCSSSelector})(A||(A={}));function d(s){switch(s){case D.a.DARK:return"vs-dark";case D.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class o{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new W.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(R.i)(()=>{const r=this.themingParticipants.indexOf(s);this.themingParticipants.splice(r,1)})}getThemingParticipants(){return this.themingParticipants}}let n=new o;L.a.add(f.ThemingContribution,n);function a(s){return n.onColorThemeChange(s)}class h extends R.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(r=>this.onThemeChange(r)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(Ge,oe,K){typeof window!="undefined"&&function(W,R){Ge.exports=R()}(this,function(){return function(ee){var W={};function R(F){if(W[F])return W[F].exports;var L=W[F]={i:F,l:!1,exports:{}};return ee[F].call(L.exports,L,L.exports,R),L.l=!0,L.exports}return R.m=ee,R.c=W,R.d=function(F,L,D){R.o(F,L)||Object.defineProperty(F,L,{enumerable:!0,get:D})},R.r=function(F){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})},R.t=function(F,L){if(L&1&&(F=R(F)),L&8)return F;if(L&4&&typeof F=="object"&&F&&F.__esModule)return F;var D=Object.create(null);if(R.r(D),Object.defineProperty(D,"default",{enumerable:!0,value:F}),L&2&&typeof F!="string")for(var j in F)R.d(D,j,function(U){return F[U]}.bind(null,j));return D},R.n=function(F){var L=F&&F.__esModule?function(){return F.default}:function(){return F};return R.d(L,"a",L),L},R.o=function(F,L){return Object.prototype.hasOwnProperty.call(F,L)},R.p="/dist/",R(R.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ee,W,R){"use strict";var F=Object.prototype.hasOwnProperty,L="~";function D(){}Object.create&&(D.prototype=Object.create(null),new D().__proto__||(L=!1));function j(d,f,o){this.fn=d,this.context=f,this.once=o||!1}function U(d,f,o,n,a){if(typeof o!="function")throw new TypeError("The listener must be a function");var h=new j(o,n||d,a),s=L?L+f:f;return d._events[s]?d._events[s].fn?d._events[s]=[d._events[s],h]:d._events[s].push(h):(d._events[s]=h,d._eventsCount++),d}function e(d,f){--d._eventsCount===0?d._events=new D:delete d._events[f]}function A(){this._events=new D,this._eventsCount=0}A.prototype.eventNames=function(){var f=[],o,n;if(this._eventsCount===0)return f;for(n in o=this._events)F.call(o,n)&&f.push(L?n.slice(1):n);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(o)):f},A.prototype.listeners=function(f){var o=L?L+f:f,n=this._events[o];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,h=n.length,s=new Array(h);a<h;a++)s[a]=n[a].fn;return s},A.prototype.listenerCount=function(f){var o=L?L+f:f,n=this._events[o];return n?n.fn?1:n.length:0},A.prototype.emit=function(f,o,n,a,h,s){var r=L?L+f:f;if(!this._events[r])return!1;var t=this._events[r],i=arguments.length,b,m;if(t.fn){t.once&&this.removeListener(f,t.fn,void 0,!0);switch(i){case 1:return t.fn.call(t.context),!0;case 2:return t.fn.call(t.context,o),!0;case 3:return t.fn.call(t.context,o,n),!0;case 4:return t.fn.call(t.context,o,n,a),!0;case 5:return t.fn.call(t.context,o,n,a,h),!0;case 6:return t.fn.call(t.context,o,n,a,h,s),!0}for(m=1,b=new Array(i-1);m<i;m++)b[m-1]=arguments[m];t.fn.apply(t.context,b)}else{var _=t.length,x;for(m=0;m<_;m++){t[m].once&&this.removeListener(f,t[m].fn,void 0,!0);switch(i){case 1:t[m].fn.call(t[m].context);break;case 2:t[m].fn.call(t[m].context,o);break;case 3:t[m].fn.call(t[m].context,o,n);break;case 4:t[m].fn.call(t[m].context,o,n,a);break;default:if(!b)for(x=1,b=new Array(i-1);x<i;x++)b[x-1]=arguments[x];t[m].fn.apply(t[m].context,b)}}}return!0},A.prototype.on=function(f,o,n){return U(this,f,o,n,!1)},A.prototype.once=function(f,o,n){return U(this,f,o,n,!0)},A.prototype.removeListener=function(f,o,n,a){var h=L?L+f:f;if(!this._events[h])return this;if(!o)return e(this,h),this;var s=this._events[h];if(s.fn)s.fn===o&&(!a||s.once)&&(!n||s.context===n)&&e(this,h);else{for(var r=0,t=[],i=s.length;r<i;r++)(s[r].fn!==o||a&&!s[r].once||n&&s[r].context!==n)&&t.push(s[r]);t.length?this._events[h]=t.length===1?t[0]:t:e(this,h)}return this},A.prototype.removeAllListeners=function(f){var o;return f?(o=L?L+f:f,this._events[o]&&e(this,o)):(this._events=new D,this._eventsCount=0),this},A.prototype.off=A.prototype.removeListener,A.prototype.addListener=A.prototype.on,A.prefixed=L,A.EventEmitter=A,ee.exports=A},"./node_modules/url-toolkit/src/url-toolkit.js":function(ee,W,R){(function(F){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,D=/^([^\/?#]*)([^]*)$/,j=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(A,d,f){if(f=f||{},A=A.trim(),d=d.trim(),!d){if(!f.alwaysNormalize)return A;var o=e.parseURL(A);if(!o)throw new Error("Error trying to parse base URL.");return o.path=e.normalizePath(o.path),e.buildURLFromParts(o)}var n=e.parseURL(d);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return f.alwaysNormalize?(n.path=e.normalizePath(n.path),e.buildURLFromParts(n)):d;var a=e.parseURL(A);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var h=D.exec(a.path);a.netLoc=h[1],a.path=h[2]}a.netLoc&&!a.path&&(a.path="/");var s={scheme:a.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(s.netLoc=a.netLoc,n.path[0]!=="/"))if(!n.path)s.path=a.path,n.params||(s.params=a.params,n.query||(s.query=a.query));else{var r=a.path,t=r.substring(0,r.lastIndexOf("/")+1)+n.path;s.path=e.normalizePath(t)}return s.path===null&&(s.path=f.alwaysNormalize?e.normalizePath(n.path):n.path),e.buildURLFromParts(s)},parseURL:function(A){var d=L.exec(A);return d?{scheme:d[1]||"",netLoc:d[2]||"",path:d[3]||"",params:d[4]||"",query:d[5]||"",fragment:d[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(j,"");A.length!==(A=A.replace(U,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};ee.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(ee,W,R){function F(f){var o={};function n(h){if(o[h])return o[h].exports;var s=o[h]={i:h,l:!1,exports:{}};return f[h].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=f,n.c=o,n.i=function(h){return h},n.d=function(h,s,r){n.o(h,s)||Object.defineProperty(h,s,{configurable:!1,enumerable:!0,get:r})},n.r=function(h){Object.defineProperty(h,"__esModule",{value:!0})},n.n=function(h){var s=h&&h.__esModule?function(){return h.default}:function(){return h};return n.d(s,"a",s),s},n.o=function(h,s){return Object.prototype.hasOwnProperty.call(h,s)},n.p="/",n.oe=function(h){throw console.error(h),h};var a=n(n.s=ENTRY_MODULE);return a.default||a}var L="[\\.|\\-|\\+|\\w|/|@]+",D="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function j(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(f){return!isNaN(1*f)}function e(f,o,n){var a={};a[n]=[];var h=o.toString(),s=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return a;for(var r=s[1],t=new RegExp("(\\\\n|\\W)"+j(r)+D,"g"),i;i=t.exec(h);){if(i[3]==="dll-reference")continue;a[n].push(i[3])}for(t=new RegExp("\\("+j(r)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+D,"g");i=t.exec(h);)f[i[2]]||(a[n].push(i[1]),f[i[2]]=R(i[1]).m),a[i[2]]=a[i[2]]||[],a[i[2]].push(i[4]);for(var b=Object.keys(a),m=0;m<b.length;m++)for(var _=0;_<a[b[m]].length;_++)U(a[b[m]][_])&&(a[b[m]][_]=1*a[b[m]][_]);return a}function A(f){var o=Object.keys(f);return o.reduce(function(n,a){return n||f[a].length>0},!1)}function d(f,o){for(var n={main:[o]},a={main:[]},h={main:{}};A(n);)for(var s=Object.keys(n),r=0;r<s.length;r++){var t=s[r],i=n[t],b=i.pop();if(h[t]=h[t]||{},h[t][b]||!f[t][b])continue;h[t][b]=!0,a[t]=a[t]||[],a[t].push(b);for(var m=e(f,f[t][b],t),_=Object.keys(m),x=0;x<_.length;x++)n[_[x]]=n[_[x]]||[],n[_[x]]=n[_[x]].concat(m[_[x]])}return a}ee.exports=function(f,o){o=o||{};var n={main:R.m},a=o.all?{main:Object.keys(n.main)}:d(n,f),h="";Object.keys(a).filter(function(b){return b!=="main"}).forEach(function(b){for(var m=0;a[b][m];)m++;a[b].push(m),n[b][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",h=h+"var "+b+" = ("+F.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+a[b].map(function(_){return""+JSON.stringify(_)+": "+n[b][_].toString()}).join(",")+`});
|
|
`}),h=h+"new (("+F.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+a.main.map(function(b){return""+JSON.stringify(b)+": "+n.main[b].toString()}).join(",")+"}))(self);";var s=new window.Blob([h],{type:"text/javascript"});if(o.bare)return s;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,t=r.createObjectURL(s),i=new window.Worker(t);return i.objectURL=t,i}},"./src/config.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"hlsDefaultConfig",function(){return x}),R.d(W,"mergeConfig",function(){return y}),R.d(W,"enableStreamingMode",function(){return c});var F=R("./src/controller/abr-controller.ts"),L=R("./src/controller/audio-stream-controller.ts"),D=R("./src/controller/audio-track-controller.ts"),j=R("./src/controller/subtitle-stream-controller.ts"),U=R("./src/controller/subtitle-track-controller.ts"),e=R("./src/controller/buffer-controller.ts"),A=R("./src/controller/timeline-controller.ts"),d=R("./src/controller/cap-level-controller.ts"),f=R("./src/controller/fps-controller.ts"),o=R("./src/controller/eme-controller.ts"),n=R("./src/controller/cmcd-controller.ts"),a=R("./src/utils/xhr-loader.ts"),h=R("./src/utils/fetch-loader.ts"),s=R("./src/utils/cues.ts"),r=R("./src/utils/mediakeys-helper.ts"),t=R("./src/utils/logger.ts");function i(){return i=Object.assign||function(u){for(var l=1;l<arguments.length;l++){var v=arguments[l];for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(u[g]=v[g])}return u},i.apply(this,arguments)}function b(u,l){var v=Object.keys(u);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(u);l&&(g=g.filter(function(w){return Object.getOwnPropertyDescriptor(u,w).enumerable})),v.push.apply(v,g)}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(g){_(u,g,v[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(v)):b(Object(v)).forEach(function(g){Object.defineProperty(u,g,Object.getOwnPropertyDescriptor(v,g))})}return u}function _(u,l,v){return l in u?Object.defineProperty(u,l,{value:v,enumerable:!0,configurable:!0,writable:!0}):u[l]=v,u}var x=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:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:F.default,bufferController:e.default,capLevelController:d.default,fpsController:f.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:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},E()),{},{subtitleStreamController:j.SubtitleStreamController,subtitleTrackController:U.default,timelineController:A.TimelineController,audioStreamController:L.default,audioTrackController:D.default,emeController:o.default,cmcdController:n.default});function E(){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 i({},u,l)}function c(u){var l=u.loader;if(l!==h.default&&l!==a.default)t.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,t.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/polyfills/number.ts"),L=R("./src/utils/ewma-bandwidth-estimator.ts"),D=R("./src/events.ts"),j=R("./src/utils/buffer-helper.ts"),U=R("./src/errors.ts"),e=R("./src/types/loader.ts"),A=R("./src/utils/logger.ts");function d(n,a){for(var h=0;h<a.length;h++){var s=a[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function f(n,a,h){return a&&d(n.prototype,a),h&&d(n,h),n}var o=function(){function n(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 L.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var a=n.prototype;return a.registerListeners=function(){var s=this.hls;s.on(D.Events.FRAG_LOADING,this.onFragLoading,this),s.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(D.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(D.Events.FRAG_LOADING,this.onFragLoading,this),s.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(D.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(s,r){var t=r.frag;if(t.type===e.PlaylistLevelType.MAIN&&!this.timer){var i;this.fragCurrent=t,this.partCurrent=(i=r.part)!=null?i:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(s,r){var t=this.hls.config;r.details.live?this.bwEstimator.update(t.abrEwmaSlowLive,t.abrEwmaFastLive):this.bwEstimator.update(t.abrEwmaSlowVoD,t.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var s=this.fragCurrent,r=this.partCurrent,t=this.hls,i=t.autoLevelEnabled,b=t.config,m=t.media;if(!s||!m)return;var _=r?r.stats:s.stats,x=r?r.duration:s.duration;if(_.aborted){A.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||m.paused||!m.playbackRate||!m.readyState)return;var E=performance.now()-_.loading.start,y=Math.abs(m.playbackRate);if(E<=500*x/y)return;var c=t.levels,u=t.minAutoLevel,l=c[s.level],v=_.total||Math.max(_.loaded,Math.round(x*l.maxBitrate/8)),g=Math.max(1,_.bwEstimate?_.bwEstimate/8:_.loaded*1e3/E),w=(v-_.loaded)/g,O=m.currentTime,I=(j.BufferHelper.bufferInfo(m,O,b.maxBufferHole).end-O)/y;if(I>=2*x/y||w<=I)return;var S=Number.POSITIVE_INFINITY,P;for(P=s.level-1;P>u;P--){var B=c[P].maxBitrate;if(S=x*B/(8*.8*g),S<I)break}if(S>=w)return;var C=this.bwEstimator.getEstimate();A.logger.warn("Fragment "+s.sn+(r?" part "+r.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+P+`
|
|
Current BW estimate: `+(Object(F.isFiniteNumber)(C)?(C/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+w.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+S.toFixed(3)+` s
|
|
Time to underbuffer: `+I.toFixed(3)+" s"),t.nextLoadLevel=P,this.bwEstimator.sample(E,_.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),t.trigger(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:r,stats:_})},a.onFragLoaded=function(s,r){var t=r.frag,i=r.part;if(t.type===e.PlaylistLevelType.MAIN&&Object(F.isFiniteNumber)(t.sn)){var b=i?i.stats:t.stats,m=i?i.duration:t.duration;if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var _=this.hls.levels[t.level],x=(_.loaded?_.loaded.bytes:0)+b.loaded,E=(_.loaded?_.loaded.duration:0)+m;_.loaded={bytes:x,duration:E},_.realBitrate=Math.round(8*x/E)}if(t.bitrateTest){var y={stats:b,frag:t,part:i,id:t.type};this.onFragBuffered(D.Events.FRAG_BUFFERED,y),t.bitrateTest=!1}}},a.onFragBuffered=function(s,r){var t=r.frag,i=r.part,b=i?i.stats:t.stats;if(b.aborted)return;if(t.type!==e.PlaylistLevelType.MAIN||t.sn==="initSegment")return;var m=b.parsing.end-b.loading.start;this.bwEstimator.sample(m,b.loaded),b.bwEstimate=this.bwEstimator.getEstimate(),t.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},a.onError=function(s,r){switch(r.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var s=this.fragCurrent,r=this.partCurrent,t=this.hls,i=t.maxAutoLevel,b=t.config,m=t.minAutoLevel,_=t.media,x=r?r.duration:s?s.duration:0,E=_?_.currentTime:0,y=_&&_.playbackRate!==0?Math.abs(_.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():b.abrEwmaDefaultEstimate,u=(j.BufferHelper.bufferInfo(_,E,b.maxBufferHole).end-E)/y,l=this.findBestLevel(c,m,i,u,b.abrBandWidthFactor,b.abrBandWidthUpFactor);if(l>=0)return l;A.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=x?Math.min(x,b.maxStarvationDelay):b.maxStarvationDelay,g=b.abrBandWidthFactor,w=b.abrBandWidthUpFactor;if(!u){var O=this.bitrateTestDelay;if(O){var I=x?Math.min(x,b.maxLoadingDelay):b.maxLoadingDelay;v=I-O,A.logger.trace("bitrate test took "+Math.round(1e3*O)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),g=w=1}}return l=this.findBestLevel(c,m,i,u+v,g,w),Math.max(l,0)},a.findBestLevel=function(s,r,t,i,b,m){for(var _,x=this.fragCurrent,E=this.partCurrent,y=this.lastLoadedFragLevel,c=this.hls.levels,u=c[y],l=!!(u!=null&&(_=u.details)!==null&&_!==void 0&&_.live),v=u==null?void 0:u.codecSet,g=E?E.duration:x?x.duration:0,w=t;w>=r;w--){var O=c[w];if(!O||v&&O.codecSet!==v)continue;var I=O.details,S=(E?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||g,P=void 0;w<=y?P=b*s:P=m*s;var B=c[w].maxBitrate,C=B*S/P;if(A.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(P)+"/"+B+"/"+S+"/"+i+"/"+C),P>B&&(!C||l&&!this.bitrateTestDelay||C<i))return w}return-1},f(n,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,r=this.bwEstimator;if(s!==-1&&(!r||!r.canEstimate()))return s;var t=this.getNextABRAutoLevel();return s!==-1&&(t=Math.min(s,t)),t},set:function(s){this._nextAutoLevel=s}}]),n}();W.default=o},"./src/controller/audio-stream-controller.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/polyfills/number.ts"),L=R("./src/controller/base-stream-controller.ts"),D=R("./src/events.ts"),j=R("./src/utils/buffer-helper.ts"),U=R("./src/controller/fragment-tracker.ts"),e=R("./src/types/level.ts"),A=R("./src/types/loader.ts"),d=R("./src/loader/fragment.ts"),f=R("./src/demux/chunk-cache.ts"),o=R("./src/demux/transmuxer-interface.ts"),n=R("./src/types/transmuxer.ts"),a=R("./src/controller/fragment-finders.ts"),h=R("./src/utils/discontinuities.ts"),s=R("./src/errors.ts"),r=R("./src/utils/logger.ts");function t(){return t=Object.assign||function(x){for(var E=1;E<arguments.length;E++){var y=arguments[E];for(var c in y)Object.prototype.hasOwnProperty.call(y,c)&&(x[c]=y[c])}return x},t.apply(this,arguments)}function i(x,E){x.prototype=Object.create(E.prototype),x.prototype.constructor=x,b(x,E)}function b(x,E){return b=Object.setPrototypeOf||function(c,u){return c.__proto__=u,c},b(x,E)}var m=100,_=function(x){i(E,x);function E(c,u){var l;return l=x.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=E.prototype;return y.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},y._registerListeners=function(){var u=this.hls;u.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(D.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(D.Events.ERROR,this.onError,this),u.on(D.Events.BUFFER_RESET,this.onBufferReset,this),u.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var u=this.hls;u.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(D.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(D.Events.ERROR,this.onError,this),u.off(D.Events.BUFFER_RESET,this.onBufferReset,this),u.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onInitPtsFound=function(u,l){var v=l.frag,g=l.id,w=l.initPTS;if(g==="main"){var O=v.cc;this.initPTS[v.cc]=w,this.log("InitPTS for cc: "+O+" found from main: "+w),this.videoTrackCC=O,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},y.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=L.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=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},y.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_TRACK:{var u,l=this.levels,v=this.trackId,g=l==null||((u=l[v])===null||u===void 0)?void 0:u.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var w,O=performance.now(),I=this.retryDate;(!I||O>=I||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var S=this.waitingData;if(S){var P=S.frag,B=S.part,C=S.cache,H=S.complete;if(this.initPTS[P.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var z=C.flush(),Z={frag:P,part:B,payload:z,networkDetails:null};this._handleFragmentLoadProgress(Z),H&&x.prototype._handleFragmentLoadComplete.call(this,Z)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+P.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Q=this.getLoadPosition(),pe=j.BufferHelper.bufferInfo(this.mediaBuffer,Q,this.config.maxBufferHole),le=Object(a.fragmentWithinToleranceTest)(pe.end,this.config.maxFragLookUpTolerance,P);le<0&&(r.logger.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+pe.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.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=L.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,g=this.levels,w=this.media,O=this.trackId,I=v.config;if(!g||!g[O])return;if(!w&&(this.startFragRequested||!I.startFragPrefetch))return;var S=g[O],P=S.details;if(!P||P.live&&this.levelLastLoaded!==O||this.waitForCdnTuneIn(P)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,d.ElementaryStreamTypes.AUDIO,A.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,A.PlaylistLevelType.AUDIO);if(B===null)return;var C=B.len,H=this.getMaxBufferLength(),z=this.audioSwitch;if(C>=H&&!z)return;if(!z&&this._streamEnded(B,P)){v.trigger(D.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var Z=P.fragments,Q=Z[0].start,pe=B.end;if(z){var le=this.getLoadPosition();pe=le,P.PTSKnown&&le<Q&&((B.end>Q||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=Q+.05))}var de=this.getNextFragment(pe,P);if(!de){this.bufferFlushed=!0;return}((u=de.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((l=de.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(de,P):this.loadFragment(de,P,pe)},y.getMaxBufferLength=function(){var u=x.prototype.getMaxBufferLength.call(this),l=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,A.PlaylistLevelType.MAIN);return l===null?u:Math.max(u,l.len)},y.onMediaDetaching=function(){this.videoBuffer=null,x.prototype.onMediaDetaching.call(this)},y.onAudioTracksUpdated=function(u,l){var v=l.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(g){return new e.Level(g)})},y.onAudioTrackSwitching=function(u,l){var v=!!l.url;this.trackId=l.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(m):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.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,g=this.levels,w=l.details,O=l.id;if(!g){this.warn("Audio tracks were reset while loading level "+O);return}this.log("Track "+O+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var I=g[O],S=0;if(w.live||(v=I.details)!==null&&v!==void 0&&v.live){var P=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!P)return;!I.details&&w.hasProgramDateTime&&P.hasProgramDateTime?(Object(h.alignMediaPlaylistByPDT)(w,P),S=w.fragments[0].start):S=this.alignPlaylists(w,I.details)}I.details=w,this.levelLastLoaded=O,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(I.details,S),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=L.State.IDLE),this.tick()},y._handleFragmentLoadProgress=function(u){var l,v=u.frag,g=u.part,w=u.payload,O=this.config,I=this.trackId,S=this.levels;if(!S){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 P=S[I];console.assert(P,"Audio track is defined on fragment load progress");var B=P.details;console.assert(B,"Audio track details are defined on fragment load progress");var C=O.defaultAudioCodec||P.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new o.default(this.hls,A.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[v.cc],Z=(l=v.initSegment)===null||l===void 0?void 0:l.data;if(z!==void 0){var Q=!1,pe=g?g.index:-1,le=pe!==-1,de=new n.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,w.byteLength,pe,le);H.push(w,Z,C,"",v,g,B.totalduration,Q,de,z)}else{r.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+I);var ce=this.waitingData=this.waitingData||{frag:v,part:g,cache:new f.default,complete:!1},me=ce.cache;me.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},y._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}x.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,g=l.part;if(v.type!==A.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(g?" p: "+g.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(D.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,g)},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(A.PlaylistLevelType.AUDIO,l);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=l.fatal?L.State.ERROR:L.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===L.State.PARSING||this.state===L.State.PARSED)){var v=!0,g=this.getFwdBufferInfo(this.mediaBuffer,A.PlaylistLevelType.AUDIO);g&&g.len>.5&&(v=!this.reduceMaxBufferLength(g.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,x.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},y.onBufferFlushed=function(u,l){var v=l.type;v===d.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},y._handleTransmuxComplete=function(u){var l,v="audio",g=this.hls,w=u.remuxResult,O=u.chunkMeta,I=this.getCurrentContext(O);if(!I){this.warn("The loading context changed while buffering fragment "+O.sn+" of level "+O.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(O.level);return}var S=I.frag,P=I.part,B=w.audio,C=w.text,H=w.id3,z=w.initSegment;if(this.fragContextChanged(S))return;if(this.state=L.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),z!=null&&z.tracks&&(this._bufferInitSegment(z.tracks,S,O),g.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:v,tracks:z.tracks})),B){var Z=B.startPTS,Q=B.endPTS,pe=B.startDTS,le=B.endDTS;P&&(P.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:Z,endPTS:Q,startDTS:pe,endDTS:le}),S.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,Z,Q,pe,le),this.bufferFragmentData(B,S,P,O)}if(H!=null&&(l=H.samples)!==null&&l!==void 0&&l.length){var de=t({frag:S,id:v},H);g.trigger(D.Events.FRAG_PARSING_METADATA,de)}if(C){var ce=t({frag:S,id:v},C);g.trigger(D.Events.FRAG_PARSING_USERDATA,ce)}},y._bufferInitSegment=function(u,l,v){if(this.state!==L.State.PARSING)return;u.video&&delete u.video;var g=u.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(D.Events.BUFFER_CODECS,u);var w=g.initSegment;if(w!=null&&w.byteLength){var O={type:"audio",frag:l,part:null,chunkMeta:v,parent:l.type,data:w};this.hls.trigger(D.Events.BUFFER_APPENDING,O)}this.tick()},y.loadFragment=function(u,l,v){var g=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||g===U.FragmentState.NOT_LOADED||g===U.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):l.live&&!Object(F.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=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,x.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"),x.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:v})},E}(L.default);W.default=_},"./src/controller/audio-track-controller.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/events.ts"),L=R("./src/errors.ts"),D=R("./src/controller/base-playlist-controller.ts"),j=R("./src/types/loader.ts");function U(o,n){for(var a=0;a<n.length;a++){var h=n[a];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(o,h.key,h)}}function e(o,n,a){return n&&U(o.prototype,n),a&&U(o,a),o}function A(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,d(o,n)}function d(o,n){return d=Object.setPrototypeOf||function(h,s){return h.__proto__=s,h},d(o,n)}var f=function(o){A(n,o);function n(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 a=n.prototype;return a.registerListeners=function(){var s=this.hls;s.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(F.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(F.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,o.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(s,r){this.tracks=r.audioTracks||[]},a.onAudioTrackLoaded=function(s,r){var t=r.id,i=r.details,b=this.tracksInGroup[t];if(!b){this.warn("Invalid audio track id "+t);return}var m=b.details;b.details=r.details,this.log("audioTrack "+t+" loaded ["+i.startSN+"-"+i.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,r,m))},a.onLevelLoading=function(s,r){this.switchLevel(r.level)},a.onLevelSwitching=function(s,r){this.switchLevel(r.level)},a.switchLevel=function(s){var r=this.hls.levels[s];if(!(r!=null&&r.audioGroupIds))return;var t=r.audioGroupIds[r.urlId];if(this.groupId!==t){this.groupId=t;var i=this.tracks.filter(function(m){return!t||m.groupId===t});this.selectDefaultTrack&&!i.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var b={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(F.Events.AUDIO_TRACKS_UPDATED,b),this.selectInitialTrack()}},a.onError=function(s,r){if(o.prototype.onError.call(this,s,r),r.fatal||!r.context)return;r.context.type===j.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},a.setAudioTrack=function(s){var r=this.tracksInGroup;if(s<0||s>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var t=r[this.trackId];this.log("Now switching to audio-track index "+s);var i=r[s],b=i.id,m=i.groupId,_=m===void 0?"":m,x=i.name,E=i.type,y=i.url;if(this.trackId=s,this.trackName=x,this.selectDefaultTrack=!1,this.hls.trigger(F.Events.AUDIO_TRACK_SWITCHING,{id:b,groupId:_,name:x,type:E,url:y}),i.details&&!i.details.live)return;var c=this.switchParams(i.url,t==null?void 0:t.details);this.loadPlaylist(c)},a.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,t=this.findTrackId(r)||this.findTrackId();t!==-1?this.setAudioTrack(t):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(s){for(var r=this.tracksInGroup,t=0;t<r.length;t++){var i=r[t];if((!this.selectDefaultTrack||i.default)&&(!s||s===i.name))return i.id}return-1},a.loadPlaylist=function(s){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var t=r.id,i=r.groupId,b=r.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: "+t),this.clearTimer(),this.hls.trigger(F.Events.AUDIO_TRACK_LOADING,{url:b,id:t,groupId:i,deliveryDirectives:s||null})}},e(n,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),n}(D.default);W.default=f},"./src/controller/base-playlist-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var F=R("./src/polyfills/number.ts"),L=R("./src/types/level.ts"),D=R("./src/controller/level-helper.ts"),j=R("./src/utils/logger.ts"),U=R("./src/errors.ts"),e=function(){function A(f,o){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=j.logger.log.bind(j.logger,o+":"),this.warn=j.logger.warn.bind(j.logger,o+":"),this.hls=f}var d=A.prototype;return d.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},d.onError=function(o,n){n.fatal&&n.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},d.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},d.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},d.stopLoad=function(){this.canLoad=!1,this.clearTimer()},d.switchParams=function(o,n){var a=n==null?void 0:n.renditionReports;if(a)for(var h=0;h<a.length;h++){var s=a[h],r=""+s.URI;if(r===o.substr(-r.length)){var t=parseInt(s["LAST-MSN"]),i=parseInt(s["LAST-PART"]);if(n&&this.hls.config.lowLatencyMode){var b=Math.min(n.age-n.partTarget,n.targetduration);i!==void 0&&b>n.partTarget&&(i+=1)}if(Object(F.isFiniteNumber)(t))return new L.HlsUrlParameters(t,Object(F.isFiniteNumber)(i)?i:void 0,L.HlsSkip.No)}}},d.loadPlaylist=function(o){},d.shouldLoadTrack=function(o){return this.canLoad&&o&&!!o.url&&(!o.details||o.details.live)},d.playlistLoaded=function(o,n,a){var h=this,s=n.details,r=n.stats,t=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(s.advancedDateTime=Date.now()-t,s.live||a!=null&&a.live){if(s.reloaded(a),a&&this.log("live playlist "+o+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),a&&s.fragments.length>0&&Object(D.mergeDetails)(a,s),!this.canLoad||!s.live)return;var i,b=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var _=this.hls.config.lowLatencyMode,x=s.lastPartSn,E=s.endSN,y=s.lastPartIndex,c=y!==-1,u=x===E,l=_?0:y;c?(b=u?E+1:x,m=u?l:y+1):b=E+1;var v=s.age,g=v+s.ageHeader,w=Math.min(g-s.partTarget,s.targetduration*1.5);if(w>0){if(a&&w>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+w+" with playlist age: "+s.age),w=0;else{var O=Math.floor(w/s.targetduration);if(b+=O,m!==void 0){var I=Math.round(w%s.targetduration/s.partTarget);m+=I}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+w+" skip sn "+O+" to part "+m)}s.tuneInGoal=w}if(i=this.getDeliveryDirectives(s,n.deliveryDirectives,b,m),_||!u){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(s,n.deliveryDirectives,b,m);var S=Object(D.computeReloadInterval)(s,r);b!==void 0&&s.canBlockReload&&(S-=s.partTarget||1),this.log("reload live playlist "+o+" in "+Math.round(S)+" ms"),this.timer=self.setTimeout(function(){return h.loadPlaylist(i)},S)}else this.clearTimer()},d.getDeliveryDirectives=function(o,n,a,h){var s=Object(L.getSkipValue)(o,a);return n!=null&&n.skip&&o.deltaUpdateFailed&&(a=n.msn,h=n.part,s=L.HlsSkip.No),new L.HlsUrlParameters(a,h,s)},d.retryLoadingOrFail=function(o){var n=this,a=this.hls.config,h=this.retryCount<a.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 r=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return n.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+o.details+'"')}}else this.warn('cannot recover from error "'+o.details+'"'),this.clearTimer(),o.fatal=!0;return h},A}()},"./src/controller/base-stream-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"State",function(){return E}),R.d(W,"default",function(){return y});var F=R("./src/polyfills/number.ts"),L=R("./src/task-loop.ts"),D=R("./src/controller/fragment-tracker.ts"),j=R("./src/utils/buffer-helper.ts"),U=R("./src/utils/logger.ts"),e=R("./src/events.ts"),A=R("./src/errors.ts"),d=R("./src/types/transmuxer.ts"),f=R("./src/utils/mp4-tools.ts"),o=R("./src/utils/discontinuities.ts"),n=R("./src/controller/fragment-finders.ts"),a=R("./src/controller/level-helper.ts"),h=R("./src/loader/fragment-loader.ts"),s=R("./src/crypt/decrypter.ts"),r=R("./src/utils/time-ranges.ts"),t=R("./src/types/loader.ts");function i(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&&i(c.prototype,u),l&&i(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 _(c,u){c.prototype=Object.create(u.prototype),c.prototype.constructor=c,x(c,u)}function x(c,u){return x=Object.setPrototypeOf||function(v,g){return v.__proto__=g,v},x(c,u)}var E={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){_(u,c);function u(v,g,w){var O;return O=c.call(this)||this,O.hls=void 0,O.fragPrevious=null,O.fragCurrent=null,O.fragmentTracker=void 0,O.transmuxer=null,O._state=E.STOPPED,O.media=void 0,O.mediaBuffer=void 0,O.config=void 0,O.bitrateTest=!1,O.lastCurrentTime=0,O.nextLoadPosition=0,O.startPosition=0,O.loadedmetadata=!1,O.fragLoadError=0,O.retryDate=0,O.levels=null,O.fragmentLoader=void 0,O.levelLastLoaded=null,O.startFragRequested=!1,O.decrypter=void 0,O.initPTS=[],O.onvseeking=null,O.onvended=null,O.logPrefix="",O.log=void 0,O.warn=void 0,O.logPrefix=w,O.log=U.logger.log.bind(U.logger,w+":"),O.warn=U.logger.warn.bind(U.logger,w+":"),O.hls=v,O.fragmentLoader=new h.default(v.config),O.fragmentTracker=g,O.config=v.config,O.decrypter=new s.default(v,v.config),v.on(e.Events.KEY_LOADED,O.onKeyLoaded,m(O)),O}var l=u.prototype;return l.doTick=function(){this.onTickEnd()},l.onTickEnd=function(){},l.startLoad=function(g){},l.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},l._streamEnded=function(g,w){var O=this.fragCurrent,I=this.fragmentTracker;if(!w.live&&O&&O.sn===w.endSN&&!g.nextStart){var S=I.getState(O);return S===D.FragmentState.PARTIAL||S===D.FragmentState.OK}return!1},l.onMediaAttached=function(g,w){var O=this.media=this.mediaBuffer=w.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),O.addEventListener("seeking",this.onvseeking),O.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===E.STOPPED&&this.startLoad(I.startPosition)},l.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.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 g=this.config,w=this.fragCurrent,O=this.media,I=this.mediaBuffer,S=this.state,P=O?O.currentTime:0,B=j.BufferHelper.bufferInfo(I||O,P,g.maxBufferHole);if(this.log("media seeking to "+(Object(F.isFiniteNumber)(P)?P.toFixed(3):P)+", state: "+S),S===E.ENDED)this.resetLoadingState();else if(w&&!B.len){var C=g.maxFragLookUpTolerance,H=w.start-C,z=w.start+w.duration+C,Z=P>z;(P<H||Z)&&(Z&&w.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),w.loader.abort()),this.resetLoadingState())}O&&(this.lastCurrentTime=P),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=P),this.tickImmediate()},l.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},l.onKeyLoaded=function(g,w){if(this.state!==E.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=E.IDLE;var O=this.levels[w.frag.level].details;O&&this.loadFragment(w.frag,O,w.frag.start)},l.onHandlerDestroying=function(){this.stopLoad(),c.prototype.onHandlerDestroying.call(this)},l.onHandlerDestroyed=function(){this.state=E.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(g,w){this.log("Loading key for "+g.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=E.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(e.Events.KEY_LOADING,{frag:g})},l.loadFragment=function(g,w,O){this._loadFragForPlayback(g,w,O)},l._loadFragForPlayback=function(g,w,O){var I=this,S=function(B){if(I.fragContextChanged(g)){I.warn("Fragment "+g.sn+(B.part?" p: "+B.part.index:"")+" of level "+g.level+" was dropped during download."),I.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,I._handleFragmentLoadProgress(B)};this._doFragLoad(g,w,O,S).then(function(P){if(!P)return;I.fragLoadError=0;var B=I.state;if(I.fragContextChanged(g)){(B===E.FRAG_LOADING||B===E.BACKTRACKING||!I.fragCurrent&&B===E.PARSING)&&(I.fragmentTracker.removeFragment(g),I.state=E.IDLE);return}if("payload"in P&&(I.log("Loaded fragment "+g.sn+" of level "+g.level),I.hls.trigger(e.Events.FRAG_LOADED,P),I.state===E.BACKTRACKING)){I.fragmentTracker.backtrack(g,P),I.resetFragmentLoading(g);return}I._handleFragmentLoadComplete(P)}).catch(function(P){I.warn(P),I.resetFragmentLoading(g)})},l.flushMainBuffer=function(g,w,O){if(O===void 0&&(O=null),!(g-w))return;var I={startOffset:g,endOffset:w,type:O};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,I)},l._loadInitSegment=function(g){var w=this;this._doFragLoad(g).then(function(O){if(!O||w.fragContextChanged(g)||!w.levels)throw new Error("init load aborted");return O}).then(function(O){var I=w.hls,S=O.payload,P=g.decryptdata;if(S&&S.byteLength>0&&P&&P.key&&P.iv&&P.method==="AES-128"){var B=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(S),P.key.buffer,P.iv.buffer).then(function(C){var H=self.performance.now();return I.trigger(e.Events.FRAG_DECRYPTED,{frag:g,payload:C,stats:{tstart:B,tdecrypt:H}}),O.payload=C,O})}return O}).then(function(O){var I=w.fragCurrent,S=w.hls,P=w.levels;if(!P)throw new Error("init load aborted, missing levels");var B=P[g.level].details;console.assert(B,"Level details are defined when init segment is loaded");var C=g.stats;w.state=E.IDLE,w.fragLoadError=0,g.data=new Uint8Array(O.payload),C.parsing.start=C.buffering.start=self.performance.now(),C.parsing.end=C.buffering.end=self.performance.now(),O.frag===I&&S.trigger(e.Events.FRAG_BUFFERED,{stats:C,frag:I,part:null,id:g.type}),w.tick()}).catch(function(O){w.warn(O),w.resetFragmentLoading(g)})},l.fragContextChanged=function(g){var w=this.fragCurrent;return!g||!w||g.level!==w.level||g.sn!==w.sn||g.urlId!==w.urlId},l.fragBufferedComplete=function(g,w){var O=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+r.default.toString(j.BufferHelper.getBuffered(O))),this.state=E.IDLE,this.tick()},l._handleFragmentLoadComplete=function(g){var w=this.transmuxer;if(!w)return;var O=g.frag,I=g.part,S=g.partsLoaded,P=!S||S.length===0||S.some(function(C){return!C}),B=new d.ChunkMetadata(O.level,O.sn,O.stats.chunkCount+1,0,I?I.index:-1,!P);w.flush(B)},l._handleFragmentLoadProgress=function(g){},l._doFragLoad=function(g,w,O,I){var S=this;if(O===void 0&&(O=null),!this.levels)throw new Error("frag load aborted, missing levels");if(O=Math.max(g.start,O||0),this.config.lowLatencyMode&&w){var P=w.partList;if(P&&I){O>g.end&&w.fragmentHint&&(g=w.fragmentHint);var B=this.getNextPart(P,g,O);if(B>-1){var C=P[B];return this.log("Loading part sn: "+g.sn+" p: "+C.index+" cc: "+g.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+B+"-"+(P.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(O.toFixed(3))),this.nextLoadPosition=C.start+C.duration,this.state=E.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:g,part:P[B],targetBufferTime:O}),this.doFragPartsLoad(g,P,B,I).catch(function(H){return S.handleFragLoadError(H)})}else if(!g.url||this.loadedEndOfParts(P,O))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(O.toFixed(3))),Object(F.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=E.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:g,targetBufferTime:O}),this.fragmentLoader.load(g,I).catch(function(H){return S.handleFragLoadError(H)})},l.doFragPartsLoad=function(g,w,O,I){var S=this;return new Promise(function(P,B){var C=[],H=function z(Z){var Q=w[Z];S.fragmentLoader.loadPart(g,Q,I).then(function(pe){C[Q.index]=pe;var le=pe.part;S.hls.trigger(e.Events.FRAG_LOADED,pe);var de=w[Z+1];if(de&&de.fragment===g)z(Z+1);else return P({frag:g,part:le,partsLoaded:C})}).catch(B)};H(O)})},l.handleFragLoadError=function(g){var w=g.data;return w&&w.details===A.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(e.Events.ERROR,w),null},l._handleTransmuxerFlush=function(g){var w=this.getCurrentContext(g);if(!w||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var O=w.frag,I=w.part,S=w.level,P=self.performance.now();O.stats.parsing.end=P,I&&(I.stats.parsing.end=P),this.updateLevelTiming(O,I,S,g.partial)},l.getCurrentContext=function(g){var w=this.levels,O=g.level,I=g.sn,S=g.part;if(!w||!w[O])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+O+". The current chunk will not be buffered."),null;var P=w[O],B=S>-1?Object(a.getPartWith)(P,I,S):null,C=B?B.fragment:Object(a.getFragmentWithSN)(P,I,this.fragCurrent);return C?{frag:C,part:B,level:P}:null},l.bufferFragmentData=function(g,w,O,I){if(!g||this.state!==E.PARSING)return;var S=g.data1,P=g.data2,B=S;if(S&&P&&(B=Object(f.appendUint8Array)(S,P)),!B||!B.length)return;var C={type:g.type,frag:w,part:O,chunkMeta:I,parent:w.type,data:B};this.hls.trigger(e.Events.BUFFER_APPENDING,C),g.dropped&&g.independent&&!O&&this.flushBufferGap(w)},l.flushBufferGap=function(g){var w=this.media;if(!w)return;if(!j.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,g.start);return}var O=w.currentTime,I=j.BufferHelper.bufferInfo(w,O,0),S=g.duration,P=Math.min(this.config.maxFragLookUpTolerance*2,S*.25),B=Math.max(Math.min(g.start-P,I.end-P),O+P);g.start-B>P&&this.flushMainBuffer(B,g.start)},l.getFwdBufferInfo=function(g,w){var O=this.config,I=this.getLoadPosition();if(!Object(F.isFiniteNumber)(I))return null;var S=j.BufferHelper.bufferInfo(g,I,O.maxBufferHole);if(S.len===0&&S.nextStart!==void 0){var P=this.fragmentTracker.getBufferedFrag(I,w);if(P&&S.nextStart<P.end)return j.BufferHelper.bufferInfo(g,I,Math.max(S.nextStart,O.maxBufferHole))}return S},l.getMaxBufferLength=function(g){var w=this.config,O;return g?O=Math.max(8*w.maxBufferSize/g,w.maxBufferLength):O=w.maxBufferLength,Math.min(O,w.maxMaxBufferLength)},l.reduceMaxBufferLength=function(g){var w=this.config,O=g||w.maxBufferLength;return w.maxMaxBufferLength>=O?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},l.getNextFragment=function(g,w){var O,I,S=w.fragments,P=S.length;if(!P)return null;var B=this.config,C=S[0].start,H;if(w.live){var z=B.initialLiveManifestSize;if(P<z)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+z+")"),null;!w.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(w,S),this.startPosition=H?this.hls.liveSyncPosition||H.start:g)}else g<=C&&(H=S[0]);if(!H){var Z=B.lowLatencyMode?w.partEnd:w.fragmentEnd;H=this.getFragmentAtPosition(g,Z,w)}return(O=H)!==null&&O!==void 0&&O.initSegment&&!((I=H)!==null&&I!==void 0&&I.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},l.getNextPart=function(g,w,O){for(var I=-1,S=!1,P=!0,B=0,C=g.length;B<C;B++){var H=g[B];if(P=P&&!H.independent,I>-1&&O<H.start)break;var z=H.loaded;!z&&(S||H.independent||P)&&H.fragment===w&&(I=B),S=z}return I},l.loadedEndOfParts=function(g,w){var O=g[g.length-1];return O&&w>O.start&&O.loaded},l.getInitialLiveFragment=function(g,w){var O=this.fragPrevious,I=null;if(O){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+O.programDateTime),I=Object(n.findFragmentByPDT)(w,O.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var S=O.sn+1;if(S>=g.startSN&&S<=g.endSN){var P=w[S-g.startSN];O.cc===P.cc&&(I=P,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(n.findFragWithCC)(w,O.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(I=this.getFragmentAtPosition(B,this.bitrateTest?g.fragmentEnd:g.edge,g))}return I},l.getFragmentAtPosition=function(g,w,O){var I=this.config,S=this.fragPrevious,P=O.fragments,B=O.endSN,C=O.fragmentHint,H=I.maxFragLookUpTolerance,z=!!(I.lowLatencyMode&&O.partList&&C);z&&C&&!this.bitrateTest&&(P=P.concat(C),B=C.sn);var Z;if(g<w){var Q=g>w-H?0:H;Z=Object(n.findFragmentByPTS)(S,P,g,Q)}else Z=P[P.length-1];if(Z){var pe=Z.sn-O.startSN,le=S&&Z.level===S.level,de=P[pe+1],ce=this.fragmentTracker.getState(Z);if(ce===D.FragmentState.BACKTRACKED){Z=null;for(var me=pe;P[me]&&this.fragmentTracker.getState(P[me])===D.FragmentState.BACKTRACKED;)S?Z=P[me--]:Z=P[--me];Z||(Z=de)}else S&&Z.sn===S.sn&&!z&&(le&&(Z.sn<B&&this.fragmentTracker.getState(de)!==D.FragmentState.OK?(this.log("SN "+Z.sn+" just loaded, load next one: "+de.sn),Z=de):Z=null))}return Z},l.synchronizeToLiveEdge=function(g){var w=this.config,O=this.media;if(!O)return;var I=this.hls.liveSyncPosition,S=O.currentTime,P=g.fragments[0].start,B=g.edge,C=S>=P-w.maxFragLookUpTolerance&&S<=B;if(I!==null&&O.duration>I&&(S<I||!C)){var H=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*g.targetduration;(!C&&O.readyState<4||S<B-H)&&(this.loadedmetadata||(this.nextLoadPosition=I),O.readyState&&(this.warn("Playback: "+S.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+I.toFixed(3)),O.currentTime=I))}},l.alignPlaylists=function(g,w){var O=this.levels,I=this.levelLastLoaded,S=this.fragPrevious,P=I!==null?O[I]:null,B=g.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var C=g.fragments[0].start,H=!w,z=g.alignedSliding&&Object(F.isFiniteNumber)(C);if(H||!z&&!C){Object(o.alignStream)(S,P,g);var Z=g.fragments[0].start;return this.log("Live playlist sliding: "+Z.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+g.startSN+" prev-sn: "+(S?S.sn:"na")+" fragments: "+B),Z}return C},l.waitForCdnTuneIn=function(g){var w=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*w)},l.setStartPosition=function(g,w){var O=this.startPosition;if(O<w&&(O=-1),O===-1||this.lastCurrentTime===-1){var I=g.startTimeOffset;Object(F.isFiniteNumber)(I)?(O=w+I,I<0&&(O+=g.totalduration),O=Math.min(Math.max(w,O),w+g.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+O),this.startPosition=O):g.live?O=this.hls.liveSyncPosition||w:this.startPosition=O=0,this.lastCurrentTime=O}this.nextLoadPosition=O},l.getLoadPosition=function(){var g=this.media,w=0;return this.loadedmetadata&&g?w=g.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},l.handleFragLoadAborted=function(g,w){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(w?" part"+w.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},l.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=E.IDLE)},l.onFragmentOrKeyLoadError=function(g,w){if(w.fatal)return;var O=w.frag;if(!O||O.type!==g)return;var I=this.fragCurrent;console.assert(I&&O.sn===I.sn&&O.level===I.level&&O.urlId===I.urlId,"Frag load error must match current frag to retry");var S=this.config;if(this.fragLoadError+1<=S.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(O.level))return;var P=Math.min(Math.pow(2,this.fragLoadError)*S.fragLoadingRetryDelay,S.fragLoadingMaxRetryTimeout);this.warn("Fragment "+O.sn+" of "+g+" "+O.level+" failed to load, retrying in "+P+"ms"),this.retryDate=self.performance.now()+P,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(g===t.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(U.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)},l.afterBufferFlushed=function(g,w,O){if(!g)return;var I=j.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(w,I,O),this.state===E.ENDED&&this.resetLoadingState()},l.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},l.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[g].details:null;if(w!=null&&w.live)return this.startPosition=-1,this.setStartPosition(w,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},l.updateLevelTiming=function(g,w,O,I){var S=this,P=O.details;console.assert(!!P,"level.details must be defined");var B=Object.keys(g.elementaryStreams).reduce(function(C,H){var z=g.elementaryStreams[H];if(z){var Z=z.endPTS-z.startPTS;if(Z<=0)return S.warn("Could not parse fragment "+g.sn+" "+H+" duration reliably ("+Z+") resetting transmuxer to fallback to playlist timing"),S.resetTransmuxer(),C||!1;var Q=I?0:Object(a.updateFragPTSDTS)(P,g,z.startPTS,z.endPTS,z.startDTS,z.endDTS);return S.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:P,level:O,drift:Q,type:H,frag:g,start:z.startPTS,end:z.endPTS}),!0}return C},!1);B?(this.state=E.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:g,part:w})):this.resetLoadingState()},l.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},b(u,[{key:"state",get:function(){return this._state},set:function(g){var w=this._state;w!==g&&(this._state=g,this.log(w+"->"+g))}}]),u}(L.default)},"./src/controller/buffer-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n});var F=R("./src/polyfills/number.ts"),L=R("./src/events.ts"),D=R("./src/utils/logger.ts"),j=R("./src/errors.ts"),U=R("./src/utils/buffer-helper.ts"),e=R("./src/utils/mediasource-helper.ts"),A=R("./src/loader/fragment.ts"),d=R("./src/controller/buffer-operation-queue.ts"),f=Object(e.getMediaSource)(),o=/([ha]vc.)(?:\.[^.,]+)+/,n=function(){function a(s){var r=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 t=r.hls,i=r.media,b=r.mediaSource;D.logger.log("[buffer-controller]: Media source opened"),i&&(r.updateMediaElementDuration(),t.trigger(L.Events.MEDIA_ATTACHED,{media:i})),b&&b.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){D.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){D.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var h=a.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 r=this.hls;r.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(L.Events.BUFFER_RESET,this.onBufferReset,this),r.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(L.Events.BUFFER_EOS,this.onBufferEos,this),r.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(L.Events.FRAG_PARSED,this.onFragParsed,this),r.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},h.unregisterListeners=function(){var r=this.hls;r.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(L.Events.BUFFER_RESET,this.onBufferReset,this),r.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(L.Events.BUFFER_EOS,this.onBufferEos,this),r.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(L.Events.FRAG_PARSED,this.onFragParsed,this),r.off(L.Events.FRAG_CHANGED,this.onFragChanged,this)},h._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new d.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},h.onManifestParsed=function(r,t){var i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,D.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},h.onMediaAttaching=function(r,t){var i=this.media=t.media;if(i&&f){var b=this.mediaSource=new f;b.addEventListener("sourceopen",this._onMediaSourceOpen),b.addEventListener("sourceended",this._onMediaSourceEnded),b.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(b),this._objectUrl=i.src}},h.onMediaDetaching=function(){var r=this.media,t=this.mediaSource,i=this._objectUrl;if(t){if(D.logger.log("[buffer-controller]: media source detaching"),t.readyState==="open")try{t.endOfStream()}catch(b){D.logger.warn("[buffer-controller]: onMediaDetaching: "+b.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(i&&self.URL.revokeObjectURL(i),r.src===i?(r.removeAttribute("src"),r.load()):D.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(L.Events.MEDIA_DETACHED,void 0)},h.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(t){var i=r.sourceBuffer[t];try{i&&(r.removeBufferListeners(t),r.mediaSource&&r.mediaSource.removeSourceBuffer(i),r.sourceBuffer[t]=void 0)}catch(b){D.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",b)}}),this._initSourceBuffer()},h.onBufferCodecs=function(r,t){var i=this,b=this.getSourceBufferTypes().length;if(Object.keys(t).forEach(function(m){if(b){var _=i.tracks[m];if(_&&typeof _.buffer.changeType=="function"){var x=t[m],E=x.codec,y=x.levelCodec,c=x.container,u=(_.levelCodec||_.codec).replace(o,"$1"),l=(y||E).replace(o,"$1");if(u!==l){var v=c+";codecs="+(y||E);i.appendChangeType(m,v)}}}else i.pendingTracks[m]=t[m]}),b)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},h.appendChangeType=function(r,t){var i=this,b=this.operationQueue,m={execute:function(){var x=i.sourceBuffer[r];x&&(D.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+t),x.changeType(t)),b.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(x){D.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",x)}};b.append(m,r)},h.onBufferAppending=function(r,t){var i=this,b=this.hls,m=this.operationQueue,_=this.tracks,x=t.data,E=t.type,y=t.frag,c=t.part,u=t.chunkMeta,l=u.buffering[E],v=self.performance.now();l.start=v;var g=y.stats.buffering,w=c?c.stats.buffering:null;g.start===0&&(g.start=v),w&&w.start===0&&(w.start=v);var O=_.audio,I=E==="audio"&&u.id===1&&(O==null?void 0:O.container)==="audio/mpeg",S={execute:function(){if(l.executeStart=self.performance.now(),I){var B=i.sourceBuffer[E];if(B){var C=y.start-B.timestampOffset;Math.abs(C)>=.1&&(D.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+y.start+" (delta: "+C+") sn: "+y.sn+")"),B.timestampOffset=y.start)}}i.appendExecutor(x,E)},onStart:function(){},onComplete:function(){var B=self.performance.now();l.executeEnd=l.end=B,g.first===0&&(g.first=B),w&&w.first===0&&(w.first=B);var C=i.sourceBuffer,H={};for(var z in C)H[z]=U.BufferHelper.getBuffered(C[z]);i.appendError=0,i.hls.trigger(L.Events.BUFFER_APPENDED,{type:E,frag:y,part:c,chunkMeta:u,parent:y.type,timeRanges:H})},onError:function(B){D.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",B);var C={type:j.ErrorTypes.MEDIA_ERROR,parent:y.type,details:j.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?C.details=j.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,C.details=j.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>b.config.appendErrorMaxRetry&&(D.logger.error("[buffer-controller]: Failed "+b.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),C.fatal=!0)),b.trigger(L.Events.ERROR,C)}};m.append(S,E)},h.onBufferFlushing=function(r,t){var i=this,b=this.operationQueue,m=function(x){return{execute:i.removeExecutor.bind(i,x,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(L.Events.BUFFER_FLUSHED,{type:x})},onError:function(y){D.logger.warn("[buffer-controller]: Failed to remove from "+x+" SourceBuffer",y)}}};t.type?b.append(m(t.type),t.type):this.getSourceBufferTypes().forEach(function(_){b.append(m(_),_)})},h.onFragParsed=function(r,t){var i=this,b=t.frag,m=t.part,_=[],x=m?m.elementaryStreams:b.elementaryStreams;x[A.ElementaryStreamTypes.AUDIOVIDEO]?_.push("audiovideo"):(x[A.ElementaryStreamTypes.AUDIO]&&_.push("audio"),x[A.ElementaryStreamTypes.VIDEO]&&_.push("video"));var E=function(){var c=self.performance.now();b.stats.buffering.end=c,m&&(m.stats.buffering.end=c);var u=m?m.stats:b.stats;i.hls.trigger(L.Events.FRAG_BUFFERED,{frag:b,part:m,stats:u,id:b.type})};_.length===0&&D.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+b.type+" level: "+b.level+" sn: "+b.sn),this.blockBuffers(E,_)},h.onFragChanged=function(r,t){this.flushBackBuffer()},h.onBufferEos=function(r,t){var i=this,b=this.getSourceBufferTypes().reduce(function(m,_){var x=i.sourceBuffer[_];return(!t.type||t.type===_)&&(x&&!x.ended&&(x.ended=!0,D.logger.log("[buffer-controller]: "+_+" sourceBuffer now EOS"))),m&&!!(!x||x.ended)},!0);b&&this.blockBuffers(function(){var m=i.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},h.onLevelUpdated=function(r,t){var i=t.details;if(!i.fragments.length)return;this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},h.flushBackBuffer=function(){var r=this.hls,t=this.details,i=this.media,b=this.sourceBuffer;if(!i||t===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var _=t.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(F.isFiniteNumber)(_)||_<0)return;var x=i.currentTime,E=t.levelTargetDuration,y=Math.max(_,E),c=Math.floor(x/E)*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)&&(r.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:c}),t.live&&r.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c}),r.trigger(L.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 r=this.details,t=this.hls,i=this.media,b=this.mediaSource,m=r.fragments[0].start+r.totalduration,_=i.duration,x=Object(F.isFiniteNumber)(b.duration)?b.duration:0;r.live&&t.config.liveDurationInfinity?(D.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),b.duration=Infinity,this.updateSeekableRange(r)):(m>x&&m>_||!Object(F.isFiniteNumber)(_))&&(D.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),b.duration=m)},h.updateSeekableRange=function(r){var t=this.mediaSource,i=r.fragments,b=i.length;if(b&&r.live&&t!==null&&t!==void 0&&t.setLiveSeekableRange){var m=Math.max(0,i[0].start),_=Math.max(m,m+r.totalduration);t.setLiveSeekableRange(m,_)}},h.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,t=this.operationQueue,i=this.pendingTracks,b=Object.keys(i).length;if(b&&!r||b===2){this.createSourceBuffers(i),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(L.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(_){t.executeNext(_)})}},h.createSourceBuffers=function(r){var t=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var b=0;for(var m in r)if(!t[m]){var _=r[m];if(!_)throw Error("source buffer exists for track "+m+", however track does not");var x=_.levelCodec||_.codec,E=_.container+";codecs="+x;D.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var y=t[m]=i.addSourceBuffer(E),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:x,container:_.container,levelCodec:_.levelCodec,id:_.id},b++}catch(u){D.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(L.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:E})}}b&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},h._onSBUpdateStart=function(r){var t=this.operationQueue,i=t.current(r);i.onStart()},h._onSBUpdateEnd=function(r){var t=this.operationQueue,i=t.current(r);i.onComplete(),t.shiftAndExecuteNext(r)},h._onSBUpdateError=function(r,t){D.logger.error("[buffer-controller]: "+r+" SourceBuffer error",t),this.hls.trigger(L.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(r);i&&i.onError(t)},h.removeExecutor=function(r,t,i){var b=this.media,m=this.mediaSource,_=this.operationQueue,x=this.sourceBuffer,E=x[r];if(!b||!m||!E){D.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),_.shiftAndExecuteNext(r);return}var y=Object(F.isFiniteNumber)(b.duration)?b.duration:Infinity,c=Object(F.isFiniteNumber)(m.duration)?m.duration:Infinity,u=Math.max(0,t),l=Math.min(i,y,c);l>u?(D.logger.log("[buffer-controller]: Removing ["+u+","+l+"] from the "+r+" SourceBuffer"),console.assert(!E.updating,r+" sourceBuffer must not be updating"),E.remove(u,l)):_.shiftAndExecuteNext(r)},h.appendExecutor=function(r,t){var i=this.operationQueue,b=this.sourceBuffer,m=b[t];if(!m){D.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(t);return}m.ended=!1,console.assert(!m.updating,t+" sourceBuffer must not be updating"),m.appendBuffer(r)},h.blockBuffers=function(r,t){var i=this;if(t===void 0&&(t=this.getSourceBufferTypes()),!t.length){D.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var b=this.operationQueue,m=t.map(function(_){return b.appendBlocker(_)});Promise.all(m).then(function(){r(),t.forEach(function(_){var x=i.sourceBuffer[_];(!x||!x.updating)&&b.shiftAndExecuteNext(_)})})},h.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},h.addBufferListener=function(r,t,i){var b=this.sourceBuffer[r];if(!b)return;var m=i.bind(this,r);this.listeners[r].push({event:t,listener:m}),b.addEventListener(t,m)},h.removeBufferListeners=function(r){var t=this.sourceBuffer[r];if(!t)return;this.listeners[r].forEach(function(i){t.removeEventListener(i.event,i.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return L});var F=R("./src/utils/logger.ts"),L=function(){function D(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var j=D.prototype;return j.append=function(e,A){var d=this.queues[A];d.push(e),d.length===1&&this.buffers[A]&&this.executeNext(A)},j.insertAbort=function(e,A){var d=this.queues[A];d.unshift(e),this.executeNext(A)},j.appendBlocker=function(e){var A,d=new Promise(function(o){A=o}),f={execute:A,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,e),d},j.executeNext=function(e){var A=this.buffers,d=this.queues,f=A[e],o=d[e];if(o.length){var n=o[0];try{n.execute()}catch(a){F.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(a),(!f||!f.updating)&&(o.shift(),this.executeNext(e))}}},j.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},j.current=function(e){return this.queues[e][0]},D}()},"./src/controller/cap-level-controller.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/events.ts");function L(U,e){for(var A=0;A<e.length;A++){var d=e[A];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(U,d.key,d)}}function D(U,e,A){return e&&L(U.prototype,e),A&&L(U,A),U}var j=function(){function U(A){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=A,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(d){this.streamController=d},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 d=this.hls;d.on(F.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),d.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var d=this.hls;d.off(F.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),d.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),d.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),d.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(d,f){U.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},e.onMediaAttaching=function(d,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},e.onManifestParsed=function(d,f){var o=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,o.config.capLevelToPlayerSize&&f.video&&this.startCapping()},e.onBufferCodecs=function(d,f){var o=this.hls;o.config.capLevelToPlayerSize&&f.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var d=this.hls.levels;if(d.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(d.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},e.getMaxLevel=function(d){var f=this,o=this.hls.levels;if(!o.length)return-1;var n=o.filter(function(a,h){return U.isLevelAllowed(h,f.restrictedLevels)&&h<=d});return this.clientRect=null,U.getMaxLevelByMediaSize(n,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 d=this.media,f={width:0,height:0};if(d){var o=d.getBoundingClientRect();f.width=o.width,f.height=o.height,!f.width&&!f.height&&(f.width=o.right-o.left||d.width||0,f.height=o.bottom-o.top||d.height||0)}return this.clientRect=f,f},U.isLevelAllowed=function(d,f){return f===void 0&&(f=[]),f.indexOf(d)===-1},U.getMaxLevelByMediaSize=function(d,f,o){if(!d||!d.length)return-1;for(var n=function(t,i){return i?t.width!==i.width||t.height!==i.height:!0},a=d.length-1,h=0;h<d.length;h+=1){var s=d[h];if((s.width>=f||s.height>=o)&&n(s,d[h+1])){a=h;break}}return a},D(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 d=1;try{d=self.devicePixelRatio}catch(f){}return d}}]),U}();W.default=j},"./src/controller/cmcd-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n});var F=R("./src/events.ts"),L=R("./src/types/cmcd.ts"),D=R("./src/utils/buffer-helper.ts"),j=R("./src/utils/logger.ts");function U(a,h){for(var s=0;s<h.length;s++){var r=h[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(a,r.key,r)}}function e(a,h,s){return h&&U(a.prototype,h),s&&U(a,s),a}function A(a,h){var s=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(s)return(s=s.call(a)).next.bind(s);if(Array.isArray(a)||(s=d(a))||h&&a&&typeof a.length=="number"){s&&(a=s);var r=0;return function(){return r>=a.length?{done:!0}:{done:!1,value:a[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(a,h){if(!a)return;if(typeof a=="string")return f(a,h);var s=Object.prototype.toString.call(a).slice(8,-1);if(s==="Object"&&a.constructor&&(s=a.constructor.name),s==="Map"||s==="Set")return Array.from(a);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return f(a,h)}function f(a,h){(h==null||h>a.length)&&(h=a.length);for(var s=0,r=new Array(h);s<h;s++)r[s]=a[s];return r}function o(){return o=Object.assign||function(a){for(var h=1;h<arguments.length;h++){var s=arguments[h];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(a[r]=s[r])}return a},o.apply(this,arguments)}var n=function(){function a(s){var r=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(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(b){try{r.apply(b,{ot:L.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(m){j.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(b){try{var m=b.frag,_=r.hls.levels[m.level],x=r.getObjectType(m),E={d:m.duration*1e3,ot:x};(x===L.CMCDObjectType.VIDEO||x===L.CMCDObjectType.AUDIO||x==L.CMCDObjectType.MUXED)&&(E.br=_.bitrate/1e3,E.tb=r.getTopBandwidth(x),E.bl=r.getBufferLength(x)),r.apply(b,E)}catch(y){j.logger.warn("Could not generate segment CMCD data.",y)}},this.hls=s;var t=this.config=s.config,i=t.cmcd;i!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||a.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}var h=a.prototype;return h.registerListeners=function(){var r=this.hls;r.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this)},h.unregisterListeners=function(){var r=this.hls;r.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(F.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(r,t){this.media=t.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(r,t){var i,b;this.audioBuffer=(i=t.tracks.audio)===null||i===void 0?void 0:i.buffer,this.videoBuffer=(b=t.tracks.video)===null||b===void 0?void 0:b.buffer},h.createData=function(){var r;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},h.apply=function(r,t){t===void 0&&(t={}),o(t,this.createData());var i=t.ot===L.CMCDObjectType.INIT||t.ot===L.CMCDObjectType.VIDEO||t.ot===L.CMCDObjectType.MUXED;if(this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering),this.useHeaders){var b=a.toHeaders(t);if(!Object.keys(b).length)return;r.headers||(r.headers={}),o(r.headers,b)}else{var m=a.toQuery(t);if(!m)return;r.url=a.appendQueryToUri(r.url,m)}},h.getObjectType=function(r){var t=r.type;return t==="subtitle"?L.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?L.CMCDObjectType.INIT:t==="audio"?L.CMCDObjectType.AUDIO:t==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},h.getTopBandwidth=function(r){for(var t=0,i=r===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,b=A(i),m;!(m=b()).done;){var _=m.value;_.bitrate>t&&(t=_.bitrate)}return t>0?t:NaN},h.getBufferLength=function(r){var t=this.hls.media,i=r===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!t)return NaN;var b=D.BufferHelper.bufferInfo(i,t.currentTime,this.config.maxBufferHole);return b.len*1e3},h.createPlaylistLoader=function(){var r=this.config.pLoader,t=this.applyPlaylistData,i=r||this.config.loader;return function(){function b(_){this.loader=void 0,this.loader=new i(_)}var m=b.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(x,E,y){t(x),this.loader.load(x,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 r=this.config.fLoader,t=this.applyFragmentData,i=r||this.config.loader;return function(){function b(_){this.loader=void 0,this.loader=new i(_)}var m=b.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(x,E,y){t(x),this.loader.load(x,E,y)},e(b,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),b}()},a.uuid=function(){var r=URL.createObjectURL(new Blob),t=r.toString();return URL.revokeObjectURL(r),t.substr(t.lastIndexOf("/")+1)},a.serialize=function(r){for(var t=[],i=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},b=function(I){return Math.round(I)},m=function(I){return b(I/100)*100},_=function(I){return encodeURIComponent(I)},x={br:b,d:b,bl:m,dl:m,mtp:m,nor:_,rtp:m,tb:b},E=Object.keys(r||{}).sort(),y=A(E),c;!(c=y()).done;){var u=c.value,l=r[u];if(!i(l))continue;if(u==="v"&&l===1)continue;if(u=="pr"&&l===1)continue;var v=x[u];v&&(l=v(l));var g=typeof l,w=void 0;u==="ot"||u==="sf"||u==="st"?w=u+"="+l:g==="boolean"?w=u:g==="number"?w=u+"="+l:w=u+"="+JSON.stringify(l),t.push(w)}return t.join(",")},a.toHeaders=function(r){for(var t=Object.keys(r),i={},b=["Object","Request","Session","Status"],m=[{},{},{},{}],_={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},x=0,E=t;x<E.length;x++){var y=E[x],c=_[y]!=null?_[y]:1;m[c][y]=r[y]}for(var u=0;u<m.length;u++){var l=a.serialize(m[u]);l&&(i["CMCD-"+b[u]]=l)}return i},a.toQuery=function(r){return"CMCD="+encodeURIComponent(a.serialize(r))},a.appendQueryToUri=function(r,t){if(!t)return r;var i=r.includes("?")?"&":"?";return""+r+i+t},a}()},"./src/controller/eme-controller.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/events.ts"),L=R("./src/errors.ts"),D=R("./src/utils/logger.ts"),j=R("./src/utils/mediakeys-helper.ts");function U(n,a){for(var h=0;h<a.length;h++){var s=a[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function e(n,a,h){return a&&U(n.prototype,a),h&&U(n,h),n}var A=3,d=function(a,h,s){var r={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(t){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:s.audioRobustness||""})}),h.forEach(function(t){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:s.videoRobustness||""})}),[r]},f=function(a,h,s,r){switch(a){case j.KeySystems.WIDEVINE:return d(h,s,r);default:throw new Error("Unknown key-system: "+a)}},o=function(){function n(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 a=n.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(s){switch(s){case j.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},a._attemptKeySystemAccess=function(s,r,t){var i=this,b=f(s,r,t,this._drmSystemOptions);D.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(s,b);this.mediaKeysPromise=m.then(function(_){return i._onMediaKeySystemAccessObtained(s,_)}),m.catch(function(_){D.logger.error('Failed to obtain key-system "'+s+'" access:',_)})},a._onMediaKeySystemAccessObtained=function(s,r){var t=this;D.logger.log('Access for key-system "'+s+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:s};this._mediaKeysList.push(i);var b=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(m){return i.mediaKeys=m,D.logger.log('Media-keys created for key-system "'+s+'"'),t._onMediaKeysCreated(),m});return b.catch(function(m){D.logger.error("Failed to create media-keys:",m)}),b},a._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),s._onNewMediaKeySession(r.mediaKeysSession))})},a._onNewMediaKeySession=function(s){var r=this;D.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(t){r._onKeySessionMessage(s,t.message)},!1)},a._onKeySessionMessage=function(s,r){D.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(t){D.logger.log("Received license data (length: "+(t&&t.byteLength)+"), updating key-session"),s.update(t)})},a.onMediaEncrypted=function(s){var r=this;if(D.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){D.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var t=function(b){if(!r._media)return;r._attemptSetMediaKeys(b),r._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(t).catch(t)},a._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){D.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}D.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(s,r){var t=this,i=this._mediaKeysList[0];if(!i){D.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(i.mediaKeysSessionInitialized){D.logger.warn("Key-Session already initialized but requested again");return}var b=i.mediaKeysSession;if(!b){D.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){D.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}D.logger.log('Generating key-session request for "'+s+'" init data type'),i.mediaKeysSessionInitialized=!0,b.generateRequest(s,r).then(function(){D.logger.debug("Key-session generation succeeded")}).catch(function(m){D.logger.error("Error generating key-session request:",m),t.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(s,r,t){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,s,r,t);var b=this._licenseXhrSetup;if(b)try{b.call(this.hls,i,s),b=void 0}catch(m){D.logger.error(m)}try{i.readyState||i.open("POST",s,!0),b&&b.call(this.hls,i,s)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return i},a._onLicenseRequestReadyStageChange=function(s,r,t,i){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,D.logger.log("License request succeeded");var b=s.response,m=this._licenseResponseCallback;if(m)try{b=m.call(this.hls,s,r)}catch(x){D.logger.error(x)}i(b)}else{if(D.logger.error("License Request XHR failed ("+r+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>A){this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var _=A-this._requestLicenseFailureCount+1;D.logger.warn("Retrying license request, "+_+" attempts left"),this._requestLicense(t,i)}break}},a._generateLicenseRequestChallenge=function(s,r){switch(s.mediaKeySystemDomain){case j.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},a._requestLicense=function(s,r){D.logger.log("Requesting content license for key-system");var t=this._mediaKeysList[0];if(!t){D.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(t.mediaKeySystemDomain),b=this._createLicenseXhr(i,s,r);D.logger.log("Sending license request to URL: "+i);var m=this._generateLicenseRequestChallenge(t,s);b.send(m)}catch(_){D.logger.error("Failure requesting DRM license: "+_),this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(s,r){if(!this._emeEnabled)return;var t=r.media;this._media=t,t.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var s=this._media,r=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(s,r){if(!this._emeEnabled)return;var t=r.levels.map(function(b){return b.audioCodec}).filter(function(b){return!!b}),i=r.levels.map(function(b){return b.videoCodec}).filter(function(b){return!!b});this._attemptKeySystemAccess(j.KeySystems.WIDEVINE,t,i)},e(n,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),n}();W.default=o},"./src/controller/fps-controller.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/events.ts"),L=R("./src/utils/logger.ts"),D=function(){function j(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=j.prototype;return U.setStreamController=function(A){this.streamController=A},U.registerListeners=function(){this.hls.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(A,d){var f=this.hls.config;if(f.capLevelOnFPSDrop){var o=d.media instanceof self.HTMLVideoElement?d.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),f.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(A,d,f){var o=performance.now();if(d){if(this.lastTime){var n=o-this.lastTime,a=f-this.lastDroppedFrames,h=d-this.lastDecodedFrames,s=1e3*a/n,r=this.hls;if(r.trigger(F.Events.FPS_DROP,{currentDropped:a,currentDecoded:h,totalDroppedFrames:f}),s>0&&a>r.config.fpsDroppedMonitoringThreshold*h){var t=r.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=t)&&(t=t-1,r.trigger(F.Events.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:r.currentLevel}),r.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=f,this.lastDecodedFrames=d}},U.checkFPSInterval=function(){var A=this.media;if(A)if(this.isVideoPlaybackQualityAvailable){var d=A.getVideoPlaybackQuality();this.checkFPS(A,d.totalVideoFrames,d.droppedVideoFrames)}else this.checkFPS(A,A.webkitDecodedFrameCount,A.webkitDroppedFrameCount)},j}();W.default=D},"./src/controller/fragment-finders.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"findFragmentByPDT",function(){return D}),R.d(W,"findFragmentByPTS",function(){return j}),R.d(W,"fragmentWithinToleranceTest",function(){return U}),R.d(W,"pdtWithinToleranceTest",function(){return e}),R.d(W,"findFragWithCC",function(){return A});var F=R("./src/polyfills/number.ts"),L=R("./src/utils/binary-search.ts");function D(d,f,o){if(f===null||!Array.isArray(d)||!d.length||!Object(F.isFiniteNumber)(f))return null;var n=d[0].programDateTime;if(f<(n||0))return null;var a=d[d.length-1].endProgramDateTime;if(f>=(a||0))return null;o=o||0;for(var h=0;h<d.length;++h){var s=d[h];if(e(f,o,s))return s}return null}function j(d,f,o,n){o===void 0&&(o=0),n===void 0&&(n=0);var a=null;if(d?a=f[d.sn-f[0].sn+1]||null:o===0&&f[0].start===0&&(a=f[0]),a&&U(o,n,a)===0)return a;var h=L.default.search(f,U.bind(null,o,n));return h||a}function U(d,f,o){d===void 0&&(d=0),f===void 0&&(f=0);var n=Math.min(f,o.duration+(o.deltaPTS?o.deltaPTS:0));return o.start+o.duration-n<=d?1:o.start-n>d&&o.start?-1:0}function e(d,f,o){var n=Math.min(f,o.duration+(o.deltaPTS?o.deltaPTS:0))*1e3,a=o.endProgramDateTime||0;return a-n>d}function A(d,f){return L.default.search(d,function(o){return o.cc<f?1:o.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"FragmentState",function(){return D}),R.d(W,"FragmentTracker",function(){return j});var F=R("./src/events.ts"),L=R("./src/types/loader.ts"),D;(function(A){A.NOT_LOADED="NOT_LOADED",A.BACKTRACKED="BACKTRACKED",A.APPENDING="APPENDING",A.PARTIAL="PARTIAL",A.OK="OK"})(D||(D={}));var j=function(){function A(f){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=f,this._registerListeners()}var d=A.prototype;return d._registerListeners=function(){var o=this.hls;o.on(F.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(F.Events.FRAG_LOADED,this.onFragLoaded,this)},d._unregisterListeners=function(){var o=this.hls;o.off(F.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(F.Events.FRAG_LOADED,this.onFragLoaded,this)},d.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},d.getAppendedFrag=function(o,n){if(n===L.PlaylistLevelType.MAIN){var a=this.activeFragment,h=this.activeParts;if(!a)return null;if(h)for(var s=h.length;s--;){var r=h[s],t=r?r.end:a.appendedPTS;if(r.start<=o&&t!==void 0&&o<=t)return s>9&&(this.activeParts=h.slice(s-9)),r}else if(a.start<=o&&a.appendedPTS!==void 0&&o<=a.appendedPTS)return a}return this.getBufferedFrag(o,n)},d.getBufferedFrag=function(o,n){for(var a=this.fragments,h=Object.keys(a),s=h.length;s--;){var r=a[h[s]];if((r==null?void 0:r.body.type)===n&&r.buffered){var t=r.body;if(t.start<=o&&o<=t.end)return t}}return null},d.detectEvictedFragments=function(o,n,a){var h=this;Object.keys(this.fragments).forEach(function(s){var r=h.fragments[s];if(!r)return;if(!r.buffered){r.body.type===a&&h.removeFragment(r.body);return}var t=r.range[o];if(!t)return;t.time.some(function(i){var b=!h.isTimeBuffered(i.startPTS,i.endPTS,n);return b&&h.removeFragment(r.body),b})})},d.detectPartialFragments=function(o){var n=this,a=this.timeRanges,h=o.frag,s=o.part;if(!a||h.sn==="initSegment")return;var r=e(h),t=this.fragments[r];if(!t)return;Object.keys(a).forEach(function(i){var b=h.elementaryStreams[i];if(!b)return;var m=a[i],_=s!==null||b.partial===!0;t.range[i]=n.getBufferedTimes(h,s,_,m)}),t.backtrack=t.loaded=null,Object.keys(t.range).length?t.buffered=!0:this.removeFragment(t.body)},d.fragBuffered=function(o){var n=e(o),a=this.fragments[n];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},d.getBufferedTimes=function(o,n,a,h){for(var s={time:[],partial:a},r=n?n.start:o.start,t=n?n.end:o.end,i=o.minEndPTS||t,b=o.maxStartPTS||r,m=0;m<h.length;m++){var _=h.start(m)-this.bufferPadding,x=h.end(m)+this.bufferPadding;if(b>=_&&i<=x){s.time.push({startPTS:Math.max(r,h.start(m)),endPTS:Math.min(t,h.end(m))});break}else if(r<x&&t>_)s.partial=!0,s.time.push({startPTS:Math.max(r,h.start(m)),endPTS:Math.min(t,h.end(m))});else if(t<=_)break}return s},d.getPartialFragment=function(o){var n=null,a,h,s,r=0,t=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(b){var m=i[b];if(!m)return;U(m)&&(h=m.body.start-t,s=m.body.end+t,o>=h&&o<=s&&(a=Math.min(o-h,s-o),r<=a&&(n=m.body,r=a)))}),n},d.getState=function(o){var n=e(o),a=this.fragments[n];return a?a.buffered?U(a)?D.PARTIAL:D.OK:a.backtrack?D.BACKTRACKED:D.APPENDING:D.NOT_LOADED},d.backtrack=function(o,n){var a=e(o),h=this.fragments[a];if(!h||h.backtrack)return null;var s=h.backtrack=n||h.loaded;return h.loaded=null,s},d.getBacktrackData=function(o){var n=e(o),a=this.fragments[n];if(a){var h,s=a.backtrack;if(s!=null&&(h=s.payload)!==null&&h!==void 0&&h.byteLength)return s;this.removeFragment(o)}return null},d.isTimeBuffered=function(o,n,a){for(var h,s,r=0;r<a.length;r++){if(h=a.start(r)-this.bufferPadding,s=a.end(r)+this.bufferPadding,o>=h&&n<=s)return!0;if(n<=h)return!1}return!1},d.onFragLoaded=function(o,n){var a=n.frag,h=n.part;if(a.sn==="initSegment"||a.bitrateTest||h)return;var s=e(a);this.fragments[s]={body:a,loaded:n,backtrack:null,buffered:!1,range:Object.create(null)}},d.onBufferAppended=function(o,n){var a=this,h=n.frag,s=n.part,r=n.timeRanges;if(h.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=h,s){var t=this.activeParts;t||(this.activeParts=t=[]),t.push(s)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(i){var b=r[i];if(a.detectEvictedFragments(i,b),!s)for(var m=0;m<b.length;m++)h.appendedPTS=Math.max(b.end(m),h.appendedPTS||0)})},d.onFragBuffered=function(o,n){this.detectPartialFragments(n)},d.hasFragment=function(o){var n=e(o);return!!this.fragments[n]},d.removeFragmentsInRange=function(o,n,a){var h=this;Object.keys(this.fragments).forEach(function(s){var r=h.fragments[s];if(!r)return;if(r.buffered){var t=r.body;t.type===a&&t.start<n&&t.end>o&&h.removeFragment(t)}})},d.removeFragment=function(o){var n=e(o);o.stats.loaded=0,o.clearElementaryStreamInfo(),delete this.fragments[n]},d.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},A}();function U(A){var d,f;return A.buffered&&(((d=A.range.video)===null||d===void 0?void 0:d.partial)||((f=A.range.audio)===null||f===void 0?void 0:f.partial))}function e(A){return A.type+"_"+A.level+"_"+A.urlId+"_"+A.sn}},"./src/controller/gap-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"STALL_MINIMUM_DURATION_MS",function(){return U}),R.d(W,"MAX_START_GAP_JUMP",function(){return e}),R.d(W,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return A}),R.d(W,"SKIP_BUFFER_RANGE_START",function(){return d}),R.d(W,"default",function(){return f});var F=R("./src/utils/buffer-helper.ts"),L=R("./src/errors.ts"),D=R("./src/events.ts"),j=R("./src/utils/logger.ts"),U=250,e=2,A=.1,d=.05,f=function(){function o(a,h,s,r){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=a,this.media=h,this.fragmentTracker=s,this.hls=r}var n=o.prototype;return n.destroy=function(){this.hls=this.fragmentTracker=this.media=null},n.poll=function(h){var s=this.config,r=this.media,t=this.stalled,i=r.currentTime,b=r.seeking,m=this.seeking&&!b,_=!this.seeking&&b;if(this.seeking=b,i!==h){if(this.moved=!0,t!==null){if(this.stallReported){var x=self.performance.now()-t;j.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(x)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((_||m)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!F.BufferHelper.getBuffered(r).length)return;var E=F.BufferHelper.bufferInfo(r,i,0),y=E.len>0,c=E.nextStart||0;if(!y&&!c)return;if(b){var u=E.len>e,l=!c||c-i>e&&!this.fragmentTracker.getPartialFragment(i);if(u||l)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,g=Math.max(c,E.start||0)-i,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,O=w==null||((v=w.details)===null||v===void 0)?void 0:v.live,I=O?w.details.targetduration*2:e;if(g>0&&g<=I){this._trySkipBufferHole(null);return}}var S=self.performance.now();if(t===null){this.stalled=S;return}var P=S-t;!b&&P>=U&&this._reportStall(E.len);var B=F.BufferHelper.bufferInfo(r,i,s.maxBufferHole);this._tryFixBufferStall(B,P)},n._tryFixBufferStall=function(h,s){var r=this.config,t=this.fragmentTracker,i=this.media,b=i.currentTime,m=t.getPartialFragment(b);if(m){var _=this._trySkipBufferHole(m);if(_)return}h.len>r.maxBufferHole&&s>r.highBufferWatchdogPeriod*1e3&&(j.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},n._reportStall=function(h){var s=this.hls,r=this.media,t=this.stallReported;t||(this.stallReported=!0,j.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+h+")"),s.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:h}))},n._trySkipBufferHole=function(h){for(var s=this.config,r=this.hls,t=this.media,i=t.currentTime,b=0,m=F.BufferHelper.getBuffered(t),_=0;_<m.length;_++){var x=m.start(_);if(i+s.maxBufferHole>=b&&i<x){var E=Math.max(x+d,t.currentTime+A);return j.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+E),this.moved=!0,this.stalled=null,t.currentTime=E,h&&r.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+E,frag:h}),E}b=m.end(_)}return 0},n._tryNudgeBuffer=function(){var h=this.config,s=this.hls,r=this.media,t=r.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<h.nudgeMaxRetry){var b=t+i*h.nudgeOffset;j.logger.warn("Nudging 'currentTime' from "+t+" to "+b),r.currentTime=b,s.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.logger.error("Playhead still not moving while enough data buffered @"+t+" after "+h.nudgeMaxRetry+" nudges"),s.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},o}()},"./src/controller/id3-track-controller.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/events.ts"),L=R("./src/utils/texttrack-utils.ts"),D=R("./src/demux/id3.ts"),j=.25,U=function(){function e(d){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=d,this._registerListeners()}var A=e.prototype;return A.destroy=function(){this._unregisterListeners()},A._registerListeners=function(){var f=this.hls;f.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(F.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var f=this.hls;f.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(F.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.onMediaAttached=function(f,o){this.media=o.media},A.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},A.getID3Track=function(f){if(!this.media)return;for(var o=0;o<f.length;o++){var n=f[o];if(n.kind==="metadata"&&n.label==="id3")return Object(L.sendAddTrackEvent)(n,this.media),n}return this.media.addTextTrack("metadata","id3")},A.onFragParsingMetadata=function(f,o){if(!this.media)return;var n=o.frag,a=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<a.length;s++){var r=D.getID3Frames(a[s].data);if(r){var t=a[s].pts,i=s<a.length-1?a[s+1].pts:n.end,b=i-t;b<=0&&(i=t+j);for(var m=0;m<r.length;m++){var _=r[m];if(!D.isTimeStampFrame(_)){var x=new h(t,i,"");x.value=_,this.id3Track.addCue(x)}}}}},A.onBufferFlushing=function(f,o){var n=o.startOffset,a=o.endOffset,h=o.type;if(!h||h==="audio"){var s=this.id3Track;s&&Object(L.removeCuesInRange)(s,n,a)}},e}();W.default=U},"./src/controller/latency-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var F=R("./src/errors.ts"),L=R("./src/events.ts"),D=R("./src/utils/logger.ts");function j(A,d){for(var f=0;f<d.length;f++){var o=d[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(A,o.key,o)}}function U(A,d,f){return d&&j(A.prototype,d),f&&j(A,f),A}var e=function(){function A(f){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=f,this.config=f.config,this.registerListeners()}var d=A.prototype;return d.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},d.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},d.onMediaAttached=function(o,n){this.media=n.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},d.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},d.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},d.onLevelUpdated=function(o,n){var a=n.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},d.onError=function(o,n){if(n.details!==F.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,D.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},d.timeupdate=function(){var o=this.media,n=this.levelDetails;if(!o||!n)return;this.currentTime=o.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var h=this.config,s=h.lowLatencyMode,r=h.maxLiveSyncPlaybackRate;if(!s||r===1)return;var t=this.targetLatency;if(t===null)return;var i=a-t,b=Math.min(this.maxLatency,t+n.targetduration),m=i<b;if(n.live&&m&&i>.05&&this.forwardBufferLength>1){var _=Math.min(2,Math.max(1,r)),x=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;o.playbackRate=Math.min(_,Math.max(1,x))}else o.playbackRate!==1&&o.playbackRate!==0&&(o.playbackRate=1)},d.estimateLiveEdge=function(){var o=this.levelDetails;return o===null?null:o.edge+o.age},d.computeLatency=function(){var o=this.estimateLiveEdge();return o===null?null:o-this.currentTime},U(A,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var o=this.config,n=this.levelDetails;return o.liveMaxLatencyDuration!==void 0?o.liveMaxLatencyDuration:n?o.liveMaxLatencyDurationCount*n.targetduration:0}},{key:"targetLatency",get:function(){var o=this.levelDetails;if(o===null)return null;var n=o.holdBack,a=o.partHoldBack,h=o.targetduration,s=this.config,r=s.liveSyncDuration,t=s.liveSyncDurationCount,i=s.lowLatencyMode,b=this.hls.userConfig,m=i&&a||n;(b.liveSyncDuration||b.liveSyncDurationCount||m===0)&&(m=r!==void 0?r:t*h);var _=h,x=1;return m+Math.min(this.stallCount*x,_)}},{key:"liveSyncPosition",get:function(){var o=this.estimateLiveEdge(),n=this.targetLatency,a=this.levelDetails;if(o===null||n===null||a===null)return null;var h=a.edge,s=o-n-this.edgeStalled,r=h-a.totalduration,t=h-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(r,s),t)}},{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 n=(this.config.lowLatencyMode&&o.partTarget||o.targetduration)*3;return Math.max(o.age-n,0)}},{key:"forwardBufferLength",get:function(){var o=this.media,n=this.levelDetails;if(!o||!n)return 0;var a=o.buffered.length;return a?o.buffered.end(a-1):n.edge-this.currentTime}}]),A}()},"./src/controller/level-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return s});var F=R("./src/types/level.ts"),L=R("./src/events.ts"),D=R("./src/errors.ts"),j=R("./src/utils/codecs.ts"),U=R("./src/controller/level-helper.ts"),e=R("./src/controller/base-playlist-controller.ts"),A=R("./src/types/loader.ts");function d(){return d=Object.assign||function(r){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var b in i)Object.prototype.hasOwnProperty.call(i,b)&&(r[b]=i[b])}return r},d.apply(this,arguments)}function f(r,t){for(var i=0;i<t.length;i++){var b=t[i];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(r,b.key,b)}}function o(r,t,i){return t&&f(r.prototype,t),i&&f(r,i),r}function n(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,a(r,t)}function a(r,t){return a=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},a(r,t)}var h=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(r){n(t,r);function t(b){var m;return m=r.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 i=t.prototype;return i._registerListeners=function(){var m=this.hls;m.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(L.Events.ERROR,this.onError,this)},i._unregisterListeners=function(){var m=this.hls;m.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(L.Events.ERROR,this.onError,this)},i.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},i.startLoad=function(){var m=this._levels;m.forEach(function(_){_.loadError=0}),r.prototype.startLoad.call(this)},i.onManifestLoaded=function(m,_){var x=[],E=[],y=[],c,u={},l,v=!1,g=!1,w=!1;if(_.levels.forEach(function(P){var B=P.attrs;v=v||!!(P.width&&P.height),g=g||!!P.videoCodec,w=w||!!P.audioCodec,h&&P.audioCodec&&P.audioCodec.indexOf("mp4a.40.34")!==-1&&(P.audioCodec=void 0);var C=P.bitrate+"-"+P.attrs.RESOLUTION+"-"+P.attrs.CODECS;l=u[C],l?l.url.push(P.url):(l=new F.Level(P),u[C]=l,x.push(l)),B&&(B.AUDIO&&Object(U.addGroupId)(l,"audio",B.AUDIO),B.SUBTITLES&&Object(U.addGroupId)(l,"text",B.SUBTITLES))}),(v||g)&&w&&(x=x.filter(function(P){var B=P.videoCodec,C=P.width,H=P.height;return!!B||!!(C&&H)})),x=x.filter(function(P){var B=P.audioCodec,C=P.videoCodec;return(!B||Object(j.isCodecSupportedInMp4)(B,"audio"))&&(!C||Object(j.isCodecSupportedInMp4)(C,"video"))}),_.audioTracks&&(E=_.audioTracks.filter(function(P){return!P.audioCodec||Object(j.isCodecSupportedInMp4)(P.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(E)),_.subtitles&&(y=_.subtitles,Object(U.assignTrackIdsByGroup)(y)),x.length>0){c=x[0].bitrate,x.sort(function(P,B){return P.bitrate-B.bitrate}),this._levels=x;for(var O=0;O<x.length;O++)if(x[O].bitrate===c){this._firstLevel=O,this.log("manifest loaded, "+x.length+" level(s) found, first bitrate: "+c);break}var I=w&&!g,S={levels:x,audioTracks:E,subtitleTracks:y,firstLevel:this._firstLevel,stats:_.stats,audio:w,video:g,altAudio:!I&&E.some(function(P){return!!P.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,S),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:_.url,reason:"no level with compatible codecs found in manifest"})},i.onError=function(m,_){if(r.prototype.onError.call(this,m,_),_.fatal)return;var x=_.context,E=this._levels[this.currentLevelIndex];if(x&&(x.type===A.PlaylistContextType.AUDIO_TRACK&&E.audioGroupIds&&x.groupId===E.audioGroupIds[E.urlId]||x.type===A.PlaylistContextType.SUBTITLE_TRACK&&E.textGroupIds&&x.groupId===E.textGroupIds[E.urlId])){this.redundantFailover(this.currentLevelIndex);return}var y=!1,c=!0,u;switch(_.details){case D.ErrorDetails.FRAG_LOAD_ERROR:case D.ErrorDetails.FRAG_LOAD_TIMEOUT:case D.ErrorDetails.KEY_LOAD_ERROR:case D.ErrorDetails.KEY_LOAD_TIMEOUT:if(_.frag){var l=this._levels[_.frag.level];l?(l.fragmentError++,l.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=_.frag.level)):u=_.frag.level}break;case D.ErrorDetails.LEVEL_LOAD_ERROR:case D.ErrorDetails.LEVEL_LOAD_TIMEOUT:x&&(x.deliveryDirectives&&(c=!1),u=x.level),y=!0;break;case D.ErrorDetails.REMUX_ALLOC_ERROR:u=_.level,y=!0;break}u!==void 0&&this.recoverLevel(_,u,y,c)},i.recoverLevel=function(m,_,x,E){var y=m.details,c=this._levels[_];if(c.loadError++,x){var u=this.retryLoadingOrFail(m);if(u)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var l=c.url.length;if(l>1&&c.loadError<l)m.levelRetry=!0,this.redundantFailover(_);else if(this.manualLevelIndex===-1){var v=_===0?this._levels.length-1:_-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(y+": switch to "+v),m.levelRetry=!0,this.hls.nextAutoLevel=v)}}},i.redundantFailover=function(m){var _=this._levels[m],x=_.url.length;if(x>1){var E=(_.urlId+1)%x;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(y){y.urlId=E}),this.level=m}},i.onFragLoaded=function(m,_){var x=_.frag;if(x!==void 0&&x.type===A.PlaylistLevelType.MAIN){var E=this._levels[x.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},i.onLevelLoaded=function(m,_){var x,E=_.level,y=_.details,c=this._levels[E];if(!c){var u;this.warn("Invalid level index "+E),(u=_.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(y.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(c.fragmentError===0&&(c.loadError=0,this.retryCount=0),this.playlistLoaded(E,_,c.details)):(x=_.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(y.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(m,_){var x=this.hls.levels[this.currentLevelIndex];if(!x)return;if(x.audioGroupIds){for(var E=-1,y=this.hls.audioTracks[_.id].groupId,c=0;c<x.audioGroupIds.length;c++)if(x.audioGroupIds[c]===y){E=c;break}E!==x.urlId&&(x.urlId=E,this.startLoad())}},i.loadPlaylist=function(m){var _=this.currentLevelIndex,x=this._levels[_];if(this.canLoad&&x&&x.url.length>0){var E=x.urlId,y=x.url[E];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 "+_+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+E+" "+y),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:y,level:_,id:E,deliveryDirectives:m||null})}},i.removeLevel=function(m,_){var x=function(c,u){return u!==_},E=this._levels.filter(function(y,c){return c!==m?!0:y.url.length>1&&_!==void 0?(y.url=y.url.filter(x),y.audioGroupIds&&(y.audioGroupIds=y.audioGroupIds.filter(x)),y.textGroupIds&&(y.textGroupIds=y.textGroupIds.filter(x)),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=E,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:E})},o(t,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var _,x=this._levels;if(x.length===0)return;if(this.currentLevelIndex===m&&(_=x[m])!==null&&_!==void 0&&_.details)return;if(m<0||m>=x.length){var E=m<0;if(this.hls.trigger(L.Events.ERROR,{type:D.ErrorTypes.OTHER_ERROR,details:D.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:E,reason:"invalid level idx"}),E)return;m=Math.min(m,x.length-1)}this.clearTimer();var y=this.currentLevelIndex,c=x[y],u=x[m];this.log("switching to level "+m+" from "+y),this.currentLevelIndex=m;var l=d({},u,{level:m,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete l._urlId,this.hls.trigger(L.Events.LEVEL_SWITCHING,l);var v=u.details;if(!v||v.live){var g=this.switchParams(u.uri,c==null?void 0:c.details);this.loadPlaylist(g)}}},{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)}}]),t}(e.default)},"./src/controller/level-helper.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"addGroupId",function(){return D}),R.d(W,"assignTrackIdsByGroup",function(){return j}),R.d(W,"updatePTS",function(){return U}),R.d(W,"updateFragPTSDTS",function(){return A}),R.d(W,"mergeDetails",function(){return d}),R.d(W,"mapPartIntersection",function(){return f}),R.d(W,"mapFragmentIntersection",function(){return o}),R.d(W,"adjustSliding",function(){return n}),R.d(W,"addSliding",function(){return a}),R.d(W,"computeReloadInterval",function(){return h}),R.d(W,"getFragmentWithSN",function(){return s}),R.d(W,"getPartWith",function(){return r});var F=R("./src/polyfills/number.ts"),L=R("./src/utils/logger.ts");function D(t,i,b){switch(i){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(b);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(b);break}}function j(t){var i={};t.forEach(function(b){var m=b.groupId||"";b.id=i[m]=i[m]||0,i[m]++})}function U(t,i,b){var m=t[i],_=t[b];e(m,_)}function e(t,i){var b=i.startPTS;if(Object(F.isFiniteNumber)(b)){var m=0,_;i.sn>t.sn?(m=b-t.start,_=t):(m=t.start-b,_=i),_.duration!==m&&(_.duration=m)}else if(i.sn>t.sn){var x=t.cc===i.cc;x&&t.minEndPTS?i.start=t.start+(t.minEndPTS-t.start):i.start=t.start+t.duration}else i.start=Math.max(t.start-i.duration,0)}function A(t,i,b,m,_,x){var E=m-b;E<=0&&(L.logger.warn("Fragment should have a positive duration",i),m=b+i.duration,x=_+i.duration);var y=b,c=m,u=i.startPTS,l=i.endPTS;if(Object(F.isFiniteNumber)(u)){var v=Math.abs(u-b);Object(F.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(v,i.deltaPTS):i.deltaPTS=v,y=Math.max(b,u),b=Math.min(b,u),_=Math.min(_,i.startDTS),c=Math.min(m,l),m=Math.max(m,l),x=Math.max(x,i.endDTS)}i.duration=m-b;var g=b-i.start;i.appendedPTS=m,i.start=i.startPTS=b,i.maxStartPTS=y,i.startDTS=_,i.endPTS=m,i.minEndPTS=c,i.endDTS=x;var w=i.sn;if(!t||w<t.startSN||w>t.endSN)return 0;var O,I=w-t.startSN,S=t.fragments;for(S[I]=i,O=I;O>0;O--)e(S[O],S[O-1]);for(O=I;O<S.length-1;O++)e(S[O],S[O+1]);return t.fragmentHint&&e(S[S.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,g}function d(t,i){for(var b=null,m=t.fragments,_=m.length-1;_>=0;_--){var x=m[_].initSegment;if(x){b=x;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var E=0,y;if(o(t,i,function(O,I){O.relurl&&(E=O.cc-I.cc),Object(F.isFiniteNumber)(O.startPTS)&&Object(F.isFiniteNumber)(O.endPTS)&&(I.start=I.startPTS=O.startPTS,I.startDTS=O.startDTS,I.appendedPTS=O.appendedPTS,I.maxStartPTS=O.maxStartPTS,I.endPTS=O.endPTS,I.endDTS=O.endDTS,I.minEndPTS=O.minEndPTS,I.duration=O.endPTS-O.startPTS,I.duration&&(y=I),i.PTSKnown=i.alignedSliding=!0),I.elementaryStreams=O.elementaryStreams,I.loader=O.loader,I.stats=O.stats,I.urlId=O.urlId,O.initSegment&&(I.initSegment=O.initSegment,b=O.initSegment)}),b){var c=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;c.forEach(function(O){var I;(!O.initSegment||O.initSegment.relurl===((I=b)===null||I===void 0?void 0:I.relurl))&&(O.initSegment=b)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(O){return!O}),i.deltaUpdateFailed)){L.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=i.skippedSegments;u--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var l=i.fragments;if(E){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<l.length;v++)l[v].cc+=E}i.skippedSegments&&(i.startCC=i.fragments[0].cc),f(t.partList,i.partList,function(O,I){I.elementaryStreams=O.elementaryStreams,I.stats=O.stats}),y?A(i,y,y.startPTS,y.endPTS,y.startDTS,y.endDTS):n(t,i),l.length&&(i.totalduration=i.edge-l[0].start),i.driftStartTime=t.driftStartTime,i.driftStart=t.driftStart;var g=i.advancedDateTime;if(i.advanced&&g){var w=i.edge;i.driftStart||(i.driftStartTime=g,i.driftStart=w),i.driftEndTime=g,i.driftEnd=w}else i.driftEndTime=t.driftEndTime,i.driftEnd=t.driftEnd,i.advancedDateTime=t.advancedDateTime}function f(t,i,b){if(t&&i)for(var m=0,_=0,x=t.length;_<=x;_++){var E=t[_],y=i[_+m];E&&y&&E.index===y.index&&E.fragment.sn===y.fragment.sn?b(E,y):m--}}function o(t,i,b){for(var m=i.skippedSegments,_=Math.max(t.startSN,i.startSN)-i.startSN,x=(t.fragmentHint?1:0)+(m?i.endSN:Math.min(t.endSN,i.endSN))-i.startSN,E=i.startSN-t.startSN,y=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,c=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=_;u<=x;u++){var l=c[E+u],v=y[u];m&&!v&&u<m&&(v=i.fragments[u]=l),l&&v&&b(l,v)}}function n(t,i){var b=i.startSN+i.skippedSegments-t.startSN,m=t.fragments;if(b<0||b>=m.length)return;a(i,m[b].start)}function a(t,i){if(i){for(var b=t.fragments,m=t.skippedSegments;m<b.length;m++)b[m].start+=i;t.fragmentHint&&(t.fragmentHint.start+=i)}}function h(t,i){var b=1e3*t.levelTargetDuration,m=b/2,_=t.age,x=_>0&&_<b*3,E=i.loading.end-i.loading.start,y,c=t.availabilityDelay;if(t.updated===!1)if(x){var u=333*t.misses;y=Math.max(Math.min(m,E*2),u),t.availabilityDelay=(t.availabilityDelay||0)+y}else y=m;else x?(c=Math.min(c||b/2,_),t.availabilityDelay=c,y=c+b-_):y=b-E;return Math.round(y)}function s(t,i,b){if(!t||!t.details)return null;var m=t.details,_=m.fragments[i-m.startSN];return _||(_=m.fragmentHint,_&&_.sn===i?_:i<m.startSN&&b&&b.sn===i?b:null)}function r(t,i,b){if(!t||!t.details)return null;var m=t.details.partList;if(m)for(var _=m.length;_--;){var x=m[_];if(x.index===b&&x.fragment.sn===i)return x}return null}},"./src/controller/stream-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return m});var F=R("./src/polyfills/number.ts"),L=R("./src/controller/base-stream-controller.ts"),D=R("./src/is-supported.ts"),j=R("./src/events.ts"),U=R("./src/utils/buffer-helper.ts"),e=R("./src/controller/fragment-tracker.ts"),A=R("./src/types/loader.ts"),d=R("./src/loader/fragment.ts"),f=R("./src/demux/transmuxer-interface.ts"),o=R("./src/types/transmuxer.ts"),n=R("./src/controller/gap-controller.ts"),a=R("./src/errors.ts"),h=R("./src/utils/logger.ts");function s(_,x){for(var E=0;E<x.length;E++){var y=x[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(_,y.key,y)}}function r(_,x,E){return x&&s(_.prototype,x),E&&s(_,E),_}function t(_,x){_.prototype=Object.create(x.prototype),_.prototype.constructor=_,i(_,x)}function i(_,x){return i=Object.setPrototypeOf||function(y,c){return y.__proto__=c,y},i(_,x)}var b=100,m=function(_){t(x,_);function x(y,c){var u;return u=_.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=x.prototype;return E._registerListeners=function(){var c=this.hls;c.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.on(j.Events.ERROR,this.onError,this),c.on(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var c=this.hls;c.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),c.off(j.Events.ERROR,this.onError,this),c.off(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),c.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),c.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.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=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,_.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.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=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var g,w=self.performance.now(),O=this.retryDate;(!O||w>=O||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){_.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var c,u,l=this.hls,v=this.levelLastLoaded,g=this.levels,w=this.media,O=l.config,I=l.nextLoadLevel;if(v===null||!w&&(this.startFragRequested||!O.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[I])return;var S=g[I];this.level=l.nextLoadLevel=I;var P=S.details;if(!P||this.state===L.State.WAITING_LEVEL||P.live&&this.levelLastLoaded!==I){this.state=L.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,A.PlaylistLevelType.MAIN);if(B===null)return;var C=B.len,H=this.getMaxBufferLength(S.maxBitrate);if(C>=H)return;if(this._streamEnded(B,P)){var z={};this.altAudio&&(z.type="video"),this.hls.trigger(j.Events.BUFFER_EOS,z),this.state=L.State.ENDED;return}var Z=B.end,Q=this.getNextFragment(Z,P);if(this.couldBacktrack&&!this.fragPrevious&&Q&&Q.sn!=="initSegment"){var pe=Q.sn-P.startSN;pe>1&&(Q=P.fragments[pe-1],this.fragmentTracker.removeFragment(Q))}if(Q&&this.fragmentTracker.getState(Q)===e.FragmentState.OK&&this.nextLoadPosition>Z){var le=this.audioOnly&&!this.altAudio?d.ElementaryStreamTypes.AUDIO:d.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,le,A.PlaylistLevelType.MAIN),Q=this.getNextFragment(this.nextLoadPosition,P)}if(!Q)return;Q.initSegment&&!Q.initSegment.data&&!this.bitrateTest&&(Q=Q.initSegment),((c=Q.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((u=Q.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(Q,P):this.loadFragment(Q,P,Z)},E.loadFragment=function(c,u,l){var v,g=this.fragmentTracker.getState(c);if(this.fragCurrent=c,g===e.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(c);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else g=e.FragmentState.NOT_LOADED}g===e.FragmentState.NOT_LOADED||g===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,_.prototype.loadFragment.call(this,c,u,l)):g===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()},E.getAppendedFrag=function(c){var u=this.fragmentTracker.getAppendedFrag(c,A.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},E.getBufferedFrag=function(c){return this.fragmentTracker.getBufferedFrag(c,A.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(c){return c?this.getBufferedFrag(c.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.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 g=this.hls.nextLoadLevel,w=c[g],O=this.fragLastKbps;O&&this.fragCurrent?l=this.fragCurrent.duration*w.maxBitrate/(1e3*O)+1:l=0}else l=0;var I=this.getBufferedFrag(u.currentTime+l);if(I){var S=this.followingBufferedFrag(I);if(S){this.abortCurrentFrag();var P=S.maxStartPTS?S.maxStartPTS:S.start,B=S.duration,C=Math.max(I.end,P+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(C,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var c=this.fragCurrent;this.fragCurrent=null,c!=null&&c.loader&&c.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(c,u){_.prototype.flushMainBuffer.call(this,c,u,this.altAudio?"video":null)},E.onMediaAttached=function(c,u){_.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 n.default(this.config,l,this.fragmentTracker,this.hls)},E.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),_.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var c=this.media,u=c?c.currentTime:null;Object(F.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(j.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},E.onManifestParsed=function(c,u){var l=!1,v=!1,g;u.levels.forEach(function(w){g=w.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(l=!0),g.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=l&&v&&!Object(D.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},E.onLevelLoading=function(c,u){var l=this.levels;if(!l||this.state!==L.State.IDLE)return;var v=l[u.level];(!v.details||v.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(v.details))&&(this.state=L.State.WAITING_LEVEL)},E.onLevelLoaded=function(c,u){var l,v=this.levels,g=u.level,w=u.details,O=w.totalduration;if(!v){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+O);var I=this.fragCurrent;I&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==u.level&&I.loader&&(this.state=L.State.IDLE,I.loader.abort()));var S=v[g],P=0;if(w.live||(l=S.details)!==null&&l!==void 0&&l.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;P=this.alignPlaylists(w,S.details)}if(S.details=w,this.levelLastLoaded=g,this.hls.trigger(j.Events.LEVEL_UPDATED,{details:w,level:g}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=L.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,P),this.tick()},E._handleFragmentLoadProgress=function(c){var u,l=c.frag,v=c.part,g=c.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+l.sn+" of level "+l.level+" will not be buffered");return}var O=w[l.level],I=O.details;if(!I){this.warn("Dropping fragment "+l.sn+" of level "+l.level+" after level details were reset");return}var S=O.videoCodec,P=I.PTSKnown||!I.live,B=(u=l.initSegment)===null||u===void 0?void 0:u.data,C=this._getAudioCodec(O),H=this.transmuxer=this.transmuxer||new f.default(this.hls,A.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),z=v?v.index:-1,Z=z!==-1,Q=new o.ChunkMetadata(l.level,l.sn,l.stats.chunkCount,g.byteLength,z,Z),pe=this.initPTS[l.cc];H.push(g,B,C,S,l,v,I.totalduration,P,Q,pe)},E.onAudioTrackSwitching=function(c,u){var l=this.altAudio,v=!!u.url,g=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 w=this.fragCurrent;w!=null&&w.loader&&(this.log("Switching to main audio track, cancel main fragment load"),w.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var O=this.hls;l&&O.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),O.trigger(j.Events.AUDIO_TRACK_SWITCHED,{id:g})}},E.onAudioTrackSwitched=function(c,u){var l=u.id,v=!!this.hls.audioTracks[l].url;if(v){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=v,this.tick()},E.onBufferCreated=function(c,u){var l=u.tracks,v,g,w=!1;for(var O in l){var I=l[O];if(I.id==="main"){if(g=O,v=I,O==="video"){var S=l[O];S&&(this.videoBuffer=S.buffer)}}else w=!0}w&&v?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(c,u){var l=u.frag,v=u.part;if(l&&l.type!==A.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===L.State.PARSED&&(this.state=L.State.IDLE);return}var g=v?v.stats:l.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),l.sn!=="initSegment"&&(this.fragPrevious=l),this.fragBufferedComplete(l,v)},E.onError=function(c,u){switch(u.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.MAIN,u);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=L.State.ERROR):!u.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var l=!0,v=this.getFwdBufferInfo(this.media,A.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}},E.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},E.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(c,u){var l=u.type;if(l!==d.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(l===d.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,l,A.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(c,u){this.levels=u.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.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),g=v.length?v.start(0):0,w=g-l;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(h.logger.log("adjusting start position by "+w+" to match buffer start"),l+=w,this.startPosition=l),this.log("seek to target start position "+l+" from current time "+u),c.currentTime=l}},E._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},E._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=L.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var g=c.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),v.trigger(j.Events.FRAG_LOADED,l)})},E._handleTransmuxComplete=function(c){var u,l="main",v=this.hls,g=c.remuxResult,w=c.chunkMeta,O=this.getCurrentContext(w);if(!O){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(w.level);return}var I=O.frag,S=O.part,P=O.level,B=g.video,C=g.text,H=g.id3,z=g.initSegment,Z=this.altAudio?void 0:g.audio;if(this.fragContextChanged(I))return;if(this.state=L.State.PARSING,z){z.tracks&&(this._bufferInitSegment(P,z.tracks,I,w),v.trigger(j.Events.FRAG_PARSING_INIT_SEGMENT,{frag:I,id:l,tracks:z.tracks}));var Q=z.initPTS,pe=z.timescale;Object(F.isFiniteNumber)(Q)&&(this.initPTS[I.cc]=Q,v.trigger(j.Events.INIT_PTS_FOUND,{frag:I,id:l,initPTS:Q,timescale:pe}))}if(B&&g.independent!==!1){if(P.details){var le=B.startPTS,de=B.endPTS,ce=B.startDTS,me=B.endDTS;if(S)S.elementaryStreams[B.type]={startPTS:le,endPTS:de,startDTS:ce,endDTS:me};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var te=this.getLoadPosition()+this.config.maxBufferHole;if(te<le){this.backtrack(I);return}I.setElementaryStreamInfo(B.type,I.start,de,I.start,me,!0)}I.setElementaryStreamInfo(B.type,le,de,ce,me),this.bufferFragmentData(B,I,S,w)}}else if(g.independent===!1){this.backtrack(I);return}if(Z){var $=Z.startPTS,_e=Z.endPTS,Oe=Z.startDTS,Ce=Z.endDTS;S&&(S.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:_e,startDTS:Oe,endDTS:Ce}),I.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,$,_e,Oe,Ce),this.bufferFragmentData(Z,I,S,w)}if(H!=null&&(u=H.samples)!==null&&u!==void 0&&u.length){var Ae={frag:I,id:l,samples:H.samples};v.trigger(j.Events.FRAG_PARSING_METADATA,Ae)}if(C){var Pe={frag:I,id:l,samples:C.samples};v.trigger(j.Events.FRAG_PARSING_USERDATA,Pe)}},E._bufferInitSegment=function(c,u,l,v){var g=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var w=u.audio,O=u.video,I=u.audiovideo;if(w){var S=c.audioCodec,P=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(S&&(S.indexOf("mp4a.40.5")!==-1?S="mp4a.40.2":S="mp4a.40.5"),w.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(S="mp4a.40.5")),P.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(S="mp4a.40.2",this.log("Android: force audio codec to "+S)),c.audioCodec&&c.audioCodec!==S&&this.log('Swapping manifest audio codec "'+c.audioCodec+'" for "'+S+'"'),w.levelCodec=S,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(S||"")+"/"+(c.audioCodec||"")+"/"+w.codec+"]")}O&&(O.levelCodec=c.videoCodec,O.id="main",this.log("Init video buffer, container:"+O.container+", codecs[level/parsed]=["+(c.videoCodec||"")+"/"+O.codec+"]")),I&&this.log("Init audiovideo buffer, container:"+I.container+", codecs[level/parsed]=["+(c.attrs.CODECS||"")+"/"+I.codec+"]"),this.hls.trigger(j.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(B){var C=u[B],H=C.initSegment;H!=null&&H.byteLength&&g.hls.trigger(j.Events.BUFFER_APPENDING,{type:B,data:H,frag:l,part:null,chunkMeta:v,parent:l.type})}),this.tick()},E.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=L.State.BACKTRACKING},E.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,g=u.level;(!v||u.sn!==v.sn||v.level!==g||u.urlId!==v.urlId)&&(this.hls.trigger(j.Events.FRAG_CHANGED,{frag:u}),(!v||v.level!==g)&&this.hls.trigger(j.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=u)}}},r(x,[{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}}]),x}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"SubtitleStreamController",function(){return t});var F=R("./src/events.ts"),L=R("./src/utils/logger.ts"),D=R("./src/utils/buffer-helper.ts"),j=R("./src/controller/fragment-finders.ts"),U=R("./src/utils/discontinuities.ts"),e=R("./src/controller/level-helper.ts"),A=R("./src/controller/fragment-tracker.ts"),d=R("./src/controller/base-stream-controller.ts"),f=R("./src/types/loader.ts"),o=R("./src/types/level.ts");function n(i,b){for(var m=0;m<b.length;m++){var _=b[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(i,_.key,_)}}function a(i,b,m){return b&&n(i.prototype,b),m&&n(i,m),i}function h(i,b){i.prototype=Object.create(b.prototype),i.prototype.constructor=i,s(i,b)}function s(i,b){return s=Object.setPrototypeOf||function(_,x){return _.__proto__=x,_},s(i,b)}var r=500,t=function(i){h(b,i);function b(_,x){var E;return E=i.call(this,_,x,"[subtitle-stream-controller]")||this,E.levels=[],E.currentTrackId=-1,E.tracksBuffered=[],E.mainDetails=null,E._registerListeners(),E}var m=b.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var x=this.hls;x.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.on(F.Events.ERROR,this.onError,this),x.on(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),x.on(F.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),x.on(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),x.on(F.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),x.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var x=this.hls;x.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),x.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),x.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),x.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),x.off(F.Events.ERROR,this.onError,this),x.off(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),x.off(F.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),x.off(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),x.off(F.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),x.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=d.State.IDLE,this.setInterval(r),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(x,E){this.mainDetails=E.details},m.onSubtitleFragProcessed=function(x,E){var y=E.frag,c=E.success;if(this.fragPrevious=y,this.state=d.State.IDLE,!c)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var l,v=y.start,g=0;g<u.length;g++)if(v>=u[g].start&&v<=u[g].end){l=u[g];break}var w=y.start+y.duration;l?l.end=w:(l={start:v,end:w},u.push(l)),this.fragmentTracker.fragBuffered(y)},m.onBufferFlushing=function(x,E){var y=E.startOffset,c=E.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,g=v.targetduration,w=c-g;if(w<=0)return;E.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(O){for(var I=0;I<O.length;){if(O[I].end<=w){O.shift();continue}else if(O[I].start<w)O[I].start=w;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(y,w,f.PlaylistLevelType.SUBTITLE)}},m.onError=function(x,E){var y,c=E.frag;if(!c||c.type!==f.PlaylistLevelType.SUBTITLE)return;(y=this.fragCurrent)!==null&&y!==void 0&&y.loader&&this.fragCurrent.loader.abort(),this.state=d.State.IDLE},m.onSubtitleTracksUpdated=function(x,E){var y=this,c=E.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(x,E){if(this.currentTrackId=E.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(r)},m.onSubtitleTrackLoaded=function(x,E){var y,c=E.details,u=E.id,l=this.currentTrackId,v=this.levels;if(!v.length)return;var g=v[l];if(u>=v.length||u!==l||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,c.live||(y=g.details)!==null&&y!==void 0&&y.live){var w=this.mainDetails;if(c.deltaUpdateFailed||!w)return;var O=w.fragments[0];if(!g.details)c.hasProgramDateTime&&w.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(c,w):O&&Object(e.addSliding)(c,O.start);else{var I=this.alignPlaylists(c,g.details);I===0&&O&&Object(e.addSliding)(c,O.start)}}if(g.details=c,this.levelLastLoaded=u,this.tick(),c.live&&!this.fragCurrent&&this.media&&this.state===d.State.IDLE){var S=Object(j.findFragmentByPTS)(null,c.fragments,this.media.currentTime,0);S||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},m._handleFragmentLoadComplete=function(x){var E=x.frag,y=x.payload,c=E.decryptdata,u=this.hls;if(this.fragContextChanged(E))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 g=performance.now();u.trigger(F.Events.FRAG_DECRYPTED,{frag:E,payload:v,stats:{tstart:l,tdecrypt:g}})})}},m.doTick=function(){if(!this.media){this.state=d.State.IDLE;return}if(this.state===d.State.IDLE){var x,E=this.currentTrackId,y=this.levels;if(!y.length||!y[E]||!y[E].details)return;var c=y[E].details,u=c.targetduration,l=this.config,v=this.media,g=D.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-u,l.maxBufferHole),w=g.end,O=g.len,I=this.getMaxBufferLength()+u;if(O>I)return;console.assert(c,"Subtitle track details are defined on idle subtitle stream controller tick");var S=c.fragments,P=S.length,B=c.edge,C,H=this.fragPrevious;if(w<B){var z=l.maxFragLookUpTolerance;H&&c.hasProgramDateTime&&(C=Object(j.findFragmentByPDT)(S,H.endProgramDateTime,z)),C||(C=Object(j.findFragmentByPTS)(H,S,w,z),!C&&H&&H.start<S[0].start&&(C=S[0]))}else C=S[P-1];(x=C)!==null&&x!==void 0&&x.encrypted?(L.logger.log("Loading key for "+C.sn),this.state=d.State.KEY_LOADING,this.hls.trigger(F.Events.KEY_LOADING,{frag:C})):C&&this.fragmentTracker.getState(C)===A.FragmentState.NOT_LOADED&&this.loadFragment(C,c,w)}},m.loadFragment=function(x,E,y){this.fragCurrent=x,i.prototype.loadFragment.call(this,x,E,y)},a(b,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),b}(d.default)},"./src/controller/subtitle-track-controller.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/events.ts"),L=R("./src/utils/texttrack-utils.ts"),D=R("./src/controller/base-playlist-controller.ts"),j=R("./src/types/loader.ts");function U(n,a){for(var h=0;h<a.length;h++){var s=a[h];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function e(n,a,h){return a&&U(n.prototype,a),h&&U(n,h),n}function A(n,a){n.prototype=Object.create(a.prototype),n.prototype.constructor=n,d(n,a)}function d(n,a){return d=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},d(n,a)}var f=function(n){A(a,n);function a(s){var r;return r=n.call(this,s,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var h=a.prototype;return h.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,n.prototype.destroy.call(this)},h.registerListeners=function(){var r=this.hls;r.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(F.Events.ERROR,this.onError,this)},h.unregisterListeners=function(){var r=this.hls;r.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(F.Events.ERROR,this.onError,this)},h.onMediaAttached=function(r,t){if(this.media=t.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(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},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 r=o(this.media.textTracks);r.forEach(function(t){Object(L.clearCurrentCues)(t)}),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(r,t){this.tracks=t.subtitleTracks},h.onSubtitleTrackLoaded=function(r,t){var i=t.id,b=t.details,m=this.trackId,_=this.tracksInGroup[m];if(!_){this.warn("Invalid subtitle track id "+i);return}var x=_.details;_.details=t.details,this.log("subtitle track "+i+" loaded ["+b.startSN+"-"+b.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,t,x))},h.onLevelLoading=function(r,t){this.switchLevel(t.level)},h.onLevelSwitching=function(r,t){this.switchLevel(t.level)},h.switchLevel=function(r){var t=this.hls.levels[r];if(!(t!=null&&t.textGroupIds))return;var i=t.textGroupIds[t.urlId];if(this.groupId!==i){var b=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(E){return!i||E.groupId===i});this.tracksInGroup=m;var _=this.findTrackId(b==null?void 0:b.name)||this.findTrackId();this.groupId=i;var x={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(F.Events.SUBTITLE_TRACKS_UPDATED,x),_!==-1&&this.setSubtitleTrack(_,b)}},h.findTrackId=function(r){for(var t=this.tracksInGroup,i=0;i<t.length;i++){var b=t[i];if((!this.selectDefaultTrack||b.default)&&(!r||r===b.name))return b.id}return-1},h.onError=function(r,t){if(n.prototype.onError.call(this,r,t),t.fatal||!t.context)return;t.context.type===j.PlaylistContextType.SUBTITLE_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},h.loadPlaylist=function(r){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var i=t.id,b=t.groupId,m=t.url;if(r)try{m=r.addDirectives(m)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADING,{url:m,id:i,groupId:b,deliveryDirectives:r||null})}},h.toggleTrackModes=function(r){var t=this,i=this.media,b=this.subtitleDisplay,m=this.trackId;if(!i)return;var _=o(i.textTracks),x=_.filter(function(c){return c.groupId===t.groupId});if(r===-1)[].slice.call(_).forEach(function(c){c.mode="disabled"});else{var E=x[m];E&&(E.mode="disabled")}var y=x[r];y&&(y.mode=b?"showing":"hidden")},h.setSubtitleTrack=function(r,t){var i,b=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(i=b[r])!==null&&i!==void 0&&i.details)||r<-1||r>=b.length)return;this.clearTimer();var m=b[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,m){var _=m.id,x=m.groupId,E=x===void 0?"":x,y=m.name,c=m.type,u=m.url;this.hls.trigger(F.Events.SUBTITLE_TRACK_SWITCH,{id:_,groupId:E,name:y,type:c,url:u});var l=this.switchParams(m.url,t==null?void 0:t.details);this.loadPlaylist(l)}else this.hls.trigger(F.Events.SUBTITLE_TRACK_SWITCH,{id:r})},h.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,t=o(this.media.textTracks),i=0;i<t.length;i++)if(t[i].mode==="hidden")r=i;else if(t[i].mode==="showing"){r=i;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},e(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,t)}}]),a}(D.default);function o(n){for(var a=[],h=0;h<n.length;h++){var s=n[h];s.kind==="subtitles"&&s.label&&a.push(n[h])}return a}W.default=f},"./src/controller/timeline-controller.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"TimelineController",function(){return o});var F=R("./src/polyfills/number.ts"),L=R("./src/events.ts"),D=R("./src/utils/cea-608-parser.ts"),j=R("./src/utils/output-filter.ts"),U=R("./src/utils/webvtt-parser.ts"),e=R("./src/utils/texttrack-utils.ts"),A=R("./src/utils/imsc1-ttml-parser.ts"),d=R("./src/types/loader.ts"),f=R("./src/utils/logger.ts"),o=function(){function s(t){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=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var i=new j.default(this,"textTrack1"),b=new j.default(this,"textTrack2"),m=new j.default(this,"textTrack3"),_=new j.default(this,"textTrack4");this.cea608Parser1=new D.default(1,i,b),this.cea608Parser2=new D.default(3,m,_)}t.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(L.Events.FRAG_LOADING,this.onFragLoading,this),t.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=s.prototype;return r.destroy=function(){var i=this.hls;i.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.off(L.Events.FRAG_LOADING,this.onFragLoading,this),i.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(i,b,m,_,x){for(var E=!1,y=x.length;y--;){var c=x[y],u=a(c[0],c[1],b,m);if(u>=0&&(c[0]=Math.min(c[0],b),c[1]=Math.max(c[1],m),E=!0,u/(m-b)>.5))return}if(E||x.push([b,m]),this.config.renderTextTracksNatively){var l=this.captionsTracks[i];this.Cues.newCue(l,b,m,_)}else{var v=this.Cues.newCue(null,b,m,_);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:v,track:i})}},r.onInitPtsFound=function(i,b){var m=this,_=b.frag,x=b.id,E=b.initPTS,y=b.timescale,c=this.unparsedVttFrags;x==="main"&&(this.initPTS[_.cc]=E,this.timescale[_.cc]=y),c.length&&(this.unparsedVttFrags=[],c.forEach(function(u){m.onFragLoaded(L.Events.FRAG_LOADED,u)}))},r.getExistingTrack=function(i){var b=this.media;if(b)for(var m=0;m<b.textTracks.length;m++){var _=b.textTracks[m];if(_[i])return _}return null},r.createCaptionsTrack=function(i){this.config.renderTextTracksNatively?this.createNativeTrack(i):this.createNonNativeTrack(i)},r.createNativeTrack=function(i){if(this.captionsTracks[i])return;var b=this.captionsProperties,m=this.captionsTracks,_=this.media,x=b[i],E=x.label,y=x.languageCode,c=this.getExistingTrack(i);if(c)m[i]=c,Object(e.clearCurrentCues)(m[i]),Object(e.sendAddTrackEvent)(m[i],_);else{var u=this.createTextTrack("captions",E,y);u&&(u[i]=!0,m[i]=u)}},r.createNonNativeTrack=function(i){if(this.nonNativeCaptionsTracks[i])return;var b=this.captionsProperties[i];if(!b)return;var m=b.label,_={_id:i,label:m,kind:"captions",default:b.media?!!b.media.default:!1,closedCaptions:b.media};this.nonNativeCaptionsTracks[i]=_,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[_]})},r.createTextTrack=function(i,b,m){var _=this.media;return _?_.addTextTrack(i,b,m):void 0},r.onMediaAttaching=function(i,b){this.media=b.media,this._cleanTracks()},r.onMediaDetaching=function(){var i=this.captionsTracks;Object.keys(i).forEach(function(b){Object(e.clearCurrentCues)(i[b]),delete i[b]}),this.nonNativeCaptionsTracks={}},r.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())},r._cleanTracks=function(){var i=this.media;if(!i)return;var b=i.textTracks;if(b)for(var m=0;m<b.length;m++)Object(e.clearCurrentCues)(b[m])},r.onSubtitleTracksUpdated=function(i,b){var m=this;this.textTracks=[];var _=b.subtitleTracks||[],x=_.some(function(u){return u.textCodec===A.IMSC1_CODEC});if(this.config.enableWebVTT||x&&this.config.enableIMSC1){var E=this.tracks&&_&&this.tracks.length===_.length;if(this.tracks=_||[],this.config.renderTextTracksNatively){var y=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,l){var v;if(l<y.length){for(var g=null,w=0;w<y.length;w++)if(n(y[w],u)){g=y[w];break}g&&(v=g)}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(!E&&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(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:c})}}},r.onManifestLoaded=function(i,b){var m=this;this.config.enableCEA708Captions&&b.captions&&b.captions.forEach(function(_){var x=/(?:CC|SERVICE)([1-4])/.exec(_.instreamId);if(!x)return;var E="textTrack"+x[1],y=m.captionsProperties[E];if(!y)return;y.label=_.name,_.lang&&(y.languageCode=_.lang),y.media=_})},r.onFragLoading=function(i,b){var m=this.cea608Parser1,_=this.cea608Parser2,x=this.lastSn,E=this.lastPartIndex;if(!this.enabled||!(m&&_))return;if(b.frag.type===d.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===x+1||u===x&&l===E+1||(m.reset(),_.reset()),this.lastSn=u,this.lastPartIndex=l}},r.onFragLoaded=function(i,b){var m=b.frag,_=b.payload,x=this.initPTS,E=this.unparsedVttFrags;if(m.type===d.PlaylistLevelType.SUBTITLE)if(_.byteLength){if(!Object(F.isFiniteNumber)(x[m.cc])){E.push(b),x.length&&this.hls.trigger(L.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===A.IMSC1_CODEC?this._parseIMSC1(m,_):this._parseVTTs(m,_,u)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(i,b){var m=this,_=this.hls;Object(A.parseIMSC1)(b,this.initPTS[i.cc],this.timescale[i.cc],function(x){m._appendCues(x,i.level),_.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(x){f.logger.log("Failed to parse IMSC1: "+x),_.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:x})})},r._parseVTTs=function(i,b,m){var _=this,x=this.hls;Object(U.parseWebVTT)(b,this.initPTS[i.cc],this.timescale[i.cc],m,i.cc,i.start,function(E){_._appendCues(E,i.level),x.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(E){_._fallbackToIMSC1(i,b),f.logger.log("Failed to parse VTT cue: "+E),x.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:E})})},r._fallbackToIMSC1=function(i,b){var m=this,_=this.tracks[i.level];_.textCodec||Object(A.parseIMSC1)(b,this.initPTS[i.cc],this.timescale[i.cc],function(){_.textCodec=A.IMSC1_CODEC,m._parseIMSC1(i,b)},function(){_.textCodec="wvtt"})},r._appendCues=function(i,b){var m=this.hls;if(this.config.renderTextTracksNatively){var _=this.textTracks[b];if(_.mode==="disabled")return;i.forEach(function(y){return Object(e.addCueToTrack)(_,y)})}else{var x=this.tracks[b],E=x.default?"default":"subtitles"+b;m.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:i,track:E})}},r.onFragDecrypted=function(i,b){var m=b.frag;if(m.type===d.PlaylistLevelType.SUBTITLE){if(!Object(F.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(b);return}this.onFragLoaded(L.Events.FRAG_LOADED,b)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(i,b){var m=this.cea608Parser1,_=this.cea608Parser2;if(!this.enabled||!(m&&_))return;for(var x=0;x<b.samples.length;x++){var E=b.samples[x].bytes;if(E){var y=this.extractCea608Data(E);m.addData(b.samples[x].pts,y[0]),_.addData(b.samples[x].pts,y[1])}}},r.onBufferFlushing=function(i,b){var m=b.startOffset,_=b.endOffset,x=b.endOffsetSubtitles,E=b.type,y=this.media;if(!y||y.currentTime<_)return;if(!E||E==="video"){var c=this.captionsTracks;Object.keys(c).forEach(function(l){return Object(e.removeCuesInRange)(c[l],m,_)})}if(this.config.renderTextTracksNatively&&(m===0&&x!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(l){return Object(e.removeCuesInRange)(u[l],m,x)})}},r.extractCea608Data=function(i){for(var b=i[0]&31,m=2,_=[[],[]],x=0;x<b;x++){var E=i[m++],y=127&i[m++],c=127&i[m++],u=(4&E)!==0,l=3&E;if(y===0&&c===0)continue;u&&((l===0||l===1)&&(_[l].push(y),_[l].push(c)))}return _},s}();function n(s,r){return s&&s.label===r.name&&!(s.textTrack1||s.textTrack2)}function a(s,r,t,i){return Math.min(r,i)-Math.max(s,t)}function h(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return F});var F=function(){function L(j,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=j,this.aesIV=U}var D=L.prototype;return D.decrypt=function(U,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,U)},L}()},"./src/crypt/aes-decryptor.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"removePadding",function(){return L}),R.d(W,"default",function(){return D});var F=R("./src/utils/typed-array.ts");function L(j){var U=j.byteLength,e=U&&new DataView(j.buffer).getUint8(U-1);return e?Object(F.sliceUint8)(j,0,U-e):j}var D=function(){function j(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=j.prototype;return U.uint8ArrayToUint32Array_=function(A){for(var d=new DataView(A),f=new Uint32Array(4),o=0;o<4;o++)f[o]=d.getUint32(o*4);return f},U.initTable=function(){var A=this.sBox,d=this.invSBox,f=this.subMix,o=f[0],n=f[1],a=f[2],h=f[3],s=this.invSubMix,r=s[0],t=s[1],i=s[2],b=s[3],m=new Uint32Array(256),_=0,x=0,E=0;for(E=0;E<256;E++)E<128?m[E]=E<<1:m[E]=E<<1^283;for(E=0;E<256;E++){var y=x^x<<1^x<<2^x<<3^x<<4;y=y>>>8^y&255^99,A[_]=y,d[y]=_;var c=m[_],u=m[c],l=m[u],v=m[y]*257^y*16843008;o[_]=v<<24|v>>>8,n[_]=v<<16|v>>>16,a[_]=v<<8|v>>>24,h[_]=v,v=l*16843009^u*65537^c*257^_*16843008,r[y]=v<<24|v>>>8,t[y]=v<<16|v>>>16,i[y]=v<<8|v>>>24,b[y]=v,_?(_=c^m[m[m[l^c]]],x^=m[m[x]]):_=x=1}},U.expandKey=function(A){for(var d=this.uint8ArrayToUint32Array_(A),f=!0,o=0;o<d.length&&f;)f=d[o]===this.key[o],o++;if(f)return;this.key=d;var n=this.keySize=d.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);var a=this.ksRows=(n+6+1)*4,h,s,r=this.keySchedule=new Uint32Array(a),t=this.invKeySchedule=new Uint32Array(a),i=this.sBox,b=this.rcon,m=this.invSubMix,_=m[0],x=m[1],E=m[2],y=m[3],c,u;for(h=0;h<a;h++){if(h<n){c=r[h]=d[h];continue}u=c,h%n===0?(u=u<<8|u>>>24,u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[u&255],u^=b[h/n|0]<<24):n>6&&h%n===4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[u&255]),r[h]=c=(r[h-n]^u)>>>0}for(s=0;s<a;s++)h=a-s,s&3?u=r[h]:u=r[h-4],s<4||h<=4?t[s]=u:t[s]=_[i[u>>>24]]^x[i[u>>>16&255]]^E[i[u>>>8&255]]^y[i[u&255]],t[s]=t[s]>>>0},U.networkToHostOrderSwap=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},U.decrypt=function(A,d,f){for(var o=this.keySize+6,n=this.invKeySchedule,a=this.invSBox,h=this.invSubMix,s=h[0],r=h[1],t=h[2],i=h[3],b=this.uint8ArrayToUint32Array_(f),m=b[0],_=b[1],x=b[2],E=b[3],y=new Int32Array(A),c=new Int32Array(y.length),u,l,v,g,w,O,I,S,P,B,C,H,z,Z,Q=this.networkToHostOrderSwap;d<y.length;){for(P=Q(y[d]),B=Q(y[d+1]),C=Q(y[d+2]),H=Q(y[d+3]),w=P^n[0],O=H^n[1],I=C^n[2],S=B^n[3],z=4,Z=1;Z<o;Z++)u=s[w>>>24]^r[O>>16&255]^t[I>>8&255]^i[S&255]^n[z],l=s[O>>>24]^r[I>>16&255]^t[S>>8&255]^i[w&255]^n[z+1],v=s[I>>>24]^r[S>>16&255]^t[w>>8&255]^i[O&255]^n[z+2],g=s[S>>>24]^r[w>>16&255]^t[O>>8&255]^i[I&255]^n[z+3],w=u,O=l,I=v,S=g,z=z+4;u=a[w>>>24]<<24^a[O>>16&255]<<16^a[I>>8&255]<<8^a[S&255]^n[z],l=a[O>>>24]<<24^a[I>>16&255]<<16^a[S>>8&255]<<8^a[w&255]^n[z+1],v=a[I>>>24]<<24^a[S>>16&255]<<16^a[w>>8&255]<<8^a[O&255]^n[z+2],g=a[S>>>24]<<24^a[w>>16&255]<<16^a[O>>8&255]<<8^a[I&255]^n[z+3],c[d]=Q(u^m),c[d+1]=Q(g^_),c[d+2]=Q(v^x),c[d+3]=Q(l^E),m=P,_=B,x=C,E=H,d=d+4}return c.buffer},j}()},"./src/crypt/decrypter.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return d});var F=R("./src/crypt/aes-crypto.ts"),L=R("./src/crypt/fast-aes-key.ts"),D=R("./src/crypt/aes-decryptor.ts"),j=R("./src/utils/logger.ts"),U=R("./src/utils/mp4-tools.ts"),e=R("./src/utils/typed-array.ts"),A=16,d=function(){function f(n,a,h){var s=h===void 0?{}:h,r=s.removePKCS7Padding,t=r===void 0?!0:r;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=n,this.config=a,this.removePKCS7Padding=t,t)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(b){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var o=f.prototype;return o.destroy=function(){this.observer=null},o.isSync=function(){return this.config.enableSoftwareAES},o.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var h=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(D.removePadding)(h):h},o.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},o.decrypt=function(a,h,s,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),h,s);var t=this.flush();t&&r(t.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),h,s).then(r)},o.softwareDecrypt=function(a,h,s){var r=this.currentIV,t=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(a=Object(U.appendUint8Array)(i,a),this.remainderData=null);var b=this.getValidChunk(a);if(!b.length)return null;r&&(s=r);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new D.default),m.expandKey(h);var _=t;return this.currentResult=m.decrypt(b.buffer,0,s),this.currentIV=Object(e.sliceUint8)(b,-16).buffer,_||null},o.webCryptoDecrypt=function(a,h,s){var r=this,t=this.subtle;return(this.key!==h||!this.fastAesKey)&&(this.key=h,this.fastAesKey=new L.default(t,h)),this.fastAesKey.expandKey().then(function(i){if(!t)return Promise.reject(new Error("web crypto not initialized"));var b=new F.default(t,s);return b.decrypt(a.buffer,i)}).catch(function(i){return r.onWebCryptoError(i,a,h,s)})},o.onWebCryptoError=function(a,h,s,r){return j.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(h,s,r)},o.getValidChunk=function(a){var h=a,s=a.length-a.length%A;return s!==a.length&&(h=Object(e.sliceUint8)(a,0,s),this.remainderData=Object(e.sliceUint8)(a,s)),h},o.logOnce=function(a){if(!this.logEnabled)return;j.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return F});var F=function(){function L(j,U){this.subtle=void 0,this.key=void 0,this.subtle=j,this.key=U}var D=L.prototype;return D.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/demux/base-audio-demuxer.ts"),L=R("./src/demux/adts.ts"),D=R("./src/utils/logger.ts"),j=R("./src/demux/id3.ts");function U(d,f){d.prototype=Object.create(f.prototype),d.prototype.constructor=d,e(d,f)}function e(d,f){return e=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},e(d,f)}var A=function(d){U(f,d);function f(n,a){var h;return h=d.call(this)||this,h.observer=void 0,h.config=void 0,h.observer=n,h.config=a,h}var o=f.prototype;return o.resetInitSegment=function(a,h,s){d.prototype.resetInitSegment.call(this,a,h,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:s,inputTimeScale:9e4,dropped:0}},f.probe=function(a){if(!a)return!1;for(var h=j.getID3Data(a,0)||[],s=h.length,r=a.length;s<r;s++)if(L.probe(a,s))return D.logger.log("ADTS sync word found !"),!0;return!1},o.canParse=function(a,h){return L.canParse(a,h)},o.appendFrame=function(a,h,s){L.initTrackConfig(a,this.observer,h,s,a.manifestCodec);var r=L.appendFrame(a,h,s,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},f}(F.default);A.minProbeByteLength=9,W.default=A},"./src/demux/adts.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"getAudioConfig",function(){return j}),R.d(W,"isHeaderPattern",function(){return U}),R.d(W,"getHeaderLength",function(){return e}),R.d(W,"getFullFrameLength",function(){return A}),R.d(W,"canGetFrameLength",function(){return d}),R.d(W,"isHeader",function(){return f}),R.d(W,"canParse",function(){return o}),R.d(W,"probe",function(){return n}),R.d(W,"initTrackConfig",function(){return a}),R.d(W,"getFrameDuration",function(){return h}),R.d(W,"parseFrameHeader",function(){return s}),R.d(W,"appendFrame",function(){return r});var F=R("./src/utils/logger.ts"),L=R("./src/errors.ts"),D=R("./src/events.ts");function j(t,i,b,m){var _,x,E,y,c=navigator.userAgent.toLowerCase(),u=m,l=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];_=((i[b+2]&192)>>>6)+1;var v=(i[b+2]&60)>>>2;if(v>l.length-1){t.trigger(D.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return E=(i[b+2]&1)<<2,E|=(i[b+3]&192)>>>6,F.logger.log("manifest codec:"+m+", ADTS type:"+_+", samplingIndex:"+v),/firefox/i.test(c)?v>=6?(_=5,y=new Array(4),x=v-3):(_=2,y=new Array(2),x=v):c.indexOf("android")!==-1?(_=2,y=new Array(2),x=v):(_=5,y=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&v>=6?x=v-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(v>=6&&E===1||/vivaldi/i.test(c))||!m&&E===1)&&(_=2,y=new Array(2)),x=v)),y[0]=_<<3,y[0]|=(v&14)>>1,y[1]|=(v&1)<<7,y[1]|=E<<3,_===5&&(y[1]|=(x&14)>>1,y[2]=(x&1)<<7,y[2]|=2<<2,y[3]=0),{config:y,samplerate:l[v],channelCount:E,codec:"mp4a.40."+_,manifestCodec:u}}function U(t,i){return t[i]===255&&(t[i+1]&246)===240}function e(t,i){return t[i+1]&1?7:9}function A(t,i){return(t[i+3]&3)<<11|t[i+4]<<3|(t[i+5]&224)>>>5}function d(t,i){return i+5<t.length}function f(t,i){return i+1<t.length&&U(t,i)}function o(t,i){return d(t,i)&&U(t,i)&&A(t,i)<=t.length-i}function n(t,i){if(f(t,i)){var b=e(t,i);if(i+b>=t.length)return!1;var m=A(t,i);if(m<=b)return!1;var _=i+m;return _===t.length||f(t,_)}return!1}function a(t,i,b,m,_){if(!t.samplerate){var x=j(i,b,m,_);if(!x)return;t.config=x.config,t.samplerate=x.samplerate,t.channelCount=x.channelCount,t.codec=x.codec,t.manifestCodec=x.manifestCodec,F.logger.log("parsed codec:"+t.codec+", rate:"+x.samplerate+", channels:"+x.channelCount)}}function h(t){return 1024*9e4/t}function s(t,i,b,m,_){var x=e(t,i),E=A(t,i);if(E-=x,E>0){var y=b+m*_;return{headerLength:x,frameLength:E,stamp:y}}}function r(t,i,b,m,_){var x=h(t.samplerate),E=s(i,b,m,_,x);if(E){var y=E.frameLength,c=E.headerLength,u=E.stamp,l=c+y,v=Math.max(0,b+l-i.length),g;v?(g=new Uint8Array(l-c),g.set(i.subarray(b+c,i.length),0)):g=i.subarray(b+c,b+l);var w={unit:g,pts:u};return v||t.samples.push(w),{sample:w,length:l,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"initPTSFn",function(){return A});var F=R("./src/polyfills/number.ts"),L=R("./src/demux/id3.ts"),D=R("./src/demux/dummy-demuxed-track.ts"),j=R("./src/utils/mp4-tools.ts"),U=R("./src/utils/typed-array.ts"),e=function(){function d(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=d.prototype;return f.resetInitSegment=function(n,a,h){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(n,a){return!1},f.appendFrame=function(n,a,h){},f.demux=function(n,a){this.cachedData&&(n=Object(j.appendUint8Array)(this.cachedData,n),this.cachedData=null);var h=L.getID3Data(n,0),s=h?h.length:0,r,t,i=this._audioTrack,b=this._id3Track,m=h?L.getTimeStamp(h):void 0,_=n.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=A(m,a)),h&&h.length>0&&b.samples.push({pts:this.initPTS,dts:this.initPTS,data:h}),t=this.initPTS;s<_;){if(this.canParse(n,s)){var x=this.appendFrame(i,n,s);x?(this.frameIndex++,t=x.sample.pts,s+=x.length,r=s):s=_}else L.canParse(n,s)?(h=L.getID3Data(n,s),b.samples.push({pts:t,dts:t,data:h}),s+=h.length,r=s):s++;if(s===_&&r!==_){var E=Object(U.sliceUint8)(n,r);this.cachedData?this.cachedData=Object(j.appendUint8Array)(this.cachedData,E):this.cachedData=E}}return{audioTrack:i,avcTrack:Object(D.dummyTrack)(),id3Track:b,textTrack:Object(D.dummyTrack)()}},f.demuxSampleAes=function(n,a,h){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(n){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(D.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(D.dummyTrack)()}},f.destroy=function(){},d}(),A=function(f,o){return Object(F.isFiniteNumber)(f)?f*90:o*9e4};W.default=e},"./src/demux/chunk-cache.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return F});var F=function(){function D(){this.chunks=[],this.dataLength=0}var j=D.prototype;return j.push=function(e){this.chunks.push(e),this.dataLength+=e.length},j.flush=function(){var e=this.chunks,A=this.dataLength,d;if(e.length)e.length===1?d=e[0]:d=L(e,A);else return new Uint8Array(0);return this.reset(),d},j.reset=function(){this.chunks.length=0,this.dataLength=0},D}();function L(D,j){for(var U=new Uint8Array(j),e=0,A=0;A<D.length;A++){var d=D[A];U.set(d,e),e+=d.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"dummyTrack",function(){return F});function F(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/utils/logger.ts"),L=function(){function D(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 j=D.prototype;return j.loadWord=function(){var e=this.data,A=this.bytesAvailable,d=e.byteLength-A,f=new Uint8Array(4),o=Math.min(4,A);if(o===0)throw new Error("no bytes available");f.set(e.subarray(d,d+o)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=o*8,this.bytesAvailable-=o},j.skipBits=function(e){var A;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,A=e>>3,e-=A>>3,this.bytesAvailable-=A,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},j.readBits=function(e){var A=Math.min(this.bitsAvailable,e),d=this.word>>>32-A;return e>32&&F.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=A,this.bitsAvailable>0?this.word<<=A:this.bytesAvailable>0&&this.loadWord(),A=e-A,A>0&&this.bitsAvailable?d<<A|this.readBits(A):d},j.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()},j.skipUEG=function(){this.skipBits(1+this.skipLZ())},j.skipEG=function(){this.skipBits(1+this.skipLZ())},j.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},j.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},j.readBoolean=function(){return this.readBits(1)===1},j.readUByte=function(){return this.readBits(8)},j.readUShort=function(){return this.readBits(16)},j.readUInt=function(){return this.readBits(32)},j.skipScalingList=function(e){for(var A=8,d=8,f,o=0;o<e;o++)d!==0&&(f=this.readEG(),d=(A+f+256)%256),A=d===0?A:d},j.readSPS=function(){var e=0,A=0,d=0,f=0,o,n,a,h=this.readUByte.bind(this),s=this.readBits.bind(this),r=this.readUEG.bind(this),t=this.readBoolean.bind(this),i=this.skipBits.bind(this),b=this.skipEG.bind(this),m=this.skipUEG.bind(this),_=this.skipScalingList.bind(this);h();var x=h();if(s(5),i(3),h(),m(),x===100||x===110||x===122||x===244||x===44||x===83||x===86||x===118||x===128){var E=r();if(E===3&&i(1),m(),m(),i(1),t())for(n=E!==3?8:12,a=0;a<n;a++)t()&&(a<6?_(16):_(64))}m();var y=r();if(y===0)r();else if(y===1)for(i(1),b(),b(),o=r(),a=0;a<o;a++)b();m(),i(1);var c=r(),u=r(),l=s(1);l===0&&i(1),i(1),t()&&(e=r(),A=r(),d=r(),f=r());var v=[1,1];if(t()&&t()){var g=h();switch(g){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-A*2),height:(2-l)*(u+1)*16-(l?2:4)*(d+f),pixelRatio:v}},j.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},D}();W.default=L},"./src/demux/id3.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"isHeader",function(){return F}),R.d(W,"isFooter",function(){return L}),R.d(W,"getID3Data",function(){return D}),R.d(W,"canParse",function(){return U}),R.d(W,"getTimeStamp",function(){return e}),R.d(W,"isTimeStampFrame",function(){return A}),R.d(W,"getID3Frames",function(){return f}),R.d(W,"decodeFrame",function(){return o}),R.d(W,"utf8ArrayToStr",function(){return r}),R.d(W,"testables",function(){return t});var F=function(_,x){return x+10<=_.length&&(_[x]===73&&_[x+1]===68&&_[x+2]===51&&(_[x+3]<255&&_[x+4]<255&&(_[x+6]<128&&_[x+7]<128&&_[x+8]<128&&_[x+9]<128)))},L=function(_,x){return x+10<=_.length&&(_[x]===51&&_[x+1]===68&&_[x+2]===73&&(_[x+3]<255&&_[x+4]<255&&(_[x+6]<128&&_[x+7]<128&&_[x+8]<128&&_[x+9]<128)))},D=function(_,x){for(var E=x,y=0;F(_,x);){y+=10;var c=j(_,x+6);y+=c,L(_,x+10)&&(y+=10),x+=y}return y>0?_.subarray(E,E+y):void 0},j=function(_,x){var E=0;return E=(_[x]&127)<<21,E|=(_[x+1]&127)<<14,E|=(_[x+2]&127)<<7,E|=_[x+3]&127,E},U=function(_,x){return F(_,x)&&j(_,x+6)+10<=_.length-x},e=function(_){for(var x=f(_),E=0;E<x.length;E++){var y=x[E];if(A(y))return s(y)}return},A=function(_){return _&&_.key==="PRIV"&&_.info==="com.apple.streaming.transportStreamTimestamp"},d=function(_){var x=String.fromCharCode(_[0],_[1],_[2],_[3]),E=j(_,4),y=10;return{type:x,size:E,data:_.subarray(y,y+E)}},f=function(_){for(var x=0,E=[];F(_,x);){var y=j(_,x+6);x+=10;for(var c=x+y;x+8<c;){var u=d(_.subarray(x)),l=o(u);l&&E.push(l),x+=u.size+10}L(_,x)&&(x+=10)}return E},o=function(_){return _.type==="PRIV"?n(_):_.type[0]==="W"?h(_):a(_)},n=function(_){if(_.size<2)return;var x=r(_.data,!0),E=new Uint8Array(_.data.subarray(x.length+1));return{key:_.type,info:x,data:E.buffer}},a=function(_){if(_.size<2)return;if(_.type==="TXXX"){var x=1,E=r(_.data.subarray(x),!0);x+=E.length+1;var y=r(_.data.subarray(x));return{key:_.type,info:E,data:y}}var c=r(_.data.subarray(1));return{key:_.type,data:c}},h=function(_){if(_.type==="WXXX"){if(_.size<2)return;var x=1,E=r(_.data.subarray(x),!0);x+=E.length+1;var y=r(_.data.subarray(x));return{key:_.type,info:E,data:y}}var c=r(_.data);return{key:_.type,data:c}},s=function(_){if(_.data.byteLength===8){var x=new Uint8Array(_.data),E=x[3]&1,y=(x[4]<<23)+(x[5]<<15)+(x[6]<<7)+x[7];return y/=45,E&&(y+=4772185884e-2),Math.round(y)}return},r=function(_,x){x===void 0&&(x=!1);var E=b();if(E){var y=E.decode(_);if(x){var c=y.indexOf("\0");return c!==-1?y.substring(0,c):y}return y.replace(/\0/g,"")}for(var u=_.length,l,v,g,w="",O=0;O<u;){if(l=_[O++],l===0&&x)return w;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:w+=String.fromCharCode(l);break;case 12:case 13:v=_[O++],w+=String.fromCharCode((l&31)<<6|v&63);break;case 14:v=_[O++],g=_[O++],w+=String.fromCharCode((l&15)<<12|(v&63)<<6|(g&63)<<0);break;default:}}return w},t={decodeTextFrame:a},i;function b(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/demux/base-audio-demuxer.ts"),L=R("./src/demux/id3.ts"),D=R("./src/utils/logger.ts"),j=R("./src/demux/mpegaudio.ts");function U(d,f){d.prototype=Object.create(f.prototype),d.prototype.constructor=d,e(d,f)}function e(d,f){return e=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},e(d,f)}var A=function(d){U(f,d);function f(){return d.apply(this,arguments)||this}var o=f.prototype;return o.resetInitSegment=function(a,h,s){d.prototype.resetInitSegment.call(this,a,h,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:s,inputTimeScale:9e4,dropped:0}},f.probe=function(a){if(!a)return!1;for(var h=L.getID3Data(a,0)||[],s=h.length,r=a.length;s<r;s++)if(j.probe(a,s))return D.logger.log("MPEG Audio sync word found !"),!0;return!1},o.canParse=function(a,h){return j.canParse(a,h)},o.appendFrame=function(a,h,s){return this.initPTS===null?void 0:j.appendFrame(a,h,s,this.initPTS,this.frameIndex)},f}(F.default);A.minProbeByteLength=4,W.default=A},"./src/demux/mp4demuxer.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/utils/mp4-tools.ts"),L=R("./src/demux/dummy-demuxed-track.ts"),D=function(){function j(e,A){this.remainderData=null,this.config=void 0,this.config=A}var U=j.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},j.probe=function(A){return Object(F.findBox)({data:A,start:0,end:Math.min(A.length,16384)},["moof"]).length>0},U.demux=function(A){var d=A,f=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(d=Object(F.appendUint8Array)(this.remainderData,A));var o=Object(F.segmentValidRange)(d);this.remainderData=o.remainder,f.samples=o.valid||new Uint8Array}else f.samples=d;return{audioTrack:Object(L.dummyTrack)(),avcTrack:f,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},U.flush=function(){var A=Object(L.dummyTrack)();return A.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:A,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},U.demuxSampleAes=function(A,d,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},j}();D.minProbeByteLength=1024,W.default=D},"./src/demux/mpegaudio.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"appendFrame",function(){return e}),R.d(W,"parseHeader",function(){return A}),R.d(W,"isHeaderPattern",function(){return d}),R.d(W,"isHeader",function(){return f}),R.d(W,"canParse",function(){return o}),R.d(W,"probe",function(){return n});var F=null,L=[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],D=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],j=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function e(a,h,s,r,t){if(s+24>h.length)return;var i=A(h,s);if(i&&s+i.frameLength<=h.length){var b=i.samplesPerFrame*9e4/i.sampleRate,m=r+t*b,_={unit:h.subarray(s,s+i.frameLength),pts:m,dts:m};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(_),{sample:_,length:i.frameLength,missing:0}}}function A(a,h){var s=a[h+1]>>3&3,r=a[h+1]>>1&3,t=a[h+2]>>4&15,i=a[h+2]>>2&3;if(s!==1&&t!==0&&t!==15&&i!==3){var b=a[h+2]>>1&1,m=a[h+3]>>6,_=s===3?3-r:r===3?3:4,x=L[_*14+t-1]*1e3,E=s===3?0:s===2?1:2,y=D[E*3+i],c=m===3?1:2,u=j[s][r],l=U[r],v=u*8*l,g=Math.floor(u*x/y+b)*l;if(F===null){var w=navigator.userAgent||"",O=w.match(/Chrome\/(\d+)/i);F=O?parseInt(O[1]):0}var I=!!F&&F<=87;return I&&r===2&&x>=224e3&&m===0&&(a[h+3]=a[h+3]|128),{sampleRate:y,channelCount:c,frameLength:g,samplesPerFrame:v}}}function d(a,h){return a[h]===255&&(a[h+1]&224)===224&&(a[h+1]&6)!==0}function f(a,h){return h+1<a.length&&d(a,h)}function o(a,h){var s=4;return d(a,h)&&s<=a.length-h}function n(a,h){if(h+1<a.length&&d(a,h)){var s=4,r=A(a,h),t=s;r!=null&&r.frameLength&&(t=r.frameLength);var i=h+t;return i===a.length||f(a,i)}return!1}},"./src/demux/sample-aes.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/crypt/decrypter.ts"),L=R("./src/demux/tsdemuxer.ts"),D=function(){function j(e,A,d){this.keyData=void 0,this.decrypter=void 0,this.keyData=d,this.decrypter=new F.default(e,A,{removePKCS7Padding:!1})}var U=j.prototype;return U.decryptBuffer=function(A,d){this.decrypter.decrypt(A,this.keyData.key.buffer,this.keyData.iv.buffer,d)},U.decryptAacSample=function(A,d,f,o){var n=A[d].unit,a=n.subarray(16,n.length-n.length%16),h=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(h,function(r){var t=new Uint8Array(r);n.set(t,16),o||s.decryptAacSamples(A,d+1,f)})},U.decryptAacSamples=function(A,d,f){for(;;d++){if(d>=A.length){f();return}if(A[d].unit.length<32)continue;var o=this.decrypter.isSync();if(this.decryptAacSample(A,d,f,o),!o)return}},U.getAvcEncryptedData=function(A){for(var d=Math.floor((A.length-48)/160)*16+16,f=new Int8Array(d),o=0,n=32;n<=A.length-16;n+=160,o+=16)f.set(A.subarray(n,n+16),o);return f},U.getAvcDecryptedUnit=function(A,d){for(var f=new Uint8Array(d),o=0,n=32;n<=A.length-16;n+=160,o+=16)A.set(f.subarray(o,o+16),n);return A},U.decryptAvcSample=function(A,d,f,o,n,a){var h=Object(L.discardEPB)(n.data),s=this.getAvcEncryptedData(h),r=this;this.decryptBuffer(s.buffer,function(t){n.data=r.getAvcDecryptedUnit(h,t),a||r.decryptAvcSamples(A,d,f+1,o)})},U.decryptAvcSamples=function(A,d,f,o){if(A instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;d++,f=0){if(d>=A.length){o();return}for(var n=A[d].units;!(f>=n.length);f++){var a=n[f];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var h=this.decrypter.isSync();if(this.decryptAvcSample(A,d,f,o,a,h),!h)return}}},j}();W.default=D},"./src/demux/transmuxer-interface.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n});var F=R("./node_modules/webworkify-webpack/index.js"),L=R.n(F),D=R("./src/events.ts"),j=R("./src/demux/transmuxer.ts"),U=R("./src/utils/logger.ts"),e=R("./src/errors.ts"),A=R("./src/utils/mediasource-helper.ts"),d=R("./node_modules/eventemitter3/index.js"),f=R.n(d),o=Object(A.getMediaSource)()||{isTypeSupported:function(){return!1}},n=function(){function a(s,r,t,i){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=r,this.onTransmuxComplete=t,this.onFlush=i;var m=s.config,_=function(u,l){l=l||{},l.frag=b.frag,l.id=b.id,s.trigger(u,l)};this.observer=new d.EventEmitter,this.observer.on(D.Events.FRAG_DECRYPTED,_),this.observer.on(D.Events.ERROR,_);var x={mp4:o.isTypeSupported("video/mp4"),mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var y;try{y=this.worker=F("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),y.addEventListener("message",this.onwmsg),y.onerror=function(c){s.trigger(D.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:x,vendor:E,id:r,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 j.default(this.observer,x,m,E,r),this.worker=null}}else this.transmuxer=new j.default(this.observer,x,m,E,r)}var h=a.prototype;return h.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},h.push=function(r,t,i,b,m,_,x,E,y,c){var u=this;y.transmuxing.start=self.performance.now();var l=this.transmuxer,v=this.worker,g=_?_.start:m.start,w=m.decryptdata,O=this.frag,I=!(O&&m.cc===O.cc),S=!(O&&y.level===O.level),P=O?y.sn-O.sn:-1,B=this.part?y.part-this.part.index:1,C=!S&&(P===1||P===0&&B===1),H=self.performance.now();(S||P||m.stats.parsing.start===0)&&(m.stats.parsing.start=H),_&&(B||!C)&&(_.stats.parsing.start=H);var z=new j.TransmuxState(I,C,E,S,g);if(!C||I){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: `+I+`
|
|
trackSwitch: `+S+`
|
|
contiguous: `+C+`
|
|
accurateTimeOffset: `+E+`
|
|
timeOffset: `+g);var Z=new j.TransmuxConfig(i,b,t,x,c);this.configureTransmuxer(Z)}if(this.frag=m,this.part=_,v)v.postMessage({cmd:"demux",data:r,decryptdata:w,chunkMeta:y,state:z},r instanceof ArrayBuffer?[r]:[]);else if(l){var Q=l.push(r,w,y,z);Object(j.isPromise)(Q)?Q.then(function(pe){u.handleTransmuxComplete(pe)}):this.handleTransmuxComplete(Q)}},h.flush=function(r){var t=this;r.transmuxing.start=self.performance.now();var i=this.transmuxer,b=this.worker;if(b)b.postMessage({cmd:"flush",chunkMeta:r});else if(i){var m=i.flush(r);Object(j.isPromise)(m)?m.then(function(_){t.handleFlushResult(_,r)}):this.handleFlushResult(m,r)}},h.handleFlushResult=function(r,t){var i=this;r.forEach(function(b){i.handleTransmuxComplete(b)}),this.onFlush(t)},h.onWorkerMessage=function(r){var t=r.data,i=this.hls;switch(t.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(t.data);break}case"flush":{this.onFlush(t.data);break}default:{t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data);break}}},h.configureTransmuxer=function(r){var t=this.worker,i=this.transmuxer;t?t.postMessage({cmd:"configure",config:r}):i&&i.configure(r)},h.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},a}()},"./src/demux/transmuxer-worker.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var F=R("./src/demux/transmuxer.ts"),L=R("./src/events.ts"),D=R("./src/utils/logger.ts"),j=R("./node_modules/eventemitter3/index.js"),U=R.n(j);function e(n){var a=new j.EventEmitter,h=function(r,t){n.postMessage({event:r,data:t})};a.on(L.Events.FRAG_DECRYPTED,h),a.on(L.Events.ERROR,h),n.addEventListener("message",function(s){var r=s.data;switch(r.cmd){case"init":{var t=JSON.parse(r.config);n.transmuxer=new F.default(a,r.typeSupported,t,r.vendor,r.id),Object(D.enableLogs)(t.debug),h("init",null);break}case"configure":{n.transmuxer.configure(r.config);break}case"demux":{var i=n.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(F.isPromise)(i)?i.then(function(_){A(n,_)}):A(n,i);break}case"flush":{var b=r.chunkMeta,m=n.transmuxer.flush(b);Object(F.isPromise)(m)?m.then(function(_){f(n,_,b)}):f(n,m,b);break}default:break}})}function A(n,a){if(o(a.remuxResult))return;var h=[],s=a.remuxResult,r=s.audio,t=s.video;r&&d(h,r),t&&d(h,t),n.postMessage({event:"transmuxComplete",data:a},h)}function d(n,a){a.data1&&n.push(a.data1.buffer),a.data2&&n.push(a.data2.buffer)}function f(n,a,h){a.forEach(function(s){A(n,s)}),n.postMessage({event:"flush",data:h})}function o(n){return!n.audio&&!n.video&&!n.text&&!n.id3&&!n.initSegment}},"./src/demux/transmuxer.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return t}),R.d(W,"isPromise",function(){return m}),R.d(W,"TransmuxConfig",function(){return _}),R.d(W,"TransmuxState",function(){return x});var F=R("./src/events.ts"),L=R("./src/errors.ts"),D=R("./src/crypt/decrypter.ts"),j=R("./src/demux/aacdemuxer.ts"),U=R("./src/demux/mp4demuxer.ts"),e=R("./src/demux/tsdemuxer.ts"),A=R("./src/demux/mp3demuxer.ts"),d=R("./src/remux/mp4-remuxer.ts"),f=R("./src/remux/passthrough-remuxer.ts"),o=R("./src/demux/chunk-cache.ts"),n=R("./src/utils/mp4-tools.ts"),a=R("./src/utils/logger.ts"),h;try{h=self.performance.now.bind(self.performance)}catch(E){a.logger.debug("Unable to use Performance API on this environment"),h=self.Date.now}var s=[{demux:e.default,remux:d.default},{demux:U.default,remux:f.default},{demux:j.default,remux:d.default},{demux:A.default,remux:d.default}],r=1024;s.forEach(function(E){var y=E.demux;r=Math.max(r,y.minProbeByteLength)});var t=function(){function E(c,u,l,v,g){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=g}var y=E.prototype;return y.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},y.push=function(u,l,v,g){var w=this,O=v.transmuxing;O.executeStart=h();var I=new Uint8Array(u),S=this.cache,P=this.config,B=this.currentTransmuxState,C=this.transmuxConfig;g&&(this.currentTransmuxState=g);var H=i(I,l);if(H&&H.method==="AES-128"){var z=this.getDecrypter();if(P.enableSoftwareAES){var Z=z.softwareDecrypt(I,H.key.buffer,H.iv.buffer);if(!Z)return O.executeEnd=h(),b(v);I=new Uint8Array(Z)}else return this.decryptionPromise=z.webCryptoDecrypt(I,H.key.buffer,H.iv.buffer).then(function(Ee){var Ie=w.push(Ee,null,v);return w.decryptionPromise=null,Ie}),this.decryptionPromise}var Q=g||B,pe=Q.contiguous,le=Q.discontinuity,de=Q.trackSwitch,ce=Q.accurateTimeOffset,me=Q.timeOffset,te=C.audioCodec,$=C.videoCodec,_e=C.defaultInitPts,Oe=C.duration,Ce=C.initSegmentData;if((le||de)&&this.resetInitSegment(Ce,te,$,Oe),le&&this.resetInitialTimestamp(_e),pe||this.resetContiguity(),this.needsProbing(I,le,de)){if(S.dataLength){var Ae=S.flush();I=Object(n.appendUint8Array)(Ae,I)}this.configureTransmuxer(I,C)}var Pe=this.transmux(I,H,me,ce,v),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,O.executeEnd=h(),Pe},y.flush=function(u){var l=this,v=u.transmuxing;v.executeStart=h();var g=this.decrypter,w=this.cache,O=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return l.flush(u)});var S=[],P=O.timeOffset;if(g){var B=g.flush();B&&S.push(this.push(B,null,u))}var C=w.dataLength;w.reset();var H=this.demuxer,z=this.remuxer;if(!H||!z)return C>=r&&this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=h(),[b(u)];var Z=H.flush(P);return m(Z)?Z.then(function(Q){return l.flushRemux(S,Q,u),S}):(this.flushRemux(S,Z,u),S)},y.flushRemux=function(u,l,v){var g=l.audioTrack,w=l.avcTrack,O=l.id3Track,I=l.textTrack,S=this.currentTransmuxState,P=S.accurateTimeOffset,B=S.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var C=this.remuxer.remux(g,w,O,I,B,P,!0,this.id);u.push({remuxResult:C,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,g){var w=this.demuxer,O=this.remuxer;if(!w||!O)return;w.resetInitSegment(l,v,g),O.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,g,w){var O;return l&&l.method==="SAMPLE-AES"?O=this.transmuxSampleAes(u,l,v,g,w):O=this.transmuxUnencrypted(u,v,g,w),O},y.transmuxUnencrypted=function(u,l,v,g){var w=this.demuxer.demux(u,l,!1,!this.config.progressive),O=w.audioTrack,I=w.avcTrack,S=w.id3Track,P=w.textTrack,B=this.remuxer.remux(O,I,S,P,l,v,!1,this.id);return{remuxResult:B,chunkMeta:g}},y.transmuxSampleAes=function(u,l,v,g,w){var O=this;return this.demuxer.demuxSampleAes(u,l,v).then(function(I){var S=O.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,v,g,!1,O.id);return{remuxResult:S,chunkMeta:w}})},y.configureTransmuxer=function(u,l){for(var v=this.config,g=this.observer,w=this.typeSupported,O=this.vendor,I=l.audioCodec,S=l.defaultInitPts,P=l.duration,B=l.initSegmentData,C=l.videoCodec,H,z=0,Z=s.length;z<Z;z++)if(s[z].demux.probe(u)){H=s[z];break}H||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:U.default,remux:f.default});var Q=this.demuxer,pe=this.remuxer,le=H.remux,de=H.demux;(!pe||!(pe instanceof le))&&(this.remuxer=new le(g,v,w,O)),(!Q||!(Q instanceof de))&&(this.demuxer=new de(g,v,w),this.probe=de.probe),this.resetInitSegment(B,I,C,P),this.resetInitialTimestamp(S)},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 D.default(this.observer,this.config)),u},E}();function i(E,y){var c=null;return E.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(E){return"then"in E&&E.then instanceof Function}var _=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},x=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(ee,W,R){"use strict";R.r(W),R.d(W,"discardEPB",function(){return b});var F=R("./src/demux/adts.ts"),L=R("./src/demux/mpegaudio.ts"),D=R("./src/demux/exp-golomb.ts"),j=R("./src/demux/id3.ts"),U=R("./src/demux/sample-aes.ts"),e=R("./src/events.ts"),A=R("./src/utils/mp4-tools.ts"),d=R("./src/utils/logger.ts"),f=R("./src/errors.ts"),o={video:1,audio:2,id3:3,text:4},n=function(){function m(x,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=x,this.config=E,this.typeSupported=y}m.probe=function(E){var y=m.syncOffset(E);return y<0?!1:(y&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+y+", junk ahead ?"),!0)},m.syncOffset=function(E){for(var y=Math.min(1e3,E.length-3*188),c=0;c<y;){if(E[c]===71&&E[c+188]===71&&E[c+2*188]===71)return c;c++}return-1},m.createTrack=function(E,y){return{container:E==="video"||E==="audio"?"video/mp2t":void 0,type:E,id:o[E],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:E==="audio"?y:void 0}};var _=m.prototype;return _.resetInitSegment=function(E,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=E,this.videoCodec=y,this._duration=c},_.resetTimeStamp=function(){},_.resetContiguity=function(){var E=this._audioTrack,y=this._avcTrack,c=this._id3Track;E&&(E.pesData=null),y&&(y.pesData=null),c&&(c.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},_.demux=function(E,y,c,u){c===void 0&&(c=!1),u===void 0&&(u=!1),c||(this.sampleAes=null);var l,v=this._avcTrack,g=this._audioTrack,w=this._id3Track,O=v.pid,I=v.pesData,S=g.pid,P=w.pid,B=g.pesData,C=w.pesData,H=!1,z=this.pmtParsed,Z=this._pmtId,Q=E.length;if(this.remainderData&&(E=Object(A.appendUint8Array)(this.remainderData,E),Q=E.length,this.remainderData=null),Q<188&&!u)return this.remainderData=E,{audioTrack:g,avcTrack:v,id3Track:w,textTrack:this._txtTrack};var pe=Math.max(0,m.syncOffset(E));Q-=(Q+pe)%188,Q<E.byteLength&&!u&&(this.remainderData=new Uint8Array(E.buffer,Q,E.buffer.byteLength-Q));for(var le=pe;le<Q;le+=188)if(E[le]===71){var de=!!(E[le+1]&64),ce=((E[le+1]&31)<<8)+E[le+2],me=(E[le+3]&48)>>4,te=void 0;if(me>1){if(te=le+5+E[le+4],te===le+188)continue}else te=le+4;switch(ce){case O:de&&(I&&(l=r(I))&&this.parseAVCPES(l,!1),I={data:[],size:0}),I&&(I.data.push(E.subarray(te,le+188)),I.size+=le+188-te);break;case S:de&&(B&&(l=r(B))&&(g.isAAC?this.parseAACPES(l):this.parseMPEGPES(l)),B={data:[],size:0}),B&&(B.data.push(E.subarray(te,le+188)),B.size+=le+188-te);break;case P:de&&(C&&(l=r(C))&&this.parseID3PES(l),C={data:[],size:0}),C&&(C.data.push(E.subarray(te,le+188)),C.size+=le+188-te);break;case 0:de&&(te+=E[te]+1),Z=this._pmtId=h(E,te);break;case Z:{de&&(te+=E[te]+1);var $=s(E,te,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,c);O=$.avc,O>0&&(v.pid=O),S=$.audio,S>0&&(g.pid=S,g.isAAC=$.isAAC),P=$.id3,P>0&&(w.pid=P),H&&!z&&(d.logger.log("reparse from beginning"),H=!1,le=pe-188),z=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});v.pesData=I,g.pesData=B,w.pesData=C;var _e={audioTrack:g,avcTrack:v,id3Track:w,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(_e),_e},_.flush=function(){var E=this.remainderData;this.remainderData=null;var y;return E?y=this.demux(E,-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},_.extractRemainingSamples=function(E){var y=E.audioTrack,c=E.avcTrack,u=E.id3Track,l=c.pesData,v=y.pesData,g=u.pesData,w;l&&(w=r(l))?(this.parseAVCPES(w,!0),c.pesData=null):c.pesData=l,v&&(w=r(v))?(y.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),y.pesData=null):(v!=null&&v.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),y.pesData=v),g&&(w=r(g))?(this.parseID3PES(w),u.pesData=null):u.pesData=g},_.demuxSampleAes=function(E,y,c){var u=this.demux(E,c,!0,!this.config.progressive),l=this.sampleAes=new U.default(this.observer,this.config,y);return this.decrypt(u,l)},_.decrypt=function(E,y){return new Promise(function(c){var u=E.audioTrack,l=E.avcTrack;u.samples&&u.isAAC?y.decryptAacSamples(u.samples,0,function(){l.samples?y.decryptAvcSamples(l.samples,0,0,function(){c(E)}):c(E)}):l.samples&&y.decryptAvcSamples(l.samples,0,0,function(){c(E)})})},_.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},_.parseAVCPES=function(E,y){var c=this,u=this._avcTrack,l=this.parseAVCNALu(E.data),v=!1,g=this.avcSample,w,O=!1;E.data=null,g&&l.length&&!u.audFound&&(t(g,u),g=this.avcSample=a(!1,E.pts,E.dts,"")),l.forEach(function(I){switch(I.type){case 1:{w=!0,g||(g=c.avcSample=a(!0,E.pts,E.dts,"")),v&&(g.debug+="NDR "),g.frame=!0;var S=I.data;if(O&&S.length>4){var P=new D.default(S).readSliceType();(P===2||P===4||P===7||P===9)&&(g.key=!0)}break}case 5:w=!0,g||(g=c.avcSample=a(!0,E.pts,E.dts,"")),v&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{w=!0,v&&g&&(g.debug+="SEI ");var B=new D.default(b(I.data));B.readUByte();for(var C=0,H=0,z=!1,Z=0;!z&&B.bytesAvailable>1;){C=0;do Z=B.readUByte(),C+=Z;while(Z===255);H=0;do Z=B.readUByte(),H+=Z;while(Z===255);if(C===4&&B.bytesAvailable!==0){z=!0;var Q=B.readUByte();if(Q===181){var pe=B.readUShort();if(pe===49){var le=B.readUInt();if(le===1195456820){var de=B.readUByte();if(de===3){for(var ce=B.readUByte(),me=B.readUByte(),te=31&ce,$=[ce,me],_e=0;_e<te;_e++)$.push(B.readUByte()),$.push(B.readUByte()),$.push(B.readUByte());i(c._txtTrack.samples,{type:3,pts:E.pts,bytes:$})}}}}}else if(C===5&&B.bytesAvailable!==0){if(z=!0,H>16){for(var Oe=[],Ce=0;Ce<16;Ce++)Oe.push(B.readUByte().toString(16)),(Ce===3||Ce===5||Ce===7||Ce===9)&&Oe.push("-");for(var Ae=H-16,Pe=new Uint8Array(Ae),ye=0;ye<Ae;ye++)Pe[ye]=B.readUByte();i(c._txtTrack.samples,{pts:E.pts,payloadType:C,uuid:Oe.join(""),userData:Object(j.utf8ArrayToStr)(Pe),userDataBytes:Pe})}}else if(H<B.bytesAvailable)for(var Ee=0;Ee<H;Ee++)B.readUByte()}break}case 7:if(w=!0,O=!0,v&&g&&(g.debug+="SPS "),!u.sps){var Ie=new D.default(I.data),X=Ie.readSPS();u.width=X.width,u.height=X.height,u.pixelRatio=X.pixelRatio,u.sps=[I.data],u.duration=c._duration;for(var se=I.data.subarray(1,4),ue="avc1.",he=0;he<3;he++){var xe=se[he].toString(16);xe.length<2&&(xe="0"+xe),ue+=xe}u.codec=ue}break;case 8:w=!0,v&&g&&(g.debug+="PPS "),u.pps||(u.pps=[I.data]);break;case 9:w=!1,u.audFound=!0,g&&t(g,u),g=c.avcSample=a(!1,E.pts,E.dts,v?"AUD ":"");break;case 12:w=!1;break;default:w=!1,g&&(g.debug+="unknown NAL "+I.type+" ");break}if(g&&w){var we=g.units;we.push(I)}}),y&&g&&(t(g,u),this.avcSample=null)},_.getLastNalUnit=function(){var E,y=this.avcSample,c;if(!y||y.units.length===0){var u=this._avcTrack.samples;y=u[u.length-1]}if((E=y)!==null&&E!==void 0&&E.units){var l=y.units;c=l[l.length-1]}return c},_.parseAVCNALu=function(E){var y=E.byteLength,c=this._avcTrack,u=c.naluState||0,l=u,v=[],g=0,w,O,I,S=-1,P=0;for(u===-1&&(S=0,P=E[0]&31,u=0,g=1);g<y;){if(w=E[g++],!u){u=w?0:1;continue}if(u===1){u=w?0:2;continue}if(!w)u=3;else if(w===1){if(S>=0){var B={data:E.subarray(S,g-u-1),type:P};v.push(B)}else{var C=this.getLastNalUnit();if(C&&(l&&g<=4-l&&(C.state&&(C.data=C.data.subarray(0,C.data.byteLength-l))),O=g-u-1,O>0)){var H=new Uint8Array(C.data.byteLength+O);H.set(C.data,0),H.set(E.subarray(0,O),C.data.byteLength),C.data=H,C.state=0}}g<y?(I=E[g]&31,S=g,P=I,u=0):u=-1}else u=0}if(S>=0&&u>=0){var z={data:E.subarray(S,y),type:P,state:u};v.push(z)}if(v.length===0){var Z=this.getLastNalUnit();if(Z){var Q=new Uint8Array(Z.data.byteLength+E.byteLength);Q.set(Z.data,0),Q.set(E,Z.data.byteLength),Z.data=Q}}return c.naluState=u,v},_.parseAACPES=function(E){var y=0,c=this._audioTrack,u=this.aacOverFlow,l=E.data;if(u){this.aacOverFlow=null;var v=u.sample.unit.byteLength,g=Math.min(u.missing,v),w=v-g;u.sample.unit.set(l.subarray(0,g),w),c.samples.push(u.sample),y=u.missing}var O,I;for(O=y,I=l.length;O<I-1&&!F.isHeader(l,O);O++);if(O!==y){var S,P;if(O<I-1?(S="AAC PES did not start with ADTS header,offset:"+O,P=!1):(S="no ADTS header found in AAC PES",P=!0),d.logger.warn("parsing error:"+S),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:P,reason:S}),P)return}F.initTrackConfig(c,this.observer,l,O,this.audioCodec);var B;if(E.pts!==void 0)B=E.pts;else if(u){var C=F.getFrameDuration(c.samplerate);B=u.sample.pts+C}else{d.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;O<I;)if(F.isHeader(l,O)){if(O+5<I){var z=F.appendFrame(c,l,O,B,H);if(z)if(z.missing)this.aacOverFlow=z;else{O+=z.length,H++;continue}}break}else O++},_.parseMPEGPES=function(E){var y=E.data,c=y.length,u=0,l=0,v=E.pts;if(v===void 0){d.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;l<c;)if(L.isHeader(y,l)){var g=L.appendFrame(this._audioTrack,y,l,v,u);if(g)l+=g.length,u++;else break}else l++},_.parseID3PES=function(E){if(E.pts===void 0){d.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(E)},m}();n.minProbeByteLength=188;function a(m,_,x,E){return{key:m,frame:!1,pts:_,dts:x,units:[],debug:E,length:0}}function h(m,_){return(m[_+10]&31)<<8|m[_+11]}function s(m,_,x,E){var y={audio:-1,avc:-1,id3:-1,isAAC:!0},c=(m[_+1]&15)<<8|m[_+2],u=_+3+c-4,l=(m[_+10]&15)<<8|m[_+11];for(_+=12+l;_<u;){var v=(m[_+1]&31)<<8|m[_+2];switch(m[_]){case 207:if(!E){d.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(!E){d.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:x?y.audio===-1&&(y.audio=v,y.isAAC=!1):d.logger.log("MPEG audio found, not supported in this browser");break;case 36:d.logger.warn("Unsupported HEVC stream type found");break;default:break}_+=((m[_+3]&15)<<8|m[_+4])+5}return y}function r(m){var _=0,x,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)}x=l[0];var g=(x[0]<<16)+(x[1]<<8)+x[2];if(g===1){if(E=(x[4]<<8)+x[5],E&&E>m.size-6)return null;var w=x[7];w&192&&(c=(x[9]&14)*536870912+(x[10]&255)*4194304+(x[11]&254)*16384+(x[12]&255)*128+(x[13]&254)/2,w&64?(u=(x[14]&14)*536870912+(x[15]&255)*4194304+(x[16]&254)*16384+(x[17]&255)*128+(x[18]&254)/2,c-u>60*9e4&&(d.logger.warn(Math.round((c-u)/9e4)+"s delta between PTS and DTS, align them"),c=u)):u=c),y=x[8];var O=y+9;if(m.size<=O)return null;m.size-=O;for(var I=new Uint8Array(m.size),S=0,P=l.length;S<P;S++){x=l[S];var B=x.byteLength;if(O)if(O>B){O-=B;continue}else x=x.subarray(O),B-=O,O=0;I.set(x,_),_+=B}return E&&(E-=y+3),{data:I,pts:c,dts:u,len:E}}return null}function t(m,_){if(m.units.length&&m.frame){if(m.pts===void 0){var x=_.samples,E=x.length;if(E){var y=x[E-1];m.pts=y.pts,m.dts=y.dts}else{_.dropped++;return}}_.samples.push(m)}m.debug.length&&d.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function i(m,_){var x=m.length;if(x>0){if(_.pts>=m[x-1].pts)m.push(_);else for(var E=x-1;E>=0;E--)if(_.pts<m[E].pts){m.splice(E,0,_);break}}else m.push(_)}function b(m){for(var _=m.byteLength,x=[],E=1;E<_-2;)m[E]===0&&m[E+1]===0&&m[E+2]===3?(x.push(E+2),E+=2):E++;if(x.length===0)return m;var y=_-x.length,c=new Uint8Array(y),u=0;for(E=0;E<y;u++,E++)u===x[0]&&(u++,x.shift()),c[E]=m[u];return c}W.default=n},"./src/errors.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"ErrorTypes",function(){return F}),R.d(W,"ErrorDetails",function(){return L});var F;(function(D){D.NETWORK_ERROR="networkError",D.MEDIA_ERROR="mediaError",D.KEY_SYSTEM_ERROR="keySystemError",D.MUX_ERROR="muxError",D.OTHER_ERROR="otherError"})(F||(F={}));var L;(function(D){D.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",D.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",D.KEY_SYSTEM_NO_SESSION="keySystemNoSession",D.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",D.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",D.MANIFEST_LOAD_ERROR="manifestLoadError",D.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",D.MANIFEST_PARSING_ERROR="manifestParsingError",D.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",D.LEVEL_EMPTY_ERROR="levelEmptyError",D.LEVEL_LOAD_ERROR="levelLoadError",D.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",D.LEVEL_SWITCH_ERROR="levelSwitchError",D.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",D.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",D.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",D.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",D.FRAG_LOAD_ERROR="fragLoadError",D.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",D.FRAG_DECRYPT_ERROR="fragDecryptError",D.FRAG_PARSING_ERROR="fragParsingError",D.REMUX_ALLOC_ERROR="remuxAllocError",D.KEY_LOAD_ERROR="keyLoadError",D.KEY_LOAD_TIMEOUT="keyLoadTimeOut",D.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",D.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",D.BUFFER_APPEND_ERROR="bufferAppendError",D.BUFFER_APPENDING_ERROR="bufferAppendingError",D.BUFFER_STALLED_ERROR="bufferStalledError",D.BUFFER_FULL_ERROR="bufferFullError",D.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",D.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",D.INTERNAL_EXCEPTION="internalException",D.INTERNAL_ABORTED="aborted",D.UNKNOWN="unknown"})(L||(L={}))},"./src/events.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"Events",function(){return F});var F;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(F||(F={}))},"./src/hls.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return m});var F=R("./node_modules/url-toolkit/src/url-toolkit.js"),L=R.n(F),D=R("./src/loader/playlist-loader.ts"),j=R("./src/loader/key-loader.ts"),U=R("./src/controller/id3-track-controller.ts"),e=R("./src/controller/latency-controller.ts"),A=R("./src/controller/level-controller.ts"),d=R("./src/controller/fragment-tracker.ts"),f=R("./src/controller/stream-controller.ts"),o=R("./src/is-supported.ts"),n=R("./src/utils/logger.ts"),a=R("./src/config.ts"),h=R("./node_modules/eventemitter3/index.js"),s=R.n(h),r=R("./src/events.ts"),t=R("./src/errors.ts");function i(_,x){for(var E=0;E<x.length;E++){var y=x[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(_,y.key,y)}}function b(_,x,E){return x&&i(_.prototype,x),E&&i(_,E),_}var m=function(){_.isSupported=function(){return Object(o.isSupported)()};function _(E){E===void 0&&(E={}),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(a.mergeConfig)(_.DefaultConfig,E);this.userConfig=E,Object(n.enableLogs)(y.debug),this._autoLevelCapping=-1,y.progressive&&Object(a.enableStreamingMode)(y);var c=y.abrController,u=y.bufferController,l=y.capLevelController,v=y.fpsController,g=this.abrController=new c(this),w=this.bufferController=new u(this),O=this.capLevelController=new l(this),I=new v(this),S=new D.default(this),P=new j.default(this),B=new U.default(this),C=this.levelController=new A.default(this),H=new d.FragmentTracker(this),z=this.streamController=new f.default(this,H);O.setStreamController(z),I.setStreamController(z);var Z=[C,z];this.networkControllers=Z;var Q=[S,P,g,w,O,I,B,H];this.audioTrackController=this.createController(y.audioTrackController,null,Z),this.createController(y.audioStreamController,H,Z),this.subtitleTrackController=this.createController(y.subtitleTrackController,null,Z),this.createController(y.subtitleStreamController,H,Z),this.createController(y.timelineController,null,Q),this.emeController=this.createController(y.emeController,null,Q),this.cmcdController=this.createController(y.cmcdController,null,Q),this.latencyController=this.createController(e.default,null,Q),this.coreComponents=Q}var x=_.prototype;return x.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},x.on=function(y,c,u){u===void 0&&(u=this),this._emitter.on(y,c,u)},x.once=function(y,c,u){u===void 0&&(u=this),this._emitter.once(y,c,u)},x.removeAllListeners=function(y){this._emitter.removeAllListeners(y)},x.off=function(y,c,u,l){u===void 0&&(u=this),this._emitter.off(y,c,u,l)},x.listeners=function(y){return this._emitter.listeners(y)},x.emit=function(y,c,u){return this._emitter.emit(y,c,u)},x.trigger=function(y,c){if(this.config.debug)return this.emit(y,y,c);try{return this.emit(y,y,c)}catch(u){n.logger.error("An internal error happened while handling event "+y+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(r.Events.ERROR,{type:t.ErrorTypes.OTHER_ERROR,details:t.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:y,error:u})}return!1},x.listenerCount=function(y){return this._emitter.listenerCount(y)},x.destroy=function(){n.logger.log("destroy"),this.trigger(r.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},x.attachMedia=function(y){n.logger.log("attachMedia"),this._media=y,this.trigger(r.Events.MEDIA_ATTACHING,{media:y})},x.detachMedia=function(){n.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},x.loadSource=function(y){this.stopLoad();var c=this.media,u=this.url,l=this.url=F.buildAbsoluteURL(self.location.href,y,{alwaysNormalize:!0});n.logger.log("loadSource:"+l),c&&u&&u!==l&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(c)),this.trigger(r.Events.MANIFEST_LOADING,{url:y})},x.startLoad=function(y){y===void 0&&(y=-1),n.logger.log("startLoad("+y+")"),this.networkControllers.forEach(function(c){c.startLoad(y)})},x.stopLoad=function(){n.logger.log("stopLoad"),this.networkControllers.forEach(function(y){y.stopLoad()})},x.swapAudioCodec=function(){n.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},x.recoverMediaError=function(){n.logger.log("recoverMediaError");var y=this._media;this.detachMedia(),y&&this.attachMedia(y)},x.removeLevel=function(y,c){c===void 0&&(c=0),this.levelController.removeLevel(y,c)},b(_,[{key:"levels",get:function(){var y=this.levelController.levels;return y||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(y){n.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){n.logger.log("set nextLevel:"+y),this.levelController.manualLevel=y,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(y){n.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){n.logger.log("set firstLevel:"+y),this.levelController.firstLevel=y}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(y){n.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&&(n.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 r.Events}},{key:"ErrorTypes",get:function(){return t.ErrorTypes}},{key:"ErrorDetails",get:function(){return t.ErrorDetails}},{key:"DefaultConfig",get:function(){return _.defaultConfig?_.defaultConfig:a.hlsDefaultConfig},set:function(y){_.defaultConfig=y}}]),_}();m.defaultConfig=void 0},"./src/is-supported.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"isSupported",function(){return D}),R.d(W,"changeTypeSupported",function(){return j});var F=R("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function D(){var U=Object(F.getMediaSource)();if(!U)return!1;var e=L(),A=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),d=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!A&&!!d}function j(){var U,e=L();return typeof(e==null||((U=e.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n}),R.d(W,"LoadError",function(){return h});var F=R("./src/polyfills/number.ts"),L=R("./src/errors.ts");function D(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,d(s,r)}function j(s){var r=typeof Map=="function"?new Map:void 0;return j=function(i){if(i===null||!A(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(i))return r.get(i);r.set(i,b)}function b(){return U(i,arguments,f(this).constructor)}return b.prototype=Object.create(i.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),d(b,i)},j(s)}function U(s,r,t){return e()?U=Reflect.construct:U=function(b,m,_){var x=[null];x.push.apply(x,m);var E=Function.bind.apply(b,x),y=new E;return _&&d(y,_.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 A(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function d(s,r){return d=Object.setPrototypeOf||function(i,b){return i.__proto__=b,i},d(s,r)}function f(s){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(s)}var o=Math.pow(2,17),n=function(){function s(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var r=s.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(i,b){var m=this,_=i.url;if(!_)return Promise.reject(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,networkDetails:null},"Fragment does not have a "+(_?"part list":"url")));this.abort();var x=this.config,E=x.fLoader,y=x.loader;return new Promise(function(c,u){m.loader&&m.loader.destroy();var l=m.loader=i.loader=E?new E(x):new y(x),v=a(i),g={timeout:x.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:x.fragLoadingMaxRetryTimeout,highWaterMark:o};i.stats=l.stats,l.load(v,g,{onSuccess:function(O,I,S,P){m.resetLoader(i,l),c({frag:i,part:null,payload:O.data,networkDetails:P})},onError:function(O,I,S){m.resetLoader(i,l),u(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:O,networkDetails:S}))},onAbort:function(O,I,S){m.resetLoader(i,l),u(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:S}))},onTimeout:function(O,I,S){m.resetLoader(i,l),u(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:S}))},onProgress:function(O,I,S,P){b&&b({frag:i,part:null,payload:S,networkDetails:P})}})})},r.loadPart=function(i,b,m){var _=this;this.abort();var x=this.config,E=x.fLoader,y=x.loader;return new Promise(function(c,u){_.loader&&_.loader.destroy();var l=_.loader=i.loader=E?new E(x):new y(x),v=a(i,b),g={timeout:x.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:x.fragLoadingMaxRetryTimeout,highWaterMark:o};b.stats=l.stats,l.load(v,g,{onSuccess:function(O,I,S,P){_.resetLoader(i,l),_.updateStatsFromPart(i,b);var B={frag:i,part:b,payload:O.data,networkDetails:P};m(B),c(B)},onError:function(O,I,S){_.resetLoader(i,l),u(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:b,response:O,networkDetails:S}))},onAbort:function(O,I,S){i.stats.aborted=b.stats.aborted,_.resetLoader(i,l),u(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:b,networkDetails:S}))},onTimeout:function(O,I,S){_.resetLoader(i,l),u(new h({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,part:b,networkDetails:S}))}})})},r.updateStatsFromPart=function(i,b){var m=i.stats,_=b.stats,x=_.total;if(m.loaded+=_.loaded,x){var E=Math.round(i.duration/b.duration),y=Math.min(Math.round(m.loaded/x),E),c=E-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=_.loading;l.start?l.first+=v.first-v.start:(l.start=v.start,l.first=v.first),l.end=v.end},r.resetLoader=function(i,b){i.loader=null,this.loader===b&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),b.destroy()},s}();function a(s,r){r===void 0&&(r=null);var t=r||s,i={frag:s,part:r,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},b=t.byteRangeStartOffset,m=t.byteRangeEndOffset;return Object(F.isFiniteNumber)(b)&&Object(F.isFiniteNumber)(m)&&(i.rangeStart=b,i.rangeEnd=m),i}var h=function(s){D(r,s);function r(t){for(var i,b=arguments.length,m=new Array(b>1?b-1:0),_=1;_<b;_++)m[_-1]=arguments[_];return i=s.call.apply(s,[this].concat(m))||this,i.data=void 0,i.data=t,i}return r}(j(Error))},"./src/loader/fragment.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"ElementaryStreamTypes",function(){return n}),R.d(W,"BaseSegment",function(){return a}),R.d(W,"Fragment",function(){return h}),R.d(W,"Part",function(){return s});var F=R("./src/polyfills/number.ts"),L=R("./node_modules/url-toolkit/src/url-toolkit.js"),D=R.n(L),j=R("./src/utils/logger.ts"),U=R("./src/loader/level-key.ts"),e=R("./src/loader/load-stats.ts");function A(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,d(r,t)}function d(r,t){return d=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},d(r,t)}function f(r,t){for(var i=0;i<t.length;i++){var b=t[i];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(r,b.key,b)}}function o(r,t,i){return t&&f(r.prototype,t),i&&f(r,i),r}var n;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(n||(n={}));var a=function(){function r(i){var b;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(b={},b[n.AUDIO]=null,b[n.VIDEO]=null,b[n.AUDIOVIDEO]=null,b),this.baseurl=i}var t=r.prototype;return t.setByteRange=function(b,m){var _=b.split("@",2),x=[];_.length===1?x[0]=m?m.byteRangeEndOffset:0:x[0]=parseInt(_[1]),x[1]=parseInt(_[0])+x[0],this._byteRange=x},o(r,[{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(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(b){this._url=b}}]),r}(),h=function(r){A(t,r);function t(b,m){var _;return _=r.call(this,m)||this,_._decryptdata=null,_.rawProgramDateTime=null,_.programDateTime=null,_.tagList=[],_.duration=0,_.sn=0,_.levelkey=void 0,_.type=void 0,_.loader=null,_.level=-1,_.cc=0,_.startPTS=void 0,_.endPTS=void 0,_.appendedPTS=void 0,_.startDTS=void 0,_.endDTS=void 0,_.start=0,_.deltaPTS=void 0,_.maxStartPTS=void 0,_.minEndPTS=void 0,_.stats=new e.LoadStats,_.urlId=0,_.data=void 0,_.bitrateTest=!1,_.title=null,_.initSegment=null,_.type=b,_}var i=t.prototype;return i.createInitializationVector=function(m){for(var _=new Uint8Array(16),x=12;x<16;x++)_[x]=m>>8*(15-x)&255;return _},i.setDecryptDataFromLevelKey=function(m,_){var x=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(x=U.LevelKey.fromURI(m.uri),x.method=m.method,x.iv=this.createInitializationVector(_),x.keyFormat="identity"),x},i.setElementaryStreamInfo=function(m,_,x,E,y,c){c===void 0&&(c=!1);var u=this.elementaryStreams,l=u[m];if(!l){u[m]={startPTS:_,endPTS:x,startDTS:E,endDTS:y,partial:c};return}l.startPTS=Math.min(l.startPTS,_),l.endPTS=Math.max(l.endPTS,x),l.startDTS=Math.min(l.startDTS,E),l.endDTS=Math.max(l.endDTS,y)},i.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[n.AUDIO]=null,m[n.VIDEO]=null,m[n.AUDIOVIDEO]=null},o(t,[{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&&j.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(F.isFiniteNumber)(this.programDateTime))return null;var m=Object(F.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)}}]),t}(a),s=function(r){A(t,r);function t(i,b,m,_,x){var E;E=r.call(this,m)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new e.LoadStats,E.duration=i.decimalFloatingPoint("DURATION"),E.gap=i.bool("GAP"),E.independent=i.bool("INDEPENDENT"),E.relurl=i.enumeratedString("URI"),E.fragment=b,E.index=_;var y=i.enumeratedString("BYTERANGE");return y&&E.setByteRange(y,x),x&&(E.fragOffset=x.fragOffset+x.duration),E}return o(t,[{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)}}]),t}(a)},"./src/loader/key-loader.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return j});var F=R("./src/events.ts"),L=R("./src/errors.ts"),D=R("./src/utils/logger.ts"),j=function(){function U(A){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=A,this._registerListeners()}var e=U.prototype;return e._registerListeners=function(){this.hls.on(F.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(F.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var d in this.loaders){var f=this.loaders[d];f&&f.destroy()}this.loaders={}},e.onKeyLoading=function(d,f){var o=f.frag,n=o.type,a=this.loaders[n];if(!o.decryptdata){D.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(a&&(D.logger.warn("abort previous key loader for type:"+n),a.abort()),!h){D.logger.warn("key uri is falsy");return}var r=s.loader,t=o.loader=this.loaders[n]=new r(s);this.decrypturl=h,this.decryptkey=null;var i={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)};t.load(i,b,m)}else this.decryptkey&&(o.decryptdata.key=this.decryptkey,this.hls.trigger(F.Events.KEY_LOADED,{frag:o}))},e.loadsuccess=function(d,f,o){var n=o.frag;if(!n.decryptdata){D.logger.error("after key load, decryptdata unset");return}this.decryptkey=n.decryptdata.key=new Uint8Array(d.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(F.Events.KEY_LOADED,{frag:n})},e.loaderror=function(d,f){var o=f.frag,n=o.loader;n&&n.abort(),delete this.loaders[o.type],this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:o,response:d})},e.loadtimeout=function(d,f){var o=f.frag,n=o.loader;n&&n.abort(),delete this.loaders[o.type],this.hls.trigger(F.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:o})},U}()},"./src/loader/level-details.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"LevelDetails",function(){return U});var F=R("./src/polyfills/number.ts");function L(e,A){for(var d=0;d<A.length;d++){var f=A[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(e,f.key,f)}}function D(e,A,d){return A&&L(e.prototype,A),d&&L(e,d),e}var j=10,U=function(){function e(d){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=d}var A=e.prototype;return A.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var o=this.lastPartSn-f.lastPartSn,n=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!n||!!o,this.advanced=this.endSN>f.endSN||o>0||o===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},D(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(F.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||j}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var o=this.driftEnd-this.driftStart;return o*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"LevelKey",function(){return U});var F=R("./node_modules/url-toolkit/src/url-toolkit.js"),L=R.n(F);function D(e,A){for(var d=0;d<A.length;d++){var f=A[d];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(e,f.key,f)}}function j(e,A,d){return A&&D(e.prototype,A),d&&D(e,d),e}var U=function(){e.fromURL=function(d,f){return new e(d,f)},e.fromURI=function(d){return new e(d)};function e(A,d){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,d?this._uri=Object(F.buildAbsoluteURL)(A,d,{alwaysNormalize:!0}):this._uri=A}return j(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"LoadStats",function(){return F});var F=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(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return t});var F=R("./src/polyfills/number.ts"),L=R("./node_modules/url-toolkit/src/url-toolkit.js"),D=R.n(L),j=R("./src/loader/fragment.ts"),U=R("./src/loader/level-details.ts"),e=R("./src/loader/level-key.ts"),A=R("./src/utils/attr-list.ts"),d=R("./src/utils/logger.ts"),f=R("./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,n=/#EXT-X-MEDIA:(.*)/g,a=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 r(x){var E,y;return s.test((E=(y=L.parseURL(x))===null||y===void 0?void 0:y.path)!=null?E:"")}var t=function(){function x(){}return x.findGroup=function(y,c){for(var u=0;u<y.length;u++){var l=y[u];if(l.id===c)return l}},x.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},x.resolve=function(y,c){return L.buildAbsoluteURL(c,y,{alwaysNormalize:!0})},x.parseMasterPlaylist=function(y,c){var u=[],l={},v=!1;o.lastIndex=0;for(var g;(g=o.exec(y))!=null;)if(g[1]){var w=new A.AttrList(g[1]),O={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:x.resolve(g[2],c)},I=w.decimalResolution("RESOLUTION");I&&(O.width=I.width,O.height=I.height),i((w.CODECS||"").split(/[ ,]+/).filter(function(P){return P}),O),O.videoCodec&&O.videoCodec.indexOf("avc1")!==-1&&(O.videoCodec=x.convertAVC1ToAVCOTI(O.videoCodec)),u.push(O)}else if(g[3]){var S=new A.AttrList(g[3]);S["DATA-ID"]&&(v=!0,l[S["DATA-ID"]]=S)}return{levels:u,sessionData:v?l:null}},x.parseMasterPlaylistMedia=function(y,c,u,l){l===void 0&&(l=[]);var v,g=[],w=0;for(n.lastIndex=0;(v=n.exec(y))!==null;){var O=new A.AttrList(v[1]);if(O.TYPE===u){var I={attrs:O,bitrate:0,id:w++,groupId:O["GROUP-ID"],instreamId:O["INSTREAM-ID"],name:O.NAME||O.LANGUAGE||"",type:u,default:O.bool("DEFAULT"),autoselect:O.bool("AUTOSELECT"),forced:O.bool("FORCED"),lang:O.LANGUAGE,url:O.URI?x.resolve(O.URI,c):""};if(l.length){var S=x.findGroup(l,I.groupId)||l[0];b(I,S,"audioCodec"),b(I,S,"textCodec")}g.push(I)}}return g},x.parseLevelPlaylist=function(y,c,u,l,v){var g=new U.LevelDetails(c),w=g.fragments,O=null,I=0,S=0,P=0,B=0,C=null,H=new j.Fragment(l,c),z,Z,Q,pe=-1,le=!1;for(a.lastIndex=0,g.m3u8=y;(z=a.exec(y))!==null;){le&&(le=!1,H=new j.Fragment(l,c),H.start=P,H.sn=I,H.cc=B,H.level=u,O&&(H.initSegment=O,H.rawProgramDateTime=O.rawProgramDateTime));var de=z[1];if(de){H.duration=parseFloat(de);var ce=(" "+z[2]).slice(1);H.title=ce||null,H.tagList.push(ce?["INF",de,ce]:["INF",de])}else if(z[3])Object(F.isFiniteNumber)(H.duration)&&(H.start=P,Q&&(H.levelkey=Q),H.sn=I,H.level=u,H.cc=B,H.urlId=v,w.push(H),H.relurl=(" "+z[3]).slice(1),_(H,C),C=H,P+=H.duration,I++,S=0,le=!0);else if(z[4]){var me=(" "+z[4]).slice(1);C?H.setByteRange(me,C):H.setByteRange(me)}else if(z[5])H.rawProgramDateTime=(" "+z[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),pe===-1&&(pe=w.length);else{if(z=z[0].match(h),!z){d.logger.warn("No matches on slow regex match for level playlist!");continue}for(Z=1;Z<z.length&&!(typeof z[Z]!="undefined");Z++);var te=(" "+z[Z]).slice(1),$=(" "+z[Z+1]).slice(1),_e=z[Z+2]?(" "+z[Z+2]).slice(1):"";switch(te){case"PLAYLIST-TYPE":g.type=$.toUpperCase();break;case"MEDIA-SEQUENCE":I=g.startSN=parseInt($);break;case"SKIP":{var Oe=new A.AttrList($),Ce=Oe.decimalInteger("SKIPPED-SEGMENTS");if(Object(F.isFiniteNumber)(Ce)){g.skippedSegments=Ce;for(var Ae=Ce;Ae--;)w.unshift(null);I+=Ce}var Pe=Oe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Pe&&(g.recentlyRemovedDateranges=Pe.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat($);break;case"VERSION":g.version=parseInt($);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":($||_e)&&H.tagList.push(_e?[$,_e]:[$]);break;case"DIS":B++;case"GAP":H.tagList.push([te]);break;case"BITRATE":H.tagList.push([te,$]);break;case"DISCONTINUITY-SEQ":B=parseInt($);break;case"KEY":{var ye,Ee=new A.AttrList($),Ie=Ee.enumeratedString("METHOD"),X=Ee.URI,se=Ee.hexadecimalInteger("IV"),ue=Ee.enumeratedString("KEYFORMATVERSIONS"),he=Ee.enumeratedString("KEYID"),xe=(ye=Ee.enumeratedString("KEYFORMAT"))!=null?ye:"identity",we=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(we.indexOf(xe)>-1){d.logger.warn("Keyformat "+xe+" is not supported from the manifest");continue}else if(xe!=="identity")continue;Ie&&(Q=e.LevelKey.fromURL(c,X),X&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&(Q.method=Ie,Q.keyFormat=xe,he&&(Q.keyID=he),ue&&(Q.keyFormatVersions=ue),Q.iv=se));break}case"START":{var Me=new A.AttrList($),De=Me.decimalFloatingPoint("TIME-OFFSET");Object(F.isFiniteNumber)(De)&&(g.startTimeOffset=De);break}case"MAP":{var ke=new A.AttrList($);H.relurl=ke.URI,ke.BYTERANGE&&H.setByteRange(ke.BYTERANGE),H.level=u,H.sn="initSegment",Q&&(H.levelkey=Q),H.initSegment=null,O=H,le=!0;break}case"SERVER-CONTROL":{var Ne=new A.AttrList($);g.canBlockReload=Ne.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Ne.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Ne.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Ne.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Ne.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ue=new A.AttrList($);g.partTarget=Ue.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Le=g.partList;Le||(Le=g.partList=[]);var Fe=S>0?Le[Le.length-1]:void 0,je=S++,ve=new j.Part(new A.AttrList($),H,c,je,Fe);Le.push(ve),H.duration+=ve.duration;break}case"PRELOAD-HINT":{var be=new A.AttrList($);g.preloadHint=be;break}case"RENDITION-REPORT":{var ae=new A.AttrList($);g.renditionReports=g.renditionReports||[],g.renditionReports.push(ae);break}default:d.logger.warn("line parsed but not handled: "+z);break}}}C&&!C.relurl?(w.pop(),P-=C.duration,g.partList&&(g.fragmentHint=C)):g.partList&&(_(H,C),H.cc=B,g.fragmentHint=H);var ie=w.length,ne=w[0],V=w[ie-1];if(P+=g.skippedSegments*g.targetduration,P>0&&ie&&V){g.averagetargetduration=P/ie;var Y=V.sn;g.endSN=Y!=="initSegment"?Y:0,ne&&(g.startCC=ne.cc,ne.initSegment||g.fragments.every(function(J){return J.relurl&&r(J.relurl)})&&(d.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new j.Fragment(l,c),H.relurl=V.relurl,H.level=u,H.sn="initSegment",ne.initSegment=H,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(P+=g.fragmentHint.duration),g.totalduration=P,g.endCC=B,pe>0&&m(w,pe),g},x}();function i(x,E){["video","audio","text"].forEach(function(y){var c=x.filter(function(l){return Object(f.isCodecType)(l,y)});if(c.length){var u=c.filter(function(l){return l.lastIndexOf("avc1",0)===0||l.lastIndexOf("mp4a",0)===0});E[y+"Codec"]=u.length>0?u[0]:c[0],x=x.filter(function(l){return c.indexOf(l)===-1})}}),E.unknownCodecs=x}function b(x,E,y){var c=E[y];c&&(x[y]=c)}function m(x,E){for(var y=x[E],c=E;c--;){var u=x[c];if(!u)return;u.programDateTime=y.programDateTime-u.duration*1e3,y=u}}function _(x,E){x.rawProgramDateTime?x.programDateTime=Date.parse(x.rawProgramDateTime):E!=null&&E.programDateTime&&(x.programDateTime=E.endProgramDateTime),Object(F.isFiniteNumber)(x.programDateTime)||(x.programDateTime=null,x.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/polyfills/number.ts"),L=R("./src/events.ts"),D=R("./src/errors.ts"),j=R("./src/utils/logger.ts"),U=R("./src/utils/mp4-tools.ts"),e=R("./src/loader/m3u8-parser.ts"),A=R("./src/types/loader.ts"),d=R("./src/utils/attr-list.ts");function f(a){var h=a.type;switch(h){case A.PlaylistContextType.AUDIO_TRACK:return A.PlaylistLevelType.AUDIO;case A.PlaylistContextType.SUBTITLE_TRACK:return A.PlaylistLevelType.SUBTITLE;default:return A.PlaylistLevelType.MAIN}}function o(a,h){var s=a.url;return(s===void 0||s.indexOf("data:")===0)&&(s=h.url),s}var n=function(){function a(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var h=a.prototype;return h.registerListeners=function(){var r=this.hls;r.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.unregisterListeners=function(){var r=this.hls;r.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},h.createInternalLoader=function(r){var t=this.hls.config,i=t.pLoader,b=t.loader,m=i||b,_=new m(t);return r.loader=_,this.loaders[r.type]=_,_},h.getInternalLoader=function(r){return this.loaders[r.type]},h.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},h.destroyInternalLoaders=function(){for(var r in this.loaders){var t=this.loaders[r];t&&t.destroy(),this.resetInternalLoader(r)}},h.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},h.onManifestLoading=function(r,t){var i=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:A.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},h.onLevelLoading=function(r,t){var i=t.id,b=t.level,m=t.url,_=t.deliveryDirectives;this.load({id:i,groupId:null,level:b,responseType:"text",type:A.PlaylistContextType.LEVEL,url:m,deliveryDirectives:_})},h.onAudioTrackLoading=function(r,t){var i=t.id,b=t.groupId,m=t.url,_=t.deliveryDirectives;this.load({id:i,groupId:b,level:null,responseType:"text",type:A.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:_})},h.onSubtitleTrackLoading=function(r,t){var i=t.id,b=t.groupId,m=t.url,_=t.deliveryDirectives;this.load({id:i,groupId:b,level:null,responseType:"text",type:A.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:_})},h.load=function(r){var t,i=this.hls.config,b=this.getInternalLoader(r);if(b){var m=b.context;if(m&&m.url===r.url){j.logger.trace("[playlist-loader]: playlist request ongoing");return}j.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),b.abort()}var _,x,E,y;switch(r.type){case A.PlaylistContextType.MANIFEST:_=i.manifestLoadingMaxRetry,x=i.manifestLoadingTimeOut,E=i.manifestLoadingRetryDelay,y=i.manifestLoadingMaxRetryTimeout;break;case A.PlaylistContextType.LEVEL:case A.PlaylistContextType.AUDIO_TRACK:case A.PlaylistContextType.SUBTITLE_TRACK:_=0,x=i.levelLoadingTimeOut;break;default:_=i.levelLoadingMaxRetry,x=i.levelLoadingTimeOut,E=i.levelLoadingRetryDelay,y=i.levelLoadingMaxRetryTimeout;break}if(b=this.createInternalLoader(r),(t=r.deliveryDirectives)!==null&&t!==void 0&&t.part){var c;if(r.type===A.PlaylistContextType.LEVEL&&r.level!==null?c=this.hls.levels[r.level].details:r.type===A.PlaylistContextType.AUDIO_TRACK&&r.id!==null?c=this.hls.audioTracks[r.id].details:r.type===A.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(c=this.hls.subtitleTracks[r.id].details),c){var u=c.partTarget,l=c.targetduration;u&&l&&(x=Math.min(Math.max(u*3,l*.8)*1e3,x))}}var v={timeout:x,maxRetry:_,retryDelay:E,maxRetryDelay:y,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};b.load(r,v,g)},h.loadsuccess=function(r,t,i,b){if(b===void 0&&(b=null),i.isSidxRequest){this.handleSidxRequest(r,i),this.handlePlaylistLoaded(r,t,i,b);return}this.resetInternalLoader(i.type);var m=r.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,i,"no EXTM3U delimiter",b);return}t.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,t,i,b):this.handleMasterPlaylist(r,t,i,b)},h.loaderror=function(r,t,i){i===void 0&&(i=null),this.handleNetworkError(t,i,!1,r)},h.loadtimeout=function(r,t,i){i===void 0&&(i=null),this.handleNetworkError(t,i,!0)},h.handleMasterPlaylist=function(r,t,i,b){var m=this.hls,_=r.data,x=o(r,i),E=e.default.parseMasterPlaylist(_,x),y=E.levels,c=E.sessionData;if(!y.length){this.handleManifestParsingError(r,i,"no level found in manifest",b);return}var u=y.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),l=y.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),v=e.default.parseMasterPlaylistMedia(_,x,"AUDIO",u),g=e.default.parseMasterPlaylistMedia(_,x,"SUBTITLES",l),w=e.default.parseMasterPlaylistMedia(_,x,"CLOSED-CAPTIONS");if(v.length){var O=v.some(function(I){return!I.url});!O&&y[0].audioCodec&&!y[0].attrs.AUDIO&&(j.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 d.AttrList({}),bitrate:0,url:""}))}m.trigger(L.Events.MANIFEST_LOADED,{levels:y,audioTracks:v,subtitles:g,captions:w,url:x,stats:t,networkDetails:b,sessionData:c})},h.handleTrackOrLevelPlaylist=function(r,t,i,b){var m=this.hls,_=i.id,x=i.level,E=i.type,y=o(r,i),c=Object(F.isFiniteNumber)(_)?_:0,u=Object(F.isFiniteNumber)(x)?x:c,l=f(i),v=e.default.parseLevelPlaylist(r.data,y,u,l,c);if(!v.fragments.length){m.trigger(L.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:y,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(E===A.PlaylistContextType.MANIFEST){var g={attrs:new d.AttrList({}),bitrate:0,details:v,name:"",url:y};m.trigger(L.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:y,stats:t,networkDetails:b,sessionData:null})}if(t.parsing.end=performance.now(),v.needSidxRanges){var w,O=(w=v.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:O,isSidxRequest:!0,type:E,level:x,levelDetails:v,id:_,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=v,this.handlePlaylistLoaded(r,t,i,b)},h.handleSidxRequest=function(r,t){var i=Object(U.parseSegmentIndex)(new Uint8Array(r.data));if(!i)return;var b=i.references,m=t.levelDetails;b.forEach(function(_,x){var E=_.info,y=m.fragments[x];y.byteRange.length===0&&y.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),y.initSegment&&y.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},h.handleManifestParsingError=function(r,t,i,b){this.hls.trigger(L.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===A.PlaylistContextType.MANIFEST,url:r.url,reason:i,response:r,context:t,networkDetails:b})},h.handleNetworkError=function(r,t,i,b){i===void 0&&(i=!1),j.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var m=D.ErrorDetails.UNKNOWN,_=!1,x=this.getInternalLoader(r);switch(r.type){case A.PlaylistContextType.MANIFEST:m=i?D.ErrorDetails.MANIFEST_LOAD_TIMEOUT:D.ErrorDetails.MANIFEST_LOAD_ERROR,_=!0;break;case A.PlaylistContextType.LEVEL:m=i?D.ErrorDetails.LEVEL_LOAD_TIMEOUT:D.ErrorDetails.LEVEL_LOAD_ERROR,_=!1;break;case A.PlaylistContextType.AUDIO_TRACK:m=i?D.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,_=!1;break;case A.PlaylistContextType.SUBTITLE_TRACK:m=i?D.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:D.ErrorDetails.SUBTITLE_LOAD_ERROR,_=!1;break}x&&this.resetInternalLoader(r.type);var E={type:D.ErrorTypes.NETWORK_ERROR,details:m,fatal:_,url:r.url,loader:x,context:r,networkDetails:t};b&&(E.response=b),this.hls.trigger(L.Events.ERROR,E)},h.handlePlaylistLoaded=function(r,t,i,b){var m=i.type,_=i.level,x=i.id,E=i.groupId,y=i.loader,c=i.levelDetails,u=i.deliveryDirectives;if(!(c!=null&&c.targetduration)){this.handleManifestParsingError(r,i,"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 A.PlaylistContextType.MANIFEST:case A.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:c,level:_||0,id:x||0,stats:t,networkDetails:b,deliveryDirectives:u});break;case A.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:c,id:x||0,groupId:E||"",stats:t,networkDetails:b,deliveryDirectives:u});break;case A.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:c,id:x||0,groupId:E||"",stats:t,networkDetails:b,deliveryDirectives:u});break}},a}();W.default=n},"./src/polyfills/number.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"isFiniteNumber",function(){return F}),R.d(W,"MAX_SAFE_INTEGER",function(){return L});var F=Number.isFinite||function(D){return typeof D=="number"&&isFinite(D)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ee,W,R){"use strict";R.r(W);var F=function(){function L(){}return L.getSilentFrame=function(j,U){switch(j){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},L}();W.default=F},"./src/remux/mp4-generator.ts":function(ee,W,R){"use strict";R.r(W);var F=Math.pow(2,32)-1,L=function(){function D(){}return D.init=function(){D.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var U;for(U in D.types)D.types.hasOwnProperty(U)&&(D.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]),A=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);D.HDLR_TYPES={video:e,audio:A};var d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);D.STTS=D.STSC=D.STCO=f,D.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),D.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),D.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),D.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);D.FTYP=D.box(D.types.ftyp,o,a,o,n),D.DINF=D.box(D.types.dinf,D.box(D.types.dref,d))},D.box=function(U){for(var e=8,A=arguments.length,d=new Array(A>1?A-1:0),f=1;f<A;f++)d[f-1]=arguments[f];for(var o=d.length,n=o;o--;)e+=d[o].byteLength;var a=new Uint8Array(e);for(a[0]=e>>24&255,a[1]=e>>16&255,a[2]=e>>8&255,a[3]=e&255,a.set(U,4),o=0,e=8;o<n;o++)a.set(d[o],e),e+=d[o].byteLength;return a},D.hdlr=function(U){return D.box(D.types.hdlr,D.HDLR_TYPES[U])},D.mdat=function(U){return D.box(D.types.mdat,U)},D.mdhd=function(U,e){e*=U;var A=Math.floor(e/(F+1)),d=Math.floor(e%(F+1));return D.box(D.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,A>>24,A>>16&255,A>>8&255,A&255,d>>24,d>>16&255,d>>8&255,d&255,85,196,0,0]))},D.mdia=function(U){return D.box(D.types.mdia,D.mdhd(U.timescale,U.duration),D.hdlr(U.type),D.minf(U))},D.mfhd=function(U){return D.box(D.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},D.minf=function(U){return U.type==="audio"?D.box(D.types.minf,D.box(D.types.smhd,D.SMHD),D.DINF,D.stbl(U)):D.box(D.types.minf,D.box(D.types.vmhd,D.VMHD),D.DINF,D.stbl(U))},D.moof=function(U,e,A){return D.box(D.types.moof,D.mfhd(U),D.traf(A,e))},D.moov=function(U){for(var e=U.length,A=[];e--;)A[e]=D.trak(U[e]);return D.box.apply(null,[D.types.moov,D.mvhd(U[0].timescale,U[0].duration)].concat(A).concat(D.mvex(U)))},D.mvex=function(U){for(var e=U.length,A=[];e--;)A[e]=D.trex(U[e]);return D.box.apply(null,[D.types.mvex].concat(A))},D.mvhd=function(U,e){e*=U;var A=Math.floor(e/(F+1)),d=Math.floor(e%(F+1)),f=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,A>>24,A>>16&255,A>>8&255,A&255,d>>24,d>>16&255,d>>8&255,d&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return D.box(D.types.mvhd,f)},D.sdtp=function(U){var e=U.samples||[],A=new Uint8Array(4+e.length),d,f;for(d=0;d<e.length;d++)f=e[d].flags,A[d+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return D.box(D.types.sdtp,A)},D.stbl=function(U){return D.box(D.types.stbl,D.stsd(U),D.box(D.types.stts,D.STTS),D.box(D.types.stsc,D.STSC),D.box(D.types.stsz,D.STSZ),D.box(D.types.stco,D.STCO))},D.avc1=function(U){var e=[],A=[],d,f,o;for(d=0;d<U.sps.length;d++)f=U.sps[d],o=f.byteLength,e.push(o>>>8&255),e.push(o&255),e=e.concat(Array.prototype.slice.call(f));for(d=0;d<U.pps.length;d++)f=U.pps[d],o=f.byteLength,A.push(o>>>8&255),A.push(o&255),A=A.concat(Array.prototype.slice.call(f));var n=D.box(D.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|U.sps.length].concat(e).concat([U.pps.length]).concat(A))),a=U.width,h=U.height,s=U.pixelRatio[0],r=U.pixelRatio[1];return D.box(D.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,a>>8&255,a&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]),n,D.box(D.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),D.box(D.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,r>>24,r>>16&255,r>>8&255,r&255])))},D.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]))},D.mp4a=function(U){var e=U.samplerate;return D.box(D.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),D.box(D.types.esds,D.esds(U)))},D.mp3=function(U){var e=U.samplerate;return D.box(D.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},D.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?D.box(D.types.stsd,D.STSD,D.mp3(U)):D.box(D.types.stsd,D.STSD,D.mp4a(U)):D.box(D.types.stsd,D.STSD,D.avc1(U))},D.tkhd=function(U){var e=U.id,A=U.duration*U.timescale,d=U.width,f=U.height,o=Math.floor(A/(F+1)),n=Math.floor(A%(F+1));return D.box(D.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,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,n>>24,n>>16&255,n>>8&255,n&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,d>>8&255,d&255,0,0,f>>8&255,f&255,0,0]))},D.traf=function(U,e){var A=D.sdtp(U),d=U.id,f=Math.floor(e/(F+1)),o=Math.floor(e%(F+1));return D.box(D.types.traf,D.box(D.types.tfhd,new Uint8Array([0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255])),D.box(D.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,o>>24,o>>16&255,o>>8&255,o&255])),D.trun(U,A.length+16+20+8+16+8+8),A)},D.trak=function(U){return U.duration=U.duration||4294967295,D.box(D.types.trak,D.tkhd(U),D.mdia(U))},D.trex=function(U){var e=U.id;return D.box(D.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]))},D.trun=function(U,e){var A=U.samples||[],d=A.length,f=12+16*d,o=new Uint8Array(f),n,a,h,s,r,t;for(e+=8+f,o.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,d&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),n=0;n<d;n++)a=A[n],h=a.duration,s=a.size,r=a.flags,t=a.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,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,t>>>24&255,t>>>16&255,t>>>8&255,t&255],12+16*n);return D.box(D.types.trun,o)},D.initSegment=function(U){D.types||D.init();var e=D.moov(U),A=new Uint8Array(D.FTYP.byteLength+e.byteLength);return A.set(D.FTYP),A.set(e,D.FTYP.byteLength),A},D}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,W.default=L},"./src/remux/mp4-remuxer.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return t}),R.d(W,"normalizePts",function(){return i});var F=R("./src/polyfills/number.ts"),L=R("./src/remux/aac-helper.ts"),D=R("./src/remux/mp4-generator.ts"),j=R("./src/events.ts"),U=R("./src/errors.ts"),e=R("./src/utils/logger.ts"),A=R("./src/types/loader.ts"),d=R("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(x){for(var E=1;E<arguments.length;E++){var y=arguments[E];for(var c in y)Object.prototype.hasOwnProperty.call(y,c)&&(x[c]=y[c])}return x},f.apply(this,arguments)}var o=10*1e3,n=1024,a=1152,h=null,s=null,r=!1,t=function(){function x(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||"",g=v.match(/Chrome\/(\d+)/i);h=g?parseInt(g[1]):0}if(s===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);s=w?parseInt(w[1]):0}r=!!h&&h<75||!!s&&s<600}var E=x.prototype;return E.destroy=function(){},E.resetTimeStamp=function(c){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=c},E.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},E.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},E.getVideoStartPts=function(c){var u=!1,l=c.reduce(function(v,g){var w=g.pts-v;return w<-4294967296?(u=!0,i(v,g.pts)):w>0?v:g.pts},c[0].pts);return u&&e.logger.debug("PTS rollover detected"),l},E.remux=function(c,u,l,v,g,w,O,I){var S,P,B,C,H,z,Z=g,Q=g,pe=c.pid>-1,le=u.pid>-1,de=u.samples.length,ce=c.samples.length>0,me=de>1,te=(!pe||ce)&&(!le||me)||this.ISGenerated||O;if(te){this.ISGenerated||(B=this.generateIS(c,u,g));var $=this.isVideoContiguous,_e=-1;if(me&&(_e=b(u.samples),!$&&this.config.forceKeyFrameOnDiscontinuity))if(z=!0,_e>0){e.logger.warn("[mp4-remuxer]: Dropped "+_e+" out of "+de+" video samples due to a missing keyframe");var Oe=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(_e),u.dropped+=_e,Q+=(u.samples[0].pts-Oe)/(u.timescale||9e4)}else _e===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+de+" video samples"),z=!1);if(this.ISGenerated){if(ce&&me){var Ce=this.getVideoStartPts(u.samples),Ae=i(c.samples[0].pts,Ce)-Ce,Pe=Ae/u.inputTimeScale;Z+=Math.max(0,Pe),Q+=Math.max(0,-Pe)}if(ce){if(c.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(c,u,g)),P=this.remuxAudio(c,Z,this.isAudioContiguous,w,le||me||I===A.PlaylistLevelType.AUDIO?Q:void 0),me){var ye=P?P.endPTS-P.startPTS:0;u.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(c,u,g)),S=this.remuxVideo(u,Q,$,ye)}}else me&&(S=this.remuxVideo(u,Q,$,0));S&&(S.firstKeyFrame=_e,S.independent=_e!==-1)}}return this.ISGenerated&&(l.samples.length&&(H=this.remuxID3(l,g)),v.samples.length&&(C=this.remuxText(v,g))),{audio:P,video:S,initSegment:B,independent:z,text:C,id3:H}},E.generateIS=function(c,u,l){var v=c.samples,g=u.samples,w=this.typeSupported,O={},I=!Object(F.isFiniteNumber)(this._initPTS),S="audio/mp4",P,B,C;if(I&&(P=B=Infinity),c.config&&v.length&&(c.timescale=c.samplerate,c.isAAC||(w.mpeg?(S="audio/mpeg",c.codec=""):w.mp3&&(c.codec="mp3")),O.audio={id:"audio",container:S,codec:c.codec,initSegment:!c.isAAC&&w.mpeg?new Uint8Array(0):D.default.initSegment([c]),metadata:{channelCount:c.channelCount}},I&&(C=c.inputTimeScale,P=B=v[0].pts-Math.round(C*l))),u.sps&&u.pps&&g.length&&(u.timescale=u.inputTimeScale,O.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:D.default.initSegment([u]),metadata:{width:u.width,height:u.height}},I)){C=u.inputTimeScale;var H=this.getVideoStartPts(g),z=Math.round(C*l);B=Math.min(B,i(g[0].dts,H)-z),P=Math.min(P,H-z)}if(Object.keys(O).length)return this.ISGenerated=!0,I&&(this._initPTS=P,this._initDTS=B),{tracks:O,initPTS:P,timescale:C}},E.remuxVideo=function(c,u,l,v){var g=c.inputTimeScale,w=c.samples,O=[],I=w.length,S=this._initPTS,P=this.nextAvcDts,B=8,C,H,z,Z=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,pe=0,le=!1;if(!l||P===null){var de=u*g,ce=w[0].pts-i(w[0].dts,w[0].pts);P=de-ce}for(var me=0;me<I;me++){var te=w[me];if(te.pts=i(te.pts-S,P),te.dts=i(te.dts-S,P),te.dts>te.pts){var $=9e4*.2;pe=Math.max(Math.min(pe,te.pts-te.dts),-1*$)}te.dts<w[me>0?me-1:me].dts&&(le=!0)}le&&w.sort(function($e,Ze){var ze=$e.dts-Ze.dts,it=$e.pts-Ze.pts;return ze||it}),H=w[0].dts,z=w[w.length-1].dts;var _e=Math.round((z-H)/(I-1));if(pe<0){if(pe<_e*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(d.toMsFromMpegTsClock)(-_e,!0)+" ms");for(var Oe=pe,Ce=0;Ce<I;Ce++)w[Ce].dts=Oe=Math.max(Oe,w[Ce].pts-_e),w[Ce].pts=Math.max(Oe,w[Ce].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(d.toMsFromMpegTsClock)(pe,!0)+" ms to overcome this issue");for(var Ae=0;Ae<I;Ae++)w[Ae].dts=w[Ae].dts+pe}H=w[0].dts}if(l){var Pe=H-P,ye=Pe>_e,Ee=Pe<-1;if(ye||Ee){ye?e.logger.warn("AVC: "+Object(d.toMsFromMpegTsClock)(Pe,!0)+" ms ("+Pe+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(d.toMsFromMpegTsClock)(-Pe,!0)+" ms ("+Pe+"dts) overlapping between fragments detected"),H=P;var Ie=w[0].pts-Pe;w[0].dts=H,w[0].pts=Ie,e.logger.log("Video: First PTS/DTS adjusted: "+Object(d.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(d.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(d.toMsFromMpegTsClock)(Pe,!0)+" ms")}}r&&(H=Math.max(0,H));for(var X=0,se=0,ue=0;ue<I;ue++){for(var he=w[ue],xe=he.units,we=xe.length,Me=0,De=0;De<we;De++)Me+=xe[De].data.length;se+=Me,X+=we,he.length=Me,he.dts=Math.max(he.dts,H),he.pts=Math.max(he.pts,he.dts,0),Z=Math.min(he.pts,Z),Q=Math.max(he.pts,Q)}z=w[I-1].dts;var ke=se+4*X+8,Ne;try{Ne=new Uint8Array(ke)}catch($e){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ke,reason:"fail allocating video mdat "+ke});return}var Ue=new DataView(Ne.buffer);Ue.setUint32(0,ke),Ne.set(D.default.types.mdat,4);for(var Le=0;Le<I;Le++){for(var Fe=w[Le],je=Fe.units,ve=0,be=0,ae=je.length;be<ae;be++){var ie=je[be],ne=ie.data,V=ie.data.byteLength;Ue.setUint32(B,V),B+=4,Ne.set(ne,B),B+=V,ve+=4+V}if(Le<I-1)C=w[Le+1].dts-Fe.dts;else{var Y=this.config,J=Fe.dts-w[Le>0?Le-1:Le].dts;if(Y.stretchShortVideoTrack&&this.nextAudioPts!==null){var q=Math.floor(Y.maxBufferHole*g),fe=(v?Z+v*g:this.nextAudioPts)-Fe.pts;fe>q?(C=fe-J,C<0&&(C=J),e.logger.log("[mp4-remuxer]: It is approximately "+fe/90+" ms to the next segment; using duration "+C/90+" ms for the last video frame.")):C=J}else C=J}var ge=Math.round(Fe.pts-Fe.dts);O.push(new m(Fe.key,C,ve,ge))}if(O.length&&h&&h<70){var Re=O[0].flags;Re.dependsOn=2,Re.isNonSync=0}console.assert(C!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=P=z+C,this.isVideoContiguous=!0;var We=D.default.moof(c.sequenceNumber++,H,f({},c,{samples:O})),Xe="video",He={data1:We,data2:Ne,startPTS:Z/g,endPTS:(Q+C)/g,startDTS:H/g,endDTS:P/g,type:Xe,hasAudio:!1,hasVideo:!0,nb:O.length,dropped:c.dropped};return c.samples=[],c.dropped=0,console.assert(Ne.length,"MDAT length must not be zero"),He},E.remuxAudio=function(c,u,l,v,g){var w=c.inputTimeScale,O=c.samplerate?c.samplerate:w,I=w/O,S=c.isAAC?n:a,P=S*I,B=this._initPTS,C=!c.isAAC&&this.typeSupported.mpeg,H=[],z=c.samples,Z=C?0:8,Q=this.nextAudioPts||-1,pe=u*w;if(this.isAudioContiguous=l=l||z.length&&Q>0&&(v&&Math.abs(pe-Q)<9e3||Math.abs(i(z[0].pts-B,pe)-Q)<20*P),z.forEach(function(ne){ne.pts=i(ne.pts-B,pe)}),!l||Q<0){if(z=z.filter(function(ne){return ne.pts>=0}),!z.length)return;g===0?Q=0:v?Q=Math.max(0,pe):Q=z[0].pts}if(c.isAAC)for(var le=g!==void 0,de=this.config.maxAudioFramesDrift,ce=0,me=Q;ce<z.length;ce++){var te=z[ce],$=te.pts,_e=$-me,Oe=Math.abs(1e3*_e/w);if(_e<=-de*P&&le)ce===0&&(e.logger.warn("Audio frame @ "+($/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*_e/w)+" ms."),this.nextAudioPts=Q=me=$);else if(_e>=de*P&&Oe<o&&le){var Ce=Math.round(_e/P);me=$-Ce*P,me<0&&(Ce--,me+=P),ce===0&&(this.nextAudioPts=Q=me),e.logger.warn("[mp4-remuxer]: Injecting "+Ce+" audio frame @ "+(me/w).toFixed(3)+"s due to "+Math.round(1e3*_e/w)+" ms gap.");for(var Ae=0;Ae<Ce;Ae++){var Pe=Math.max(me,0),ye=L.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);ye||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ye=te.unit.subarray()),z.splice(ce,0,{unit:ye,pts:Pe}),me+=P,ce++}}te.pts=me,me+=P}for(var Ee=null,Ie=null,X,se=0,ue=z.length;ue--;)se+=z[ue].unit.byteLength;for(var he=0,xe=z.length;he<xe;he++){var we=z[he],Me=we.unit,De=we.pts;if(Ie!==null){var ke=H[he-1];ke.duration=Math.round((De-Ie)/I)}else if(l&&c.isAAC&&(De=Q),Ee=De,se>0){se+=Z;try{X=new Uint8Array(se)}catch(ne){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:se,reason:"fail allocating audio mdat "+se});return}if(!C){var Ne=new DataView(X.buffer);Ne.setUint32(0,se),X.set(D.default.types.mdat,4)}}else return;X.set(Me,Z);var Ue=Me.byteLength;Z+=Ue,H.push(new m(!0,S,Ue,0)),Ie=De}var Le=H.length;if(!Le)return;var Fe=H[H.length-1];this.nextAudioPts=Q=Ie+I*Fe.duration;var je=C?new Uint8Array(0):D.default.moof(c.sequenceNumber++,Ee/I,f({},c,{samples:H}));c.samples=[];var ve=Ee/w,be=Q/w,ae="audio",ie={data1:je,data2:X,startPTS:ve,endPTS:be,startDTS:ve,endDTS:be,type:ae,hasAudio:!0,hasVideo:!1,nb:Le};return this.isAudioContiguous=!0,console.assert(X.length,"MDAT length must not be zero"),ie},E.remuxEmptyAudio=function(c,u,l,v){var g=c.inputTimeScale,w=c.samplerate?c.samplerate:g,O=g/w,I=this.nextAudioPts,S=(I!==null?I:v.startDTS*g)+this._initDTS,P=v.endDTS*g+this._initDTS,B=O*n,C=Math.ceil((P-S)/B),H=L.default.getSilentFrame(c.manifestCodec||c.codec,c.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var z=[],Z=0;Z<C;Z++){var Q=S+Z*B;z.push({unit:H,pts:Q,dts:Q})}return c.samples=z,this.remuxAudio(c,u,l,!1)},E.remuxID3=function(c,u){var l=c.samples.length;if(!l)return;for(var v=c.inputTimeScale,g=this._initPTS,w=this._initDTS,O=0;O<l;O++){var I=c.samples[O];I.pts=i(I.pts-g,u*v)/v,I.dts=i(I.dts-w,u*v)/v}var S=c.samples;return c.samples=[],{samples:S}},E.remuxText=function(c,u){var l=c.samples.length;if(!l)return;for(var v=c.inputTimeScale,g=this._initPTS,w=0;w<l;w++){var O=c.samples[w];O.pts=i(O.pts-g,u*v)/v}c.samples.sort(function(S,P){return S.pts-P.pts});var I=c.samples;return c.samples=[],{samples:I}},x}();function i(x,E){var y;if(E===null)return x;for(E<x?y=-8589934592:y=8589934592;Math.abs(x-E)>4294967296;)x+=y;return x}function b(x){for(var E=0;E<x.length;E++)if(x[E].key)return E;return-1}var m=function(E,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 _(E)},_=function(E){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=E?2:1,this.isNonSync=E?0:1}},"./src/remux/passthrough-remuxer.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/polyfills/number.ts"),L=R("./src/utils/mp4-tools.ts"),D=R("./src/loader/fragment.ts"),j=R("./src/utils/logger.ts"),U=function(){function d(){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 f=d.prototype;return f.destroy=function(){},f.resetTimeStamp=function(n){this.initPTS=n,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(n,a,h){this.audioCodec=a,this.videoCodec=h,this.generateInitSegment(n),this.emitInitSegment=!0},f.generateInitSegment=function(n){var a=this.audioCodec,h=this.videoCodec;if(!n||!n.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(L.parseInitSegment)(n);a||(a=A(s.audio,D.ElementaryStreamTypes.AUDIO)),h||(h=A(s.video,D.ElementaryStreamTypes.VIDEO));var r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:a+","+h,initSegment:n,id:"main"}:s.audio?r.audio={container:"audio/mp4",codec:a,initSegment:n,id:"audio"}:s.video?r.video={container:"video/mp4",codec:h,initSegment:n,id:"main"}:j.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},f.remux=function(n,a,h,s,r){var t=this.initPTS,i=this.lastEndDTS,b={audio:void 0,video:void 0,text:s,id3:h,initSegment:void 0};Object(F.isFiniteNumber)(i)||(i=this.lastEndDTS=r||0);var m=a.samples;if(!m||!m.length)return b;var _={initPTS:void 0,timescale:1},x=this.initData;if((!x||!x.length)&&(this.generateInitSegment(m),x=this.initData),!x||!x.length)return j.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),b;this.emitInitSegment&&(_.tracks=this.initTracks,this.emitInitSegment=!1),Object(F.isFiniteNumber)(t)||(this.initPTS=_.initPTS=t=e(x,m,i));var E=Object(L.getDuration)(m,x),y=i,c=E+y;Object(L.offsetStartDTS)(x,m,t),E>0?this.lastEndDTS=c:(j.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!x.audio,l=!!x.video,v="";u&&(v+="audio"),l&&(v+="video");var g={data1:m,startPTS:y,startDTS:y,endPTS:c,endDTS:c,type:v,hasAudio:u,hasVideo:l,nb:1,dropped:0};return b.audio=g.type==="audio"?g:void 0,b.video=g.type!=="audio"?g:void 0,b.text=s,b.id3=h,b.initSegment=_,b},d}(),e=function(f,o,n){return Object(L.getStartDTS)(f,o)-n};function A(d,f){var o=d==null?void 0:d.codec;return o&&o.length>4?o:o==="hvc1"?"hvc1.1.c.L120.90":o==="av01"?"av01.0.04M.08":o==="avc1"||f===D.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}W.default=U},"./src/task-loop.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return F});var F=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var D=L.prototype;return D.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},D.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},D.onHandlerDestroyed=function(){},D.hasInterval=function(){return!!this._tickInterval},D.hasNextTick=function(){return!!this._tickTimer},D.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},D.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},D.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},D.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},D.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},D.doTick=function(){},L}()},"./src/types/cmcd.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"CMCDVersion",function(){return F}),R.d(W,"CMCDObjectType",function(){return L}),R.d(W,"CMCDStreamingFormat",function(){return D}),R.d(W,"CMCDStreamType",function(){return j});var F=1,L;(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"})(L||(L={}));var D;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(D||(D={}));var j;(function(U){U.VOD="v",U.LIVE="l"})(j||(j={}))},"./src/types/level.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"HlsSkip",function(){return D}),R.d(W,"getSkipValue",function(){return j}),R.d(W,"HlsUrlParameters",function(){return U}),R.d(W,"Level",function(){return e});function F(A,d){for(var f=0;f<d.length;f++){var o=d[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(A,o.key,o)}}function L(A,d,f){return d&&F(A.prototype,d),f&&F(A,f),A}var D;(function(A){A.No="",A.Yes="YES",A.v2="v2"})(D||(D={}));function j(A,d){var f=A.canSkipUntil,o=A.canSkipDateRanges,n=A.endSN,a=d!==void 0?d-n:0;return f&&a<f?o?D.v2:D.Yes:D.No}var U=function(){function A(f,o,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=o,this.skip=n}var d=A.prototype;return d.addDirectives=function(o){var n=new self.URL(o);return this.msn!==void 0&&n.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&n.searchParams.set("_HLS_part",this.part.toString()),this.skip&&n.searchParams.set("_HLS_skip",this.skip),n.toString()},A}(),e=function(){function A(d){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=[d.url],this.attrs=d.attrs,this.bitrate=d.bitrate,d.details&&(this.details=d.details),this.id=d.id||0,this.name=d.name,this.width=d.width||0,this.height=d.height||0,this.audioCodec=d.audioCodec,this.videoCodec=d.videoCodec,this.unknownCodecs=d.unknownCodecs,this.codecSet=[d.videoCodec,d.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return L(A,[{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(f){var o=f%this.url.length;this._urlId!==o&&(this.details=void 0,this._urlId=o)}}]),A}()},"./src/types/loader.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"PlaylistContextType",function(){return F}),R.d(W,"PlaylistLevelType",function(){return L});var F;(function(D){D.MANIFEST="manifest",D.LEVEL="level",D.AUDIO_TRACK="audioTrack",D.SUBTITLE_TRACK="subtitleTrack"})(F||(F={}));var L;(function(D){D.MAIN="main",D.AUDIO="audio",D.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"ChunkMetadata",function(){return F});var F=function(j,U,e,A,d,f){A===void 0&&(A=0),d===void 0&&(d=-1),f===void 0&&(f=!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=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=j,this.sn=U,this.id=e,this.size=A,this.part=d,this.partial=f};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"AttrList",function(){return D});var F=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,D=function(){function j(e){typeof e=="string"&&(e=j.parseAttrList(e));for(var A in e)e.hasOwnProperty(A)&&(this[A]=e[A])}var U=j.prototype;return U.decimalInteger=function(A){var d=parseInt(this[A],10);return d>Number.MAX_SAFE_INTEGER?Infinity:d},U.hexadecimalInteger=function(A){if(this[A]){var d=(this[A]||"0x").slice(2);d=(d.length&1?"0":"")+d;for(var f=new Uint8Array(d.length/2),o=0;o<d.length/2;o++)f[o]=parseInt(d.slice(o*2,o*2+2),16);return f}else return null},U.hexadecimalIntegerAsNumber=function(A){var d=parseInt(this[A],16);return d>Number.MAX_SAFE_INTEGER?Infinity:d},U.decimalFloatingPoint=function(A){return parseFloat(this[A])},U.optionalFloat=function(A,d){var f=this[A];return f?parseFloat(f):d},U.enumeratedString=function(A){return this[A]},U.bool=function(A){return this[A]==="YES"},U.decimalResolution=function(A){var d=F.exec(this[A]);return d===null?void 0:{width:parseInt(d[1],10),height:parseInt(d[2],10)}},j.parseAttrList=function(A){var d,f={},o='"';for(L.lastIndex=0;(d=L.exec(A))!==null;){var n=d[2];n.indexOf(o)===0&&n.lastIndexOf(o)===n.length-1&&(n=n.slice(1,-1)),f[d[1]]=n}return f},j}()},"./src/utils/binary-search.ts":function(ee,W,R){"use strict";R.r(W);var F={search:function(D,j){for(var U=0,e=D.length-1,A=null,d=null;U<=e;){A=(U+e)/2|0,d=D[A];var f=j(d);if(f>0)U=A+1;else if(f<0)e=A-1;else return d}return null}};W.default=F},"./src/utils/buffer-helper.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"BufferHelper",function(){return D});var F=R("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},D=function(){function j(){}return j.isBuffered=function(e,A){try{if(e){for(var d=j.getBuffered(e),f=0;f<d.length;f++)if(A>=d.start(f)&&A<=d.end(f))return!0}}catch(o){}return!1},j.bufferInfo=function(e,A,d){try{if(e){var f=j.getBuffered(e),o=[],n;for(n=0;n<f.length;n++)o.push({start:f.start(n),end:f.end(n)});return this.bufferedInfo(o,A,d)}}catch(a){}return{len:0,start:A,end:A,nextStart:void 0}},j.bufferedInfo=function(e,A,d){A=Math.max(0,A),e.sort(function(_,x){var E=_.start-x.start;return E||x.end-_.end});var f=[];if(d)for(var o=0;o<e.length;o++){var n=f.length;if(n){var a=f[n-1].end;e[o].start-a<d?e[o].end>a&&(f[n-1].end=e[o].end):f.push(e[o])}else f.push(e[o])}else f=e;for(var h=0,s,r=A,t=A,i=0;i<f.length;i++){var b=f[i].start,m=f[i].end;if(A+d>=b&&A<m)r=b,t=m,h=t-A;else if(A+d<b){s=b;break}}return{len:h,start:r||0,end:t||0,nextStart:s}},j.getBuffered=function(e){try{return e.buffered}catch(A){return F.logger.log("failed to get media.buffered",A),L}},j}()},"./src/utils/cea-608-parser.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"Row",function(){return t}),R.d(W,"CaptionScreen",function(){return i});var F=R("./src/utils/logger.ts"),L={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},D=function(c){var u=c;return L.hasOwnProperty(c)&&(u=L[c]),String.fromCharCode(u)},j=15,U=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},A={17:2,18:4,21:6,22:8,23:10,19:13,20:15},d={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},o=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],n;(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"})(n||(n={}));var a=function(){function y(){this.time=null,this.verboseLevel=n.ERROR}var c=y.prototype;return c.log=function(l,v){this.verboseLevel>=l&&F.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,g,w){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=g||"black",this.flash=w||!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"],g=0;g<v.length;g++){var w=v[g];l.hasOwnProperty(w)&&(this[w]=l[w])}},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}(),r=function(){function y(u,l,v,g,w,O){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new s(l,v,g,w,O)}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}(),t=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 r);this.logger=u,this.pos=0,this.currPenState=new s}var c=y.prototype;return c.equals=function(l){for(var v=!0,g=0;g<U;g++)if(!this.chars[g].equals(l.chars[g])){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(n.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},c.moveCursor=function(l){var v=this.pos+l;if(l>1)for(var g=this.pos+1;g<v+1;g++)this.chars[g].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=D(l);if(this.pos>=U){this.logger.log(n.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,g=0;g<U;g++){var w=this.chars[g].uchar;w!==" "&&(v=!1),l.push(w)}return v?"":l.join("")},c.setPenStyles=function(l){this.currPenState.setStyles(l);var v=this.chars[this.pos];v.setPenState(this.currPenState)},y}(),i=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<j;l++)this.rows.push(new t(u));this.logger=u,this.currRow=j-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var c=y.prototype;return c.reset=function(){for(var l=0;l<j;l++)this.rows[l].clear();this.currRow=j-1},c.equals=function(l){for(var v=!0,g=0;g<j;g++)if(!this.rows[g].equals(l.rows[g])){v=!1;break}return v},c.copy=function(l){for(var v=0;v<j;v++)this.rows[v].copy(l.rows[v])},c.isEmpty=function(){for(var l=!0,v=0;v<j;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(n.INFO,"setCursor: "+l);var v=this.rows[this.currRow];v.setCursor(l)},c.setPAC=function(l){this.logger.log(n.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 g=0;g<j;g++)this.rows[g].clear();var w=this.currRow+1-this.nrRollUpRows,O=this.lastOutputScreen;if(O){var I=O.rows[w].cueStartTime,S=this.logger.time;if(I&&S!==null&&I<S)for(var P=0;P<this.nrRollUpRows;P++)this.rows[v-this.nrRollUpRows+P+1].copy(O.rows[w+P])}}this.currRow=v;var B=this.rows[this.currRow];if(l.indent!==null){var C=l.indent,H=Math.max(C-1,0);B.setCursor(l.indent),l.color=B.chars[H].penState.foreground}var z={foreground:l.color,underline:l.underline,italics:l.italics,background:"black",flash:!1};this.setPen(z)},c.setBkgData=function(l){this.logger.log(n.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(n.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(n.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(n.INFO,"Rolling up")},c.getDisplayText=function(l){l=l||!1;for(var v=[],g="",w=-1,O=0;O<j;O++){var I=this.rows[O].getTextString();I&&(w=O+1,l?v.push("Row "+w+": '"+I+"'"):v.push(I.trim()))}return v.length>0&&(l?g="["+v.join(" | ")+"]":g=v.join(`
|
|
`)),g},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 i(v),this.nonDisplayedMemory=new i(v),this.lastOutputScreen=new i(v),this.currRollUpRow=this.displayedMemory.rows[j-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[j-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(n.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 g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(n.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(n.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},c.ccRCL=function(){this.logger.log(n.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},c.ccBS=function(){if(this.logger.log(n.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(n.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},c.ccRU=function(l){this.logger.log(n.INFO,"RU("+l+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(l)},c.ccFON=function(){this.logger.log(n.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},c.ccRDC=function(){this.logger.log(n.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},c.ccTR=function(){this.logger.log(n.INFO,"TR"),this.setMode("MODE_TEXT")},c.ccRTD=function(){this.logger.log(n.INFO,"RTD"),this.setMode("MODE_TEXT")},c.ccEDM=function(){this.logger.log(n.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},c.ccCR=function(){this.logger.log(n.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},c.ccENM=function(){this.logger.log(n.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},c.ccEOC=function(){if(this.logger.log(n.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(n.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},c.ccTO=function(l){this.logger.log(n.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 g=Math.floor(l/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=w[g]}this.logger.log(n.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 g=new a;this.channels=[null,new b(u,l,g),new b(u+1,v,g)],this.cmdHistory=E(),this.logger=g}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 g,w,O,I=!1;this.logger.time=l;for(var S=0;S<v.length;S+=2){if(w=v[S]&127,O=v[S+1]&127,w===0&&O===0)continue;if(this.logger.log(n.DATA,"["+h([v[S],v[S+1]])+"] -> ("+h([w,O])+")"),g=this.parseCmd(w,O),g||(g=this.parseMidrow(w,O)),g||(g=this.parsePAC(w,O)),g||(g=this.parseBackgroundAttributes(w,O)),!g&&(I=this.parseChars(w,O),I)){var P=this.currentChannel;if(P&&P>0){var B=this.channels[P];B.insertChars(I)}else this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!I&&this.logger.log(n.WARNING,"Couldn't parse cleaned data "+h([w,O])+" orig: "+h([v[S],v[S+1]]))}},c.parseCmd=function(l,v){var g=this.cmdHistory,w=(l===20||l===28||l===21||l===29)&&v>=32&&v<=47,O=(l===23||l===31)&&v>=33&&v<=35;if(!(w||O))return!1;if(x(l,v,g))return _(null,null,g),this.logger.log(n.DEBUG,"Repeated command ("+h([l,v])+") is dropped"),!0;var I=l===20||l===21||l===23?1:2,S=this.channels[I];return l===20||l===21||l===28||l===29?v===32?S.ccRCL():v===33?S.ccBS():v===34?S.ccAOF():v===35?S.ccAON():v===36?S.ccDER():v===37?S.ccRU(2):v===38?S.ccRU(3):v===39?S.ccRU(4):v===40?S.ccFON():v===41?S.ccRDC():v===42?S.ccTR():v===43?S.ccRTD():v===44?S.ccEDM():v===45?S.ccCR():v===46?S.ccENM():v===47&&S.ccEOC():S.ccTO(v-32),_(l,v,g),this.currentChannel=I,!0},c.parseMidrow=function(l,v){var g=0;if((l===17||l===25)&&v>=32&&v<=47){if(l===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[g];return w?(w.ccMIDROW(v),this.logger.log(n.DEBUG,"MIDROW ("+h([l,v])+")"),!0):!1}return!1},c.parsePAC=function(l,v){var g,w=this.cmdHistory,O=(l>=17&&l<=23||l>=25&&l<=31)&&v>=64&&v<=127,I=(l===16||l===24)&&v>=64&&v<=95;if(!(O||I))return!1;if(x(l,v,w))return _(null,null,w),!0;var S=l<=23?1:2;v>=64&&v<=95?g=S===1?e[l]:d[l]:g=S===1?A[l]:f[l];var P=this.channels[S];return P?(P.setPAC(this.interpretPAC(g,v)),_(l,v,w),this.currentChannel=S,!0):!1},c.interpretPAC=function(l,v){var g,w={color:null,italics:!1,indent:null,underline:!1,row:l};return v>95?g=v-96:g=v-64,w.underline=(g&1)===1,g<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((g-16)/2)*4,w},c.parseChars=function(l,v){var g,w=null,O=null;if(l>=25?(g=2,O=l-8):(g=1,O=l),O>=17&&O<=19){var I;O===17?I=v+80:O===18?I=v+112:I=v+144,this.logger.log(n.INFO,"Special char '"+D(I)+"' in channel "+g),w=[I]}else l>=32&&l<=127&&(w=v===0?[l]:[l,v]);if(w){var S=h(w);this.logger.log(n.DEBUG,"Char codes = "+S.join(",")),_(l,v,this.cmdHistory)}return w},c.parseBackgroundAttributes=function(l,v){var g=(l===16||l===24)&&v>=32&&v<=47,w=(l===23||l===31)&&v>=45&&v<=47;if(!(g||w))return!1;var O,I={};l===16||l===24?(O=Math.floor((v-32)/2),I.background=o[O],v%2===1&&(I.background=I.background+"_semi")):v===45?I.background="transparent":(I.foreground="black",v===47&&(I.underline=!0));var S=l<=23?1:2,P=this.channels[S];return P.setBkgData(I),_(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=E()},c.cueSplitAtTime=function(l){for(var v=0;v<this.channels.length;v++){var g=this.channels[v];g&&g.cueSplitAtTime(l)}},y}();function _(y,c,u){u.a=y,u.b=c}function x(y,c,u){return u.a===y&&u.b===c}function E(){return{a:null,b:null}}W.default=m},"./src/utils/codecs.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"isCodecType",function(){return L}),R.d(W,"isCodecSupportedInMp4",function(){return D});var F={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 L(j,U){var e=F[U];return!!e&&e[j.slice(0,4)]===!0}function D(j,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+j+'"')}},"./src/utils/cues.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/utils/vttparser.ts"),L=R("./src/utils/webvtt-parser.ts"),D=R("./src/utils/texttrack-utils.ts"),j=/\s/,U={newCue:function(A,d,f,o){for(var n=[],a,h,s,r,t,i=self.VTTCue||self.TextTrackCue,b=0;b<o.rows.length;b++)if(a=o.rows[b],s=!0,r=0,t="",!a.isEmpty()){for(var m=0;m<a.chars.length;m++)j.test(a.chars[m].uchar)&&s?r++:(t+=a.chars[m].uchar,s=!1);a.cueStartTime=d,d===f&&(f+=1e-4),r>=16?r--:r++;var _=Object(F.fixLineBreaks)(t.trim()),x=Object(L.generateCueId)(d,f,_);(!A||!A.cues||!A.cues.getCueById(x))&&(h=new i(d,f,_),h.id=x,h.line=b+1,h.align="left",h.position=10+Math.min(80,Math.floor(r*8/32)*10),n.push(h))}return A&&n.length&&(n.sort(function(E,y){return E.line==="auto"||y.line==="auto"?0:E.line>8&&y.line>8?y.line-E.line:E.line-y.line}),n.forEach(function(E){return Object(D.addCueToTrack)(A,E)})),n}};W.default=U},"./src/utils/discontinuities.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"findFirstFragWithCC",function(){return j}),R.d(W,"shouldAlignOnDiscontinuities",function(){return U}),R.d(W,"findDiscontinuousReferenceFrag",function(){return e}),R.d(W,"adjustSlidingStart",function(){return d}),R.d(W,"alignStream",function(){return f}),R.d(W,"alignPDT",function(){return n}),R.d(W,"alignFragmentByPDTDelta",function(){return a}),R.d(W,"alignMediaPlaylistByPDT",function(){return h});var F=R("./src/polyfills/number.ts"),L=R("./src/utils/logger.ts"),D=R("./src/controller/level-helper.ts");function j(s,r){for(var t=null,i=0,b=s.length;i<b;i++){var m=s[i];if(m&&m.cc===r){t=m;break}}return t}function U(s,r,t){return!!(r.details&&(t.endCC>t.startCC||s&&s.cc<t.startCC))}function e(s,r){var t=s.fragments,i=r.fragments;if(!i.length||!t.length){L.logger.log("No fragments to align");return}var b=j(t,i[0].cc);if(!b||b&&!b.startPTS){L.logger.log("No frag in previous level to align on");return}return b}function A(s,r){if(s){var t=s.start+r;s.start=s.startPTS=t,s.endPTS=t+s.duration}}function d(s,r){for(var t=r.fragments,i=0,b=t.length;i<b;i++)A(t[i],s);r.fragmentHint&&A(r.fragmentHint,s),r.alignedSliding=!0}function f(s,r,t){if(!r)return;o(s,t,r),!t.alignedSliding&&r.details&&n(t,r.details),!t.alignedSliding&&r.details&&!t.skippedSegments&&Object(D.adjustSliding)(r.details,t)}function o(s,r,t){if(U(s,t,r)){var i=e(t.details,r);i&&Object(F.isFiniteNumber)(i.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),d(i.start,r))}}function n(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var t=r.fragments[0].programDateTime,i=s.fragments[0].programDateTime,b=(i-t)/1e3+r.fragments[0].start;b&&Object(F.isFiniteNumber)(b)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(i-t)+"ms, sliding:"+b.toFixed(3)+" "+s.url+" "),d(b,s))}function a(s,r){var t=s.programDateTime;if(!t)return;var i=(t-r)/1e3;s.start=s.startPTS=i,s.endPTS=i+s.duration}function h(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var t=r.fragments[0].programDateTime,i=r.fragments[0].start,b=t-i*1e3;s.fragments.forEach(function(m){a(m,b)}),s.fragmentHint&&a(s.fragmentHint,b),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/utils/ewma.ts"),L=function(){function D(U,e,A){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=A,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new F.default(U),this.fast_=new F.default(e)}var j=D.prototype;return j.update=function(e,A){var d=this.slow_,f=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new F.default(e,d.getEstimate(),d.getTotalWeight())),this.fast_.halfLife!==A&&(this.fast_=new F.default(A,f.getEstimate(),f.getTotalWeight()))},j.sample=function(e,A){e=Math.max(e,this.minDelayMs_);var d=8*A,f=e/1e3,o=d/f;this.fast_.sample(f,o),this.slow_.sample(f,o)},j.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},j.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},j.destroy=function(){},D}();W.default=L},"./src/utils/ewma.ts":function(ee,W,R){"use strict";R.r(W);var F=function(){function L(j,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=j,this.alpha_=j?Math.exp(Math.log(.5)/j):0,this.estimate_=U,this.totalWeight_=e}var D=L.prototype;return D.sample=function(U,e){var A=Math.pow(this.alpha_,U);this.estimate_=e*(1-A)+A*this.estimate_,this.totalWeight_+=U},D.getTotalWeight=function(){return this.totalWeight_},D.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},L}();W.default=F},"./src/utils/fetch-loader.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"fetchSupported",function(){return a});var F=R("./src/polyfills/number.ts"),L=R("./src/loader/load-stats.ts"),D=R("./src/demux/chunk-cache.ts");function j(i,b){i.prototype=Object.create(b.prototype),i.prototype.constructor=i,f(i,b)}function U(i){var b=typeof Map=="function"?new Map:void 0;return U=function(_){if(_===null||!d(_))return _;if(typeof _!="function")throw new TypeError("Super expression must either be null or a function");if(typeof b!="undefined"){if(b.has(_))return b.get(_);b.set(_,x)}function x(){return e(_,arguments,o(this).constructor)}return x.prototype=Object.create(_.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),f(x,_)},U(i)}function e(i,b,m){return A()?e=Reflect.construct:e=function(x,E,y){var c=[null];c.push.apply(c,E);var u=Function.bind.apply(x,c),l=new u;return y&&f(l,y.prototype),l},e.apply(null,arguments)}function A(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function d(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function f(i,b){return f=Object.setPrototypeOf||function(_,x){return _.__proto__=x,_},f(i,b)}function o(i){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},o(i)}function n(){return n=Object.assign||function(i){for(var b=1;b<arguments.length;b++){var m=arguments[b];for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(i[_]=m[_])}return i},n.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(i){}return!1}var h=function(){function i(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||r,this.controller=new self.AbortController,this.stats=new L.LoadStats}var b=i.prototype;return b.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},b.abortInternal=function(){var _=this.response;(!_||!_.ok)&&(this.stats.aborted=!0,this.controller.abort())},b.abort=function(){var _;this.abortInternal(),(_=this.callbacks)!==null&&_!==void 0&&_.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},b.load=function(_,x,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(_,this.controller.signal),l=E.onProgress,v=_.responseType==="arraybuffer",g=v?"byteLength":"length";this.context=_,this.config=x,this.callbacks=E,this.request=this.fetchSetup(_,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){y.abortInternal(),E.onTimeout(c,_,y.response)},x.timeout),self.fetch(this.request).then(function(w){if(y.response=y.loader=w,!w.ok){var O=w.status,I=w.statusText;throw new t(I||"fetch, bad network response",O,w)}return c.loading.first=Math.max(self.performance.now(),c.loading.start),c.total=parseInt(w.headers.get("Content-Length")||"0"),l&&Object(F.isFiniteNumber)(x.highWaterMark)?y.loadProgressively(w,c,_,x.highWaterMark,l):v?w.arrayBuffer():w.text()}).then(function(w){var O=y.response;self.clearTimeout(y.requestTimeout),c.loading.end=Math.max(self.performance.now(),c.loading.first),c.loaded=c.total=w[g];var I={url:O.url,data:w};l&&!Object(F.isFiniteNumber)(x.highWaterMark)&&l(c,_,w,O),E.onSuccess(I,c,_,O)}).catch(function(w){if(self.clearTimeout(y.requestTimeout),c.aborted)return;var O=w.code||0;E.onError({code:O,text:w.message},_,w.details)})},b.getCacheAge=function(){var _=null;if(this.response){var x=this.response.headers.get("age");_=x?parseFloat(x):null}return _},b.loadProgressively=function(_,x,E,y,c){y===void 0&&(y=0);var u=new D.default,l=_.body.getReader(),v=function g(){return l.read().then(function(w){if(w.done)return u.dataLength&&c(x,E,u.flush(),_),Promise.resolve(new ArrayBuffer(0));var O=w.value,I=O.length;return x.loaded+=I,I<y||u.dataLength?(u.push(O),u.dataLength>=y&&c(x,E,u.flush(),_)):c(x,E,O,_),g()}).catch(function(){return Promise.reject()})};return v()},i}();function s(i,b){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:b,headers:new self.Headers(n({},i.headers))};return i.rangeEnd&&m.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),m}function r(i,b){return new self.Request(i.url,b)}var t=function(i){j(b,i);function b(m,_,x){var E;return E=i.call(this,m)||this,E.code=void 0,E.details=void 0,E.code=_,E.details=x,E}return b}(U(Error));W.default=h},"./src/utils/imsc1-ttml-parser.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"IMSC1_CODEC",function(){return d}),R.d(W,"parseIMSC1",function(){return a});var F=R("./src/utils/mp4-tools.ts"),L=R("./src/utils/vttparser.ts"),D=R("./src/utils/vttcue.ts"),j=R("./src/demux/id3.ts"),U=R("./src/utils/timescale-conversion.ts"),e=R("./src/utils/webvtt-parser.ts");function A(){return A=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},A.apply(this,arguments)}var d="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,o=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,n={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(y,c,u,l,v){var g=Object(F.findBox)(new Uint8Array(y),["mdat"]);if(g.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var w=g[0],O=Object(j.utf8ArrayToStr)(new Uint8Array(y,w.start,w.end-w.start)),I=Object(U.toTimescaleFromScale)(c,1,u);try{l(h(O,I))}catch(S){v(S)}}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 g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(g).reduce(function(B,C){return B[C]=v.getAttribute("ttp:"+C)||g[C],B},{}),O=v.getAttribute("xml:space")!=="preserve",I=r(s(v,"styling","style")),S=r(s(v,"layout","region")),P=s(v,"body","[begin]");return[].map.call(P,function(B){var C=t(B,O);if(!C||!B.hasAttribute("begin"))return null;var H=_(B.getAttribute("begin"),w),z=_(B.getAttribute("dur"),w),Z=_(B.getAttribute("end"),w);if(H===null)throw m(B);if(Z===null){if(z===null)throw m(B);Z=H+z}var Q=new D.default(H-c,Z-c,C);Q.id=Object(e.generateCueId)(Q.startTime,Q.endTime,Q.text);var pe=S[B.getAttribute("region")],le=I[B.getAttribute("style")];Q.position=10,Q.size=80;var de=i(pe,le),ce=de.textAlign;if(ce){var me=n[ce];me&&(Q.lineAlign=me),Q.align=ce}return A(Q,de),Q}).filter(function(B){return B!==null})}function s(y,c,u){var l=y.getElementsByTagName(c)[0];return l?[].slice.call(l.querySelectorAll(u)):[]}function r(y){return y.reduce(function(c,u){var l=u.getAttribute("xml:id");return l&&(c[l]=u),c},{})}function t(y,c){return[].slice.call(y.childNodes).reduce(function(u,l,v){var g;return l.nodeName==="br"&&v?u+`
|
|
`:(g=l.childNodes)!==null&&g!==void 0&&g.length?t(l,c):c?u+l.textContent.trim().replace(/\s+/g," "):u+l.textContent},"")}function i(y,c){var u="http://www.w3.org/ns/ttml#styling",l=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return l.reduce(function(v,g){var w=b(c,u,g)||b(y,u,g);return w&&(v[g]=w),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 _(y,c){if(!y)return null;var u=Object(L.parseTimeStamp)(y);return u===null&&(f.test(y)?u=x(y,c):o.test(y)&&(u=E(y,c))),u}function x(y,c){var u=f.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 E(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(ee,W,R){"use strict";R.r(W),R.d(W,"enableLogs",function(){return e}),R.d(W,"logger",function(){return A});var F=function(){},L={trace:F,debug:F,log:F,warn:F,info:F,error:F},D=L;function j(d){var f=self.console[d];return f?f.bind(self.console,"["+d+"] >"):F}function U(d){for(var f=arguments.length,o=new Array(f>1?f-1:0),n=1;n<f;n++)o[n-1]=arguments[n];o.forEach(function(a){D[a]=d[a]?d[a].bind(d):j(a)})}function e(d){if(self.console&&d===!0||typeof d=="object"){U(d,"debug","log","info","warn","error");try{D.log()}catch(f){D=L}}else D=L}var A=D},"./src/utils/mediakeys-helper.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"KeySystems",function(){return F}),R.d(W,"requestMediaKeySystemAccess",function(){return L});var F;(function(D){D.WIDEVINE="com.widevine.alpha",D.PLAYREADY="com.microsoft.playready"})(F||(F={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"getMediaSource",function(){return F});function F(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"bin2str",function(){return U}),R.d(W,"readUint16",function(){return e}),R.d(W,"readUint32",function(){return A}),R.d(W,"writeUint32",function(){return d}),R.d(W,"findBox",function(){return f}),R.d(W,"parseSegmentIndex",function(){return o}),R.d(W,"parseInitSegment",function(){return n}),R.d(W,"getStartDTS",function(){return a}),R.d(W,"getDuration",function(){return h}),R.d(W,"computeRawDurationFromSamples",function(){return s}),R.d(W,"offsetStartDTS",function(){return r}),R.d(W,"segmentValidRange",function(){return t}),R.d(W,"appendUint8Array",function(){return i});var F=R("./src/utils/typed-array.ts"),L=R("./src/loader/fragment.ts"),D=Math.pow(2,32)-1,j=[].push;function U(b){return String.fromCharCode.apply(null,b)}function e(b,m){"data"in b&&(m+=b.start,b=b.data);var _=b[m]<<8|b[m+1];return _<0?65536+_:_}function A(b,m){"data"in b&&(m+=b.start,b=b.data);var _=b[m]<<24|b[m+1]<<16|b[m+2]<<8|b[m+3];return _<0?4294967296+_:_}function d(b,m,_){"data"in b&&(m+=b.start,b=b.data),b[m]=_>>24,b[m+1]=_>>16&255,b[m+2]=_>>8&255,b[m+3]=_&255}function f(b,m){var _=[];if(!m.length)return _;var x,E,y;"data"in b?(x=b.data,E=b.start,y=b.end):(x=b,E=0,y=x.byteLength);for(var c=E;c<y;){var u=A(x,c),l=U(x.subarray(c+4,c+8)),v=u>1?c+u:y;if(l===m[0])if(m.length===1)_.push({data:x,start:c+8,end:v});else{var g=f({data:x,start:c+8,end:v},m.slice(1));g.length&&j.apply(_,g)}c=v}return _}function o(b){var m=f(b,["moov"]),_=m[0],x=_?_.end:null,E=f(b,["sidx"]);if(!E||!E[0])return null;var y=[],c=E[0],u=c.data[0],l=u===0?8:16,v=A(c,l);l+=4;var g=0,w=0;u===0?l+=8:l+=16,l+=2;var O=c.end+w,I=e(c,l);l+=2;for(var S=0;S<I;S++){var P=l,B=A(c,P);P+=4;var C=B&2147483647,H=(B&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var z=A(c,P);P+=4,y.push({referenceSize:C,subsegmentDuration:z,info:{duration:z/v,start:O,end:O+C-1}}),O+=C,P+=4,l=P}return{earliestPresentationTime:g,timescale:v,version:u,referencesCount:I,references:y,moovEndOffset:x}}function n(b){for(var m=[],_=f(b,["moov","trak"]),x=0;x<_.length;x++){var E=_[x],y=f(E,["tkhd"])[0];if(y){var c=y.data[y.start],u=c===0?12:20,l=A(y,u),v=f(E,["mdia","mdhd"])[0];if(v){c=v.data[v.start],u=c===0?12:20;var g=A(v,u),w=f(E,["mdia","hdlr"])[0];if(w){var O=U(w.data.subarray(w.start+8,w.start+12)),I={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[O];if(I){var S=f(E,["mdia","minf","stbl","stsd"])[0],P=void 0;S&&(P=U(S.data.subarray(S.start+12,S.start+16))),m[l]={timescale:g,type:I},m[I]={timescale:g,id:l,codec:P}}}}}}var B=f(b,["moov","mvex","trex"]);return B.forEach(function(C){var H=A(C,4),z=m[H];z&&(z.default={duration:A(C,12),flags:A(C,20)})}),m}function a(b,m){return f(m,["moof","traf"]).reduce(function(_,x){var E=f(x,["tfdt"])[0],y=E.data[E.start],c=f(x,["tfhd"]).reduce(function(u,l){var v=A(l,4),g=b[v];if(g){var w=A(E,4);y===1&&(w*=Math.pow(2,32),w+=A(E,8));var O=g.timescale||9e4,I=w/O;if(isFinite(I)&&(u===null||I<u))return I}return u},null);return c!==null&&isFinite(c)&&(_===null||c<_)?c:_},null)||0}function h(b,m){for(var _=0,x=0,E=0,y=f(b,["moof","traf"]),c=0;c<y.length;c++){var u=y[c],l=f(u,["tfhd"])[0],v=A(l,4),g=m[v];if(!g)continue;var w=g.default,O=A(l,0)|(w==null?void 0:w.flags),I=w==null?void 0:w.duration;O&8&&(O&2?I=A(l,12):I=A(l,8));for(var S=g.timescale||9e4,P=f(u,["trun"]),B=0;B<P.length;B++){if(I){var C=A(P[B],4);_=I*C}else _=s(P[B]);g.type===L.ElementaryStreamTypes.VIDEO?x+=_/S:g.type===L.ElementaryStreamTypes.AUDIO&&(E+=_/S)}}if(x===0&&E===0){var H=o(b);if(H!=null&&H.references)return H.references.reduce(function(z,Z){return z+Z.info.duration||0},0)}return x||E}function s(b){var m=A(b,0),_=8;m&1&&(_+=4),m&4&&(_+=4);for(var x=0,E=A(b,4),y=0;y<E;y++){if(m&256){var c=A(b,_);x+=c,_+=4}m&512&&(_+=4),m&1024&&(_+=4),m&2048&&(_+=4)}return x}function r(b,m,_){f(m,["moof","traf"]).forEach(function(x){f(x,["tfhd"]).forEach(function(E){var y=A(E,4),c=b[y];if(!c)return;var u=c.timescale||9e4;f(x,["tfdt"]).forEach(function(l){var v=l.data[l.start],g=A(l,4);if(v===0)d(l,4,g-_*u);else{g*=Math.pow(2,32),g+=A(l,8),g-=_*u,g=Math.max(g,0);var w=Math.floor(g/(D+1)),O=Math.floor(g%(D+1));d(l,4,w),d(l,8,O)}})})})}function t(b){var m={valid:null,remainder:null},_=f(b,["moof"]);if(_){if(_.length<2)return m.remainder=b,m}else return m;var x=_[_.length-1];return m.valid=Object(F.sliceUint8)(b,0,x.start-8),m.remainder=Object(F.sliceUint8)(b,x.start-8),m}function i(b,m){var _=new Uint8Array(b.length+m.length);return _.set(b),_.set(m,b.length),_}},"./src/utils/output-filter.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"default",function(){return F});var F=function(){function L(j,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=j,this.trackName=U}var D=L.prototype;return D.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},D.newCue=function(U,e,A){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=e,this.screen=A,this.timelineController.createCaptionsTrack(this.trackName)},D.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"sendAddTrackEvent",function(){return L}),R.d(W,"addCueToTrack",function(){return D}),R.d(W,"clearCurrentCues",function(){return j}),R.d(W,"removeCuesInRange",function(){return U}),R.d(W,"getCuesInRange",function(){return A});var F=R("./src/utils/logger.ts");function L(d,f){var o;try{o=new Event("addtrack")}catch(n){o=document.createEvent("Event"),o.initEvent("addtrack",!1,!1)}o.track=d,f.dispatchEvent(o)}function D(d,f){var o=d.mode;if(o==="disabled"&&(d.mode="hidden"),d.cues&&!d.cues.getCueById(f.id))try{if(d.addCue(f),!d.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(a){F.logger.debug("[texttrack-utils]: "+a);var n=new self.TextTrackCue(f.startTime,f.endTime,f.text);n.id=f.id,d.addCue(n)}o==="disabled"&&(d.mode=o)}function j(d){var f=d.mode;if(f==="disabled"&&(d.mode="hidden"),d.cues)for(var o=d.cues.length;o--;)d.removeCue(d.cues[o]);f==="disabled"&&(d.mode=f)}function U(d,f,o){var n=d.mode;if(n==="disabled"&&(d.mode="hidden"),d.cues&&d.cues.length>0)for(var a=A(d.cues,f,o),h=0;h<a.length;h++)d.removeCue(a[h]);n==="disabled"&&(d.mode=n)}function e(d,f){if(f<d[0].startTime)return 0;var o=d.length-1;if(f>d[o].endTime)return-1;for(var n=0,a=o;n<=a;){var h=Math.floor((a+n)/2);if(f<d[h].startTime)a=h-1;else if(f>d[h].startTime&&n<o)n=h+1;else return h}return d[n].startTime-f<f-d[a].startTime?n:a}function A(d,f,o){var n=[],a=e(d,f);if(a>-1)for(var h=a,s=d.length;h<s;h++){var r=d[h];if(r.startTime>=f&&r.endTime<=o)n.push(r);else if(r.startTime>o)return n}return n}},"./src/utils/time-ranges.ts":function(ee,W,R){"use strict";R.r(W);var F={toString:function(D){for(var j="",U=D.length,e=0;e<U;e++)j+="["+D.start(e).toFixed(3)+","+D.end(e).toFixed(3)+"]";return j}};W.default=F},"./src/utils/timescale-conversion.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"toTimescaleFromBase",function(){return L}),R.d(W,"toTimescaleFromScale",function(){return D}),R.d(W,"toMsFromMpegTsClock",function(){return j}),R.d(W,"toMpegTsClockFromTimescale",function(){return U});var F=9e4;function L(e,A,d,f){d===void 0&&(d=1),f===void 0&&(f=!1);var o=e*A*d;return f?Math.round(o):o}function D(e,A,d,f){return d===void 0&&(d=1),f===void 0&&(f=!1),L(e,A,1/d,f)}function j(e,A){return A===void 0&&(A=!1),L(e,1e3,1/F,A)}function U(e,A){return A===void 0&&(A=1),L(e,F,1/A)}},"./src/utils/typed-array.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"sliceUint8",function(){return F});function F(L,D,j){return Uint8Array.prototype.slice?L.slice(D,j):new Uint8Array(Array.prototype.slice.call(L,D,j))}},"./src/utils/vttcue.ts":function(ee,W,R){"use strict";R.r(W),W.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var F=["","lr","rl"],L=["start","middle","end","left","right"];function D(d,f){if(typeof f!="string")return!1;if(!Array.isArray(d))return!1;var o=f.toLowerCase();return~d.indexOf(o)?o:!1}function j(d){return D(F,d)}function U(d){return D(L,d)}function e(d){for(var f=arguments.length,o=new Array(f>1?f-1:0),n=1;n<f;n++)o[n-1]=arguments[n];for(var a=1;a<arguments.length;a++){var h=arguments[a];for(var s in h)d[s]=h[s]}return d}function A(d,f,o){var n=this,a={enumerable:!0};n.hasBeenReset=!1;var h="",s=!1,r=d,t=f,i=o,b=null,m="",_=!0,x="auto",E="start",y=50,c="middle",u=50,l="middle";Object.defineProperty(n,"id",e({},a,{get:function(){return h},set:function(g){h=""+g}})),Object.defineProperty(n,"pauseOnExit",e({},a,{get:function(){return s},set:function(g){s=!!g}})),Object.defineProperty(n,"startTime",e({},a,{get:function(){return r},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");r=g,this.hasBeenReset=!0}})),Object.defineProperty(n,"endTime",e({},a,{get:function(){return t},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");t=g,this.hasBeenReset=!0}})),Object.defineProperty(n,"text",e({},a,{get:function(){return i},set:function(g){i=""+g,this.hasBeenReset=!0}})),Object.defineProperty(n,"region",e({},a,{get:function(){return b},set:function(g){b=g,this.hasBeenReset=!0}})),Object.defineProperty(n,"vertical",e({},a,{get:function(){return m},set:function(g){var w=j(g);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=w,this.hasBeenReset=!0}})),Object.defineProperty(n,"snapToLines",e({},a,{get:function(){return _},set:function(g){_=!!g,this.hasBeenReset=!0}})),Object.defineProperty(n,"line",e({},a,{get:function(){return x},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");x=g,this.hasBeenReset=!0}})),Object.defineProperty(n,"lineAlign",e({},a,{get:function(){return E},set:function(g){var w=U(g);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");E=w,this.hasBeenReset=!0}})),Object.defineProperty(n,"position",e({},a,{get:function(){return y},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");y=g,this.hasBeenReset=!0}})),Object.defineProperty(n,"positionAlign",e({},a,{get:function(){return c},set:function(g){var w=U(g);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");c=w,this.hasBeenReset=!0}})),Object.defineProperty(n,"size",e({},a,{get:function(){return u},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");u=g,this.hasBeenReset=!0}})),Object.defineProperty(n,"align",e({},a,{get:function(){return l},set:function(g){var w=U(g);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");l=w,this.hasBeenReset=!0}})),n.displayState=void 0}return A.prototype.getCueAsHTML=function(){var d=self.WebVTT;return d.convertCueToDOMTree(self,this.text)},A}()},"./src/utils/vttparser.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"parseTimeStamp",function(){return D}),R.d(W,"fixLineBreaks",function(){return f}),R.d(W,"VTTParser",function(){return o});var F=R("./src/utils/vttcue.ts"),L=function(){function n(){}var a=n.prototype;return a.decode=function(s,r){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},n}();function D(n){function a(s,r,t,i){return(s|0)*3600+(r|0)*60+(t|0)+parseFloat(i||0)}var h=n.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return h?parseFloat(h[2])>59?a(h[2],h[3],0,h[4]):a(h[1],h[2],h[3],h[4]):null}var j=function(){function n(){this.values=Object.create(null)}var a=n.prototype;return a.set=function(s,r){!this.get(s)&&r!==""&&(this.values[s]=r)},a.get=function(s,r,t){return t?this.has(s)?this.values[s]:r[t]:this.has(s)?this.values[s]:r},a.has=function(s){return s in this.values},a.alt=function(s,r,t){for(var i=0;i<t.length;++i)if(r===t[i]){this.set(s,r);break}},a.integer=function(s,r){/^-?\d+$/.test(r)&&this.set(s,parseInt(r,10))},a.percent=function(s,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var t=parseFloat(r);if(t>=0&&t<=100)return this.set(s,t),!0}return!1},n}();function U(n,a,h,s){var r=s?n.split(s):[n];for(var t in r){if(typeof r[t]!="string")continue;var i=r[t].split(h);if(i.length!==2)continue;var b=i[0],m=i[1];a(b,m)}}var e=new F.default(0,0,""),A=e.align==="middle"?"middle":"center";function d(n,a,h){var s=n;function r(){var b=D(n);if(b===null)throw new Error("Malformed timestamp: "+s);return n=n.replace(/^[^\sa-zA-Z-]+/,""),b}function t(b,m){var _=new j;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){_.set(y,h[l].region);break}break;case"vertical":_.alt(y,c,["rl","lr"]);break;case"line":u=c.split(","),_.integer(y,u[0]),_.percent(y,u[0])&&_.set("snapToLines",!1),_.alt(y,u[0],["auto"]),u.length===2&&_.alt("lineAlign",u[1],["start",A,"end"]);break;case"position":u=c.split(","),_.percent(y,u[0]),u.length===2&&_.alt("positionAlign",u[1],["start",A,"end","line-left","line-right","auto"]);break;case"size":_.percent(y,c);break;case"align":_.alt(y,c,["start",A,"end","left","right"]);break}},/:/,/\s/),m.region=_.get("region",null),m.vertical=_.get("vertical","");var x=_.get("line","auto");x==="auto"&&e.line===-1&&(x=-1),m.line=x,m.lineAlign=_.get("lineAlign","start"),m.snapToLines=_.get("snapToLines",!0),m.size=_.get("size",100),m.align=_.get("align",A);var E=_.get("position","auto");E==="auto"&&e.position===50&&(E=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=E}function i(){n=n.replace(/^\s+/,"")}if(i(),a.startTime=r(),i(),n.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);n=n.substr(3),i(),a.endTime=r(),i(),t(n,a)}function f(n){return n.replace(/<br(?: \/)?>/gi,`
|
|
`)}var o=function(){function n(){this.state="INITIAL",this.buffer="",this.decoder=new L,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=n.prototype;return a.parse=function(s){var r=this;s&&(r.buffer+=r.decoder.decode(s,{stream:!0}));function t(){var E=r.buffer,y=0;for(E=f(E);y<E.length&&E[y]!=="\r"&&E[y]!==`
|
|
`;)++y;var c=E.substr(0,y);return E[y]==="\r"&&++y,E[y]===`
|
|
`&&++y,r.buffer=E.substr(y),c}function i(E){U(E,function(y,c){},/:/)}try{var b="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;b=t();var m=b.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var _=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;_?_=!1:b=t();switch(r.state){case"HEADER":/:/.test(b)?i(b):b||(r.state="ID");continue;case"NOTE":b||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(b)){r.state="NOTE";break}if(!b)continue;if(r.cue=new F.default(0,0,""),r.state="CUE",b.indexOf("-->")===-1){r.cue.id=b;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{d(b,r.cue,r.regionList)}catch(E){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var x=b.indexOf("-->")!==-1;if(!b||x&&(_=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
|
|
`),r.cue.text+=b}continue;case"BADCUE":b||(r.state="ID")}}}catch(E){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.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(r){s.onparsingerror&&s.onparsingerror(r)}return s.onflush&&s.onflush(),this},n}()},"./src/utils/webvtt-parser.ts":function(ee,W,R){"use strict";R.r(W),R.d(W,"generateCueId",function(){return o}),R.d(W,"parseWebVTT",function(){return a});var F=R("./src/polyfills/number.ts"),L=R("./src/utils/vttparser.ts"),D=R("./src/demux/id3.ts"),j=R("./src/utils/timescale-conversion.ts"),U=R("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,A=function(s,r,t){return t===void 0&&(t=0),s.substr(t,r.length)===r},d=function(s){var r=parseInt(s.substr(-3)),t=parseInt(s.substr(-6,2)),i=parseInt(s.substr(-9,2)),b=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(F.isFiniteNumber)(r)||!Object(F.isFiniteNumber)(t)||!Object(F.isFiniteNumber)(i)||!Object(F.isFiniteNumber)(b))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return r+=1e3*t,r+=60*1e3*i,r+=60*60*1e3*b,r},f=function(s){for(var r=5381,t=s.length;t;)r=r*33^s.charCodeAt(--t);return(r>>>0).toString()};function o(h,s,r){return f(h.toString())+f(s.toString())+f(r)}var n=function(s,r,t){var i=s[r],b=s[i.prevCC];if(!b||!b.new&&i.new){s.ccOffset=s.presentationOffset=i.start,i.new=!1;return}for(;(m=b)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=i.start-b.start,i.new=!1,i=b,b=s[i.prevCC]}s.presentationOffset=t};function a(h,s,r,t,i,b,m,_){var x=new L.VTTParser,E=Object(D.utf8ArrayToStr)(new Uint8Array(h)).trim().replace(e,`
|
|
`).split(`
|
|
`),y=[],c=Object(j.toMpegTsClockFromTimescale)(s,r),u="00:00.000",l=0,v=0,g,w=!0,O=!1;x.oncue=function(I){var S=t[i],P=t.ccOffset,B=(l-c)/9e4;if(S!=null&&S.new&&(v!==void 0?P=t.ccOffset=S.start:n(t,i,B)),B&&(P=B-t.presentationOffset),O){var C=I.endTime-I.startTime,H=Object(U.normalizePts)((I.startTime+P-v)*9e4,b*9e4)/9e4;I.startTime=H,I.endTime=H+C}var z=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(z)),I.id||(I.id=o(I.startTime,I.endTime,z)),I.endTime>0&&y.push(I)},x.onparsingerror=function(I){g=I},x.onflush=function(){if(g){_(g);return}m(y)},E.forEach(function(I){if(w)if(A(I,"X-TIMESTAMP-MAP=")){w=!1,O=!0,I.substr(16).split(",").forEach(function(S){A(S,"LOCAL:")?u=S.substr(6):A(S,"MPEGTS:")&&(l=parseInt(S.substr(7)))});try{v=d(u)/1e3}catch(S){O=!1,g=S}return}else I===""&&(w=!1);x.parse(I+`
|
|
`)}),x.flush()}},"./src/utils/xhr-loader.ts":function(ee,W,R){"use strict";R.r(W);var F=R("./src/utils/logger.ts"),L=R("./src/loader/load-stats.ts"),D=/^age:\s*[\d.]+\s*$/m,j=function(){function U(A){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=A?A.xhrSetup:null,this.stats=new L.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 d=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),d&&(d.onreadystatechange=null,d.onprogress=null,d.readyState!==4&&(this.stats.aborted=!0,d.abort()))},e.abort=function(){var d;this.abortInternal(),(d=this.callbacks)!==null&&d!==void 0&&d.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(d,f,o){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=d,this.config=f,this.callbacks=o,this.retryDelay=f.retryDelay,this.loadInternal()},e.loadInternal=function(){var d=this.config,f=this.context;if(!d)return;var o=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var a=this.xhrSetup;try{if(a)try{a(o,f.url)}catch(r){o.open("GET",f.url,!0),a(o,f.url)}o.readyState||o.open("GET",f.url,!0);var h=this.context.headers;if(h)for(var s in h)o.setRequestHeader(s,h[s])}catch(r){this.callbacks.onError({code:o.status,text:r.message},f,o);return}f.rangeEnd&&o.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),d.timeout),o.send()},e.readystatechange=function(){var d=this.context,f=this.loader,o=this.stats;if(!d||!f)return;var n=f.readyState,a=this.config;if(o.aborted)return;if(n>=2)if(self.clearTimeout(this.requestTimeout),o.loading.first===0&&(o.loading.first=Math.max(self.performance.now(),o.loading.start)),n===4){f.onreadystatechange=null,f.onprogress=null;var h=f.status;if(h>=200&&h<300){o.loading.end=Math.max(self.performance.now(),o.loading.first);var s,r;if(d.responseType==="arraybuffer"?(s=f.response,r=s.byteLength):(s=f.responseText,r=s.length),o.loaded=o.total=r,!this.callbacks)return;var t=this.callbacks.onProgress;if(t&&t(o,d,s,f),!this.callbacks)return;var i={url:f.responseURL,data:s};this.callbacks.onSuccess(i,o,d,f)}else o.retry>=a.maxRetry||h>=400&&h<499?(F.logger.error(h+" while loading "+d.url),this.callbacks.onError({code:h,text:f.statusText},d,f)):(F.logger.warn(h+" while loading "+d.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,a.maxRetryDelay),o.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},e.loadtimeout=function(){F.logger.warn("timeout while loading "+this.context.url);var d=this.callbacks;d&&(this.abortInternal(),d.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(d){var f=this.stats;f.loaded=d.loaded,d.lengthComputable&&(f.total=d.total)},e.getCacheAge=function(){var d=null;if(this.loader&&D.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");d=f?parseFloat(f):null}return d},U}();W.default=j}}).default})},vHTk:function(Ge,oe,K){Ge.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|