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.
403 lines
1.1 MiB
403 lines
1.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[196,5,7,8,13],{"+ua5":function(qe,ve,U){},"+vTd":function(qe,ve,U){qe.exports={flex_box_center:"flex_box_center___37CPQ",flex_space_between:"flex_space_between___1yzV5",flex_box_vertical_center:"flex_box_vertical_center___2QH_C",flex_box_center_end:"flex_box_center_end___22kLi",flex_box_column:"flex_box_column___1Y3On",line:"line___-rzSr",b1:"b1___1zz_c",b2:"b2___1dAOW",list:"list___1gpez",title:"title___21uOv",tr:"tr___3kTJL",itemDetail:"itemDetail___8QmqJ",answerWrapper:"answerWrapper___3guKO",decoration:"decoration___1rcYW",row:"row___3uQSh",typeRow:"typeRow___ADZSj",type:"type___2pfNZ",typeName:"typeName___8ZhPv",typeIcon:"typeIcon___1Xniv",unpublished:"unpublished___dTXTI",private:"private___XQiDx",public:"public___iIFou",reviewFlag:"reviewFlag___YP4vk",typeRightAction:"typeRightAction___1PQjp",actionLink:"actionLink___2E5q_",actionIcon:"actionIcon___GCvNK",topicTitle:"topicTitle___3fJds",topicTitleContent:"topicTitleContent___35cf9",judgmentContent:"judgmentContent___SU5rV",programContent:"programContent___3G6-D",otherContent:"otherContent___1JHnX",combinationContent:"combinationContent___6ZXO-",con:"con___1_qCl",otherContentItem:"otherContentItem___18WrV",otehrContentHtml:"otehrContentHtml___LW3nV",difficultyRow:"difficultyRow___3HvT0",updateTimeRow:"updateTimeRow___1dNd0",updateTimeWrap:"updateTimeWrap___2PKks",updateTimeContent:"updateTimeContent___1mNBy",programLanguage:"programLanguage___3CnaJ",updateTimeRowAction:"updateTimeRowAction___1DaMt",bottomAction:"bottomAction___Y-BNC",borderColorBlue:"borderColorBlue___2Xd-0",borderColorRed:"borderColorRed___2zA_q",borderColorFFF:"borderColorFFF___2R5-5",borderColorGray:"borderColorGray___nZnDe",selectIcon:"selectIcon___2byLd",colorGreen:"colorGreen___1iOKR",parseAnswerBorder:"parseAnswerBorder___1LTYn",answer:"answer___2L9lv",answerHtml:"answerHtml___3zrOk",parse:"parse___3d3dm",parseText:"parseText___1C_VL",parseAnswer:"parseAnswer___QMVPC",parseAnswerHtml:"parseAnswerHtml___2TCVz",actionBar:"actionBar___2ItMN",know:"know___y8QKK",menu:"menu___SYdg7",bottom:"bottom___2dFIa",textBtn:"textBtn___1y00f"}},"+z73":function(qe,ve,U){qe.exports={flex_box_center:"flex_box_center___3WSrc",flex_space_between:"flex_space_between___1fpCp",flex_box_vertical_center:"flex_box_vertical_center___3Wy8W",flex_box_center_end:"flex_box_center_end___3YIs2",flex_box_column:"flex_box_column___3CNwR",pWrap:"pWrap___2jVbQ",few:"few___3Eebn"}},"/cxE":function(qe,ve,U){"use strict";U.d(ve,"f",function(){return O}),U.d(ve,"g",function(){return k}),U.d(ve,"h",function(){return w}),U.d(ve,"e",function(){return B}),U.d(ve,"b",function(){return M}),U.d(ve,"c",function(){return e}),U.d(ve,"d",function(){return C}),U.d(ve,"a",function(){return y});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(c){setTimeout(()=>{throw c.stack?new Error(c.message+`
|
|
|
|
`+c.stack):c},0)}}emit(c){this.listeners.forEach(d=>{d(c)})}onUnexpectedError(c){this.unexpectedErrorHandler(c),this.emit(c)}onUnexpectedExternalError(c){this.unexpectedErrorHandler(c)}}const W=new ne;function O(c){B(c)||W.onUnexpectedError(c);return}function k(c){B(c)||W.onUnexpectedExternalError(c);return}function w(c){if(c instanceof Error){let{name:d,message:a}=c;const i=c.stacktrace||c.stack;return{$isError:!0,name:d,message:a,stack:i}}return c}const D="Canceled";function B(c){return c instanceof Error&&c.name===D&&c.message===D}function M(){const c=new Error(D);return c.name=c.message,c}function e(c){return c?new Error(`Illegal argument: ${c}`):new Error("Illegal argument")}function C(c){return c?new Error(`Illegal state: ${c}`):new Error("Illegal state")}class y extends Error{constructor(c){super("NotSupported");c&&(this.message=c)}}},"1vnw":function(qe,ve,U){qe.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(qe,ve,U){"use strict";U.d(ve,"a",function(){return W});class ne{constructor(O){this.element=O,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class W{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let O=this._first;for(;O!==ne.Undefined;){const k=O.next;O.prev=ne.Undefined,O.next=ne.Undefined,O=k}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(O){return this._insert(O,!1)}push(O){return this._insert(O,!0)}_insert(O,k){const w=new ne(O);if(this._first===ne.Undefined)this._first=w,this._last=w;else if(k){const B=this._last;this._last=w,w.prev=B,B.next=w}else{const B=this._first;this._first=w,w.next=B,B.prev=w}this._size+=1;let D=!1;return()=>{D||(D=!0,this._remove(w))}}shift(){if(this._first===ne.Undefined)return;{const O=this._first.element;return this._remove(this._first),O}}pop(){if(this._last===ne.Undefined)return;{const O=this._last.element;return this._remove(this._last),O}}_remove(O){if(O.prev!==ne.Undefined&&O.next!==ne.Undefined){const k=O.prev;k.next=O.next,O.next.prev=k}else O.prev===ne.Undefined&&O.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):O.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):O.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let O=this._first;for(;O!==ne.Undefined;)yield O.element,O=O.next}}},"3/fG":function(qe,ve,U){"use strict";U.d(ve,"a",function(){return W});function ne(O,k){let w;return k.length===0?w=O:w=O.replace(/\{(\d+)\}/g,function(D,B){const M=B[0];return typeof k[M]!="undefined"?k[M]:D}),w}function W(O,k,...w){return ne(k,w)}},"5VLF":function(qe,ve,U){"use strict";var ne,W;function O(k,w,D){var B=function(M,e){return k.js_beautify(M,e)};return B.js=k.js_beautify,B.css=w.css_beautify,B.html=D.html_beautify,B.js_beautify=k.js_beautify,B.css_beautify=w.css_beautify,B.html_beautify=D.html_beautify,B}!(ne=[U("6UM0"),U("TXwP"),U("psGv")],W=function(k,w,D){return O(k,w,D)}.apply(ve,ne),W!==void 0&&(qe.exports=W))},"5Y4S":function(qe,ve,U){"use strict";U.d(ve,"a",function(){return O});var ne=U("MNsG");const W=ne.b.performance&&typeof ne.b.performance.now=="function";class O{constructor(k){this._highResolution=W&&k,this._startTime=this._now(),this._stopTime=-1}static create(k=!0){return new O(k)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"6+eU":function(qe,ve,U){"use strict";U.d(ve,"a",function(){return m});var ne=U("wx14"),W=U("rePB"),O=U("VTBJ"),k=U("1OyB"),w=U("vuIU"),D=U("Ji7U"),B=U("LK+K"),M=U("q1tI"),e=U.n(M),C=U("TSYQ"),y=U.n(C),c=function(_){var l,f="".concat(_.rootPrefixCls,"-item"),u=y()(f,"".concat(f,"-").concat(_.page),(l={},Object(W.a)(l,"".concat(f,"-active"),_.active),Object(W.a)(l,_.className,!!_.className),Object(W.a)(l,"".concat(f,"-disabled"),!_.page),l)),h=function(){_.onClick(_.page)},E=function(S){_.onKeyPress(S,_.onClick,_.page)};return e.a.createElement("li",{title:_.showTitle?_.page:null,className:u,onClick:h,onKeyPress:E,tabIndex:"0"},_.itemRender(_.page,"page",e.a.createElement("a",{rel:"nofollow"},_.page)))},d=c,a={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},i=function(b){Object(D.a)(l,b);var _=Object(B.a)(l);function l(){var f;Object(k.a)(this,l);for(var u=arguments.length,h=new Array(u),E=0;E<u;E++)h[E]=arguments[E];return f=_.call.apply(_,[this].concat(h)),f.state={goInputText:""},f.buildOptionText=function(v){return"".concat(v," ").concat(f.props.locale.items_per_page)},f.changeSize=function(v){f.props.changeSize(Number(v))},f.handleChange=function(v){f.setState({goInputText:v.target.value})},f.handleBlur=function(v){var S=f.props,L=S.goButton,I=S.quickGo,A=S.rootPrefixCls,P=f.state.goInputText;if(L||P==="")return;if(v.relatedTarget&&(v.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||v.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;f.setState({goInputText:""}),I(f.getValidValue())},f.go=function(v){var S=f.state.goInputText;if(S==="")return;(v.keyCode===a.ENTER||v.type==="click")&&(f.setState({goInputText:""}),f.props.quickGo(f.getValidValue()))},f}return Object(w.a)(l,[{key:"getValidValue",value:function(){var u=this.state,h=u.goInputText,E=u.current;return!h||isNaN(h)?E:Number(h)}},{key:"getPageSizeOptions",value:function(){var u=this.props,h=u.pageSize,E=u.pageSizeOptions;return E.some(function(v){return v.toString()===h.toString()})?E:E.concat([h.toString()]).sort(function(v,S){var L=isNaN(Number(v))?0:Number(v),I=isNaN(Number(S))?0:Number(S);return L-I})}},{key:"render",value:function(){var u=this,h=this.props,E=h.pageSize,v=h.locale,S=h.rootPrefixCls,L=h.changeSize,I=h.quickGo,A=h.goButton,P=h.selectComponentClass,H=h.buildOptionText,R=h.selectPrefixCls,K=h.disabled,z=this.state.goInputText,oe="".concat(S,"-options"),$=P,fe=null,de=null,ee=null;if(!L&&!I)return null;var ie=this.getPageSizeOptions();if(L&&$){var ge=ie.map(function(Z,Y){return e.a.createElement($.Option,{key:Y,value:Z.toString()},(H||u.buildOptionText)(Z))});fe=e.a.createElement($,{disabled:K,prefixCls:R,showSearch:!1,className:"".concat(oe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||ie[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Y){return Y.parentNode}},ge)}return I&&(A&&(ee=typeof A=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:K,className:"".concat(oe,"-quick-jumper-button")},v.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),de=e.a.createElement("div",{className:"".concat(oe,"-quick-jumper")},v.jump_to,e.a.createElement("input",{disabled:K,type:"text",value:z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),v.page,ee)),e.a.createElement("li",{className:"".concat(oe)},fe,de)}}]),l}(e.a.Component);i.defaultProps={pageSizeOptions:["10","20","50","100"]};var o=i,s=U("N2Kk");function r(){}function n(b){return typeof b=="number"&&isFinite(b)&&Math.floor(b)===b}function t(b,_,l){return l}function g(b,_,l){var f=typeof b=="undefined"?_.pageSize:b;return Math.floor((l.total-1)/f)+1}var p=function(b){Object(D.a)(l,b);var _=Object(B.a)(l);function l(f){var u;Object(k.a)(this,l),u=_.call(this,f),u.getJumpPrevPage=function(){return Math.max(1,u.state.current-(u.props.showLessItems?3:5))},u.getJumpNextPage=function(){return Math.min(g(void 0,u.state,u.props),u.state.current+(u.props.showLessItems?3:5))},u.getItemIcon=function(L,I){var A=u.props.prefixCls,P=L||e.a.createElement("button",{type:"button","aria-label":I,className:"".concat(A,"-item-link")});return typeof L=="function"&&(P=e.a.createElement(L,Object(O.a)({},u.props))),P},u.savePaginationNode=function(L){u.paginationNode=L},u.isValid=function(L){return n(L)&&L!==u.state.current},u.shouldDisplayQuickJumper=function(){var L=u.props,I=L.showQuickJumper,A=L.pageSize,P=L.total;return P<=A?!1:I},u.handleKeyDown=function(L){(L.keyCode===a.ARROW_UP||L.keyCode===a.ARROW_DOWN)&&L.preventDefault()},u.handleKeyUp=function(L){var I=u.getValidValue(L),A=u.state.currentInputValue;I!==A&&u.setState({currentInputValue:I}),L.keyCode===a.ENTER?u.handleChange(I):L.keyCode===a.ARROW_UP?u.handleChange(I-1):L.keyCode===a.ARROW_DOWN&&u.handleChange(I+1)},u.changePageSize=function(L){var I=u.state.current,A=g(L,u.state,u.props);I=I>A?A:I,A===0&&(I=u.state.current),typeof L=="number"&&("pageSize"in u.props||u.setState({pageSize:L}),"current"in u.props||u.setState({current:I,currentInputValue:I})),u.props.onShowSizeChange(I,L),"onChange"in u.props&&u.props.onChange&&u.props.onChange(I,L)},u.handleChange=function(L){var I=u.props.disabled,A=L;if(u.isValid(A)&&!I){var P=g(void 0,u.state,u.props);A>P?A=P:A<1&&(A=1),"current"in u.props||u.setState({current:A,currentInputValue:A});var H=u.state.pageSize;return u.props.onChange(A,H),A}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<g(void 0,u.state,u.props)},u.runIfEnter=function(L,I){if(L.key==="Enter"||L.charCode===13){for(var A=arguments.length,P=new Array(A>2?A-2:0),H=2;H<A;H++)P[H-2]=arguments[H];I.apply(void 0,P)}},u.runIfEnterPrev=function(L){u.runIfEnter(L,u.prev)},u.runIfEnterNext=function(L){u.runIfEnter(L,u.next)},u.runIfEnterJumpPrev=function(L){u.runIfEnter(L,u.jumpPrev)},u.runIfEnterJumpNext=function(L){u.runIfEnter(L,u.jumpNext)},u.handleGoTO=function(L){(L.keyCode===a.ENTER||L.type==="click")&&u.handleChange(u.state.currentInputValue)};var h=f.onChange!==r,E="current"in f;E&&!h&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var v=f.defaultCurrent;"current"in f&&(v=f.current);var S=f.defaultPageSize;return"pageSize"in f&&(S=f.pageSize),v=Math.min(v,g(S,void 0,f)),u.state={current:v,currentInputValue:v,pageSize:S},u}return Object(w.a)(l,[{key:"componentDidUpdate",value:function(u,h){var E=this.props.prefixCls;if(h.current!==this.state.current&&this.paginationNode){var v=this.paginationNode.querySelector(".".concat(E,"-item-").concat(h.current));v&&document.activeElement===v&&v.blur()}}},{key:"getValidValue",value:function(u){var h=u.target.value,E=g(void 0,this.state,this.props),v=this.state.currentInputValue,S;return h===""?S=h:isNaN(Number(h))?S=v:h>=E?S=E:S=Number(h),S}},{key:"getShowSizeChanger",value:function(){var u=this.props,h=u.showSizeChanger,E=u.total,v=u.totalBoundaryShowSizeChanger;return typeof h!="undefined"?h:E>v}},{key:"renderPrev",value:function(u){var h=this.props,E=h.prevIcon,v=h.itemRender,S=v(u,"prev",this.getItemIcon(E,"prev page")),L=!this.hasPrev();return Object(M.isValidElement)(S)?Object(M.cloneElement)(S,{disabled:L}):S}},{key:"renderNext",value:function(u){var h=this.props,E=h.nextIcon,v=h.itemRender,S=v(u,"next",this.getItemIcon(E,"next page")),L=!this.hasNext();return Object(M.isValidElement)(S)?Object(M.cloneElement)(S,{disabled:L}):S}},{key:"render",value:function(){var u=this,h=this.props,E=h.prefixCls,v=h.className,S=h.style,L=h.disabled,I=h.hideOnSinglePage,A=h.total,P=h.locale,H=h.showQuickJumper,R=h.showLessItems,K=h.showTitle,z=h.showTotal,oe=h.simple,$=h.itemRender,fe=h.showPrevNextJumpers,de=h.jumpPrevIcon,ee=h.jumpNextIcon,ie=h.selectComponentClass,ge=h.selectPrefixCls,Z=h.pageSizeOptions,Y=this.state,Se=Y.current,Pe=Y.pageSize,ke=Y.currentInputValue;if(I===!0&&A<=Pe)return null;var Re=g(void 0,this.state,this.props),Me=[],Ce=null,Le=null,Ne=null,J=null,pe=null,Te=H&&H.goButton,xe=R?1:2,We=Se-1>0?Se-1:0,He=Se+1<Re?Se+1:Re,Oe=Object.keys(this.props).reduce(function(Q,q){return(q.substr(0,5)==="data-"||q.substr(0,5)==="aria-"||q==="role")&&(Q[q]=u.props[q]),Q},{});if(oe)return Te&&(typeof Te=="boolean"?pe=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},P.jump_to_confirm):pe=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Te),pe=e.a.createElement("li",{title:K?"".concat(P.jump_to).concat(Se,"/").concat(Re):null,className:"".concat(E,"-simple-pager")},pe)),e.a.createElement("ul",Object(ne.a)({className:y()(E,"".concat(E,"-simple"),Object(W.a)({},"".concat(E,"-disabled"),L),v),style:S,ref:this.savePaginationNode},Oe),e.a.createElement("li",{title:K?P.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:y()("".concat(E,"-prev"),Object(W.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(We)),e.a.createElement("li",{title:K?"".concat(Se,"/").concat(Re):null,className:"".concat(E,"-simple-pager")},e.a.createElement("input",{type:"text",value:ke,disabled:L,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),e.a.createElement("span",{className:"".concat(E,"-slash")},"/"),Re),e.a.createElement("li",{title:K?P.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:y()("".concat(E,"-next"),Object(W.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(He)),pe);if(Re<=3+xe*2){var Ue={locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:K,itemRender:$};Re||Me.push(e.a.createElement(d,Object(ne.a)({},Ue,{key:"noPager",page:Re,className:"".concat(E,"-disabled")})));for(var Qe=1;Qe<=Re;Qe+=1){var Ze=Se===Qe;Me.push(e.a.createElement(d,Object(ne.a)({},Ue,{key:Qe,page:Qe,active:Ze})))}}else{var Je=R?P.prev_3:P.prev_5,ze=R?P.next_3:P.next_5;fe&&(Ce=e.a.createElement("li",{title:K?Je:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:y()("".concat(E,"-jump-prev"),Object(W.a)({},"".concat(E,"-jump-prev-custom-icon"),!!de))},$(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(de,"prev page"))),Le=e.a.createElement("li",{title:K?ze:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:y()("".concat(E,"-jump-next"),Object(W.a)({},"".concat(E,"-jump-next-custom-icon"),!!ee))},$(this.getJumpNextPage(),"jump-next",this.getItemIcon(ee,"next page")))),J=e.a.createElement(d,{locale:P,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Re,page:Re,active:!1,showTitle:K,itemRender:$}),Ne=e.a.createElement(d,{locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:K,itemRender:$});var nt=Math.max(1,Se-xe),it=Math.min(Se+xe,Re);Se-1<=xe&&(it=1+xe*2),Re-Se<=xe&&(nt=Re-xe*2);for(var je=nt;je<=it;je+=1){var Ke=Se===je;Me.push(e.a.createElement(d,{locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:je,page:je,active:Ke,showTitle:K,itemRender:$}))}Se-1>=xe*2&&Se!==1+2&&(Me[0]=Object(M.cloneElement)(Me[0],{className:"".concat(E,"-item-after-jump-prev")}),Me.unshift(Ce)),Re-Se>=xe*2&&Se!==Re-2&&(Me[Me.length-1]=Object(M.cloneElement)(Me[Me.length-1],{className:"".concat(E,"-item-before-jump-next")}),Me.push(Le)),nt!==1&&Me.unshift(Ne),it!==Re&&Me.push(J)}var ae=null;z&&(ae=e.a.createElement("li",{className:"".concat(E,"-total-text")},z(A,[A===0?0:(Se-1)*Pe+1,Se*Pe>A?A:Se*Pe])));var ce=!this.hasPrev()||!Re,ye=!this.hasNext()||!Re;return e.a.createElement("ul",Object(ne.a)({className:y()(E,v,Object(W.a)({},"".concat(E,"-disabled"),L)),style:S,unselectable:"unselectable",ref:this.savePaginationNode},Oe),ae,e.a.createElement("li",{title:K?P.prev_page:null,onClick:this.prev,tabIndex:ce?null:0,onKeyPress:this.runIfEnterPrev,className:y()("".concat(E,"-prev"),Object(W.a)({},"".concat(E,"-disabled"),ce)),"aria-disabled":ce},this.renderPrev(We)),Me,e.a.createElement("li",{title:K?P.next_page:null,onClick:this.next,tabIndex:ye?null:0,onKeyPress:this.runIfEnterNext,className:y()("".concat(E,"-next"),Object(W.a)({},"".concat(E,"-disabled"),ye)),"aria-disabled":ye},this.renderNext(He)),e.a.createElement(o,{disabled:L,locale:P,rootPrefixCls:E,selectComponentClass:ie,selectPrefixCls:ge,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Se,pageSize:Pe,pageSizeOptions:Z,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Te}))}}],[{key:"getDerivedStateFromProps",value:function(u,h){var E={};if("current"in u&&(E.current=u.current,u.current!==h.current&&(E.currentInputValue=E.current)),"pageSize"in u&&u.pageSize!==h.pageSize){var v=h.current,S=g(u.pageSize,h,u);v=v>S?S:v,"current"in u||(E.current=v,E.currentInputValue=v),E.pageSize=u.pageSize}return E}}]),l}(e.a.Component);p.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:t,totalBoundaryShowSizeChanger:50};var m=p},"6UM0":function(qe,ve,U){var ne,W;(function(){var O;(function(){"use strict";var w=[function(e,C,y){var c=y(1).Beautifier,d=y(5).Options;function a(i,o){var s=new c(i,o);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new d}},function(e,C,y){var c=y(2).Output,d=y(3).Token,a=y(4),i=y(5).Options,o=y(7).Tokenizer,s=y(7).line_starters,r=y(7).positionable_operators,n=y(7).TOKEN;function t(R,K){return K.indexOf(R)!==-1}function g(R){return R.replace(/^\s+/g,"")}function p(R){for(var K={},z=0;z<R.length;z++)K[R[z].replace(/-/g,"_")]=R[z];return K}function m(R,K){return R&&R.type===n.RESERVED&&R.text===K}function b(R,K){return R&&R.type===n.RESERVED&&t(R.text,K)}var _=["case","return","do","if","throw","else","await","break","continue","async"],l=["before-newline","after-newline","preserve-newline"],f=p(l),u=[f.before_newline,f.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(R,K){if(K.multiline_frame||K.mode===h.ForInitializer||K.mode===h.Conditional)return;R.remove_indent(K.start_line_index)}function v(R){R=R.replace(a.allLineBreaks,`
|
|
`);for(var K=[],z=R.indexOf(`
|
|
`);z!==-1;)K.push(R.substring(0,z)),R=R.substring(z+1),z=R.indexOf(`
|
|
`);return R.length&&K.push(R),K}function S(R){return R===h.ArrayLiteral}function L(R){return t(R,[h.Expression,h.ForInitializer,h.Conditional])}function I(R,K){for(var z=0;z<R.length;z++){var oe=R[z].trim();if(oe.charAt(0)!==K)return!1}return!0}function A(R,K){for(var z=0,oe=R.length,$;z<oe;z++)if($=R[z],$&&$.indexOf(K)!==0)return!1;return!0}function P(R,K){K=K||{},this._source_text=R||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new i(K)}P.prototype.create_flags=function(R,K){var z=0;R&&(z=R.indentation_level,!this._output.just_added_newline()&&R.line_indent_level>z&&(z=R.line_indent_level));var oe={mode:K,parent:R,last_token:R?R.last_token:new d(n.START_BLOCK,""),last_word:R?R.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:R?R.line_indent_level:z,start_line_index:this._output.get_line_number(),ternary_depth:0};return oe},P.prototype._reset=function(R){var K=R.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new c(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var z=new o(R,this._options);return this._tokens=z.tokenize(),R},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,K=this._reset(this._source_text),z=this._options.eol;this._options.eol==="auto"&&(z=`
|
|
`,K&&a.lineBreak.test(K||"")&&(z=K.match(a.lineBreak)[0]));for(var oe=this._tokens.next();oe;)this.handle_token(oe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=oe,oe=this._tokens.next();return R=this._output.get_code(z),R},P.prototype.handle_token=function(R,K){R.type===n.START_EXPR?this.handle_start_expr(R):R.type===n.END_EXPR?this.handle_end_expr(R):R.type===n.START_BLOCK?this.handle_start_block(R):R.type===n.END_BLOCK?this.handle_end_block(R):R.type===n.WORD?this.handle_word(R):R.type===n.RESERVED?this.handle_word(R):R.type===n.SEMICOLON?this.handle_semicolon(R):R.type===n.STRING?this.handle_string(R):R.type===n.EQUALS?this.handle_equals(R):R.type===n.OPERATOR?this.handle_operator(R):R.type===n.COMMA?this.handle_comma(R):R.type===n.BLOCK_COMMENT?this.handle_block_comment(R,K):R.type===n.COMMENT?this.handle_comment(R,K):R.type===n.DOT?this.handle_dot(R):R.type===n.EOF?this.handle_eof(R):R.type===n.UNKNOWN?this.handle_unknown(R,K):this.handle_unknown(R,K)},P.prototype.handle_whitespace_and_comments=function(R,K){var z=R.newlines,oe=this._options.keep_array_indentation&&S(this._flags.mode);if(R.comments_before)for(var $=R.comments_before.next();$;)this.handle_whitespace_and_comments($,K),this.handle_token($,K),$=R.comments_before.next();if(oe)for(var fe=0;fe<z;fe+=1)this.print_newline(fe>0,K);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,K);for(var de=1;de<z;de+=1)this.print_newline(!0,K)}};var H=["async","break","continue","return","throw","yield"];P.prototype.allow_wrap_or_preserved_newline=function(R,K){if(K=K===void 0?!1:K,this._output.just_added_newline())return;var z=this._options.preserve_newlines&&R.newlines||K,oe=t(this._flags.last_token.text,r)||t(R.text,r);if(oe){var $=t(this._flags.last_token.text,r)&&t(this._options.operator_position,u)||t(R.text,r);z=z&&$}if(z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(b(this._flags.last_token,H))return;this._output.set_wrap_point()}},P.prototype.print_newline=function(R,K){if(!K&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var z=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&m(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(R)&&(this._flags.multiline_frame=!0)},P.prototype.print_token_line_indentation=function(R){this._output.just_added_newline()&&(this._options.keep_array_indentation&&R.newlines&&(R.text==="["||S(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(R.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(R){if(this._output.raw){this._output.add_raw_token(R);return}if(this._options.comma_first&&R.previous&&R.previous.type===n.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var K=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(K),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(R),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(R),this._output.non_breaking_space=!0,this._output.add_token(R.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(R){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,R),this._flags=this.create_flags(this._previous_flags,R),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===h.Statement&&E(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===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||b(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(R){var K=!1;return K=K||b(this._flags.last_token,["var","let","const"])&&R.type===n.WORD,K=K||m(this._flags.last_token,"do"),K=K||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&b(this._flags.last_token,H)&&!R.newlines,K=K||m(this._flags.last_token,"else")&&!(m(R,"if")&&!R.comments_before),K=K||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),K=K||this._flags.last_token.type===n.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==n.WORD&&R.type!==n.RESERVED,K=K||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||b(this._flags.last_token,["get","set"])),K?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(R,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R,b(R,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R);var K=h.Expression;if(R.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){b(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(R),this.set_mode(K),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}K=h.ArrayLiteral,S(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),t(this._flags.last_token.type,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,K=h.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=h.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&R.whitespace_before===""?this._output.space_before_token=!1:(t(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var z=this._tokens.peek(-3);if(this._options.space_after_named_function&&z){var oe=this._tokens.peek(-4);b(z,["async","function"])||z.text==="*"&&b(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(z.text==="{"||z.text===","||z.text==="*"&&(oe.text==="{"||oe.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(R);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&t(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(R,R.newlines),this.print_token(R),this.set_mode(K),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(R){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(R,R.text==="]"&&S(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.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(R),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},P.prototype.handle_start_block=function(R){this.handle_whitespace_and_comments(R);var K=this._tokens.peek(),z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):z&&(t(z.text,[":",","])&&t(K.type,[n.STRING,n.WORD,n.RESERVED])||t(K.text,["get","set","..."])&&t(z.type,[n.WORD,n.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(z.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):t(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||b(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(b(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var oe=!K.comments_before&&K.text==="}",$=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var fe=0,de=null;this._flags.inline_frame=!0;do if(fe+=1,de=this._tokens.peek(fe-1),de.newlines){this._flags.inline_frame=!1;break}while(de.type!==n.EOF&&!(de.type===n.END_BLOCK&&de.opened===R))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&($||this._flags.last_token.type===n.EQUALS||b(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(S(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(R),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(this._flags.last_token.type===n.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(R),this.indent(),!oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(R){for(this.handle_whitespace_and_comments(R);this._flags.mode===h.Statement;)this.restore_mode();var K=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!K?this._output.space_before_token=!0:this._options.brace_style==="expand"?K||this.print_newline():K||(S(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(R)},P.prototype.handle_word=function(R){if(R.type===n.RESERVED){if(t(R.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)R.type=n.WORD;else if(R.text==="import"&&t(this._tokens.peek().text,["(","."]))R.type=n.WORD;else if(t(R.text,["as","from"])&&!this._flags.import_block)R.type=n.WORD;else if(this._flags.mode===h.ObjectLiteral){var K=this._tokens.peek();K.text===":"&&(R.type=n.WORD)}}if(this.start_of_statement(R)?b(this._flags.last_token,["var","let","const"])&&R.type===n.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!L(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!b(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(R),this.print_newline()):this.handle_whitespace_and_comments(R),this._flags.do_block&&!this._flags.do_while)if(m(R,"while")){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&m(R,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&b(R,["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(R),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R)),m(R,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?b(this._flags.last_token,["get","set","new","export"])||b(this._flags.last_token,H)?this._output.space_before_token=!0:m(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(L(this._flags.mode)||S(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var z="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?z="SPACE":b(R,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines?z="NEWLINE":(z="SPACE",this._output.space_before_token=!0):z="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===h.BlockStatement?z="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&L(this._flags.mode)?z="SPACE":this._flags.last_token.type===n.STRING?z="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&t(this._last_last_text,["{",","]))?z="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?z="SPACE":z="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,z="NEWLINE"),b(R,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"),b(R,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var oe=this._output.current_line;oe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else z==="NEWLINE"?b(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&b(R,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!b(R,["var","let","const"]))&&this._flags.last_token.text!==":"&&(m(R,"if")&&m(R.previous,"else")?this._output.space_before_token=!0:this.print_newline()):b(R,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&S(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():z==="SPACE"&&(this._output.space_before_token=!0);R.previous&&(R.previous.type===n.WORD||R.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===n.RESERVED&&(R.text==="do"?this._flags.do_block=!0:R.text==="if"?this._flags.if_block=!0:R.text==="import"?this._flags.import_block=!0:this._flags.import_block&&m(R,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(R){this.start_of_statement(R)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(R);for(var K=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&m(K,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(R)},P.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R):R.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},P.prototype.handle_equals=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0},P.prototype.handle_comma=function(R){this.handle_whitespace_and_comments(R,!0),this.print_token(R),this._output.space_before_token=!0,this._flags.declaration_statement?(L(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)},P.prototype.handle_operator=function(R){var K=R.text==="*"&&(b(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),z=t(R.text,["-","+"])&&(t(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||t(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(R)){var oe=!K;this.handle_whitespace_and_comments(R,oe)}if(R.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(this._flags.last_token.type===n.OPERATOR&&t(this._options.operator_position,u)&&this.allow_wrap_or_preserved_newline(R),R.text===":"&&this._flags.in_case){this.print_token(R),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.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 $=!0,fe=!0,de=!1;if(R.text===":"?this._flags.ternary_depth===0?$=!1:(this._flags.ternary_depth-=1,de=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!z&&!K&&this._options.preserve_newlines&&t(R.text,r)){var ee=R.text===":",ie=ee&&de,ge=ee&&!de;switch(this._options.operator_position){case f.before_newline:this._output.space_before_token=!ge,this.print_token(R),(!ee||ie)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case f.after_newline:this._output.space_before_token=!0,!ee||ie?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(R):this._output.space_before_token=!1,this.print_token(R),this._output.space_before_token=!0;return;case f.preserve_newline:ge||this.allow_wrap_or_preserved_newline(R),$=!(this._output.just_added_newline()||ge),this._output.space_before_token=$,this.print_token(R),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(R),$=!1;var Z=this._tokens.peek();fe=Z&&t(Z.type,[n.WORD,n.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),$=this._flags.last_token.type===n.START_BLOCK,fe=!1;else if(t(R.text,["--","++","!","~"])||z){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),$=!1,fe=!1,R.newlines&&(R.text==="--"||R.text==="++"||R.text==="~")){var Y=b(this._flags.last_token,_)&&R.newlines;Y&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(Y,!0)}this._flags.last_token.text===";"&&L(this._flags.mode)&&($=!0),this._flags.last_token.type===n.RESERVED?$=!0:this._flags.last_token.type===n.END_EXPR?$=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===n.OPERATOR&&($=t(R.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(R.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(fe=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||$,this.print_token(R),this._output.space_before_token=fe},P.prototype.handle_block_comment=function(R,K){if(this._output.raw){this._output.add_raw_token(R),R.directives&&R.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(R.directives){this.print_newline(!1,K),this.print_token(R),R.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(R.text)&&!R.newlines){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0;return}else this.print_block_commment(R,K)},P.prototype.print_block_commment=function(R,K){var z=v(R.text),oe,$=!1,fe=!1,de=R.whitespace_before,ee=de.length;if(this.print_newline(!1,K),this.print_token_line_indentation(R),this._output.add_token(z[0]),this.print_newline(!1,K),z.length>1){for(z=z.slice(1),$=I(z,"*"),fe=A(z,de),$&&(this._flags.alignment=1),oe=0;oe<z.length;oe++)$?(this.print_token_line_indentation(R),this._output.add_token(g(z[oe]))):fe&&z[oe]?(this.print_token_line_indentation(R),this._output.add_token(z[oe].substring(ee))):(this._output.current_line.set_indent(-1),this._output.add_token(z[oe])),this.print_newline(!1,K);this._flags.alignment=0}},P.prototype.handle_comment=function(R,K){R.newlines?this.print_newline(!1,K):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(R),this.print_newline(!1,K)},P.prototype.handle_dot=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),b(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(R,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(R)},P.prototype.handle_unknown=function(R,K){this.print_token(R),R.text[R.text.length-1]===`
|
|
`&&this.print_newline(!1,K)},P.prototype.handle_eof=function(R){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R)},e.exports.Beautifier=P},function(e){function C(d){this.__parent=d,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}C.prototype.clone_empty=function(){var d=new C(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},C.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},C.prototype.has_match=function(d){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(d))return!0;return!1},C.prototype.set_indent=function(d,a){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},C.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},C.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},C.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},C.prototype.is_empty=function(){return this.__items.length===0},C.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},C.prototype.push=function(d){this.__items.push(d);var a=d.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=d.length-a:this.__character_count+=d.length},C.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},C.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},C.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},C.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},C.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function y(d,a){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),a=a||"",d.indent_level>0&&(a=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}y.prototype.get_indent_size=function(d,a){var i=this.__base_string_length;return a=a||0,d<0&&(i=0),i+=d*this.__indent_size,i+=a,i},y.prototype.get_indent_string=function(d,a){var i=this.__base_string;return a=a||0,d<0&&(d=0,i=""),a+=d*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},y.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var d=this.__cache.length,a=0,i="";this.__indent_size&&d>=this.__indent_size&&(a=Math.floor(d/this.__indent_size),d-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),d&&(i+=new Array(d+1).join(" ")),this.__cache.push(i)};function c(d,a){this.__indent_cache=new y(d,a),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new C(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(d,a){return this.__indent_cache.get_indent_string(d,a)},c.prototype.get_indent_size=function(d,a){return this.__indent_cache.get_indent_size(d,a)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(d){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(i=i.replace(/[\n]/g,d)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(d,a){return d=d||0,a=a||0,this.next_line.set_indent(d,a),this.__lines.length>1?(this.current_line.set_indent(d,a),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(d){for(var a=0;a<d.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.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(" "))},c.prototype.remove_indent=function(d){for(var a=this.__lines.length;d<a;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&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},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(d,a){for(var i=this.__lines.length-2;i>=0;){var o=this.__lines[i];if(o.is_empty())break;if(o.item(0).indexOf(d)!==0&&o.item(-1)!==a){this.__lines.splice(i+1,0,new C(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=c},function(e){function C(y,c,d,a){this.type=y,this.text=c,this.comments_before=null,this.newlines=d||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=C},function(e,C){var y="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",a="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",i="(?:\\\\u[0-9a-fA-F]{4}|["+y+d+"])",o="(?:\\\\u[0-9a-fA-F]{4}|["+c+d+a+"])*";C.identifier=new RegExp(i+o,"g"),C.identifierStart=new RegExp(i),C.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+c+d+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;C.newline=/[\n\r\u2028\u2029]/,C.lineBreak=new RegExp(`\r
|
|
|`+C.newline.source),C.allLineBreaks=new RegExp(C.lineBreak.source,"g")},function(e,C,y){var c=y(6).Options,d=["before-newline","after-newline","preserve-newline"];function a(i){c.call(this,i,"js");var o=this.raw_options.brace_style||null;o==="expand-strict"?this.raw_options.brace_style="expand":o==="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",d),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new c,e.exports.Options=a},function(e){function C(d,a){this.raw_options=y(d,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}C.prototype._get_array=function(d,a){var i=this.raw_options[d],o=a||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(o=i.concat()):typeof i=="string"&&(o=i.split(/[^a-zA-Z0-9_\/\-]+/)),o},C.prototype._get_boolean=function(d,a){var i=this.raw_options[d],o=i===void 0?!!a:!!i;return o},C.prototype._get_characters=function(d,a){var i=this.raw_options[d],o=a||"";return typeof i=="string"&&(o=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},C.prototype._get_number=function(d,a){var i=this.raw_options[d];a=parseInt(a,10),isNaN(a)&&(a=0);var o=parseInt(i,10);return isNaN(o)&&(o=a),o},C.prototype._get_selection=function(d,a,i){var o=this._get_selection_list(d,a,i);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[d]+"'");return o[0]},C.prototype._get_selection_list=function(d,a,i){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[a[0]],!this._is_valid_selection(i,a))throw new Error("Invalid Default Value!");var o=this._get_array(d,i);if(!this._is_valid_selection(o,a))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[d]+"'");return o},C.prototype._is_valid_selection=function(d,a){return d.length&&a.length&&!d.some(function(i){return a.indexOf(i)===-1})};function y(d,a){var i={};d=c(d);var o;for(o in d)o!==a&&(i[o]=d[o]);if(a&&d[a])for(o in d[a])i[o]=d[a][o];return i}function c(d){var a={},i;for(i in d){var o=i.replace(/-/g,"_");a[o]=d[i]}return a}e.exports.Options=C,e.exports.normalizeOpts=c,e.exports.mergeOpts=y},function(e,C,y){var c=y(8).InputScanner,d=y(9).Tokenizer,a=y(9).TOKEN,i=y(13).Directives,o=y(4),s=y(12).Pattern,r=y(14).TemplatablePattern;function n(I,A){return A.indexOf(I)!==-1}var t={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},g=new i(/\/\*/,/\*\//),p=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,m=/[0-9]/,b=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),l=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";l=l.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),l="\\?\\.(?!\\d) "+l,l=l.replace(/ /g,"|");var f=new RegExp(l),u="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=u.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+h.join("|")+")$"),v,S=function(I,A){d.call(this,I,A),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),H=new r(this._input).read_options(this._options);this.__patterns={template:H,identifier:H.starting_with(o.identifier).matching(o.identifierMatch),number:P.matching(p),punct:P.matching(f),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(o.lineBreak),shebang:P.starting_with(/#!/).until_after(o.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:H.until(/['\\\n\r\u2028\u2029]/),double_quote:H.until(/["\\\n\r\u2028\u2029]/),template_text:H.until(/[`\\$]/),template_expression:H.until(/[`}\\]/)}};S.prototype=new d,S.prototype._is_comment=function(I){return I.type===t.COMMENT||I.type===t.BLOCK_COMMENT||I.type===t.UNKNOWN},S.prototype._is_opening=function(I){return I.type===t.START_BLOCK||I.type===t.START_EXPR},S.prototype._is_closing=function(I,A){return(I.type===t.END_BLOCK||I.type===t.END_EXPR)&&A&&(I.text==="]"&&A.text==="["||I.text===")"&&A.text==="("||I.text==="}"&&A.text==="{")},S.prototype._reset=function(){v=!1},S.prototype._get_next_token=function(I,A){var P=null;this._readWhitespace();var H=this._input.peek();return H===null?this._create_token(t.EOF,""):(P=P||this._read_non_javascript(H),P=P||this._read_string(H),P=P||this._read_word(I),P=P||this._read_singles(H),P=P||this._read_comment(H),P=P||this._read_regexp(H,I),P=P||this._read_xml(H,I),P=P||this._read_punctuation(),P=P||this._create_token(t.UNKNOWN,this._input.next()),P)},S.prototype._read_word=function(I){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(o.allLineBreaks,`
|
|
`),!(I.type===t.DOT||I.type===t.RESERVED&&(I.text==="set"||I.text==="get"))&&E.test(A)?(A==="in"||A==="of")&&(I.type===t.WORD||I.type===t.STRING)?this._create_token(t.OPERATOR,A):this._create_token(t.RESERVED,A):this._create_token(t.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(t.WORD,A)},S.prototype._read_singles=function(I){var A=null;return I==="("||I==="["?A=this._create_token(t.START_EXPR,I):I===")"||I==="]"?A=this._create_token(t.END_EXPR,I):I==="{"?A=this._create_token(t.START_BLOCK,I):I==="}"?A=this._create_token(t.END_BLOCK,I):I===";"?A=this._create_token(t.SEMICOLON,I):I==="."&&b.test(this._input.peek(1))?A=this._create_token(t.DOT,I):I===","&&(A=this._create_token(t.COMMA,I)),A&&this._input.next(),A},S.prototype._read_punctuation=function(){var I=this.__patterns.punct.read();if(I!=="")return I==="="?this._create_token(t.EQUALS,I):I==="?."?this._create_token(t.DOT,I):this._create_token(t.OPERATOR,I)},S.prototype._read_non_javascript=function(I){var A="";if(I==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(t.UNKNOWN,A.trim()+`
|
|
`);if(A=this.__patterns.include.read(),A)return this._create_token(t.UNKNOWN,A.trim()+`
|
|
`);I=this._input.next();var P="#";if(this._input.hasNext()&&this._input.testChar(m)){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(t.WORD,P)}this._input.back()}else if(I==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)A+=this._input.next();return v=!0,this._create_token(t.COMMENT,A)}}else if(v&&I==="-"&&(A=this.__patterns.html_comment_end.read(),A))return v=!1,this._create_token(t.COMMENT,A);return null},S.prototype._read_comment=function(I){var A=null;if(I==="/"){var P="";if(this._input.peek(1)==="*"){P=this.__patterns.block_comment.read();var H=g.get_directives(P);H&&H.ignore==="start"&&(P+=g.readIgnored(this._input)),P=P.replace(o.allLineBreaks,`
|
|
`),A=this._create_token(t.BLOCK_COMMENT,P),A.directives=H}else this._input.peek(1)==="/"&&(P=this.__patterns.comment.read(),A=this._create_token(t.COMMENT,P))}return A},S.prototype._read_string=function(I){if(I==="`"||I==="'"||I==='"'){var A=this._input.next();return this.has_char_escapes=!1,I==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(I),this.has_char_escapes&&this._options.unescape_strings&&(A=L(A)),this._input.peek()===I&&(A+=this._input.next()),A=A.replace(o.allLineBreaks,`
|
|
`),this._create_token(t.STRING,A)}return null},S.prototype._allow_regexp_or_xml=function(I){return I.type===t.RESERVED&&n(I.text,["return","case","throw","else","do","typeof","yield"])||I.type===t.END_EXPR&&I.text===")"&&I.opened.previous.type===t.RESERVED&&n(I.opened.previous.text,["if","while","for"])||n(I.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},S.prototype._read_regexp=function(I,A){if(I==="/"&&this._allow_regexp_or_xml(A)){for(var P=this._input.next(),H=!1,R=!1;this._input.hasNext()&&(H||R||this._input.peek()!==I)&&!this._input.testChar(o.newline);)P+=this._input.peek(),H?H=!1:(H=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===I&&(P+=this._input.next(),P+=this._input.read(o.identifier)),this._create_token(t.STRING,P)}return null},S.prototype._read_xml=function(I,A){if(this._options.e4x&&I==="<"&&this._allow_regexp_or_xml(A)){var P="",H=this.__patterns.xml.read_match();if(H){for(var R=H[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),K=R.indexOf("{")===0,z=0;H;){var oe=!!H[1],$=H[2],fe=!!H[H.length-1]||$.slice(0,8)==="![CDATA[";if(!fe&&($===R||K&&$.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--z:++z),P+=H[0],z<=0)break;H=this.__patterns.xml.read_match()}return H||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(o.allLineBreaks,`
|
|
`),this._create_token(t.STRING,P)}}return null};function L(I){for(var A="",P=0,H=new c(I),R=null;H.hasNext();)if(R=H.match(/([\s]|[^\\]|\\\\)+/g),R&&(A+=R[0]),H.peek()==="\\"){if(H.next(),H.peek()==="x")R=H.match(/x([0-9A-Fa-f]{2})/g);else if(H.peek()==="u")R=H.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",H.hasNext()&&(A+=H.next());continue}if(!R)return I;if(P=parseInt(R[1],16),P>126&&P<=255&&R[0].indexOf("x")===0)return I;if(P>=0&&P<32){A+="\\"+R[0];continue}else P===34||P===39||P===92?A+="\\"+String.fromCharCode(P):A+=String.fromCharCode(P)}return A}S.prototype._read_string_recursive=function(I,A,P){var H,R;I==="'"?R=this.__patterns.single_quote:I==='"'?R=this.__patterns.double_quote:I==="`"?R=this.__patterns.template_text:I==="}"&&(R=this.__patterns.template_expression);for(var K=R.read(),z="";this._input.hasNext();){if(z=this._input.next(),z===I||!A&&o.newline.test(z)){this._input.back();break}else z==="\\"&&this._input.hasNext()?(H=this._input.peek(),H==="x"||H==="u"?this.has_char_escapes=!0:H==="\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("}",A,"`"):z+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(z+=this._input.next())));z+=R.read(),K+=z}return K},e.exports.Tokenizer=S,e.exports.TOKEN=t,e.exports.positionable_operators=_.slice(),e.exports.line_starters=u.slice()},function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function y(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},y.prototype.peek=function(c){var d=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(d=this.__input.charAt(c)),d},y.prototype.__match=function(c,d){c.lastIndex=d;var a=c.exec(this.__input);return a&&!(C&&c.sticky)&&(a.index!==d&&(a=null)),a},y.prototype.test=function(c,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(c,d):!1},y.prototype.testChar=function(c,d){var a=this.peek(d);return c.lastIndex=0,a!==null&&c.test(a)},y.prototype.match=function(c){var d=this.__match(c,this.__position);return d?this.__position+=d[0].length:d=null,d},y.prototype.read=function(c,d,a){var i="",o;return c&&(o=this.match(c),o&&(i+=o[0])),d&&(o||!c)&&(i+=this.readUntil(d,a)),i},y.prototype.readUntil=function(c,d){var a="",i=this.__position;c.lastIndex=this.__position;var o=c.exec(this.__input);return o?(i=o.index,d&&(i+=o[0].length)):i=this.__input_length,a=this.__input.substring(this.__position,i),this.__position=i,a},y.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},y.prototype.get_regexp=function(c,d){var a=null,i="g";return d&&C&&(i="y"),typeof c=="string"&&c!==""?a=new RegExp(c,i):c&&(a=new RegExp(c.source,i)),a},y.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(c){var d=this.__position,a=this.readUntilAfter(c);return this.__position=d,a},y.prototype.lookBack=function(c){var d=this.__position-1;return d>=c.length&&this.__input.substring(d-c.length,d).toLowerCase()===c},e.exports.InputScanner=y},function(e,C,y){var c=y(8).InputScanner,d=y(3).Token,a=y(10).TokenStream,i=y(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(r,n){this._input=new c(r),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var r,n=new d(o.START,""),t=null,g=[],p=new a;n.type!==o.EOF;){for(r=this._get_next_token(n,t);this._is_comment(r);)p.add(r),r=this._get_next_token(n,t);p.isEmpty()||(r.comments_before=p,p=new a),r.parent=t,this._is_opening(r)?(g.push(t),t=r):t&&this._is_closing(r,t)&&(r.opened=t,t.closed=r,t=g.pop(),r.parent=t),r.previous=n,n.next=r,this.__tokens.add(r),n=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,n){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(o.RAW,t):this._create_token(o.EOF,"")},s.prototype._is_comment=function(r){return!1},s.prototype._is_opening=function(r){return!1},s.prototype._is_closing=function(r,n){return!1},s.prototype._create_token=function(r,n){var t=new d(r,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return t},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=s,e.exports.TOKEN=o},function(e){function C(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}C.prototype.restart=function(){this.__position=0},C.prototype.isEmpty=function(){return this.__tokens_length===0},C.prototype.hasNext=function(){return this.__position<this.__tokens_length},C.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},C.prototype.peek=function(y){var c=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(c=this.__tokens[y]),c},C.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},e.exports.TokenStream=C},function(e,C,y){var c=y(12).Pattern;function d(a,i){c.call(this,a,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}d.prototype=new c,d.prototype.__set_whitespace_patterns=function(a,i){a+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},d.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var i=this.__split(this._newline_regexp,a);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return a},d.prototype.matching=function(a,i){var o=this._create();return o.__set_whitespace_patterns(a,i),o._update(),o},d.prototype._create=function(){return new d(this._input,this)},d.prototype.__split=function(a,i){a.lastIndex=0;for(var o=0,s=[],r=a.exec(i);r;)s.push(i.substring(o,r.index)),o=r.index+r[0].length,r=a.exec(i);return o<i.length?s.push(i.substring(o,i.length)):s.push(""),s},e.exports.WhitespacePattern=d},function(e){function C(y,c){this._input=y,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}C.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},C.prototype.read_match=function(){return this._input.match(this._match_pattern)},C.prototype.until_after=function(y){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(y),c._update(),c},C.prototype.until=function(y){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(y),c._update(),c},C.prototype.starting_with=function(y){var c=this._create();return c._starting_pattern=this._input.get_regexp(y,!0),c._update(),c},C.prototype.matching=function(y){var c=this._create();return c._match_pattern=this._input.get_regexp(y,!0),c._update(),c},C.prototype._create=function(){return new C(this._input,this)},C.prototype._update=function(){},e.exports.Pattern=C},function(e){function C(y,c){y=typeof y=="string"?y:y.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+c,"g")}C.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(y);d;)c[d[1]]=d[2],d=this.__directive_pattern.exec(y);return c},C.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},function(e,C,y){var c=y(12).Pattern,d={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(i,o){c.call(this,i,o),this.__template_pattern=null,this._disabled=Object.assign({},d),this._excluded=Object.assign({},d),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var s=new c(i);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new c,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(i){var o=this._create();return o._disabled[i]=!0,o._update(),o},a.prototype.read_options=function(i){var o=this._create();for(var s in d)o._disabled[s]=i.templating.indexOf(s)===-1;return o._update(),o},a.prototype.exclude=function(i){var o=this._create();return o._excluded[i]=!0,o._update(),o},a.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),i+=o,o=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},a.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},a.prototype._read_template=function(){var i="",o=this._input.peek();if(o==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(i=i||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},e.exports.TemplatablePattern=a}],D={};function B(e){var C=D[e];if(C!==void 0)return C.exports;var y=D[e]={exports:{}};return w[e](y,y.exports,B),y.exports}var M=B(0);O=M})();var k=O;!(ne=[],W=function(){return{js_beautify:k}}.apply(ve,ne),W!==void 0&&(qe.exports=W))})()},"746U":function(qe,ve,U){"use strict";U.d(ve,"f",function(){return ne}),U.d(ve,"l",function(){return W}),U.d(ve,"k",function(){return O}),U.d(ve,"j",function(){return k}),U.d(ve,"g",function(){return w}),U.d(ve,"m",function(){return D}),U.d(ve,"h",function(){return B}),U.d(ve,"n",function(){return M}),U.d(ve,"c",function(){return e}),U.d(ve,"a",function(){return C}),U.d(ve,"i",function(){return y}),U.d(ve,"o",function(){return c}),U.d(ve,"e",function(){return i}),U.d(ve,"d",function(){return o}),U.d(ve,"p",function(){return s}),U.d(ve,"b",function(){return r});function ne(n){return Array.isArray(n)}function W(n){return typeof n=="string"}function O(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function k(n){return typeof n=="number"&&!isNaN(n)}function w(n){return n===!0||n===!1}function D(n){return typeof n=="undefined"}function B(n){return!M(n)}function M(n){return D(n)||n===null}function e(n,t){if(!n)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function C(n){if(M(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function y(n){return typeof n=="function"}function c(n,t){const g=Math.min(n.length,t.length);for(let p=0;p<g;p++)d(n[p],t[p])}function d(n,t){if(W(t)){if(typeof n!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(y(t)){try{if(n instanceof t)return}catch(g){}if(!M(n)&&n.constructor===t)return;if(t.length===1&&t.call(void 0,n)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(n){let t=[],g=Object.getPrototypeOf(n);for(;Object.prototype!==g;)t=t.concat(Object.getOwnPropertyNames(g)),g=Object.getPrototypeOf(g);return t}function i(n){const t=[];for(const g of a(n))typeof n[g]=="function"&&t.push(g);return t}function o(n,t){const g=m=>function(){const b=Array.prototype.slice.call(arguments,0);return t(m,b)};let p={};for(const m of n)p[m]=g(m);return p}function s(n){return n===null?void 0:n}function r(n,t="Unreachable"){throw new Error(t)}},"815F":function(qe,ve,U){"use strict";U.d(ve,"e",function(){return B}),U.d(ve,"c",function(){return e}),U.d(ve,"d",function(){return C}),U.d(ve,"a",function(){return c}),U.d(ve,"f",function(){return d}),U.d(ve,"b",function(){return a});var ne=U("KQm4"),W=U("VTBJ"),O=U("Ff2n"),k=U("Zm9Q"),w=U("Kwbf"),D=U("OZM5");function B(i,o){return i!=null?i:o}function M(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=new Map;function s(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(t){var g=t.key,p=t.children;Object(w.a)(g!=null,"Tree node must have a certain key: [".concat(n).concat(g,"]"));var m=String(g);Object(w.a)(!o.has(m)||g===null||g===void 0,"Same 'key' exist in the Tree: ".concat(m)),o.set(m,!0),s(p,"".concat(n).concat(m," > "))})}s(i)}function e(i){function o(s){var r=Object(k.a)(s);return r.map(function(n){if(!Object(D.i)(n))return Object(w.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var t=n.key,g=n.props,p=g.children,m=Object(O.a)(g,["children"]),b=Object(W.a)({key:t},m),_=o(p);return _.length&&(b.children=_),b}).filter(function(n){return n})}return o(i)}function C(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=new Set(o===!0?[]:o),r=[];function n(t){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(p,m){var b=Object(D.h)(g?g.pos:"0",m),_=B(p.key,b),l=Object(W.a)(Object(W.a)({},p),{},{parent:g,pos:b,children:null,data:p,isStart:[].concat(Object(ne.a)(g?g.isStart:[]),[m===0]),isEnd:[].concat(Object(ne.a)(g?g.isEnd:[]),[m===t.length-1])});return r.push(l),o===!0||s.has(_)?l.children=n(p.children||[],l):l.children=[],l})}return n(i),r}function y(i,o,s){var r;s?typeof s=="string"?r=function(g){return g[s]}:typeof s=="function"&&(r=function(g){return s(g)}):r=function(g,p){return B(g.key,p)};function n(t,g,p){var m=t?t.children:i,b=t?Object(D.h)(p.pos,g):"0";if(t){var _=r(t,b),l={node:t,index:g,pos:b,key:_,parentPos:p.node?p.pos:null,level:p.level+1};o(l)}m&&m.forEach(function(f,u){n(f,u,{node:t,pos:b,level:p?p.level+1:-1})})}n(null)}function c(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.initWrapper,r=o.processEntity,n=o.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,g={},p={},m={posEntities:g,keyEntities:p};return s&&(m=s(m)||m),y(i,function(b){var _=b.node,l=b.index,f=b.pos,u=b.key,h=b.parentPos,E=b.level,v={node:_,index:l,key:u,pos:f,level:E},S=B(u,f);g[f]=v,p[S]=v,v.parent=g[h],v.parent&&(v.parent.children=v.parent.children||[],v.parent.children.push(v)),r&&r(v,m)},t),n&&n(m),m}function d(i,o){var s=o.expandedKeys,r=o.selectedKeys,n=o.loadedKeys,t=o.loadingKeys,g=o.checkedKeys,p=o.halfCheckedKeys,m=o.dragOverNodeKey,b=o.dropPosition,_=o.keyEntities,l=_[i],f={eventKey:i,expanded:s.indexOf(i)!==-1,selected:r.indexOf(i)!==-1,loaded:n.indexOf(i)!==-1,loading:t.indexOf(i)!==-1,checked:g.indexOf(i)!==-1,halfChecked:p.indexOf(i)!==-1,pos:String(l?l.pos:""),dragOver:m===i&&b===0,dragOverGapTop:m===i&&b===-1,dragOverGapBottom:m===i&&b===1};return f}function a(i){var o=i.data,s=i.expanded,r=i.selected,n=i.checked,t=i.loaded,g=i.loading,p=i.halfChecked,m=i.dragOver,b=i.dragOverGapTop,_=i.dragOverGapBottom,l=i.pos,f=i.active,u=Object(W.a)(Object(W.a)({},o),{},{expanded:s,selected:r,checked:n,loaded:t,loading:g,halfChecked:p,dragOver:m,dragOverGapTop:b,dragOverGapBottom:_,pos:l,active:f});return"props"in u||Object.defineProperty(u,"props",{get:function(){return Object(w.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),u}},"8HAY":function(qe,ve,U){"use strict";U.d(ve,"a",function(){return w}),U.d(ve,"b",function(){return D}),U.d(ve,"d",function(){return B}),U.d(ve,"e",function(){return M}),U.d(ve,"c",function(){return e});var ne=U("MI8n"),W=U("pmY6"),O=U("3/fG"),k=function(C,y,c,d){function a(i){return i instanceof c?i:new c(function(o){o(i)})}return new(c||(c=Promise))(function(i,o){function s(t){try{n(d.next(t))}catch(g){o(g)}}function r(t){try{n(d.throw(t))}catch(g){o(g)}}function n(t){t.done?i(t.value):a(t.value).then(s,r)}n((d=d.apply(C,y||[])).next())})};class w extends W.a{constructor(C,y="",c="",d=!0,a){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=C,this._label=y,this._cssClass=c,this._enabled=d,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(C){this._setLabel(C)}_setLabel(C){this._label!==C&&(this._label=C,this._onDidChange.fire({label:C}))}get tooltip(){return this._tooltip||""}set tooltip(C){this._setTooltip(C)}_setTooltip(C){this._tooltip!==C&&(this._tooltip=C,this._onDidChange.fire({tooltip:C}))}get class(){return this._cssClass}set class(C){this._setClass(C)}_setClass(C){this._cssClass!==C&&(this._cssClass=C,this._onDidChange.fire({class:C}))}get enabled(){return this._enabled}set enabled(C){this._setEnabled(C)}_setEnabled(C){this._enabled!==C&&(this._enabled=C,this._onDidChange.fire({enabled:C}))}get checked(){return this._checked}set checked(C){this._setChecked(C)}_setChecked(C){this._checked!==C&&(this._checked=C,this._onDidChange.fire({checked:C}))}run(C,y){return k(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(C))})}}class D extends W.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(C,y){return k(this,void 0,void 0,function*(){if(!C.enabled)return;this._onBeforeRun.fire({action:C});let c;try{yield this.runAction(C,y)}catch(d){c=d}this._onDidRun.fire({action:C,error:c})})}runAction(C,y){return k(this,void 0,void 0,function*(){yield C.run(y)})}}class B extends w{constructor(C){super(B.ID,C,C?"separator text":"separator");this.checked=!1,this.enabled=!1}}B.ID="vs.actions.separator";class M{constructor(C,y,c,d){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=C,this.label=y,this.class=d,this._actions=c}get actions(){return this._actions}dispose(){}run(){return k(this,void 0,void 0,function*(){})}}class e extends w{constructor(){super(e.ID,O.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(qe,ve,U){qe.exports={button:"button___1wy9m"}},"9Bee":function(qe,ve,U){"use strict";var ne=U("DYRE"),W=U("zeV3"),O=U("+L6B"),k=U("2/Rp"),w=U("k1fw"),D=U("9og8"),B=U("tJVT"),M=U("WmNS"),e=U.n(M),C=U("q1tI"),y=U.n(C),c=U("vg9a"),d=U("DlQD"),a=U.n(d),i=U("rUJ1");function o(F,T){var x=F.match(/^(\s+)(?:```)/);if(x===null)return T;var N=x[1];return T.split(`
|
|
`).map(function(G){var j=G.match(/^\s+/);if(j===null)return G;var _e=Object(B.a)(j,1),Ge=_e[0];return Ge.length>=N.length?G.slice(N.length):G}).join(`
|
|
`)}var s=[],r=["<ul>"],n=new a.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function g(){s.length=0,r=["<ul>"]}var p={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(F,T,x,N){if(T>=F.length||F[T].level<=x)return T;var G=F[T];N.push("<li><a href='#"+G.anchor+"'>"+G.text+"</a>"),T++;var j=[];return T=m(F,T,G.level,j),j.length>0&&(N.push("<ul>"),j.forEach(function(_e){N.push(_e)}),N.push("</ul>")),N.push("</li>"),T=m(F,T,x,N),T}function b(){return m(s,0,0,r),r.push("</ul>"),r.join("")}var _={heading:function(T){var x=t.exec(T);if(x)return{type:"heading",raw:x[0],depth:x[1].length,text:x[2]}},fences:function(T){var x=this.rules.block.fences.exec(T);if(x){var N=x[0],G=o(N,x[3]||""),j=x[2]?x[2].trim():x[2];if(["latex","katex","math"].indexOf(j)>=0){var _e=u(),Ge=G;G=_e,h[_e]={type:"block",expression:Ge}}return{type:"code",raw:N,lang:j,text:G}}}},l=/(?:\${2})([^\n`]+?)(?:\${2})/gi,f=0,u=function(){return"__special_katext_id_".concat(f++,"__")},h={};function E(){return h}function v(){f=0,h={}}function S(F){return F=F.replace(l,function(T,x){var N=u();return h[N]={type:"inline",expression:x},N}),F}var L=n.listitem;n.listitem=function(F){return L(S(F))};var I=n.paragraph;n.paragraph=function(F){return I(S(F))};var A=n.tablecell;n.tablecell=function(F,T){return A(S(F),T)},n.code=function(F,T,x){var N=(T||"").match(/\S*/)[0];return N?["latex","katex","math"].indexOf(N)>=0?"<p class='editormd-tex'>".concat(F,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(T,'">').concat(x?F:Object(i.escape)(F,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(x?F:Object(i.escape)(F,!0))+"</code></pre>"},n.heading=function(F,T,x){var N=this.options.headerPrefix+x.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:N,level:T,text:F}),"<h"+T+' id="'+N+'">'+F+"</h"+T+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:_,renderer:n});var P=a.a,H=U("SJMd"),R=U("ulZh"),K=U.n(R),z=U("m3rI"),oe=U("Oy/b"),$=U("p5ED"),fe=U("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var de=function(F,T){return(de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,N){x.__proto__=N}||function(x,N){for(var G in N)Object.prototype.hasOwnProperty.call(N,G)&&(x[G]=N[G])})(F,T)};function ee(F,T){function x(){this.constructor=F}de(F,T),F.prototype=T===null?Object.create(T):(x.prototype=T.prototype,new x)}function ie(F,T,x,N){return new(x||(x=Promise))(function(G,j){function _e(st){try{tt(N.next(st))}catch(Ve){j(Ve)}}function Ge(st){try{tt(N.throw(st))}catch(Ve){j(Ve)}}function tt(st){var Ve;st.done?G(st.value):(Ve=st.value,Ve instanceof x?Ve:new x(function(yt){yt(Ve)})).then(_e,Ge)}tt((N=N.apply(F,T||[])).next())})}function ge(F,T){var x,N,G,j,_e={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return j={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(j[Symbol.iterator]=function(){return this}),j;function Ge(tt){return function(st){return function(Ve){if(x)throw new TypeError("Generator is already executing.");for(;_e;)try{if(x=1,N&&(G=2&Ve[0]?N.return:Ve[0]?N.throw||((G=N.return)&&G.call(N),0):N.next)&&!(G=G.call(N,Ve[1])).done)return G;switch(N=0,G&&(Ve=[2&Ve[0],G.value]),Ve[0]){case 0:case 1:G=Ve;break;case 4:return _e.label++,{value:Ve[1],done:!1};case 5:_e.label++,N=Ve[1],Ve=[0];continue;case 7:Ve=_e.ops.pop(),_e.trys.pop();continue;default:if(!(G=_e.trys,(G=G.length>0&&G[G.length-1])||Ve[0]!==6&&Ve[0]!==2)){_e=0;continue}if(Ve[0]===3&&(!G||Ve[1]>G[0]&&Ve[1]<G[3])){_e.label=Ve[1];break}if(Ve[0]===6&&_e.label<G[1]){_e.label=G[1],G=Ve;break}if(G&&_e.label<G[2]){_e.label=G[2],_e.ops.push(Ve);break}G[2]&&_e.ops.pop(),_e.trys.pop();continue}Ve=T.call(F,_e)}catch(yt){Ve=[6,yt],N=0}finally{x=G=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([tt,st])}}}function Z(){for(var F=0,T=0,x=arguments.length;T<x;T++)F+=arguments[T].length;var N=Array(F),G=0;for(T=0;T<x;T++)for(var j=arguments[T],_e=0,Ge=j.length;_e<Ge;_e++,G++)N[G]=j[_e];return N}var Y=function(){function F(){}return F.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},F.setAttributes=function(T,x){for(var N=0,G=x;N<G.length;N++){var j=G[N],_e=j[0],Ge=j[1];T.setAttribute(_e,Ge)}},F.createRect=function(T,x,N){var G=document.createElementNS("http://www.w3.org/2000/svg","rect");return G.setAttribute("width",T.toString()),G.setAttribute("height",x.toString()),N&&F.setAttributes(G,N),G},F.createLine=function(T,x,N,G,j){var _e=document.createElementNS("http://www.w3.org/2000/svg","line");return _e.setAttribute("x1",T.toString()),_e.setAttribute("y1",x.toString()),_e.setAttribute("x2",N.toString()),_e.setAttribute("y2",G.toString()),j&&F.setAttributes(_e,j),_e},F.createPolygon=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","polygon");return N.setAttribute("points",T),x&&F.setAttributes(N,x),N},F.createCircle=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","circle");return N.setAttribute("cx",(T/2).toString()),N.setAttribute("cy",(T/2).toString()),N.setAttribute("r",T.toString()),x&&F.setAttributes(N,x),N},F.createEllipse=function(T,x,N){var G=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return G.setAttribute("cx",(T/2).toString()),G.setAttribute("cy",(x/2).toString()),G.setAttribute("rx",(T/2).toString()),G.setAttribute("ry",(x/2).toString()),N&&F.setAttributes(G,N),G},F.createGroup=function(T){var x=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&F.setAttributes(x,T),x},F.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},F.createMarker=function(T,x,N,G,j,_e,Ge){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(tt,[["id",T],["orient",x],["markerWidth",N.toString()],["markerHeight",G.toString()],["refX",j.toString()],["refY",_e.toString()]]),tt.appendChild(Ge),tt},F.createText=function(T){var x=document.createElementNS("http://www.w3.org/2000/svg","text");return x.setAttribute("x","0"),x.setAttribute("y","0"),T&&F.setAttributes(x,T),x},F.createTSpan=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","tspan");return N.textContent=T,x&&F.setAttributes(N,x),N},F.createImage=function(T){var x=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&F.setAttributes(x,T),x},F.createPoint=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return N.x=T,N.y=x,N},F.createPath=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","path");return N.setAttribute("d",T),x&&F.setAttributes(N,x),N},F}(),Se=function(){function F(){}return F.addKey=function(T){F.key=T},Object.defineProperty(F,"isLicensed",{get:function(){return!!F.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(F.key)},enumerable:!1,configurable:!0}),F}(),Pe=function(){function F(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return F.prototype.rasterize=function(T,x,N){var G=this;return new Promise(function(j){var _e=N!==void 0?N:document.createElement("canvas");T===null&&(G.markersOnly=!0,G.naturalSize=!1);var Ge=document.createElementNS("http://www.w3.org/2000/svg","svg");Ge.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ge.setAttribute("width",x.width.baseVal.valueAsString),Ge.setAttribute("height",x.height.baseVal.valueAsString),Ge.setAttribute("viewBox","0 0 "+x.viewBox.baseVal.width.toString()+" "+x.viewBox.baseVal.height.toString()),Ge.innerHTML=x.innerHTML,G.naturalSize===!0?(Ge.width.baseVal.value=T.naturalWidth,Ge.height.baseVal.value=T.naturalHeight):G.width!==void 0&&G.height!==void 0&&(Ge.width.baseVal.value=G.width,Ge.height.baseVal.value=G.height),_e.width=Ge.width.baseVal.value,_e.height=Ge.height.baseVal.value;var tt=Ge.outerHTML,st=_e.getContext("2d");G.markersOnly!==!0&&st.drawImage(T,0,0,_e.width,_e.height);var Ve=window.URL,yt=new Image(_e.width,_e.height);yt.setAttribute("crossOrigin","anonymous");var jt=new Blob([tt],{type:"image/svg+xml"}),Qt=Ve.createObjectURL(jt);yt.onload=function(){st.drawImage(yt,0,0),Ve.revokeObjectURL(Qt);var Dn=_e.toDataURL(G.imageType,G.imageQuality);j(Dn)},yt.src=Qt})},F}(),ke=function(){},Re=function(){function F(T){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(F.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(F.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(F.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),F.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},F.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},F.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new Me("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Me("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Me("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ce("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ce("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},F.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},F}(),Me=function(F,T){this.selector=F,this.style=T},Ce=function(F,T){this.localName=F,this.style=T},Le=function(){function F(T,x,N,G,j){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=x,this.markerItems=N,this.uiStyleSettings=G,this.styles=j,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return F.prototype.show=function(T){var x=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var N=document.createElement("div");N.className=this.toolbarBlockStyleClass.name,N.style.whiteSpace="nowrap",this.uiContainer.appendChild(N),this.addActionButton(N,'<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(N,'<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(N,'<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(N,'<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(N,'<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(N,'<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(N,'<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(N,'<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(j){var _e=document.createElement("div");_e.className=""+x.toolbarButtonStyleClass.name,_e.setAttribute("data-type-name",j.typeName),_e.innerHTML=j.icon,_e.addEventListener("click",function(){x.markerToolbarButtonClicked(_e,j)}),x.buttons.push(_e),x.markerButtons.push(_e)}),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()},F.prototype.addButtonClickListener=function(T){this.buttonClickListeners.push(T)},F.prototype.removeButtonClickListener=function(T){this.buttonClickListeners.indexOf(T)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(T),1)},F.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},F.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var T=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var x=0;x<this.markerButtons.length;x++)x<T||x===T&&this.markerButtons.length-1===T?this.markerButtonBlock.appendChild(this.markerButtons[x]):(x===T&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[x]))}},F.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")},F.prototype.resetButtonStyles=function(){var T=this;this.buttons.forEach(function(x){x.className=x.className.replace(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name,"").trim(),x.className=x.className.replace(T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?T.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:T.toolbarActiveButtonStyleColorsClass.name,"").trim(),x.className+=" "+(T.uiStyleSettings.toolbarButtonStyleColorsClassName?T.uiStyleSettings.toolbarButtonStyleColorsClassName:T.toolbarButtonStyleColorsClass.name)})},F.prototype.addActionButton=function(T,x,N){var G=this,j=document.createElement("div");switch(j.className=""+this.toolbarButtonStyleClass.name,j.innerHTML=x,j.setAttribute("data-action",N),j.addEventListener("click",function(){G.actionToolbarButtonClicked(j,N)}),N){case"select":j.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":j.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":j.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":j.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":j.style.fill=this.uiStyleSettings.closeButtonColor}T.appendChild(j),this.buttons.push(j)},F.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ce("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 Ce("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ce("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ce("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 Ce("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ce("toolbar_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.toolbarButtonStyleColorsClass=this.styles.addClass(new Ce("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ce("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Me("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Me("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},F.prototype.markerToolbarButtonClicked=function(T,x){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(N){return N("marker",x)}),this.markerButtonOverflowBlock.style.display="none"},F.prototype.actionToolbarButtonClicked=function(T,x){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(N){return N("action",x)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},F.prototype.setActiveButton=function(T){this.resetButtonStyles(),T.className=T.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),T.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},F.prototype.setActiveMarkerButton=function(T){var x=this.markerButtons.find(function(N){return N.getAttribute("data-type-name")===T});x&&this.setActiveButton(x)},F.prototype.setCurrentMarker=function(T){var x=this;this.currentMarker=T,this.buttons.filter(function(N){return/delete|notes/.test(N.getAttribute("data-action"))}).forEach(function(N){x.currentMarker===void 0?(N.style.fillOpacity="0.4",N.style.pointerEvents="none"):(N.style.fillOpacity="1",N.style.pointerEvents="all")})},F}(),Ne=function(){function F(T,x,N,G){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=x,this.uiStyleSettings=N,this.styles=G,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return F.prototype.addStyles=function(){var T;this.toolboxStyleClass=this.styles.addClass(new Ce("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 Ce("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var x=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ce("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ce("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ce("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 Ce("toolbox-panel-row_colors",`
|
|
background-color: `+((T=this.uiStyleSettings.toolboxBackgroundColor)!==null&&T!==void 0?T:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ce("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
|
|
padding: `+x+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ce("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ce("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Me("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Me("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},F.prototype.show=function(T){var x;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=T,this.uiContainer.className=this.toolboxStyleClass.name+" "+((x=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&x!==void 0?x:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},F.prototype.setPanelButtons=function(T){var x,N,G=this;this.panels=T,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((x=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&x!==void 0?x:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(j){var _e;j.uiStyleSettings=G.uiStyleSettings;var Ge=document.createElement("div");Ge.className=G.toolboxButtonStyleClass.name+" "+((_e=G.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&_e!==void 0?_e:G.toolboxButtonStyleColorsClass.name),Ge.innerHTML=j.icon,Ge.title=j.title,Ge.addEventListener("click",function(){G.panelButtonClick(j)}),G.panelButtons.push(Ge),G.buttonRow.appendChild(Ge)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},F.prototype.panelButtonClick=function(T){var x=this,N=-1;if(T!==this.activePanel){N=this.panels.indexOf(T),this.panelRow.innerHTML="";var G=T.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=T}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){x.displayMode==="inline"?x.panelRow.style.display="none":x.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(j,_e){var Ge,tt;j.className=x.toolboxButtonStyleClass.name+" "+(_e===N?""+((Ge=x.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ge!==void 0?Ge:x.toolboxActiveButtonStyleColorsClass.name):""+((tt=x.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:x.toolboxButtonStyleColorsClass.name))})},F}(),J=function(F,T){this.title=F,this.icon=T},pe=function(F){function T(x,N,G,j){var _e=F.call(this,x,j||'<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 _e.colors=[],_e.addTransparent=!1,_e.colorBoxes=[],_e.colors=N,_e.currentColor=G,_e.setCurrentColor=_e.setCurrentColor.bind(_e),_e.getColorBox=_e.getColorBox.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,N=document.createElement("div");return N.style.overflow="hidden",N.style.whiteSpace="nowrap",this.colors.forEach(function(G){var j=x.getColorBox(G);N.appendChild(j),x.colorBoxes.push(j)}),N},T.prototype.getColorBox=function(x){var N=this,G=this.uiStyleSettings.toolbarHeight/4,j=this.uiStyleSettings.toolbarHeight-G,_e=document.createElement("div");_e.style.display="inline-block",_e.style.boxSizing="content-box",_e.style.width=j-2+"px",_e.style.height=j-2+"px",_e.style.padding="1px",_e.style.marginRight="2px",_e.style.marginBottom="2px",_e.style.borderWidth="2px",_e.style.borderStyle="solid",_e.style.borderRadius=(j+2)/2+"px",_e.style.borderColor=x===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",_e.addEventListener("click",function(){N.setCurrentColor(x,_e)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=j-2+"px",Ge.style.height=j-2+"px",Ge.style.backgroundColor=x,Ge.style.borderRadius=j/2+"px",x==="transparent"&&(Ge.style.fill=this.uiStyleSettings.toolboxAccentColor,Ge.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>`),_e.appendChild(Ge),_e},T.prototype.setCurrentColor=function(x,N){var G=this;this.currentColor=x,this.colorBoxes.forEach(function(j){j.style.borderColor=j===N?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(x)},T}(J),Te=function(){function F(T,x,N){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=x,this.globalSettings=N,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(F.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),F.prototype.ownsTarget=function(T){return!1},Object.defineProperty(F.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),F.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},F.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},F.prototype.pointerDown=function(T,x){},F.prototype.dblClick=function(T,x){},F.prototype.manipulate=function(T){},F.prototype.pointerUp=function(T){this.stateChanged()},F.prototype.dispose=function(){},F.prototype.addMarkerVisualToContainer=function(T){this.container.childNodes.length>0?this.container.insertBefore(T,this.container.childNodes[0]):this.container.appendChild(T)},F.prototype.getState=function(){return{typeName:F.typeName,state:this.state,notes:this.notes}},F.prototype.restoreState=function(T){this._state=T.state,this.notes=T.notes},F.prototype.scale=function(T,x){},F.prototype.colorChanged=function(T){this.onColorChanged&&this.onColorChanged(T),this.stateChanged()},F.prototype.fillColorChanged=function(T){this.onFillColorChanged&&this.onFillColorChanged(T),this.stateChanged()},F.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var T=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),T.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(T)&&this.onStateChanged(this)}},F.typeName="MarkerBase",F}(),xe=function(){function F(){this.findGripByVisual=this.findGripByVisual.bind(this)}return F.prototype.findGripByVisual=function(T){return this.topLeft.ownsTarget(T)?this.topLeft:this.topCenter.ownsTarget(T)?this.topCenter:this.topRight.ownsTarget(T)?this.topRight:this.centerLeft.ownsTarget(T)?this.centerLeft:this.centerRight.ownsTarget(T)?this.centerRight:this.bottomLeft.ownsTarget(T)?this.bottomLeft:this.bottomCenter.ownsTarget(T)?this.bottomCenter:this.bottomRight.ownsTarget(T)?this.bottomRight:void 0},F}(),We=function(){function F(){this.GRIP_SIZE=10,this.visual=Y.createGroup(),this.visual.appendChild(Y.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Y.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},F}(),He=function(){function F(){}return F.toITransformMatrix=function(T){return{a:T.a,b:T.b,c:T.c,d:T.d,e:T.e,f:T.f}},F.toSVGMatrix=function(T,x){return T.a=x.a,T.b=x.b,T.c=x.c,T.d=x.d,T.e=x.e,T.f=x.f,T},F}(),Oe=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.left=0,j.top=0,j.width=0,j.height=0,j.defaultSize={x:50,y:20},j.offsetX=0,j.offsetY=0,j.rotationAngle=0,j.CB_DISTANCE=10,j._suppressMarkerCreateEvent=!1,j.container.transform.baseVal.appendItem(Y.createTransform()),j.setupControlBox(),j}return ee(T,F),Object.defineProperty(T.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"visual",{get:function(){return this._visual},set:function(x){this._visual=x;var N=Y.createTransform();this._visual.transform.baseVal.appendItem(N)},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(x){return!!F.prototype.ownsTarget.call(this,x)||!!(this.controlGrips.findGripByVisual(x)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(x))},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.state==="new"&&(this.left=x.x,this.top=x.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var G=this.unrotatePoint(x);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(N),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N)){this.activeGrip=this.rotatorGrip;var j=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=j.x-this.width/2,this.top=j.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var _e=this.container.transform.baseVal.getItem(0);_e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(_e,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},T.prototype.pointerUp=function(x){var N=this.state;F.prototype.pointerUp.call(this,x),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(x),this._state="select",N==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},T.prototype.moveVisual=function(x){this.visual.style.transform="translate("+x.x+"px, "+x.y+"px)"},T.prototype.manipulate=function(x){var N=this.unrotatePoint(x);this.state==="creating"?this.resize(x):this.state==="move"?(this.left=this.manipulationStartLeft+(N.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(N.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(N):this.state==="rotate"&&this.rotate(x)},T.prototype.resize=function(x){var N=this.manipulationStartLeft,G=this.manipulationStartWidth,j=this.manipulationStartTop,_e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:N=this.manipulationStartLeft+x.x-this.manipulationStartX,G=this.manipulationStartWidth+this.manipulationStartLeft-N;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:G=this.manipulationStartWidth+x.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:j=this.manipulationStartTop+x.y-this.manipulationStartY,_e=this.manipulationStartHeight+this.manipulationStartTop-j;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:_e=this.manipulationStartHeight+x.y-this.manipulationStartY}G>=0?(this.left=N,this.width=G):(this.left=N+G,this.width=-G),_e>=0?(this.top=j,this.height=_e):(this.top=j+_e,this.height=-_e),this.setSize()},T.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},T.prototype.rotate=function(x){if(Math.abs(x.x-this.centerX)>.1){var N=Math.sign(x.x-this.centerX);this.rotationAngle=180*Math.atan((x.y-this.centerY)/(x.x-this.centerX))/Math.PI+90*N,this.applyRotation()}},T.prototype.applyRotation=function(){var x=this.container.transform.baseVal.getItem(0);x.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(x,0)},T.prototype.rotatePoint=function(x){if(this.rotationAngle===0)return x;var N=this.container.getCTM(),G=Y.createPoint(x.x,x.y);return{x:(G=G.matrixTransform(N)).x,y:G.y}},T.prototype.unrotatePoint=function(x){if(this.rotationAngle===0)return x;var N=this.container.getCTM();N=N.inverse();var G=Y.createPoint(x.x,x.y);return{x:(G=G.matrixTransform(N)).x,y:G.y}},T.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=Y.createGroup();var x=Y.createTransform();x.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(x),this.container.appendChild(this.controlBox),this.controlRect=Y.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=Y.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 xe,this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){var x=this.controlBox.transform.baseVal.getItem(0);x.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(x,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()},T.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()},T.prototype.createGrip=function(){var x=new We;return x.visual.transform.baseVal.appendItem(Y.createTransform()),this.controlBox.appendChild(x.visual),x},T.prototype.positionGrips=function(){var x=this.controlGrips.topLeft.GRIP_SIZE,N=-x/2,G=N,j=(this.width+this.CB_DISTANCE)/2-x/2,_e=(this.height+this.CB_DISTANCE)/2-x/2,Ge=this.height+this.CB_DISTANCE-x/2,tt=this.width+this.CB_DISTANCE-x/2;this.positionGrip(this.controlGrips.topLeft.visual,N,G),this.positionGrip(this.controlGrips.topCenter.visual,j,G),this.positionGrip(this.controlGrips.topRight.visual,tt,G),this.positionGrip(this.controlGrips.centerLeft.visual,N,_e),this.positionGrip(this.controlGrips.centerRight.visual,tt,_e),this.positionGrip(this.controlGrips.bottomLeft.visual,N,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,j,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,j,G-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(x,N,G){var j=x.transform.baseVal.getItem(0);j.setTranslate(N,G),x.transform.baseVal.replaceItem(j,0)},T.prototype.hideControlBox=function(){this.controlBox.style.display="none"},T.prototype.showControlBox=function(){this.controlBox.style.display=""},T.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:He.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:He.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},F.prototype.getState.call(this))},T.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var N=x;this.left=N.left,this.top=N.top,this.width=N.width,this.height=N.height,this.rotationAngle=N.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,N.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,N.containerTransformMatrix))},T.prototype.scale=function(x,N){F.prototype.scale.call(this,x,N);var G=this.rotatePoint({x:this.left,y:this.top}),j=this.unrotatePoint({x:G.x*x,y:G.y*N});this.left=j.x,this.top=j.y,this.width=this.width*x,this.height=this.height*N,this.adjustControlBox()},T}(Te),Ue=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.fillColor="transparent",j.strokeColor="transparent",j.strokeWidth=0,j.strokeDasharray="",j.opacity=1,j.setStrokeColor=j.setStrokeColor.bind(j),j.setFillColor=j.setFillColor.bind(j),j.setStrokeWidth=j.setStrokeWidth.bind(j),j.setStrokeDasharray=j.setStrokeDasharray.bind(j),j.createVisual=j.createVisual.bind(j),j}return ee(T,F),T.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual)},T.prototype.createVisual=function(){this.visual=Y.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)},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},T.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x)},T.prototype.resize=function(x){F.prototype.resize.call(this,x),this.setSize()},T.prototype.setSize=function(){F.prototype.setSize.call(this),Y.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(x){F.prototype.pointerUp.call(this,x),this.setSize()},T.prototype.setStrokeColor=function(x){this.strokeColor=x,this.visual&&Y.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(x),this.stateChanged()},T.prototype.setFillColor=function(x){this.fillColor=x,this.visual&&Y.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},T.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.visual&&Y.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.visual&&Y.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this))},T.prototype.restoreState=function(x){var N=x;this.fillColor=N.fillColor,this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.opacity=N.opacity,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},T.prototype.scale=function(x,N){F.prototype.scale.call(this,x,N),this.setSize()},T.title="Rectangle marker",T}(Oe),Qe=function(F){function T(x,N,G,j){var _e=F.call(this,x,j||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return _e.widths=[],_e.widthBoxes=[],_e.widths=N,_e.currentWidth=G,_e.setCurrentWidth=_e.setCurrentWidth.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",this.widths.forEach(function(G){var j=document.createElement("div");j.style.display="flex",j.style.flexGrow="2",j.style.alignItems="center",j.style.justifyContent="space-between",j.style.padding="5px",j.style.borderWidth="2px",j.style.borderStyle="solid",j.style.borderColor=G===x.currentWidth?x.uiStyleSettings.toolboxAccentColor:"transparent",j.addEventListener("click",function(){x.setCurrentWidth(G,j)}),N.appendChild(j);var _e=document.createElement("div");_e.innerText=G.toString(),_e.style.marginRight="5px",j.appendChild(_e);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=G+"px solid "+x.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",Ge.appendChild(tt),j.appendChild(Ge),x.widthBoxes.push(j)}),N},T.prototype.setCurrentWidth=function(x,N){var G=this;this.currentWidth=x,this.widthBoxes.forEach(function(j){j.style.borderColor=j===N?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(J),Ze=function(F){function T(x,N,G,j){var _e=F.call(this,x,j||'<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 _e.styles=[],_e.styleBoxes=[],_e.styles=N,_e.currentStyle=G,_e.setCurrentStyle=_e.setCurrentStyle.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",this.styles.forEach(function(G){var j=document.createElement("div");j.style.display="flex",j.style.alignItems="center",j.style.justifyContent="space-between",j.style.padding="5px",j.style.borderWidth="2px",j.style.borderStyle="solid",j.style.overflow="hidden",j.style.maxWidth=100/x.styles.length-5+"%",j.style.borderColor=G===x.currentStyle?x.uiStyleSettings.toolboxAccentColor:"transparent",j.addEventListener("click",function(){x.setCurrentStyle(G,j)}),N.appendChild(j);var _e=document.createElement("div");_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.overflow="hidden";var Ge=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+x.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(G!==""?'stroke-dasharray="'+G+'"':"")+` />
|
|
</svg>`;_e.innerHTML=Ge,j.appendChild(_e),x.styleBoxes.push(j)}),N},T.prototype.setCurrentStyle=function(x,N){var G=this;this.currentStyle=x,this.styleBoxes.forEach(function(j){j.style.borderColor=j===N?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(J),Je=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.strokeColor=G.defaultColor,j.strokeWidth=G.defaultStrokeWidth,j.strokeDasharray=G.defaultStrokeDasharray,j.strokePanel=new pe("Line color",G.defaultColorSet,G.defaultColor),j.strokePanel.onColorChanged=j.setStrokeColor,j.strokeWidthPanel=new Qe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),j.strokeWidthPanel.onWidthChanged=j.setStrokeWidth,j.strokeStylePanel=new Ze("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),j.strokeStylePanel.onStyleChanged=j.setStrokeDasharray,j}return ee(T,F),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=T.typeName,x},T.typeName="FrameMarker",T.title="Frame marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',T}(Ue),ze=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},nt=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.x1=0,j.y1=0,j.x2=0,j.y2=0,j.defaultLength=50,j.manipulationStartX=0,j.manipulationStartY=0,j.manipulationStartX1=0,j.manipulationStartY1=0,j.manipulationStartX2=0,j.manipulationStartY2=0,j.setupControlBox(),j}return ee(T,F),T.prototype.ownsTarget=function(x){return!!F.prototype.ownsTarget.call(this,x)||!(!this.grip1.ownsTarget(x)&&!this.grip2.ownsTarget(x))},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.manipulationStartX=x.x,this.manipulationStartY=x.y,this.state==="new"&&(this.x1=x.x,this.y1=x.y,this.x2=x.x,this.y2=x.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(N)?this.activeGrip=this.grip1:this.grip2.ownsTarget(N)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(x){var N=this.state;F.prototype.pointerUp.call(this,x),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(x),this._state="select",N==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},T.prototype.adjustVisual=function(){},T.prototype.manipulate=function(x){this.state==="creating"?this.resize(x):this.state==="move"?(this.x1=this.manipulationStartX1+x.x-this.manipulationStartX,this.y1=this.manipulationStartY1+x.y-this.manipulationStartY,this.x2=this.manipulationStartX2+x.x-this.manipulationStartX,this.y2=this.manipulationStartY2+x.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(x)},T.prototype.resize=function(x){switch(this.activeGrip){case this.grip1:this.x1=x.x,this.y1=x.y;break;case this.grip2:case void 0:this.x2=x.x,this.y2=x.y}this.adjustVisual(),this.adjustControlBox()},T.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},T.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},T.prototype.setupControlBox=function(){this.controlBox=Y.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},T.prototype.adjustControlBox=function(){this.positionGrips()},T.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},T.prototype.createGrip=function(){var x=new We;return x.visual.transform.baseVal.appendItem(Y.createTransform()),this.controlBox.appendChild(x.visual),x},T.prototype.positionGrips=function(){var x=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-x/2,this.y1-x/2),this.positionGrip(this.grip2.visual,this.x2-x/2,this.y2-x/2)},T.prototype.positionGrip=function(x,N,G){var j=x.transform.baseVal.getItem(0);j.setTranslate(N,G),x.transform.baseVal.replaceItem(j,0)},T.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},F.prototype.getState.call(this))},T.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var N=x;this.x1=N.x1,this.y1=N.y1,this.x2=N.x2,this.y2=N.y2},T.prototype.scale=function(x,N){F.prototype.scale.call(this,x,N),this.x1=this.x1*x,this.y1=this.y1*N,this.x2=this.x2*x,this.y2=this.y2*N,this.adjustVisual(),this.adjustControlBox()},T}(Te),it=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.strokeColor="transparent",j.strokeWidth=0,j.strokeDasharray="",j.setStrokeColor=j.setStrokeColor.bind(j),j.setStrokeWidth=j.setStrokeWidth.bind(j),j.setStrokeDasharray=j.setStrokeDasharray.bind(j),j.strokeColor=G.defaultColor,j.strokeWidth=G.defaultStrokeWidth,j.strokeDasharray=G.defaultStrokeDasharray,j.strokePanel=new pe("Line color",G.defaultColorSet,G.defaultColor),j.strokePanel.onColorChanged=j.setStrokeColor,j.strokeWidthPanel=new Qe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),j.strokeWidthPanel.onWidthChanged=j.setStrokeWidth,j.strokeStylePanel=new Ze("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),j.strokeStylePanel.onStyleChanged=j.setStrokeDasharray,j}return ee(T,F),T.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.selectorLine&&x!==this.visibleLine)},T.prototype.createVisual=function(){this.visual=Y.createGroup(),this.selectorLine=Y.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Y.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)},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},T.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()),Y.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Y.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Y.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setStrokeColor=function(x){this.strokeColor=x,this.adjustVisual(),this.colorChanged(x)},T.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.adjustVisual()},T.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},F.prototype.getState.call(this));return x.typeName=T.typeName,x},T.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var N=x;this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.createVisual(),this.adjustVisual()},T.typeName="LineMarker",T.title="Line marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',T}(nt),je=function(F){function T(x,N,G,j){var _e=F.call(this,x,j||'<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 _e.fonts=[],_e.fontBoxes=[],_e.fonts=N,_e.currentFont=G,_e.setCurrentFont=_e.setCurrentFont.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,N=document.createElement("div");return N.style.overflow="hidden",N.style.flexGrow="2",this.fonts.forEach(function(G){var j=document.createElement("div");j.style.display="inline-block",j.style.alignItems="center",j.style.justifyContent="space-between",j.style.padding="5px",j.style.borderWidth="2px",j.style.borderStyle="solid",j.style.overflow="hidden",j.style.maxWidth=100/x.fonts.length-5+"%",j.style.borderColor=G===x.currentFont?x.uiStyleSettings.toolboxAccentColor:"transparent",j.addEventListener("click",function(){x.setCurrentFont(G,j)}),N.appendChild(j);var _e=document.createElement("div");_e.style.display="flex",_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.fontFamily=G,_e.style.overflow="hidden";var Ge=document.createElement("div");Ge.style.whiteSpace="nowrap",Ge.style.overflow="hidden",Ge.style.textOverflow="ellipsis",Ge.innerHTML="The quick brown fox jumps over the lazy dog",_e.appendChild(Ge),j.appendChild(_e),x.fontBoxes.push(j)}),N},T.prototype.setCurrentFont=function(x,N){var G=this;this.currentFont=x,this.fontBoxes.forEach(function(j){j.style.borderColor=j===N?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(J),Ke=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.color="transparent",j.padding=5,j.DEFAULT_TEXT="your text here",j.text=j.DEFAULT_TEXT,j.isMoved=!1,j.color=G.defaultColor,j.fontFamily=G.defaultFontFamily,j.defaultSize={x:100,y:30},j.setColor=j.setColor.bind(j),j.setFont=j.setFont.bind(j),j.renderText=j.renderText.bind(j),j.sizeText=j.sizeText.bind(j),j.textEditDivClicked=j.textEditDivClicked.bind(j),j.showTextEditor=j.showTextEditor.bind(j),j.setSize=j.setSize.bind(j),j.positionTextEditor=j.positionTextEditor.bind(j),j.colorPanel=new pe("Color",G.defaultColorSet,G.defaultColor),j.colorPanel.onColorChanged=j.setColor,j.fontFamilyPanel=new je("Font",G.defaultFontFamilies,G.defaultFontFamily),j.fontFamilyPanel.onFontChanged=j.setFont,j}return ee(T,F),T.prototype.ownsTarget=function(x){if(F.prototype.ownsTarget.call(this,x)||x===this.visual||x===this.textElement||x===this.bgRectangle)return!0;var N=!1;return this.textElement.childNodes.forEach(function(G){G===x&&(N=!0)}),N},T.prototype.createVisual=function(){this.visual=Y.createGroup(),this.bgRectangle=Y.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Y.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Y.createTransform()),this.textElement.transform.baseVal.appendItem(Y.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.isMoved=!1,this.pointerDownPoint=x,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},T.prototype.renderText=function(){var x=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(N){x.textElement.appendChild(Y.createTSpan(N.trim()===""?" ":N.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var x=this.textElement.getBBox(),N=1;if(x.width>0&&x.height>0){var G=(1*this.width-this.width*this.padding*2/100)/x.width,j=(1*this.height-this.height*this.padding*2/100)/x.height;N=Math.min(G,j)}return N},T.prototype.getTextPosition=function(x){var N=this.textElement.getBBox(),G=0,j=0;return N.width>0&&N.height>0&&(G=(this.width-N.width*x)/2,j=this.height/2-N.height*x/2),{x:G,y:j}},T.prototype.sizeText=function(){var x=this.textElement.getBBox(),N=this.getTextScale(),G=this.getTextPosition(N);G.y-=x.y*N,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+G.x+"px, "+G.y+"px) scale("+N+", "+N+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(G.x,G.y),this.textElement.transform.baseVal.getItem(1).setScale(N,N))},T.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(x.x-this.pointerDownPoint.x)>5||Math.abs(x.y-this.pointerDownPoint.y)>5)},T.prototype.resize=function(x){F.prototype.resize.call(this,x),this.isMoved=!0,this.setSize(),this.sizeText()},T.prototype.setSize=function(){F.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Y.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Y.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},T.prototype.pointerUp=function(x){var N=this.state;N==="creating"&&(this._suppressMarkerCreateEvent=!0),F.prototype.pointerUp.call(this,x),this.setSize(),(N==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},T.prototype.showTextEditor=function(){var x=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(N){N.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var N=Number.parseFloat(x.textEditor.style.fontSize);x.textEditor.clientWidth>=Number.parseInt(x.textEditor.style.maxWidth)&&N>.9;)N-=.1,x.textEditor.style.fontSize=Math.max(N,.9)+"em"}),this.textEditor.addEventListener("keyup",function(N){N.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(N){if(N.clipboardData){var G=N.clipboardData.getData("text"),j=window.getSelection();if(!j.rangeCount)return!1;j.deleteFromDocument(),j.getRangeAt(0).insertNode(document.createTextNode(G)),N.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){x.textEditDivClicked(x.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},T.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var x=this.getTextScale(),N=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),G=this.textElement.getBBox(),j={x:G.width*x,y:G.height*x};N.x-=j.x/2,N.y-=j.y/2,this.textEditor.style.top=N.y+"px",this.textEditor.style.left=N.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-N.x+"px",this.textEditor.style.fontSize=Math.max(16*x,12)+"px",this.textElement.style.display="none"}},T.prototype.textEditDivClicked=function(x){this.text=x.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},T.prototype.select=function(){F.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},T.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),F.prototype.deselect.call(this)},T.prototype.dblClick=function(x,N){F.prototype.dblClick.call(this,x,N),this.showTextEditor()},T.prototype.setColor=function(x){this.textElement&&Y.setAttributes(this.textElement,[["fill",x]]),this.color=x,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(x)},T.prototype.setFont=function(x){this.textElement&&Y.setAttributes(this.textElement,[["font-family",x]]),this.fontFamily=x,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},T.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},T.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},F.prototype.getState.call(this));return x.typeName=T.typeName,x},T.prototype.restoreState=function(x){var N=x;this.color=N.color,this.fontFamily=N.fontFamily,this.padding=N.padding,this.text=N.text,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},T.prototype.scale=function(x,N){F.prototype.scale.call(this,x,N),this.setSize(),this.sizeText(),this.positionTextEditor()},T.typeName="TextMarker",T.title="Text marker",T.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>',T}(Oe),ae=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.color="transparent",j.lineWidth=3,j.drawing=!1,j.pixelRatio=1,j.color=G.defaultColor,j.lineWidth=G.defaultStrokeWidth,j.pixelRatio=G.freehandPixelRatio,j.setColor=j.setColor.bind(j),j.addCanvas=j.addCanvas.bind(j),j.finishCreation=j.finishCreation.bind(j),j.setLineWidth=j.setLineWidth.bind(j),j.colorPanel=new pe("Color",G.defaultColorSet,G.defaultColor),j.colorPanel.onColorChanged=j.setColor,j.lineWidthPanel=new Qe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),j.lineWidthPanel.onWidthChanged=j.setLineWidth,j}return ee(T,F),T.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.drawingImage)},T.prototype.createVisual=function(){this.visual=Y.createGroup(),this.drawingImage=Y.createImage(),this.visual.appendChild(this.drawingImage);var x=Y.createTransform();this.visual.transform.baseVal.appendItem(x),this.addMarkerVisualToContainer(this.visual)},T.prototype.pointerDown=function(x,N){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(x.x,x.y),this.drawing=!0):F.prototype.pointerDown.call(this,x,N)},T.prototype.manipulate=function(x){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(x.x,x.y),this.canvasContext.stroke()):F.prototype.manipulate.call(this,x)},T.prototype.resize=function(x){F.prototype.resize.call(this,x),Y.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Y.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},T.prototype.pointerUp=function(x){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):F.prototype.pointerUp.call(this,x)},T.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)},T.prototype.select=function(){this.state==="creating"&&this.finishCreation(),F.prototype.select.call(this)},T.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),F.prototype.deselect.call(this)},T.prototype.finishCreation=function(){for(var x=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),N=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],G=N[0],j=N[1],_e=N[2],Ge=N[3],tt=!1,st=0;st<this.canvasElement.height;st++)for(var Ve=0;Ve<this.canvasElement.width;Ve++)x.data[st*this.canvasElement.width*4+4*Ve+3]>0&&(tt=!0,st<j&&(j=st),Ve<G&&(G=Ve),st>Ge&&(Ge=st),Ve>_e&&(_e=Ve));if(tt){this.left=G/this.pixelRatio,this.top=j/this.pixelRatio,this.width=(_e-G)/this.pixelRatio,this.height=(Ge-j)/this.pixelRatio;var yt=document.createElement("canvas");yt.width=_e-G,yt.height=Ge-j,yt.getContext("2d").putImageData(this.canvasContext.getImageData(G,j,_e-G,Ge-j),0,0),this.drawingImgUrl=yt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},T.prototype.setDrawingImage=function(){Y.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Y.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},T.prototype.setColor=function(x){this.color=x,this.colorChanged(x)},T.prototype.setLineWidth=function(x){this.lineWidth=x},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=Object.assign({drawingImgUrl:this.drawingImgUrl},F.prototype.getState.call(this));return x.typeName=T.typeName,x},T.prototype.restoreState=function(x){this.createVisual(),F.prototype.restoreState.call(this,x),this.drawingImgUrl=x.drawingImgUrl,this.setDrawingImage()},T.prototype.scale=function(x,N){F.prototype.scale.call(this,x,N),this.setDrawingImage()},T.typeName="FreehandMarker",T.title="Freehand marker",T.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>',T}(Oe),ce=function(F){function T(x,N,G){var j=F.call(this,x,G||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return j.typeBoxes=[],j.currentType=N,j.setCurrentType=j.setCurrentType.bind(j),j}return ee(T,F),T.prototype.getUi=function(){var x=this,N=document.createElement("div");N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2";for(var G=function(Ge){var tt="both";switch(Ge){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var st=document.createElement("div");if(st.style.display="flex",st.style.flexGrow="2",st.style.alignItems="center",st.style.justifyContent="space-between",st.style.padding="5px",st.style.borderWidth="2px",st.style.borderStyle="solid",st.style.borderColor=tt===j.currentType?j.uiStyleSettings.toolboxAccentColor:"transparent",st.addEventListener("click",function(){x.setCurrentType(tt,st)}),N.appendChild(st),tt==="both"||tt==="start"){var Ve=document.createElement("div");Ve.style.display="flex",Ve.style.alignItems="center",Ve.style.minHeight="20px",Ve.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(j.uiStyleSettings!==void 0?j.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Ve.style.marginLeft="5px",st.appendChild(Ve)}var yt=document.createElement("div");yt.style.display="flex",yt.style.alignItems="center",yt.style.minHeight="20px",yt.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(j.uiStyleSettings!==void 0?j.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",yt.appendChild(jt),st.appendChild(yt),tt==="both"||tt==="end"){var Qt=document.createElement("div");Qt.style.display="flex",Qt.style.alignItems="center",Qt.style.minHeight="20px",Qt.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="`+(j.uiStyleSettings!==void 0?j.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Qt.style.marginRight="5px",st.appendChild(Qt)}j.typeBoxes.push(st)},j=this,_e=0;_e<4;_e++)G(_e);return N},T.prototype.setCurrentType=function(x,N){var G=this;this.currentType=x,this.typeBoxes.forEach(function(j){j.style.borderColor=j===N?G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(J),ye=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.arrowType="end",j.arrowBaseHeight=10,j.arrowBaseWidth=10,j.getArrowPoints=j.getArrowPoints.bind(j),j.setArrowType=j.setArrowType.bind(j),j.arrowTypePanel=new ce("Arrow type","end"),j.arrowTypePanel.onArrowTypeChanged=j.setArrowType,j}return ee(T,F),T.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.arrow1&&x!==this.arrow2)},T.prototype.getArrowPoints=function(x,N){var G=this.arrowBaseWidth+2*this.strokeWidth,j=this.arrowBaseHeight+2*this.strokeWidth;return x-G/2+","+(N+j/2)+" "+x+","+(N-j/2)+" "+(x+G/2)+","+(N+j/2)},T.prototype.createTips=function(){this.arrow1=Y.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Y.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Y.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Y.createTransform()),this.visual.appendChild(this.arrow2)},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(F.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",Y.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Y.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var x=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),N=this.arrow1.transform.baseVal.getItem(0);N.setRotate(x,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(N,0);var G=this.arrow2.transform.baseVal.getItem(0);G.setRotate(x+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(G,0)}},T.prototype.setArrowType=function(x){this.arrowType=x,this.adjustVisual(),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=Object.assign({arrowType:this.arrowType},F.prototype.getState.call(this));return x.typeName=T.typeName,x},T.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var N=x;this.arrowType=N.arrowType,this.createTips(),this.adjustVisual()},T.typeName="ArrowMarker",T.title="Arrow marker",T.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',T}(it),Q=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.fillColor=G.defaultFillColor,j.strokeWidth=0,j.fillPanel=new pe("Color",G.defaultColorSet,G.defaultFillColor),j.fillPanel.onColorChanged=j.setFillColor,j}return ee(T,F),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=T.typeName,x},T.typeName="CoverMarker",T.title="Cover marker",T.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',T}(Ue),q=function(F){function T(x,N,G,j){var _e=F.call(this,x,j||'<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 _e.opacities=[],_e.opacityBoxes=[],_e.opacities=N,_e.currentOpacity=G,_e.setCurrentOpacity=_e.setCurrentOpacity.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,N=document.createElement("div");return N.style.display="flex",N.style.overflow="hidden",N.style.flexGrow="2",N.style.justifyContent="space-between",this.opacities.forEach(function(G){var j=document.createElement("div");j.style.display="flex",j.style.alignItems="center",j.style.justifyContent="center",j.style.padding="5px",j.style.borderWidth="2px",j.style.borderStyle="solid",j.style.borderColor=G===x.currentOpacity?x.uiStyleSettings.toolboxAccentColor:"transparent",j.addEventListener("click",function(){x.setCurrentOpacity(G,j)}),N.appendChild(j);var _e=document.createElement("div");_e.innerText=100*G+"%",j.appendChild(_e),x.opacityBoxes.push(j)}),N},T.prototype.setCurrentOpacity=function(x,N){var G=this;this.currentOpacity=x,this.opacityBoxes.forEach(function(j){j.style.borderColor=j===N?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(J),se=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.setOpacity=j.setOpacity.bind(j),j.fillColor=G.defaultHighlightColor,j.strokeWidth=0,j.opacity=G.defaultHighlightOpacity,j.fillPanel=new pe("Color",G.defaultColorSet,j.fillColor),j.fillPanel.onColorChanged=j.setFillColor,j.opacityPanel=new q("Opacity",G.defaultOpacitySteps,j.opacity),j.opacityPanel.onOpacityChanged=j.setOpacity,j}return ee(T,F),T.prototype.setOpacity=function(x){this.opacity=x,this.visual&&Y.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=T.typeName,x},T.typeName="HighlightMarker",T.title="Highlight marker",T.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>',T}(Q),me='<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>',De=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.bgColor="transparent",j.tipPosition={x:0,y:0},j.tipBase1Position={x:0,y:0},j.tipBase2Position={x:0,y:0},j.tipMoving=!1,j.color=G.defaultStrokeColor,j.bgColor=G.defaultFillColor,j.fontFamily=G.defaultFontFamily,j.defaultSize={x:100,y:30},j.setBgColor=j.setBgColor.bind(j),j.getTipPoints=j.getTipPoints.bind(j),j.positionTip=j.positionTip.bind(j),j.setTipPoints=j.setTipPoints.bind(j),j.colorPanel=new pe("Text color",G.defaultColorSet,j.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>'),j.colorPanel.onColorChanged=j.setColor,j.bgColorPanel=new pe("Fill color",G.defaultColorSet,j.bgColor,me),j.bgColorPanel.onColorChanged=j.setBgColor,j.fontFamilyPanel=new je("Font",G.defaultFontFamilies,G.defaultFontFamily),j.fontFamilyPanel.onFontChanged=j.setFont,j.tipGrip=new We,j.tipGrip.visual.transform.baseVal.appendItem(Y.createTransform()),j.controlBox.appendChild(j.tipGrip.visual),j}return ee(T,F),T.prototype.ownsTarget=function(x){return F.prototype.ownsTarget.call(this,x)||this.tipGrip.ownsTarget(x)||this.tip===x},T.prototype.createTip=function(){Y.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Y.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},T.prototype.pointerDown=function(x,N){this.state==="new"&&F.prototype.pointerDown.call(this,x,N),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(N)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):F.prototype.pointerDown.call(this,x,N)},T.prototype.pointerUp=function(x){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,F.prototype.pointerUp.call(this,x);else{var N=this.state==="creating";F.prototype.pointerUp.call(this,x),this.setTipPoints(N),this.positionTip()}},T.prototype.manipulate=function(x){if(this.tipMoving){var N=this.unrotatePoint(x);this.tipPosition={x:N.x-this.manipulationStartLeft,y:N.y-this.manipulationStartTop},this.positionTip()}else F.prototype.manipulate.call(this,x)},T.prototype.setBgColor=function(x){this.bgRectangle&&this.tip&&(Y.setAttributes(this.bgRectangle,[["fill",x]]),Y.setAttributes(this.tip,[["fill",x]])),this.bgColor=x,this.fillColorChanged(x)},T.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},T.prototype.setTipPoints=function(x){x===void 0&&(x=!1);var N=Math.min(this.height/2,15),G=this.height/5;x&&(this.tipPosition={x:N+G/2,y:this.height+20});var j=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?j<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(G=this.width/5,N=Math.min(this.width/2,15),this.tipBase1Position={x:N,y:0},this.tipBase2Position={x:N+G,y:0}):(this.tipBase1Position={x:0,y:N},this.tipBase2Position={x:0,y:N+G}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?j<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(G=this.width/5,N=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-N-G,y:0},this.tipBase2Position={x:this.width-N,y:0}):(this.tipBase1Position={x:this.width,y:N},this.tipBase2Position={x:this.width,y:N+G}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?j<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(G=this.width/5,N=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-N-G,y:this.height},this.tipBase2Position={x:this.width-N,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-N-G},this.tipBase2Position={x:this.width,y:this.height-N}):j<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(G=this.width/5,N=Math.min(this.width/2,15),this.tipBase1Position={x:N,y:this.height},this.tipBase2Position={x:N+G,y:this.height}):(this.tipBase1Position={x:0,y:this.height-N},this.tipBase2Position={x:0,y:this.height-N-G})},T.prototype.resize=function(x){F.prototype.resize.call(this,x),this.positionTip()},T.prototype.positionTip=function(){Y.setAttributes(this.tip,[["points",this.getTipPoints()]]);var x=this.tipGrip.visual.transform.baseVal.getItem(0);x.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(x,0)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),T.prototype.select=function(){this.positionTip(),F.prototype.select.call(this)},T.prototype.getState=function(){var x=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},F.prototype.getState.call(this));return x.typeName=T.typeName,x},T.prototype.restoreState=function(x){var N=x;this.bgColor=N.bgColor,this.tipPosition=N.tipPosition,F.prototype.restoreState.call(this,x),this.createTip(),this.setTipPoints()},T.prototype.scale=function(x,N){F.prototype.scale.call(this,x,N),this.tipPosition={x:this.tipPosition.x*x,y:this.tipPosition.y*N},this.positionTip()},T.typeName="CalloutMarker",T.title="Callout marker",T.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>',T}(Ke),Be=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.fillColor="transparent",j.strokeColor="transparent",j.strokeWidth=0,j.strokeDasharray="",j.opacity=1,j.strokeColor=G.defaultColor,j.strokeWidth=G.defaultStrokeWidth,j.strokeDasharray=G.defaultStrokeDasharray,j.fillColor=G.defaultFillColor,j.setStrokeColor=j.setStrokeColor.bind(j),j.setFillColor=j.setFillColor.bind(j),j.setStrokeWidth=j.setStrokeWidth.bind(j),j.setStrokeDasharray=j.setStrokeDasharray.bind(j),j.setOpacity=j.setOpacity.bind(j),j.createVisual=j.createVisual.bind(j),j.strokePanel=new pe("Line color",Z(G.defaultColorSet,["transparent"]),G.defaultColor),j.strokePanel.onColorChanged=j.setStrokeColor,j.fillPanel=new pe("Fill color",Z(G.defaultColorSet,["transparent"]),j.fillColor,me),j.fillPanel.onColorChanged=j.setFillColor,j.strokeWidthPanel=new Qe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),j.strokeWidthPanel.onWidthChanged=j.setStrokeWidth,j.strokeStylePanel=new Ze("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),j.strokeStylePanel.onStyleChanged=j.setStrokeDasharray,j.opacityPanel=new q("Opacity",G.defaultOpacitySteps,j.opacity),j.opacityPanel.onOpacityChanged=j.setOpacity,j}return ee(T,F),T.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual)},T.prototype.createVisual=function(){this.visual=Y.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)},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},T.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x)},T.prototype.resize=function(x){F.prototype.resize.call(this,x),this.setSize()},T.prototype.setSize=function(){F.prototype.setSize.call(this),Y.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},T.prototype.pointerUp=function(x){F.prototype.pointerUp.call(this,x),this.setSize()},T.prototype.setStrokeColor=function(x){this.strokeColor=x,this.visual&&Y.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(x),this.stateChanged()},T.prototype.setFillColor=function(x){this.fillColor=x,this.visual&&Y.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(x),this.stateChanged()},T.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.visual&&Y.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},T.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.visual&&Y.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},T.prototype.setOpacity=function(x){this.opacity=x,this.visual&&Y.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this));return x.typeName=T.typeName,x},T.prototype.restoreState=function(x){var N=x;this.fillColor=N.fillColor,this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.opacity=N.opacity,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},T.prototype.scale=function(x,N){F.prototype.scale.call(this,x,N),this.setSize()},T.typeName="EllipseMarker",T.title="Ellipse marker",T.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>',T}(Oe),Xe=function(F){function T(x,N,G){return F.call(this,x,N,G)||this}return ee(T,F),Object.defineProperty(T.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),T.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.tip1&&x!==this.tip2)},T.prototype.createTips=function(){this.tip1=Y.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(Y.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Y.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(Y.createTransform()),this.visual.appendChild(this.tip2)},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.state==="creating"&&this.createTips()},T.prototype.adjustVisual=function(){if(F.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Y.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()]]),Y.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 x=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),N=this.tip1.transform.baseVal.getItem(0);N.setRotate(x,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(N,0);var G=this.tip2.transform.baseVal.getItem(0);G.setRotate(x+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(G,0)}},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=T.typeName,x},T.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x),this.createTips(),this.adjustVisual()},T.typeName="MeasurementMarker",T.title="Measurement marker",T.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>',T}(it),ut=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.strokePanel.colors=G.defaultColorSet,j.fillColor="transparent",j}return ee(T,F),Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=T.typeName,x},T.typeName="EllipseFrameMarker",T.title="Ellipse frame marker",T.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>',T}(Be),vt=function(){function F(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),F.prototype.addUndoStep=function(T){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(T)||(this.undoStack.push(T),JSON.stringify(this.lastRedoStep)!==JSON.stringify(T)&&this.redoStack.splice(0,this.redoStack.length))},F.prototype.replaceLastUndoStep=function(T){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=T)},F.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},F.prototype.undo=function(){if(this.undoStack.length>1){var T=this.undoStack.pop();return T!==void 0&&this.redoStack.push(T),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},F.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},F}(),dt=function(F){function T(x,N,G){var j=F.call(this,x,N,G)||this;return j.strokeColor="transparent",j.strokeWidth=0,j.strokeDasharray="",j.curveX=0,j.curveY=0,j.manipulationStartCurveX=0,j.manipulationStartCurveY=0,j.setStrokeColor=j.setStrokeColor.bind(j),j.setStrokeWidth=j.setStrokeWidth.bind(j),j.setStrokeDasharray=j.setStrokeDasharray.bind(j),j.positionGrips=j.positionGrips.bind(j),j.addControlGrips=j.addControlGrips.bind(j),j.adjustVisual=j.adjustVisual.bind(j),j.setupControlBox=j.setupControlBox.bind(j),j.resize=j.resize.bind(j),j.strokeColor=G.defaultColor,j.strokeWidth=G.defaultStrokeWidth,j.strokeDasharray=G.defaultStrokeDasharray,j.strokePanel=new pe("Line color",G.defaultColorSet,G.defaultColor),j.strokePanel.onColorChanged=j.setStrokeColor,j.strokeWidthPanel=new Qe("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),j.strokeWidthPanel.onWidthChanged=j.setStrokeWidth,j.strokeStylePanel=new Ze("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),j.strokeStylePanel.onStyleChanged=j.setStrokeDasharray,j}return ee(T,F),T.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.selectorCurve&&x!==this.visibleCurve&&!this.curveGrip.ownsTarget(x))},T.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},T.prototype.createVisual=function(){this.visual=Y.createGroup(),this.selectorCurve=Y.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Y.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)},T.prototype.pointerDown=function(x,N){F.prototype.pointerDown.call(this,x,N),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=x.x,this.curveY=x.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(N)&&(this.activeGrip=this.curveGrip,this._state="resize")},T.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Y.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Y.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Y.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},T.prototype.setupControlBox=function(){F.prototype.setupControlBox.call(this),this.curveControlLine1=Y.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Y.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)},T.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,F.prototype.addControlGrips.call(this)},T.prototype.positionGrips=function(){F.prototype.positionGrips.call(this);var x=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-x/2,this.curveY-x/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()))},T.prototype.manipulate=function(x){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+x.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+x.y-this.manipulationStartY),F.prototype.manipulate.call(this,x)},T.prototype.resize=function(x){this.activeGrip===this.curveGrip&&(this.curveX=x.x,this.curveY=x.y),F.prototype.resize.call(this,x),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},T.prototype.setStrokeColor=function(x){this.strokeColor=x,this.adjustVisual(),this.colorChanged(x)},T.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.adjustVisual()},T.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.adjustVisual()},T.prototype.scale=function(x,N){this.curveX=this.curveX*x,this.curveY=this.curveY*N,F.prototype.scale.call(this,x,N)},Object.defineProperty(T.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),T.prototype.getState=function(){var x=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},F.prototype.getState.call(this));return x.typeName=T.typeName,x},T.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var N=x;this.strokeColor=N.strokeColor,this.strokeWidth=N.strokeWidth,this.strokeDasharray=N.strokeDasharray,this.curveX=N.curveX,this.curveY=N.curveY,this.createVisual(),this.adjustVisual()},T.typeName="CurveMarker",T.title="Curve marker",T.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>',T}(nt),_t=function(){function F(T,x){x===void 0&&(x=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=T,this.cancelable=x}return Object.defineProperty(F.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),F.prototype.preventDefault=function(){this._defaultPrevented=!0},F}(),xt=function(F){function T(x,N,G){var j=F.call(this,x,!1)||this;return j.dataUrl=N,j.state=G,j}return ee(T,F),T}(_t),rt=function(F){function T(x,N,G){G===void 0&&(G=!1);var j=F.call(this,x,G)||this;return j.marker=N,j}return ee(T,F),T}(_t),Yt=function(){function F(){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 F.prototype.addEventListener=function(T,x){this[T].push(x)},F.prototype.removeEventListener=function(T,x){var N=this[T].indexOf(x);N>-1&&this[T].splice(N,1)},F}(),It=function(){function F(T){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ze,this._isOpen=!1,this.undoRedoManager=new vt,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 Yt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=F.instanceCounter++,this.styles=new Re(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=T,this.targetRoot=document.body,this.width=T.clientWidth,this.height=T.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(F.prototype,"ALL_MARKER_TYPES",{get:function(){return[Je,ae,ye,Ke,ut,Be,se,De,Xe,Q,it,dt]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Je,ae,ye,Ke,Be,se,De]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Je,ae,ye,Ke,se]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(T){var x=this;this._availableMarkerTypes.splice(0),T.forEach(function(N){if(typeof N=="string"){var G=x.ALL_MARKER_TYPES.find(function(j){return j.typeName===N});G!==void 0&&x._availableMarkerTypes.push(G)}else x._availableMarkerTypes.push(N)})},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(T){this._zoomLevel=T,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(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),F.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Se.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},F.prototype.show=function(){var T=this;this.styles.styleSheetRoot===void 0&&ke.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ke.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(x){return x(new _t(T))})},F.prototype.render=function(){return ie(this,void 0,void 0,function(){var T;return ge(this,function(x){switch(x.label){case 0:return this.setCurrentMarker(),(T=new Pe).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.markersOnly=this.renderMarkersOnly,T.width=this.renderWidth,T.height=this.renderHeight,[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return x.sent(),[4,T.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,x.sent()]}})})},F.prototype.close=function(T){var x=this;if(T===void 0&&(T=!1),this.isOpen){var N=!1;T||this.eventListeners.beforeclose.forEach(function(G){var j=new _t(x,!0);G(j),j.defaultPrevented&&(N=!0)}),N||(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 _t(x))}),this.detachEvents(),this._isOpen=!1)}},F.prototype.addMarkersToToolbar=function(){for(var T,x=[],N=0;N<arguments.length;N++)x[N]=arguments[N];(T=this._availableMarkerTypes).push.apply(T,x)},F.prototype.addRenderEventListener=function(T){this.addEventListener("render",function(x){T(x.dataUrl,x.state)})},F.prototype.removeRenderEventListener=function(T){},F.prototype.addCloseEventListener=function(T){this.addEventListener("close",function(){T()})},F.prototype.removeCloseEventListener=function(T){},F.prototype.setupResizeObserver=function(){var T=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return T.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},F.prototype.onPopupTargetResize=function(){var T=1*this.target.clientWidth/this.target.clientHeight,x=this.editorCanvas.clientWidth/T>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*T:this.editorCanvas.clientWidth,N=x<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(x,N)},F.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},F.prototype.resize=function(T,x){this._isResizing=!0;var N=T/this.imageWidth,G=x/this.imageHeight;this.imageWidth=Math.round(T),this.imageHeight=Math.round(x),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(N,G),this._isResizing=!1},F.prototype.scaleMarkers=function(T,x){var N,G=this;this._currentMarker&&this._currentMarker instanceof Ke?this._currentMarker.scale(T,x):(N=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(j){j!==G._currentMarker&&j.scale(T,x)}),N!==void 0&&this.setCurrentMarker(N)},F.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"},F.prototype.setTopLeft=function(){var T=this.editingTarget.getBoundingClientRect(),x=this.editorCanvas.getBoundingClientRect();this.left=T.left-x.left,this.top=T.top-x.top},F.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)},F.prototype.addDefs=function(){for(var T,x=[],N=0;N<arguments.length;N++)x[N]=arguments[N];this.defs=Y.createDefs(),this.addDefsToImage(),(T=this.defs).append.apply(T,x)},F.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},F.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)},F.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},F.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},F.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)},F.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},F.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)},F.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 T=document.createElement("a");T.href="https://markerjs.com/",T.target="_blank",T.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>',T.title="Powered by marker.js",T.style.display="grid",T.style.alignItems="center",T.style.justifyItems="center",T.style.padding="3px",T.style.width="20px",T.style.height="20px",this.logoUI.appendChild(T),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},F.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")},F.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"},F.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},F.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 T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"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 Le(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 Ne(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},F.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},F.prototype.removeMarker=function(T){this.markerImage.removeChild(T.container),this.markers.indexOf(T)>-1&&this.markers.splice(this.markers.indexOf(T),1),T.dispose()},F.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())},F.prototype.toolbarButtonClicked=function(T,x){if(T==="marker"&&x!==void 0)this.createNewMarker(x);else if(T==="action")switch(x){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()}},F.prototype.deleteSelectedMarker=function(){var T=this;if(this._currentMarker!==void 0){var x=!1;if(this.eventListeners.markerbeforedelete.forEach(function(G){var j=new rt(T,T._currentMarker,!0);G(j),j.defaultPrevented&&(x=!0)}),!x){var N=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 rt(T,N))})}}},F.prototype.clear=function(){var T=this,x=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(_e){var Ge=new rt(T,void 0,!0);_e(Ge),Ge.defaultPrevented&&(x=!0)}),!x)){this.setCurrentMarker();for(var N=function(_e){var Ge=G.markers[_e];G.setCurrentMarker(G.markers[_e]),G._currentMarker.dispose(),G.markerImage.removeChild(G._currentMarker.container),G.markers.splice(G.markers.indexOf(G._currentMarker),1),G.eventListeners.markerdelete.forEach(function(tt){return tt(new rt(T,Ge))})},G=this,j=this.markers.length-1;j>=0;j--)N(j);this.addUndoStep()}},Object.defineProperty(F.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),F.prototype.showNotesEditor=function(){var T;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=(T=this._currentMarker.notes)!==null&&T!==void 0?T:"",this.overlayContainer.appendChild(this.notesArea))},F.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)},F.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},F.prototype.addUndoStep=function(){var T=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var x=this.getState(),N=this.undoRedoManager.getLastUndoStep();if(!N||N.width===x.width&&N.height===x.height){var G=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(x),G<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(j){return j(new _t(T))})}else this.undoRedoManager.replaceLastUndoStep(x),this.eventListeners.statechange.forEach(function(j){return j(new _t(T))})}},F.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},F.prototype.undoStep=function(){var T=this,x=this.undoRedoManager.undo();x!==void 0&&(this.restoreState(x),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(N){return N(new _t(T))}))},F.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},F.prototype.redoStep=function(){var T=this,x=this.undoRedoManager.redo();x!==void 0&&(this.restoreState(x),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(N){return N(new _t(T))}))},F.prototype.stepZoom=function(){var T=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=T<this.zoomSteps.length-1?this.zoomSteps[T+1]:this.zoomSteps[0]},F.prototype.panTo=function(T){this.contentDiv.scrollBy({left:this.prevPanPoint.x-T.x,top:this.prevPanPoint.y-T.y}),this.prevPanPoint=T},F.prototype.startRenderAndClose=function(){return ie(this,void 0,void 0,function(){var T,x,N=this;return ge(this,function(G){switch(G.label){case 0:return[4,this.render()];case 1:return T=G.sent(),x=this.getState(),this.eventListeners.render.forEach(function(j){return j(new xt(N,T,x))}),this.close(!0),[2]}})})},F.prototype.getState=function(T){T===!0&&this.setCurrentMarker();var x={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(N){return x.markers.push(N.getState())}),x},F.prototype.restoreState=function(T){var x=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);T.markers.forEach(function(N){var G=x._availableMarkerTypes.find(function(_e){return _e.typeName===N.typeName});if(G!==void 0){var j=x.addNewMarker(G);j.restoreState(N),x.markers.push(j)}}),T.width&&T.height&&(T.width!==this.imageWidth||T.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/T.width,this.imageHeight/T.height),this.eventListeners.restorestate.forEach(function(N){return N(new _t(x))})},F.prototype.addNewMarker=function(T){var x=Y.createGroup();return this.markerImage.appendChild(x),new T(x,this.overlayContainer,this.settings)},F.prototype.createNewMarker=function(T){var x,N=this;(x=typeof T=="string"?this._availableMarkerTypes.find(function(G){return G.typeName===T}):T)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(x),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(x.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(G){return G(new rt(N,N._currentMarker))}))},F.prototype.markerCreated=function(T){var x=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(T),this.setCurrentMarker(T),T instanceof ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(N){return N(new rt(x,x._currentMarker))})},F.prototype.colorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=T,this.settings.defaultStrokeColor=T)},F.prototype.fillColorChanged=function(T){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=T)},F.prototype.markerStateChanged=function(T){var x=this;this.eventListeners.markerchange.forEach(function(N){return N(new rt(x,T))})},F.prototype.setCurrentMarker=function(T){var x=this;this._currentMarker!==T&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(N){return N(new rt(x,x._currentMarker))})),this._currentMarker=T,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(N){return N(new rt(x,x._currentMarker))}))},F.prototype.onPointerDown=function(T){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||T.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var x=this.markers.find(function(N){return N.ownsTarget(T.target)});x!==void 0?(this.setCurrentMarker(x),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:T.clientX,y:T.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(T.clientX,T.clientY))},F.prototype.onDblClick=function(T){if(this._isFocused||this.focus(),this.mode==="select"){var x=this.markers.find(function(N){return N.ownsTarget(T.target)});x!==void 0&&x!==this._currentMarker&&this.setCurrentMarker(x),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(T.clientX,T.clientY),T.target):this.setCurrentMarker()}},F.prototype.onPointerMove=function(T){this.touchPoints!==1&&T.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||T.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(T.clientX,T.clientY)):this.zoomLevel>1&&this.panTo({x:T.clientX,y:T.clientY}))},F.prototype.onPointerUp=function(T){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(T.clientX,T.clientY)),this.isDragging=!1,this.addUndoStep()},F.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},F.prototype.onKeyUp=function(T){this._currentMarker===void 0||this.notesArea!==void 0||T.key!=="Delete"&&T.key!=="Backspace"||this.deleteSelectedMarker()},F.prototype.clientToLocalCoordinates=function(T,x){var N=this.markerImage.getBoundingClientRect();return{x:(T-N.left)/this.zoomLevel,y:(x-N.top)/this.zoomLevel}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var T=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=T+"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()},F.prototype.addLicenseKey=function(T){Se.addKey(T)},F.prototype.addEventListener=function(T,x){this.eventListeners.addEventListener(T,x)},F.prototype.removeEventListener=function(T,x){this.eventListeners.removeEventListener(T,x)},F.prototype.renderState=function(T){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(T),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(F.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),F.prototype.focus=function(){var T=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(x){return x(new _t(T))}))},F.prototype.blur=function(){var T=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(x){return x(new _t(T))}))},F.instanceCounter=0,F}();/* **********************************
|
|
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 qt=function(F,T){return(qt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,N){x.__proto__=N}||function(x,N){for(var G in N)Object.prototype.hasOwnProperty.call(N,G)&&(x[G]=N[G])})(F,T)};function $t(F,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function x(){this.constructor=F}qt(F,T),F.prototype=T===null?Object.create(T):(x.prototype=T.prototype,new x)}function bt(F,T,x,N){return new(x||(x=Promise))(function(G,j){function _e(st){try{tt(N.next(st))}catch(Ve){j(Ve)}}function Ge(st){try{tt(N.throw(st))}catch(Ve){j(Ve)}}function tt(st){var Ve;st.done?G(st.value):(Ve=st.value,Ve instanceof x?Ve:new x(function(yt){yt(Ve)})).then(_e,Ge)}tt((N=N.apply(F,T||[])).next())})}function en(F,T){var x,N,G,j,_e={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return j={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(j[Symbol.iterator]=function(){return this}),j;function Ge(tt){return function(st){return function(Ve){if(x)throw new TypeError("Generator is already executing.");for(;_e;)try{if(x=1,N&&(G=2&Ve[0]?N.return:Ve[0]?N.throw||((G=N.return)&&G.call(N),0):N.next)&&!(G=G.call(N,Ve[1])).done)return G;switch(N=0,G&&(Ve=[2&Ve[0],G.value]),Ve[0]){case 0:case 1:G=Ve;break;case 4:return _e.label++,{value:Ve[1],done:!1};case 5:_e.label++,N=Ve[1],Ve=[0];continue;case 7:Ve=_e.ops.pop(),_e.trys.pop();continue;default:if(!(G=_e.trys,(G=G.length>0&&G[G.length-1])||Ve[0]!==6&&Ve[0]!==2)){_e=0;continue}if(Ve[0]===3&&(!G||Ve[1]>G[0]&&Ve[1]<G[3])){_e.label=Ve[1];break}if(Ve[0]===6&&_e.label<G[1]){_e.label=G[1],G=Ve;break}if(G&&_e.label<G[2]){_e.label=G[2],_e.ops.push(Ve);break}G[2]&&_e.ops.pop(),_e.trys.pop();continue}Ve=T.call(F,_e)}catch(yt){Ve=[6,yt],N=0}finally{x=G=0}if(5&Ve[0])throw Ve[1];return{value:Ve[0]?Ve[1]:void 0,done:!0}}([tt,st])}}}var hn=function(){function F(){}return F.addKey=function(T){F.key=T},Object.defineProperty(F,"isLicensed",{get:function(){return!!F.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(F.key)},enumerable:!1,configurable:!0}),F}(),ct=function(){function F(){}return F.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},F.setAttributes=function(T,x){for(var N=0,G=x;N<G.length;N++){var j=G[N],_e=j[0],Ge=j[1];T.setAttribute(_e,Ge)}},F.createRect=function(T,x,N){var G=document.createElementNS("http://www.w3.org/2000/svg","rect");return G.setAttribute("width",T.toString()),G.setAttribute("height",x.toString()),N&&F.setAttributes(G,N),G},F.createLine=function(T,x,N,G,j){var _e=document.createElementNS("http://www.w3.org/2000/svg","line");return _e.setAttribute("x1",T.toString()),_e.setAttribute("y1",x.toString()),_e.setAttribute("x2",N.toString()),_e.setAttribute("y2",G.toString()),j&&F.setAttributes(_e,j),_e},F.createPolygon=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","polygon");return N.setAttribute("points",T),x&&F.setAttributes(N,x),N},F.createCircle=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","circle");return N.setAttribute("cx",(T/2).toString()),N.setAttribute("cy",(T/2).toString()),N.setAttribute("r",T.toString()),x&&F.setAttributes(N,x),N},F.createEllipse=function(T,x,N){var G=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return G.setAttribute("cx",(T/2).toString()),G.setAttribute("cy",(x/2).toString()),G.setAttribute("rx",(T/2).toString()),G.setAttribute("ry",(x/2).toString()),N&&F.setAttributes(G,N),G},F.createGroup=function(T){var x=document.createElementNS("http://www.w3.org/2000/svg","g");return T&&F.setAttributes(x,T),x},F.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},F.createMarker=function(T,x,N,G,j,_e,Ge){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(tt,[["id",T],["orient",x],["markerWidth",N.toString()],["markerHeight",G.toString()],["refX",j.toString()],["refY",_e.toString()]]),tt.appendChild(Ge),tt},F.createText=function(T){var x=document.createElementNS("http://www.w3.org/2000/svg","text");return x.setAttribute("x","0"),x.setAttribute("y","0"),T&&F.setAttributes(x,T),x},F.createTSpan=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","tspan");return N.textContent=T,x&&F.setAttributes(N,x),N},F.createImage=function(T){var x=document.createElementNS("http://www.w3.org/2000/svg","image");return T&&F.setAttributes(x,T),x},F.createPoint=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return N.x=T,N.y=x,N},F.createPath=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg","path");return N.setAttribute("d",T),x&&F.setAttributes(N,x),N},F.createElement=function(T,x){var N=document.createElementNS("http://www.w3.org/2000/svg",T);return x&&F.setAttributes(N,x),N},F.getHollowRectanglePath=function(T,x,N,G,j,_e,Ge,tt){return"M"+T+","+x+"V"+(x+G)+"H"+(T+N)+"V"+x+"H"+j+"V"+_e+"H"+(j+Ge)+"V"+(_e+tt)+"H"+j+"V"+x+"Z"},F}(),_n=function(){function F(T){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+T+"_"}return Object.defineProperty(F.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(F.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(F.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),F.prototype.addClass=function(T){return this.styleSheet===void 0&&this.addStyleSheet(),T.name=""+this.classNamePrefix+T.localName,this.classes.push(T),this.styleSheet.sheet.insertRule("."+T.name+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length),T},F.prototype.addRule=function(T){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(T),this.styleSheet.sheet.insertRule(T.selector+" {"+T.style+"}",this.styleSheet.sheet.cssRules.length)},F.prototype.addStyleSheet=function(){var T;this.styleSheet=document.createElement("style"),((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).appendChild(this.styleSheet),this.addRule(new at("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new at("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new at("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new lt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new lt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},F.prototype.removeStyleSheet=function(){var T;this.styleSheet&&(((T=this.styleSheetRoot)!==null&&T!==void 0?T:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},F}(),at=function(F,T){this.selector=F,this.style=T},lt=function(F,T){this.localName=F,this.style=T},Pt=function(){function F(){this.blocks=[],this.display=""}return F.prototype.addButtonBlock=function(T){T.className=this.blockClassName,T.buttonClassName=this.buttonClassName,T.buttonColorsClassName=this.buttonColorsClassName,T.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(T)},F.prototype.addElementBlock=function(T){T.className===void 0&&(T.className=this.blockClassName),this.blocks.push(T)},F.prototype.getUI=function(){var T=document.createElement("div");return T.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,T.style.display=this.display,this.blocks.forEach(function(x){return T.appendChild(x.getUI())}),T},F}(),Kt=function(){function F(){}return F.prototype.getUI=function(){var T=document.createElement("div");if(T.className=this.className,this.minWidth!==void 0&&(T.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":T.style.justifyContent="flex-start";break;case"center":T.style.justifyContent="center";break;case"end":T.style.justifyContent="flex-end"}return T.style.whiteSpace="nowrap",T},F}(),rn=function(F){function T(){var x=F!==null&&F.apply(this,arguments)||this;return x.buttons=[],x}return $t(T,F),T.prototype.addButton=function(x){x.className=this.buttonClassName,x.colorsClassName=this.buttonColorsClassName,x.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(x)},T.prototype.getUI=function(){var x=F.prototype.getUI.call(this);return this.buttons.forEach(function(N){return x.appendChild(N.getUI())}),x},T}(Kt),an=function(){function F(T,x){this._isActive=!1,this._isHidden=!1,this._icon=T,this.title=x,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(F.prototype,"icon",{get:function(){return this._icon},set:function(T){this._icon=T,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isActive",{get:function(){return this._isActive},set:function(T){this._isActive=T,this.adjustClassName()},enumerable:!1,configurable:!0}),F.prototype.getUI=function(){var T=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 T.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},F.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,"")))},F.prototype.hide=function(){this._isHidden=!0},F}(),Cn=function(F){function T(){var x=F!==null&&F.apply(this,arguments)||this;return x.elements=[],x}return $t(T,F),T.prototype.addElement=function(x){this.elements.push(x)},T.prototype.getUI=function(){var x=F.prototype.getUI.call(this);return this.elements.forEach(function(N){return x.appendChild(N)}),x},T}(Kt),bn=function(){function F(T,x){this.horizontal=T,this.vertical=x}return Object.defineProperty(F.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),F.prototype.getVerticalLength=function(T){return T/this.ratio},F.prototype.getHorizontalLength=function(T){return T*this.ratio},F}(),Wt=function(){function F(){}return F.getIcon=function(T,x){if(T>0&&x>0){var N=new bn(T,x),G=N.ratio>=1?20:N.getHorizontalLength(20),j=N.ratio<1?20:N.getVerticalLength(20),_e=document.createElementNS("http://www.w3.org/2000/svg","svg");_e.setAttribute("xmlns","http://www.w3.org/2000/svg"),_e.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(_e);var Ge=ct.createDefs();_e.appendChild(Ge);var tt=ct.createElement("clipPath",[["id","text-bg-clip"]]);Ge.appendChild(tt);var st=ct.createPath(ct.getHollowRectanglePath((24-G)/2,(24-j)/2,G,j,(24-G)/2+2,(24-j)/2+2,G-4,j-4));_e.appendChild(st);var Ve=ct.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ve.appendChild(ct.createTSpan(T+":"+x)),_e.appendChild(Ve);var yt=Ve.getBBox();ct.setAttributes(Ve,[["x",((24-yt.width)/2).toString()],["y",((24-yt.height)/2-yt.y).toString()]]);var jt=ct.createPath(ct.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(yt.width))/2,(24-Math.ceil(yt.height))/2,Math.ceil(yt.width),Math.ceil(yt.height)));return tt.appendChild(jt),ct.setAttributes(st,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(_e),_e.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>'},F}(),wn=function(F){function T(x,N,G){var j=F.call(this,x,N)||this;return j.isDropdownOpen=!1,j.onClick=j.dropdownButtonClicked,j.dropdownButtons=G,j}return $t(T,F),T.prototype.setupDropdown=function(){var x=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(N){N.className=x.className,N.colorsClassName=x.colorsClassName,x.dropdownBlock.appendChild(N.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},T.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},T.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},T.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},T.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},T.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},T}(an),In=function(){function F(T,x){this.GRIP_SIZE=10,this.color=T,this.fillColor=x,this.visual=ct.createGroup(),this.visual.appendChild(ct.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ct.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(T){return T===this.visual||T===this.visual.childNodes[0]||T===this.visual.childNodes[1]},F.prototype.setCenter=function(T,x){this.visual.childNodes.forEach(function(N){return ct.setAttributes(N,[["cx",T.toString()],["cy",x.toString()]])})},F}(),Mn=function(){function F(T,x,N,G){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=T,this.canvasHeight=x,this.margin=N,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(F.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(T){this._aspectRatio=T,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.gridContainer&&ct.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(T){this._zoomFactor=T,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),F.prototype.open=function(){var T=this;this.cropShadeElement=ct.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ct.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var x=0;x<this.numberOfGridLines;x++)this.horizontalGridLines.push(ct.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ct.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(N){return T.gridContainer.appendChild(N)}),this.verticalGridLines.forEach(function(N){return T.gridContainer.appendChild(N)}),this.cropRectElement=ct.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new In(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new In(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new In(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new In(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},F.prototype.setCropRectangle=function(T){this.cropRect=T;var x=Object.assign({},this.cropRect);this.zoomFactor!==1&&(x.width=this.cropRect.width*this.zoomFactor,x.height=this.cropRect.height*this.zoomFactor,x.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-x.width/2,x.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-x.height/2),ct.setAttributes(this.cropRectElement,[["x",x.x.toString()],["y",x.y.toString()],["width",x.width.toString()],["height",x.height.toString()]]);var N=x.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(j,_e){var Ge=x.y+N*(_e+1);ct.setAttributes(j,[["x1",""+x.x],["y1",""+Ge],["x2",""+(x.x+x.width)],["y2",""+Ge]])});var G=x.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(j,_e){var Ge=x.x+G*(_e+1);ct.setAttributes(j,[["x1",""+Ge],["y1",""+x.y],["x2",""+Ge],["y2",""+(x.y+x.height)]])}),ct.setAttributes(this.cropShadeElement,[["d",ct.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,x.x,x.y,x.width,x.height)]]),this.topLeftGrip.setCenter(x.x,x.y),this.topRightGrip.setCenter(x.x+x.width,x.y),this.bottomLeftGrip.setCenter(x.x,x.y+x.height),this.bottomRightGrip.setCenter(x.x+x.width,x.y+x.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},F.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)},F.prototype.clientToLocalCoordinates=function(T,x){var N=this.container.getBoundingClientRect();return{x:T-N.left+this.margin,y:x-N.top+this.margin}},F.prototype.onPointerDown=function(T){this.container.setPointerCapture(T.pointerId),this.previousPoint=this.clientToLocalCoordinates(T.clientX,T.clientY),this.cropRectElement===T.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(T.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(T.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(T.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(T.target)&&(this.activeGrip=this.bottomRightGrip)},F.prototype.onPointerMove=function(T){if(this.isMoving)this.move(this.clientToLocalCoordinates(T.clientX,T.clientY));else if(this.activeGrip){var x=this.clientToLocalCoordinates(T.clientX,T.clientY);this.resize(x)}T.preventDefault()},F.prototype.onPointerUp=function(T){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(T.pointerId)},F.prototype.move=function(T){var x=T.x-this.previousPoint.x,N=T.y-this.previousPoint.y;this.zoomFactor!==1&&(x=-x/this.zoomFactor,N=-N/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+x),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+N),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=T},F.prototype.resize=function(T){var x=Object.assign({},this.cropRect),N=T.x-this.previousPoint.x,G=T.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:x.x+N<this.margin&&(N=this.margin-x.x),x.x+=N,x.width=this.cropRect.x+this.cropRect.width-x.x;break;case this.bottomRightGrip:case this.topRightGrip:x.width+N>this.canvasWidth*this.zoomFactor&&(N=this.canvasWidth*this.zoomFactor-x.width),x.width+=N}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(x.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(N),x.height=this.aspectRatio.getVerticalLength(x.width)):(x.y+=G,x.height=this.cropRect.y+this.cropRect.height-x.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?x.height=this.aspectRatio.getVerticalLength(x.width):x.height+=G}x.width<10&&(x.x=this.cropRect.x,x.width=10),x.height<10&&(x.y=this.cropRect.y,x.height=10),this.previousPoint=T,x.x>=this.margin&&x.y>=this.margin&&x.x-this.margin+x.width<=this.canvasWidth&&x.y-this.margin+x.height<=this.canvasHeight&&(this.cropRect=x,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},F.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var T=this.cropRect.x+this.cropRect.width/2,x=this.cropRect.y+this.cropRect.height/2,N=this.aspectRatio.getHorizontalLength(this.cropRect.height),G=this.aspectRatio.getVerticalLength(this.cropRect.width);N/this.canvasWidth<G/this.canvasHeight?this.cropRect.width=N: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=T-this.cropRect.width/2,this.cropRect.y=x-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)}},F.prototype.getRescaledRect=function(T,x,N,G,j,_e){var Ge=N/T,tt=G/x;return{x:(j.x-_e)*Ge+_e,y:(j.y-_e)*tt+_e,width:j.width*Ge,height:j.height*tt}},F.prototype.scaleCanvas=function(T,x){var N=this.getRescaledRect(this.canvasWidth,this.canvasHeight,T,x,this.cropRect,this.margin);this.canvasWidth=T,this.canvasHeight=x,this.onCropChange&&this.onCropChange(N),this.setCropRectangle(N)},F}(),Bn=function(){function F(T){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=T,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(F.prototype,"angle",{get:function(){return this._angle},set:function(T){this._angle=T,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),F.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},F.prototype.onPointerDown=function(T){this.controlContainer.setPointerCapture(T.pointerId),this.isDragging=!0,this.previousPoint={x:T.clientX,y:T.clientY}},F.prototype.onPointerMove=function(T){this.isDragging&&(this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.previousPoint.x=T.clientX)},F.prototype.onPointerUp=function(T){this.isDragging&&this.onAngleChange&&this.onAngleChange((T.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(T.pointerId)},F.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var T=this.angleLabelText.getBBox();ct.setAttributes(this.angleLabelElement,[["x",((this.width-T.width)/2).toString()],["y",(this.height/2).toString()]])}},F.prototype.positionScaleShape=function(){if(this.scaleShape){var T=this.scaleShape.transform.baseVal.getItem(0);T.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(T,0)}},F.prototype.getVisual=function(){var T=document.createElementNS("http://www.w3.org/2000/svg","svg");T.setAttribute("xmlns","http://www.w3.org/2000/svg"),T.setAttribute("width",this.width+"px"),T.setAttribute("height",this.height+"px"),T.setAttribute("viewBox","0 0 "+this.width+" "+this.height),T.style.flexShrink="0",document.body.appendChild(T);for(var x="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,N=1;N<=this.width/5+10;N++){var G=N%5==0?this.height/3:this.height/6;x+="h4v"+-G+"h1v"+G}x+="v1H0Z",this.scaleShape=ct.createPath(x);var j=ct.createTransform();this.scaleShape.transform.baseVal.appendItem(j),T.appendChild(this.scaleShape),this.angleLabelElement=ct.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ct.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var _e=ct.createTSpan("");return _e.innerHTML="°",this.angleLabelElement.appendChild(_e),T.appendChild(this.angleLabelElement),document.body.removeChild(T),T},F}(),Fn=function(){function F(){this.naturalSize=!1,this.imageType="image/png"}return F.prototype.rasterize=function(T,x,N,G,j,_e,Ge){var tt=this;return new Promise(function(st){var Ve=document.createElement("canvas");Ve.width=T.width.baseVal.value-2*G,Ve.height=T.height.baseVal.value-2*G;var yt=1,jt=1;tt.naturalSize===!0?(yt=x.naturalWidth/(T.width.baseVal.value-2*G)/_e,jt=x.naturalHeight/(T.height.baseVal.value-2*G)/Ge,Ve.width=x.naturalWidth/_e,Ve.height=x.naturalHeight/Ge):tt.width!==void 0&&tt.height!==void 0&&(yt=tt.width/N.width,jt=tt.height/N.height,Ve.width*=yt,Ve.height*=jt);var Qt=Ve.getContext("2d");Qt.translate(Ve.width/2,Ve.height/2),Qt.rotate(j*Math.PI/180),Qt.scale(_e,Ge),Qt.translate(-Ve.width/2,-Ve.height/2),Qt.drawImage(x,0,0,Ve.width,Ve.height);var Dn=document.createElement("canvas");Dn.width=N.width*yt,Dn.height=N.height*jt,Dn.getContext("2d").putImageData(Qt.getImageData((N.x-G)*yt,(N.y-G)*jt,N.width*yt,N.height*jt),0,0),st(Dn.toDataURL(tt.imageType,tt.imageQuality))})},F}(),Wn=function(){function F(T){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=F.instanceCounter++,this.styles=new _n(this.instanceNo),this.target=T,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(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(T){this._zoomToCropEnabled=T,T?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(T){this._isGridVisible=T,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"gridLines",{get:function(){return this._gridLines},set:function(T){this._gridLines=T,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(T){this._rotationAngle=T,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"aspectRatio",{get:function(){var T;return(T=this._aspectRatio)!==null&&T!==void 0?T:this.aspectRatios[0]},set:function(T){this._aspectRatio=T},enumerable:!1,configurable:!0}),F.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},F.prototype.show=function(){this.showUI(),this.open()},F.prototype.close=function(T){T===void 0&&(T=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),T||this.closeEventListeners.forEach(function(x){return x()}),this._isOpen=!1)},F.prototype.addRenderEventListener=function(T){this.renderEventListeners.push(T)},F.prototype.removeRenderEventListener=function(T){this.renderEventListeners.indexOf(T)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(T),1)},F.prototype.addCloseEventListener=function(T){this.closeEventListeners.push(T)},F.prototype.removeCloseEventListener=function(T){this.closeEventListeners.indexOf(T)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(T),1)},F.prototype.setupResizeObserver=function(){var T=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){T.resize(T.target.clientWidth,T.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))},F.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var T=1*this.target.clientWidth/this.target.clientHeight,x=this.contentDiv.clientWidth/T>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*T:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,N=x+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/T;this.resize(x,N)}},F.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},F.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",ct.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},F.prototype.resize=function(T,x){this.imageWidth=Math.round(T),this.imageHeight=Math.round(x),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()},F.prototype.setEditingTarget=function(){var T=document.createElement("canvas");T.width=this.target.naturalWidth,T.height=this.target.naturalHeight,T.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var x=T.toDataURL();ct.setAttributes(this.editingTarget,[["href",x]]),this.setEditingTargetSize()},F.prototype.setTopLeft=function(){var T=this.target.getBoundingClientRect(),x=this.editorCanvas.getBoundingClientRect();this.left=T.left-x.left-this.CANVAS_MARGIN,this.top=T.top-x.top-this.CANVAS_MARGIN},F.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=ct.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ct.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ct.createGroup(),this.editingTargetRotationScaleContainer=ct.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var T=ct.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(T);var x=ct.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(x),this.editingTargetContainer=ct.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)},F.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},F.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=ct.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Mn(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()},F.prototype.zoomToCrop=function(){if(this.cropRect){var T=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,x=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=T+"px "+x+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-T+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-x+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},F.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)},F.prototype.cropRectChanged=function(T){this.cropRect=T,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},F.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},F.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"},F.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},F.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 T=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,x=this.target.offsetTop>T+this.CANVAS_MARGIN?this.target.offsetTop-(T+this.CANVAS_MARGIN):0;this.coverDiv.style.top=x+"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},F.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},F.prototype.addTopToolbar=function(){var T=this;this.topToolbar=new Pt,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 x=new rn;x.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(x);var N=[];this.aspectRatios.forEach(function(jt){var Qt=new an(Wt.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);Qt.onClick=function(){return T.ratioButtonClicked(jt)},N.push(Qt)}),this.aspectRatioButton=new wn(Wt.getIcon(0,0),"Aspect ratio",N),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,x.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var G=new an('<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(){T.isGridVisible=!T.isGridVisible,G.isActive=T.isGridVisible},x.addButton(G);var j=new an('<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(j.isActive=this.zoomToCropEnabled,j.onClick=function(){T.zoomToCropEnabled=!T.zoomToCropEnabled,j.isActive=T.zoomToCropEnabled},x.addButton(j),!hn.isLicensed){var _e=new Cn;this.topToolbar.addElementBlock(_e);var Ge=document.createElement("div");Ge.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var tt=document.createElement("a");tt.style.color="currentColor",tt.href="https://markerjs.com/products/cropro",tt.target="_blank",tt.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>',Ge.appendChild(tt),_e.addElement(Ge)}var st=new rn;st.minWidth=3*this.toolbarHeight+"px",st.contentAlign="end",this.topToolbar.addButtonBlock(st);var Ve=new an('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ve.onClick=this.startRenderAndClose,st.addButton(Ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var yt=new an('<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");yt.onClick=this.close,st.addButton(yt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(yt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},F.prototype.addBottomToolbar=function(){var T=this;this.bottomToolbar=new Pt,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 x=new rn;x.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(x);var N=new an('<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");N.onClick=this.rotateLeftButtonClicked,x.addButton(N);var G=new an('<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,x.addButton(G);var j=new Cn;j.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(j),this.straightener=new Bn("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(st){T.rotateBy(st),T.straightener.angle=T.rotationAngle},j.addElement(this.straightener.getUI());var _e=new rn;_e.minWidth=2*this.toolbarHeight+"px",_e.contentAlign="end",this.bottomToolbar.addButtonBlock(_e);var Ge=new an('<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");Ge.onClick=this.flipHorizontallyButtonClicked,_e.addButton(Ge);var tt=new an('<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");tt.onClick=this.flipVerticallyButtonClicked,_e.addButton(tt)},F.prototype.ratioButtonClicked=function(T){this.aspectRatio=T,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},F.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Wt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},F.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new bn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},F.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},F.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},F.prototype.restoreState=function(T){if(T){var x=this.cropLayer.getRescaledRect(T.width,T.height,this.imageWidth,this.imageHeight,T.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(x),this.cropRectChanged(x),this.flippedHorizontally=T.flippedHorizontally,this.flippedVertically=T.flippedVertically,this.applyFlip(),this.rotationAngle=T.rotationAngle,this.applyRotation()}},F.prototype.clientToLocalCoordinates=function(T,x){var N=this.cropImage.getBoundingClientRect();return{x:T-N.left,y:x-N.top}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var T=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=T+"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()},F.prototype.rotateLeftButtonClicked=function(){var T=this.rotationAngle-90;this.rotationAngle%90!=0&&(T+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(T)},F.prototype.rotateRightButtonClicked=function(){var T=this.rotationAngle+90;this.rotationAngle%90!=0&&(T-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(T)},F.prototype.rotateTo=function(T){T=(T=T>180?T-360:T)<=-180?T+360:T,this.rotationAngle=T,this.applyRotation()},F.prototype.rotateBy=function(T){this.rotateTo((this.rotationAngle+T)%360)},F.prototype.applyRotation=function(){var T=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var x=this.editingTargetRotationContainer.transform.baseVal.getItem(0);x.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(x,0);var N=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/N.width,this.imageHeight/N.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=T},F.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},F.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},F.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},F.prototype.startRenderAndClose=function(){return bt(this,void 0,void 0,function(){var T,x;return en(this,function(N){switch(N.label){case 0:return[4,this.render()];case 1:return T=N.sent(),x=this.getState(),this.renderEventListeners.forEach(function(G){return G(T,x)}),this.close(!0),[2]}})})},F.prototype.render=function(){return bt(this,void 0,void 0,function(){var T;return en(this,function(x){switch(x.label){case 0:return(T=new Fn).naturalSize=this.renderAtNaturalSize,T.imageType=this.renderImageType,T.imageQuality=this.renderImageQuality,T.width=this.renderWidth,T.height=this.renderHeight,this.unzoomFromCrop(),ct.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,T.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 x.sent(),[4,T.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,x.sent()]}})})},F.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new lt("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 lt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new lt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var T=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new lt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*T)+`px;
|
|
height: `+(this.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new lt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new lt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new at("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new at("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new lt("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 lt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new lt("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 lt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*T)+`px;
|
|
padding: `+T+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new lt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},F.instanceCounter=0,F}(),Jn=U("8hTe"),Vn=U.n(Jn),Xn=/<pre[^>]*>/g;function li(F){var T=document.createElement("div");return T.innerHTML=F,T.childNodes.length===0?"":T.childNodes[0].nodeValue}var fn=ve.a=function(F){var T=F.value,x=T===void 0?"":T,N=F.edit,G=N===void 0?!1:N,j=F.className,_e=F.showTextOnly,Ge=F.showLines,tt=F.replaces,st=F.zoomImg,Ve=F.hasMask,yt=F.style,jt=yt===void 0?{}:yt,Qt=F.stylesPrev,Dn=Qt===void 0?{}:Qt,Kn=String(x),pn=Object(C.useRef)(),jn=Object(C.useRef)(),ui=Object(C.useState)(""),qn=Object(B.a)(ui,2),Yn=qn[0],Gn=qn[1],ni=Object(C.useState)("office"),ht=Object(B.a)(ni,2),ft=ht[0],Et=ht[1],kt=function(){var Vt=new Wn(jn.current);Vt.displayMode="popup",Vt.addRenderEventListener(function(){var gn=Object(D.a)(e.a.mark(function Ft(On){var on;return e.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return pn.current.style.display="none",Tn.next=3,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:On}});case 3:on=Tn.sent,on!=null&&on.id&&tt(jn.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(on==null?void 0:on.id,"?type=").concat(on.content_type));case 5:case"end":return Tn.stop()}},Ft)}));return function(Ft){return gn.apply(this,arguments)}}()),Vt.show()},dn=function(){var Vt=new It(jn.current);Vt.settings.displayMode="popup",Vt.addEventListener("render",function(){var gn=Object(D.a)(e.a.mark(function Ft(On){var on;return e.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:if(pn.current.style.display="none",!jn.current){Tn.next=6;break}return Tn.next=4,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:On.dataUrl}});case 4:on=Tn.sent,on!=null&&on.id&&tt(jn.current.getAttribute("src").replace(z.a.API_SERVER,""),"/api/attachments/".concat(on==null?void 0:on.id,"?type=").concat(on.content_type));case 6:case"end":return Tn.stop()}},Ft)}));return function(Ft){return gn.apply(this,arguments)}}()),Vt.show(),window.markerArea=Vt},Zt=Object(C.useMemo)(function(){pn.current&&(pn.current.style.zIndex=-1);try{var mn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Vt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,gn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Kn=Kn.replace(mn,"("+z.a.API_SERVER+"/api/attachments/").replace(Vt,'"'+z.a.API_SERVER+"/api/attachments/").replace(gn,'"'+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(ri){}var Ft=P(Kn),On=E();if(Kn.match(/\[TOC\]/)&&(Ft=Ft.replace("<p>[TOC]</p>",b()),g()),Ft=Ft.replace(/(__special_katext_id_\d+__)/g,function(ri,Tn){var di=On[Tn],Si=di.type,Ai=di.expression;return Object(oe.renderToString)(li(Ai)||"",{displayMode:Si==="block",throwOnError:!1,output:"html"})}),Ft=Ft.replace(/▁/g,"\u2581\u2581\u2581"),v(),_e){var on=document.createElement("div");return on.innerHTML=Ft,on.innerText}return setTimeout(function(){return xi()},500),Ft},[Kn]),En=Object(C.useRef)();p.WebkitLineClamp=Ge,Ge&&(jt=Object(w.a)(Object(w.a)({},jt),p));function ii(mn){var Vt=mn.target;if(Vt.tagName.toUpperCase()==="IMG"){if(st){var gn=Vt.getAttribute("src");Gn(gn),Et("image")}}else if(Vt.tagName.toUpperCase()==="A"){var Ft=Vt.getAttribute("href");if(Ft.indexOf("office")>-1)mn.preventDefault(),Gn(Ft),Et("office");else if(Ft.indexOf("application/pdf")>-1)mn.preventDefault(),Gn(Ft),Et("pdf");else if(Ft.indexOf("text/html")>-1)mn.preventDefault(),Gn(Ft),Et("html");else if(Ft.startsWith("#")){mn.preventDefault();var On=document.getElementById(Ft.replace("#",""));On&&On.scrollIntoView(!0)}}}var xi=function(){var Vt,gn=(Vt=En.current)===null||Vt===void 0?void 0:Vt.querySelectorAll("video");gn==null||gn.forEach(function(Ft){if(Ft.oncontextmenu=function(){return!1},Ft.src.indexOf(".m3u8")>-1&&!Ft.canPlayType("application/vnd.apple.mpegurl")){if(K.a.isSupported()){var On=new K.a;On.loadSource(Ft.src),On.attachMedia(Ft)}}})};Object(C.useEffect)(function(){if(En.current&&Zt&&(Zt.match(Xn)&&window.PR.prettyPrint()),En.current)return En.current.addEventListener("click",ii),function(){En.current.removeEventListener("click",ii),v(),g()}},[Zt,En.current,ii]);var Bi=function(Vt){if(!G)return;Vt.target.nodeName==="IMG"?(pn.current.style.zIndex=1,pn.current.style.display="flex",pn.current.style.width=Vt.target.clientWidth+"px",pn.current.style.height=Vt.target.clientHeight+"px",pn.current.style.top=Vt.target.offsetTop+"px",pn.current.style.left=Vt.target.offsetLeft+"px",jn.current.src=Vt.target.getAttribute("src")):pn.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:En,style:Object(w.a)({},jt),className:"".concat(j||""," markdown-body ").concat(Vn.a.mdBody),onMouseOver:Bi,dangerouslySetInnerHTML:{__html:Zt}}),y.a.createElement("div",{ref:pn,className:Vn.a.button},y.a.createElement(W.a,null,y.a.createElement(k.a,{onClick:function(){return kt()}},"\u88C1\u526A"),y.a.createElement(k.a,{onClick:function(){return dn()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:jn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement($.a,{close:!0,data:Yn,type:Yn!=null&&Yn.length?ft:"",style:Object(w.a)({},Dn),onClose:function(){return Gn("")}}))}},BU3w:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return D});var ne=U("MNnm"),W="rc-util-key";function O(B){if(B.attachTo)return B.attachTo;var M=document.querySelector("head");return M||document.body}function k(B){var M,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var C=document.createElement("style");if((M=e.csp)===null||M===void 0?void 0:M.nonce){var y;C.nonce=(y=e.csp)===null||y===void 0?void 0:y.nonce}C.innerHTML=B;var c=O(e),d=c.firstChild;return e.prepend&&c.prepend?c.prepend(C):e.prepend&&d?c.insertBefore(C,d):c.appendChild(C),C}var w=new Map;function D(B,M){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=O(e);if(!w.has(C)){var y=k("",e),c=y.parentNode;w.set(C,c),c.removeChild(y)}var d=Array.from(w.get(C).children).find(function(r){return r.tagName==="STYLE"&&r[W]===M});if(d){var a,i;if(((a=e.csp)===null||a===void 0?void 0:a.nonce)&&d.nonce!==((i=e.csp)===null||i===void 0?void 0:i.nonce)){var o;d.nonce=(o=e.csp)===null||o===void 0?void 0:o.nonce}return d.innerHTML!==B&&(d.innerHTML=B),d}var s=k(B,e);return s[W]=M,s}},BdwD:function(qe,ve,U){"use strict";var ne=U("+L6B"),W=U("2/Rp"),O=U("0Owb"),k=U("k1fw"),w=U("q1tI"),D=U.n(w),B=U("FOrL"),M=U.n(B),e=function(y){var c=y.buttonProps,d=c===void 0?{}:c,a=y.styles,i=a===void 0?{}:a,o=y.customText,s=y.ButtonText,r=y.ButtonClick,n=y.Buttonclass,t=y.ButtonTwo;return D.a.createElement("section",{className:"tc animated fadeIn",style:Object(k.a)(Object(k.a)({},{color:"#999",margin:"200px auto"}),i)},D.a.createElement("img",{src:M.a}),D.a.createElement("p",{className:"mt20 font14"},o||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&D.a.createElement(W.a,Object(O.a)({className:n,onClick:r},d),s),t&&t)};ve.a=e},"C/vA":function(qe,ve,U){"use strict";U.d(ve,"a",function(){return ne});function ne(W){const O=this;let k=!1,w;return function(){return k||(k=!0,w=W.apply(O,arguments)),w}}},"Cg/j":function(qe,ve,U){"use strict";U.d(ve,"b",function(){return ne}),U.d(ve,"a",function(){return W}),U.d(ve,"c",function(){return k}),U.d(ve,"d",function(){return w});var ne;(function(D){D.serviceIds=new Map,D.DI_TARGET="$di$target",D.DI_DEPENDENCIES="$di$dependencies";function B(M){return M[D.DI_DEPENDENCIES]||[]}D.getServiceDependencies=B})(ne||(ne={}));const W=k("instantiationService");function O(D,B,M,e){B[ne.DI_TARGET]===B?B[ne.DI_DEPENDENCIES].push({id:D,index:M,optional:e}):(B[ne.DI_DEPENDENCIES]=[{id:D,index:M,optional:e}],B[ne.DI_TARGET]=B)}function k(D){if(ne.serviceIds.has(D))return ne.serviceIds.get(D);const B=function(M,e,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");O(B,M,C,!1)};return B.toString=()=>D,ne.serviceIds.set(D,B),B}function w(D){return function(B,M,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");O(D,B,e,!0)}}},DlQD:function(qe,ve,U){(function(ne,W){qe.exports=W()})(this,function(){"use strict";function ne(ae,ce){for(var ye=0;ye<ce.length;ye++){var Q=ce[ye];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(ae,Q.key,Q)}}function W(ae,ce,ye){return ce&&ne(ae.prototype,ce),ye&&ne(ae,ye),ae}function O(ae,ce){if(!ae)return;if(typeof ae=="string")return k(ae,ce);var ye=Object.prototype.toString.call(ae).slice(8,-1);if(ye==="Object"&&ae.constructor&&(ye=ae.constructor.name),ye==="Map"||ye==="Set")return Array.from(ae);if(ye==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ye))return k(ae,ce)}function k(ae,ce){(ce==null||ce>ae.length)&&(ce=ae.length);for(var ye=0,Q=new Array(ce);ye<ce;ye++)Q[ye]=ae[ye];return Q}function w(ae,ce){var ye;if(typeof Symbol=="undefined"||ae[Symbol.iterator]==null){if(Array.isArray(ae)||(ye=O(ae))||ce&&ae&&typeof ae.length=="number"){ye&&(ae=ye);var Q=0;return function(){return Q>=ae.length?{done:!0}:{done:!1,value:ae[Q++]}}}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 ye=ae[Symbol.iterator](),ye.next.bind(ye)}function D(ae,ce){return ce={exports:{}},ae(ce,ce.exports),ce.exports}var B=D(function(ae){function ce(){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 ye(Q){ae.exports.defaults=Q}ae.exports={defaults:ce(),getDefaults:ce,changeDefaults:ye}}),M=B.defaults,e=B.getDefaults,C=B.changeDefaults,y=/[&<>"']/,c=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,i={"&":"&","<":"<",">":">",'"':""","'":"'"},o=function(ce){return i[ce]};function s(ae,ce){if(ce){if(y.test(ae))return ae.replace(c,o)}else if(d.test(ae))return ae.replace(a,o);return ae}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(ae){return ae.replace(r,function(ce,ye){return ye=ye.toLowerCase(),ye==="colon"?":":ye.charAt(0)==="#"?ye.charAt(1)==="x"?String.fromCharCode(parseInt(ye.substring(2),16)):String.fromCharCode(+ye.substring(1)):""})}var t=/(^|[^\[])\^/g;function g(ae,ce){ae=ae.source||ae,ce=ce||"";var ye={replace:function(q,se){return se=se.source||se,se=se.replace(t,"$1"),ae=ae.replace(q,se),ye},getRegex:function(){return new RegExp(ae,ce)}};return ye}var p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(ae,ce,ye){if(ae){var Q;try{Q=decodeURIComponent(n(ye)).replace(p,"").toLowerCase()}catch(q){return null}if(Q.indexOf("javascript:")===0||Q.indexOf("vbscript:")===0||Q.indexOf("data:")===0)return null}ce&&!m.test(ye)&&(ye=h(ce,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(q){return null}return ye}var _={},l=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(ae,ce){_[" "+ae]||(l.test(ae)?_[" "+ae]=ae+"/":_[" "+ae]=L(ae,"/",!0)),ae=_[" "+ae];var ye=ae.indexOf(":")===-1;return ce.substring(0,2)==="//"?ye?ce:ae.replace(f,"$1")+ce:ce.charAt(0)==="/"?ye?ce:ae.replace(u,"$1")+ce:ae+ce}var E={exec:function(){}};function v(ae){for(var ce=1,ye,Q;ce<arguments.length;ce++){ye=arguments[ce];for(Q in ye)Object.prototype.hasOwnProperty.call(ye,Q)&&(ae[Q]=ye[Q])}return ae}function S(ae,ce){var ye=ae.replace(/\|/g,function(se,me,De){for(var Be=!1,Xe=me;--Xe>=0&&De[Xe]==="\\";)Be=!Be;return Be?"|":" |"}),Q=ye.split(/ \|/),q=0;if(Q.length>ce)Q.splice(ce);else for(;Q.length<ce;)Q.push("");for(;q<Q.length;q++)Q[q]=Q[q].trim().replace(/\\\|/g,"|");return Q}function L(ae,ce,ye){var Q=ae.length;if(Q===0)return"";for(var q=0;q<Q;){var se=ae.charAt(Q-q-1);if(se===ce&&!ye)q++;else if(se!==ce&&ye)q++;else break}return ae.substr(0,Q-q)}function I(ae,ce){if(ae.indexOf(ce[1])===-1)return-1;for(var ye=ae.length,Q=0,q=0;q<ye;q++)if(ae[q]==="\\")q++;else if(ae[q]===ce[0])Q++;else if(ae[q]===ce[1]&&(Q--,Q<0))return q;return-1}function A(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:n,edit:g,cleanUrl:b,resolveUrl:h,noopTest:E,merge:v,splitCells:S,rtrim:L,findClosingBracket:I,checkSanitizeDeprecation:A},H=B.defaults,R=P.rtrim,K=P.splitCells,z=P.escape,oe=P.findClosingBracket;function $(ae,ce,ye){var Q=ce.href,q=ce.title?z(ce.title):null,se=ae[1].replace(/\\([\[\]])/g,"$1");return ae[0].charAt(0)!=="!"?{type:"link",raw:ye,href:Q,title:q,text:se}:{type:"image",raw:ye,href:Q,title:q,text:z(se)}}function fe(ae,ce){var ye=ae.match(/^(\s+)(?:```)/);if(ye===null)return ce;var Q=ye[1];return ce.split(`
|
|
`).map(function(q){var se=q.match(/^\s+/);if(se===null)return q;var me=se[0];return me.length>=Q.length?q.slice(Q.length):q}).join(`
|
|
`)}var de=function(){function ae(ye){this.options=ye||H}var ce=ae.prototype;return ce.space=function(Q){var q=this.rules.block.newline.exec(Q);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:`
|
|
`}},ce.code=function(Q,q){var se=this.rules.block.code.exec(Q);if(se){var me=q[q.length-1];if(me&&me.type==="paragraph")return{raw:se[0],text:se[0].trimRight()};var De=se[0].replace(/^ {4}/gm,"");return{type:"code",raw:se[0],codeBlockStyle:"indented",text:this.options.pedantic?De:R(De,`
|
|
`)}}},ce.fences=function(Q){var q=this.rules.block.fences.exec(Q);if(q){var se=q[0],me=fe(se,q[3]||"");return{type:"code",raw:se,lang:q[2]?q[2].trim():q[2],text:me}}},ce.heading=function(Q){var q=this.rules.block.heading.exec(Q);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},ce.nptable=function(Q){var q=this.rules.block.nptable.exec(Q);if(q){var se={type:"table",header:K(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
|
|
`):[],raw:q[0]};if(se.header.length===se.align.length){var me=se.align.length,De;for(De=0;De<me;De++)/^ *-+: *$/.test(se.align[De])?se.align[De]="right":/^ *:-+: *$/.test(se.align[De])?se.align[De]="center":/^ *:-+ *$/.test(se.align[De])?se.align[De]="left":se.align[De]=null;for(me=se.cells.length,De=0;De<me;De++)se.cells[De]=K(se.cells[De],se.header.length);return se}}},ce.hr=function(Q){var q=this.rules.block.hr.exec(Q);if(q)return{type:"hr",raw:q[0]}},ce.blockquote=function(Q){var q=this.rules.block.blockquote.exec(Q);if(q){var se=q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:q[0],text:se}}},ce.list=function(Q){var q=this.rules.block.list.exec(Q);if(q){for(var se=q[0],me=q[2],De=me.length>1,Be=me[me.length-1]===")",Xe={type:"list",raw:se,ordered:De,start:De?+me.slice(0,-1):"",loose:!1,items:[]},ut=q[0].match(this.rules.block.item),vt=!1,dt,_t,xt,rt,Yt,It,qt,$t=ut.length,bt=0;bt<$t;bt++)dt=ut[bt],se=dt,_t=dt.length,dt=dt.replace(/^ *([*+-]|\d+[.)]) */,""),~dt.indexOf(`
|
|
`)&&(_t-=dt.length,dt=this.options.pedantic?dt.replace(/^ {1,4}/gm,""):dt.replace(new RegExp("^ {1,"+_t+"}","gm"),"")),bt!==$t-1&&(xt=this.rules.block.bullet.exec(ut[bt+1])[0],(De?xt.length===1||!Be&&xt[xt.length-1]===")":xt.length>1||this.options.smartLists&&xt!==me)&&(rt=ut.slice(bt+1).join(`
|
|
`),Xe.raw=Xe.raw.substring(0,Xe.raw.length-rt.length),bt=$t-1)),Yt=vt||/\n\n(?!\s*$)/.test(dt),bt!==$t-1&&(vt=dt.charAt(dt.length-1)===`
|
|
`,Yt||(Yt=vt)),Yt&&(Xe.loose=!0),It=/^\[[ xX]\] /.test(dt),qt=void 0,It&&(qt=dt[1]!==" ",dt=dt.replace(/^\[[ xX]\] +/,"")),Xe.items.push({type:"list_item",raw:se,task:It,checked:qt,loose:Yt,text:dt});return Xe}},ce.html=function(Q){var q=this.rules.block.html.exec(Q);if(q)return{type:this.options.sanitize?"paragraph":"html",raw:q[0],pre:!this.options.sanitizer&&(q[1]==="pre"||q[1]==="script"||q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(q[0]):z(q[0]):q[0]}},ce.def=function(Q){var q=this.rules.block.def.exec(Q);if(q){q[3]&&(q[3]=q[3].substring(1,q[3].length-1));var se=q[1].toLowerCase().replace(/\s+/g," ");return{tag:se,raw:q[0],href:q[2],title:q[3]}}},ce.table=function(Q){var q=this.rules.block.table.exec(Q);if(q){var se={type:"table",header:K(q[1].replace(/^ *| *\| *$/g,"")),align:q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:q[3]?q[3].replace(/\n$/,"").split(`
|
|
`):[]};if(se.header.length===se.align.length){se.raw=q[0];var me=se.align.length,De;for(De=0;De<me;De++)/^ *-+: *$/.test(se.align[De])?se.align[De]="right":/^ *:-+: *$/.test(se.align[De])?se.align[De]="center":/^ *:-+ *$/.test(se.align[De])?se.align[De]="left":se.align[De]=null;for(me=se.cells.length,De=0;De<me;De++)se.cells[De]=K(se.cells[De].replace(/^ *\| *| *\| *$/g,""),se.header.length);return se}}},ce.lheading=function(Q){var q=this.rules.block.lheading.exec(Q);if(q)return{type:"heading",raw:q[0],depth:q[2].charAt(0)==="="?1:2,text:q[1]}},ce.paragraph=function(Q){var q=this.rules.block.paragraph.exec(Q);if(q)return{type:"paragraph",raw:q[0],text:q[1].charAt(q[1].length-1)===`
|
|
`?q[1].slice(0,-1):q[1]}},ce.text=function(Q,q){var se=this.rules.block.text.exec(Q);if(se){var me=q[q.length-1];return me&&me.type==="text"?{raw:se[0],text:se[0]}:{type:"text",raw:se[0],text:se[0]}}},ce.escape=function(Q){var q=this.rules.inline.escape.exec(Q);if(q)return{type:"escape",raw:q[0],text:z(q[1])}},ce.tag=function(Q,q,se){var me=this.rules.inline.tag.exec(Q);if(me)return!q&&/^<a /i.test(me[0])?q=!0:q&&/^<\/a>/i.test(me[0])&&(q=!1),!se&&/^<(pre|code|kbd|script)(\s|>)/i.test(me[0])?se=!0:se&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(me[0])&&(se=!1),{type:this.options.sanitize?"text":"html",raw:me[0],inLink:q,inRawBlock:se,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):z(me[0]):me[0]}},ce.link=function(Q){var q=this.rules.inline.link.exec(Q);if(q){var se=oe(q[2],"()");if(se>-1){var me=q[0].indexOf("!")===0?5:4,De=me+q[1].length+se;q[2]=q[2].substring(0,se),q[0]=q[0].substring(0,De).trim(),q[3]=""}var Be=q[2],Xe="";if(this.options.pedantic){var ut=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Be);ut?(Be=ut[1],Xe=ut[3]):Xe=""}else Xe=q[3]?q[3].slice(1,-1):"";Be=Be.trim().replace(/^<([\s\S]*)>$/,"$1");var vt=$(q,{href:Be&&Be.replace(this.rules.inline._escapes,"$1"),title:Xe&&Xe.replace(this.rules.inline._escapes,"$1")},q[0]);return vt}},ce.reflink=function(Q,q){var se;if((se=this.rules.inline.reflink.exec(Q))||(se=this.rules.inline.nolink.exec(Q))){var me=(se[2]||se[1]).replace(/\s+/g," ");if(me=q[me.toLowerCase()],!me||!me.href){var De=se[0].charAt(0);return{type:"text",raw:De,text:De}}var Be=$(se,me,se[0]);return Be}},ce.strong=function(Q,q,se){se===void 0&&(se="");var me=this.rules.inline.strong.start.exec(Q);if(me&&(!me[1]||me[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){q=q.slice(-1*Q.length);var De=me[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;De.lastIndex=0;for(var Be;(me=De.exec(q))!=null;)if(Be=this.rules.inline.strong.middle.exec(q.slice(0,me.index+3)),Be)return{type:"strong",raw:Q.slice(0,Be[0].length),text:Q.slice(2,Be[0].length-2)}}},ce.em=function(Q,q,se){se===void 0&&(se="");var me=this.rules.inline.em.start.exec(Q);if(me&&(!me[1]||me[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){q=q.slice(-1*Q.length);var De=me[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;De.lastIndex=0;for(var Be;(me=De.exec(q))!=null;)if(Be=this.rules.inline.em.middle.exec(q.slice(0,me.index+2)),Be)return{type:"em",raw:Q.slice(0,Be[0].length),text:Q.slice(1,Be[0].length-1)}}},ce.codespan=function(Q){var q=this.rules.inline.code.exec(Q);if(q){var se=q[2].replace(/\n/g," "),me=/[^ ]/.test(se),De=se.startsWith(" ")&&se.endsWith(" ");return me&&De&&(se=se.substring(1,se.length-1)),se=z(se,!0),{type:"codespan",raw:q[0],text:se}}},ce.br=function(Q){var q=this.rules.inline.br.exec(Q);if(q)return{type:"br",raw:q[0]}},ce.del=function(Q){var q=this.rules.inline.del.exec(Q);if(q)return{type:"del",raw:q[0],text:q[1]}},ce.autolink=function(Q,q){var se=this.rules.inline.autolink.exec(Q);if(se){var me,De;return se[2]==="@"?(me=z(this.options.mangle?q(se[1]):se[1]),De="mailto:"+me):(me=z(se[1]),De=me),{type:"link",raw:se[0],text:me,href:De,tokens:[{type:"text",raw:me,text:me}]}}},ce.url=function(Q,q){var se;if(se=this.rules.inline.url.exec(Q)){var me,De;if(se[2]==="@")me=z(this.options.mangle?q(se[0]):se[0]),De="mailto:"+me;else{var Be;do Be=se[0],se[0]=this.rules.inline._backpedal.exec(se[0])[0];while(Be!==se[0]);me=z(se[0]),se[1]==="www."?De="http://"+me:De=me}return{type:"link",raw:se[0],text:me,href:De,tokens:[{type:"text",raw:me,text:me}]}}},ce.inlineText=function(Q,q,se){var me=this.rules.inline.text.exec(Q);if(me){var De;return q?De=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(me[0]):z(me[0]):me[0]:De=z(this.options.smartypants?se(me[0]):me[0]),{type:"text",raw:me[0],text:De}}},ae}(),ee=P.noopTest,ie=P.edit,ge=P.merge,Z={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:ee,table:ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Z._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Z._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Z.def=ie(Z.def).replace("label",Z._label).replace("title",Z._title).getRegex(),Z.bullet=/(?:[*+-]|\d{1,9}[.)])/,Z.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Z.item=ie(Z.item,"gm").replace(/bull/g,Z.bullet).getRegex(),Z.list=ie(Z.list).replace(/bull/g,Z.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Z.def.source+")").getRegex(),Z._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",Z._comment=/<!--(?!-?>)[\s\S]*?-->/,Z.html=ie(Z.html,"i").replace("comment",Z._comment).replace("tag",Z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Z.paragraph=ie(Z._paragraph).replace("hr",Z.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",Z._tag).getRegex(),Z.blockquote=ie(Z.blockquote).replace("paragraph",Z.paragraph).getRegex(),Z.normal=ge({},Z),Z.gfm=ge({},Z.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*|$)"}),Z.gfm.nptable=ie(Z.gfm.nptable).replace("hr",Z.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",Z._tag).getRegex(),Z.gfm.table=ie(Z.gfm.table).replace("hr",Z.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",Z._tag).getRegex(),Z.pedantic=ge({},Z.normal,{html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Z._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:ee,paragraph:ie(Z.normal._paragraph).replace("hr",Z.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",Z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Y={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ee,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:ee,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};Y._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Y.punctuation=ie(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Y._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Y.em.start=ie(Y.em.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.middle=ie(Y.em.middle).replace(/punctuation/g,Y._punctuation).replace(/overlapSkip/g,Y._overlapSkip).getRegex(),Y.em.endAst=ie(Y.em.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.endUnd=ie(Y.em.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.start=ie(Y.strong.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.middle=ie(Y.strong.middle).replace(/punctuation/g,Y._punctuation).replace(/blockSkip/g,Y._blockSkip).getRegex(),Y.strong.endAst=ie(Y.strong.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.endUnd=ie(Y.strong.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=ie(Y._blockSkip,"g").getRegex(),Y.overlapSkip=ie(Y._overlapSkip,"g").getRegex(),Y._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Y._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Y._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])?)+(?![-_])/,Y.autolink=ie(Y.autolink).replace("scheme",Y._scheme).replace("email",Y._email).getRegex(),Y._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Y.tag=ie(Y.tag).replace("comment",Z._comment).replace("attribute",Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=ie(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex(),Y.reflink=ie(Y.reflink).replace("label",Y._label).getRegex(),Y.reflinkSearch=ie(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex(),Y.normal=ge({},Y),Y.pedantic=ge({},Y.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:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()}),Y.gfm=ge({},Y.normal,{escape:ie(Y.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),Y.gfm.url=ie(Y.gfm.url,"i").replace("email",Y.gfm._extended_email).getRegex(),Y.breaks=ge({},Y.gfm,{br:ie(Y.br).replace("{2,}","*").getRegex(),text:ie(Y.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Se={block:Z,inline:Y},Pe=B.defaults,ke=Se.block,Re=Se.inline;function Me(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 Ce(ae){var ce="",ye,Q,q=ae.length;for(ye=0;ye<q;ye++)Q=ae.charCodeAt(ye),Math.random()>.5&&(Q="x"+Q.toString(16)),ce+="&#"+Q+";";return ce}var Le=function(){function ae(ye){this.tokens=[],this.tokens.links=Object.create(null),this.options=ye||Pe,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Q={block:ke.normal,inline:Re.normal};this.options.pedantic?(Q.block=ke.pedantic,Q.inline=Re.pedantic):this.options.gfm&&(Q.block=ke.gfm,this.options.breaks?Q.inline=Re.breaks:Q.inline=Re.gfm),this.tokenizer.rules=Q}ae.lex=function(Q,q){var se=new ae(q);return se.lex(Q)};var ce=ae.prototype;return ce.lex=function(Q){return Q=Q.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(Q,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(Q,q,se){q===void 0&&(q=[]),se===void 0&&(se=!0),Q=Q.replace(/^ +$/gm,"");for(var me,De,Be,Xe;Q;){if(me=this.tokenizer.space(Q)){Q=Q.substring(me.raw.length),me.type&&q.push(me);continue}if(me=this.tokenizer.code(Q,q)){Q=Q.substring(me.raw.length),me.type?q.push(me):(Xe=q[q.length-1],Xe.raw+=`
|
|
`+me.raw,Xe.text+=`
|
|
`+me.text);continue}if(me=this.tokenizer.fences(Q)){Q=Q.substring(me.raw.length),q.push(me);continue}if(me=this.tokenizer.heading(Q)){Q=Q.substring(me.raw.length),q.push(me);continue}if(me=this.tokenizer.nptable(Q)){Q=Q.substring(me.raw.length),q.push(me);continue}if(me=this.tokenizer.hr(Q)){Q=Q.substring(me.raw.length),q.push(me);continue}if(me=this.tokenizer.blockquote(Q)){Q=Q.substring(me.raw.length),me.tokens=this.blockTokens(me.text,[],se),q.push(me);continue}if(me=this.tokenizer.list(Q)){for(Q=Q.substring(me.raw.length),Be=me.items.length,De=0;De<Be;De++)me.items[De].tokens=this.blockTokens(me.items[De].text,[],!1);q.push(me);continue}if(me=this.tokenizer.html(Q)){Q=Q.substring(me.raw.length),q.push(me);continue}if(se&&(me=this.tokenizer.def(Q))){Q=Q.substring(me.raw.length),this.tokens.links[me.tag]||(this.tokens.links[me.tag]={href:me.href,title:me.title});continue}if(me=this.tokenizer.table(Q)){Q=Q.substring(me.raw.length),q.push(me);continue}if(me=this.tokenizer.lheading(Q)){Q=Q.substring(me.raw.length),q.push(me);continue}if(se&&(me=this.tokenizer.paragraph(Q))){Q=Q.substring(me.raw.length),q.push(me);continue}if(me=this.tokenizer.text(Q,q)){Q=Q.substring(me.raw.length),me.type?q.push(me):(Xe=q[q.length-1],Xe.raw+=`
|
|
`+me.raw,Xe.text+=`
|
|
`+me.text);continue}if(Q){var ut="Infinite loop on byte: "+Q.charCodeAt(0);if(this.options.silent){console.error(ut);break}else throw new Error(ut)}}return q},ce.inline=function(Q){var q,se,me,De,Be,Xe,ut=Q.length;for(q=0;q<ut;q++){Xe=Q[q];switch(Xe.type){case"paragraph":case"text":case"heading":{Xe.tokens=[],this.inlineTokens(Xe.text,Xe.tokens);break}case"table":{for(Xe.tokens={header:[],cells:[]},De=Xe.header.length,se=0;se<De;se++)Xe.tokens.header[se]=[],this.inlineTokens(Xe.header[se],Xe.tokens.header[se]);for(De=Xe.cells.length,se=0;se<De;se++)for(Be=Xe.cells[se],Xe.tokens.cells[se]=[],me=0;me<Be.length;me++)Xe.tokens.cells[se][me]=[],this.inlineTokens(Be[me],Xe.tokens.cells[se][me]);break}case"blockquote":{this.inline(Xe.tokens);break}case"list":{for(De=Xe.items.length,se=0;se<De;se++)this.inline(Xe.items[se].tokens);break}}}return Q},ce.inlineTokens=function(Q,q,se,me,De){q===void 0&&(q=[]),se===void 0&&(se=!1),me===void 0&&(me=!1),De===void 0&&(De="");var Be,Xe=Q,ut;if(this.tokens.links){var vt=Object.keys(this.tokens.links);if(vt.length>0)for(;(ut=this.tokenizer.rules.inline.reflinkSearch.exec(Xe))!=null;)vt.includes(ut[0].slice(ut[0].lastIndexOf("[")+1,-1))&&(Xe=Xe.slice(0,ut.index)+"["+"a".repeat(ut[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ut=this.tokenizer.rules.inline.blockSkip.exec(Xe))!=null;)Xe=Xe.slice(0,ut.index)+"["+"a".repeat(ut[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Q;){if(Be=this.tokenizer.escape(Q)){Q=Q.substring(Be.raw.length),q.push(Be);continue}if(Be=this.tokenizer.tag(Q,se,me)){Q=Q.substring(Be.raw.length),se=Be.inLink,me=Be.inRawBlock,q.push(Be);continue}if(Be=this.tokenizer.link(Q)){Q=Q.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,me)),q.push(Be);continue}if(Be=this.tokenizer.reflink(Q,this.tokens.links)){Q=Q.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,me)),q.push(Be);continue}if(Be=this.tokenizer.strong(Q,Xe,De)){Q=Q.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],se,me),q.push(Be);continue}if(Be=this.tokenizer.em(Q,Xe,De)){Q=Q.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],se,me),q.push(Be);continue}if(Be=this.tokenizer.codespan(Q)){Q=Q.substring(Be.raw.length),q.push(Be);continue}if(Be=this.tokenizer.br(Q)){Q=Q.substring(Be.raw.length),q.push(Be);continue}if(Be=this.tokenizer.del(Q)){Q=Q.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],se,me),q.push(Be);continue}if(Be=this.tokenizer.autolink(Q,Ce)){Q=Q.substring(Be.raw.length),q.push(Be);continue}if(!se&&(Be=this.tokenizer.url(Q,Ce))){Q=Q.substring(Be.raw.length),q.push(Be);continue}if(Be=this.tokenizer.inlineText(Q,me,Me)){Q=Q.substring(Be.raw.length),De=Be.raw.slice(-1),q.push(Be);continue}if(Q){var dt="Infinite loop on byte: "+Q.charCodeAt(0);if(this.options.silent){console.error(dt);break}else throw new Error(dt)}}return q},W(ae,null,[{key:"rules",get:function(){return{block:ke,inline:Re}}}]),ae}(),Ne=B.defaults,J=P.cleanUrl,pe=P.escape,Te=function(){function ae(ye){this.options=ye||Ne}var ce=ae.prototype;return ce.code=function(Q,q,se){var me=(q||"").match(/\S*/)[0];if(this.options.highlight){var De=this.options.highlight(Q,me);De!=null&&De!==Q&&(se=!0,Q=De)}return me?'<pre><code class="'+this.options.langPrefix+pe(me,!0)+'">'+(se?Q:pe(Q,!0))+`</code></pre>
|
|
`:"<pre><code>"+(se?Q:pe(Q,!0))+`</code></pre>
|
|
`},ce.blockquote=function(Q){return`<blockquote>
|
|
`+Q+`</blockquote>
|
|
`},ce.html=function(Q){return Q},ce.heading=function(Q,q,se,me){return this.options.headerIds?"<h"+q+' id="'+this.options.headerPrefix+me.slug(se)+'">'+Q+"</h"+q+`>
|
|
`:"<h"+q+">"+Q+"</h"+q+`>
|
|
`},ce.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ce.list=function(Q,q,se){var me=q?"ol":"ul",De=q&&se!==1?' start="'+se+'"':"";return"<"+me+De+`>
|
|
`+Q+"</"+me+`>
|
|
`},ce.listitem=function(Q){return"<li>"+Q+`</li>
|
|
`},ce.checkbox=function(Q){return"<input "+(Q?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(Q){return"<p>"+Q+`</p>
|
|
`},ce.table=function(Q,q){return q&&(q="<tbody>"+q+"</tbody>"),`<table>
|
|
<thead>
|
|
`+Q+`</thead>
|
|
`+q+`</table>
|
|
`},ce.tablerow=function(Q){return`<tr>
|
|
`+Q+`</tr>
|
|
`},ce.tablecell=function(Q,q){var se=q.header?"th":"td",me=q.align?"<"+se+' align="'+q.align+'">':"<"+se+">";return me+Q+"</"+se+`>
|
|
`},ce.strong=function(Q){return"<strong>"+Q+"</strong>"},ce.em=function(Q){return"<em>"+Q+"</em>"},ce.codespan=function(Q){return"<code>"+Q+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(Q){return"<del>"+Q+"</del>"},ce.link=function(Q,q,se){if(Q=J(this.options.sanitize,this.options.baseUrl,Q),Q===null)return se;var me='<a href="'+pe(Q)+'"';return q&&(me+=' title="'+q+'"'),me+=">"+se+"</a>",me},ce.image=function(Q,q,se){if(Q=J(this.options.sanitize,this.options.baseUrl,Q),Q===null)return se;var me='<img src="'+Q+'" alt="'+se+'"';return q&&(me+=' title="'+q+'"'),me+=this.options.xhtml?"/>":">",me},ce.text=function(Q){return Q},ae}(),xe=function(){function ae(){}var ce=ae.prototype;return ce.strong=function(Q){return Q},ce.em=function(Q){return Q},ce.codespan=function(Q){return Q},ce.del=function(Q){return Q},ce.html=function(Q){return Q},ce.text=function(Q){return Q},ce.link=function(Q,q,se){return""+se},ce.image=function(Q,q,se){return""+se},ce.br=function(){return""},ae}(),We=function(){function ae(){this.seen={}}var ce=ae.prototype;return ce.slug=function(Q){var q=Q.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(q)){var se=q;do this.seen[se]++,q=se+"-"+this.seen[se];while(this.seen.hasOwnProperty(q))}return this.seen[q]=0,q},ae}(),He=B.defaults,Oe=P.unescape,Ue=function(){function ae(ye){this.options=ye||He,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new xe,this.slugger=new We}ae.parse=function(Q,q){var se=new ae(q);return se.parse(Q)};var ce=ae.prototype;return ce.parse=function(Q,q){q===void 0&&(q=!0);var se="",me,De,Be,Xe,ut,vt,dt,_t,xt,rt,Yt,It,qt,$t,bt,en,hn,ct,_n=Q.length;for(me=0;me<_n;me++){rt=Q[me];switch(rt.type){case"space":continue;case"hr":{se+=this.renderer.hr();continue}case"heading":{se+=this.renderer.heading(this.parseInline(rt.tokens),rt.depth,Oe(this.parseInline(rt.tokens,this.textRenderer)),this.slugger);continue}case"code":{se+=this.renderer.code(rt.text,rt.lang,rt.escaped);continue}case"table":{for(_t="",dt="",Xe=rt.header.length,De=0;De<Xe;De++)dt+=this.renderer.tablecell(this.parseInline(rt.tokens.header[De]),{header:!0,align:rt.align[De]});for(_t+=this.renderer.tablerow(dt),xt="",Xe=rt.cells.length,De=0;De<Xe;De++){for(vt=rt.tokens.cells[De],dt="",ut=vt.length,Be=0;Be<ut;Be++)dt+=this.renderer.tablecell(this.parseInline(vt[Be]),{header:!1,align:rt.align[Be]});xt+=this.renderer.tablerow(dt)}se+=this.renderer.table(_t,xt);continue}case"blockquote":{xt=this.parse(rt.tokens),se+=this.renderer.blockquote(xt);continue}case"list":{for(Yt=rt.ordered,It=rt.start,qt=rt.loose,Xe=rt.items.length,xt="",De=0;De<Xe;De++)bt=rt.items[De],en=bt.checked,hn=bt.task,$t="",bt.task&&(ct=this.renderer.checkbox(en),qt?bt.tokens.length>0&&bt.tokens[0].type==="text"?(bt.tokens[0].text=ct+" "+bt.tokens[0].text,bt.tokens[0].tokens&&bt.tokens[0].tokens.length>0&&bt.tokens[0].tokens[0].type==="text"&&(bt.tokens[0].tokens[0].text=ct+" "+bt.tokens[0].tokens[0].text)):bt.tokens.unshift({type:"text",text:ct}):$t+=ct),$t+=this.parse(bt.tokens,qt),xt+=this.renderer.listitem($t,hn,en);se+=this.renderer.list(xt,Yt,It);continue}case"html":{se+=this.renderer.html(rt.text);continue}case"paragraph":{se+=this.renderer.paragraph(this.parseInline(rt.tokens));continue}case"text":{for(xt=rt.tokens?this.parseInline(rt.tokens):rt.text;me+1<_n&&Q[me+1].type==="text";)rt=Q[++me],xt+=`
|
|
`+(rt.tokens?this.parseInline(rt.tokens):rt.text);se+=q?this.renderer.paragraph(xt):xt;continue}default:{var at='Token with "'+rt.type+'" type was not found.';if(this.options.silent){console.error(at);return}else throw new Error(at)}}}return se},ce.parseInline=function(Q,q){q=q||this.renderer;var se="",me,De,Be=Q.length;for(me=0;me<Be;me++){De=Q[me];switch(De.type){case"escape":{se+=q.text(De.text);break}case"html":{se+=q.html(De.text);break}case"link":{se+=q.link(De.href,De.title,this.parseInline(De.tokens,q));break}case"image":{se+=q.image(De.href,De.title,De.text);break}case"strong":{se+=q.strong(this.parseInline(De.tokens,q));break}case"em":{se+=q.em(this.parseInline(De.tokens,q));break}case"codespan":{se+=q.codespan(De.text);break}case"br":{se+=q.br();break}case"del":{se+=q.del(this.parseInline(De.tokens,q));break}case"text":{se+=q.text(De.text);break}default:{var Xe='Token with "'+De.type+'" type was not found.';if(this.options.silent){console.error(Xe);return}else throw new Error(Xe)}}}return se},ae}(),Qe=P.merge,Ze=P.checkSanitizeDeprecation,Je=P.escape,ze=B.getDefaults,nt=B.changeDefaults,it=B.defaults;function je(ae,ce,ye){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 ce=="function"&&(ye=ce,ce=null),ce=Qe({},je.defaults,ce||{}),Ze(ce),ye){var Q=ce.highlight,q;try{q=Le.lex(ae,ce)}catch(Be){return ye(Be)}var se=function(Xe){var ut;if(!Xe)try{ut=Ue.parse(q,ce)}catch(vt){Xe=vt}return ce.highlight=Q,Xe?ye(Xe):ye(null,ut)};if(!Q||Q.length<3)return se();if(delete ce.highlight,!q.length)return se();var me=0;je.walkTokens(q,function(Be){Be.type==="code"&&(me++,setTimeout(function(){Q(Be.text,Be.lang,function(Xe,ut){if(Xe)return se(Xe);ut!=null&&ut!==Be.text&&(Be.text=ut,Be.escaped=!0),me--,me===0&&se()})},0))}),me===0&&se();return}try{var De=Le.lex(ae,ce);return ce.walkTokens&&je.walkTokens(De,ce.walkTokens),Ue.parse(De,ce)}catch(Be){if(Be.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+Je(Be.message+"",!0)+"</pre>";throw Be}}je.options=je.setOptions=function(ae){return Qe(je.defaults,ae),nt(je.defaults),je},je.getDefaults=ze,je.defaults=it,je.use=function(ae){var ce=Qe({},ae);if(ae.renderer&&function(){var Q=je.defaults.renderer||new Te,q=function(De){var Be=Q[De];Q[De]=function(){for(var Xe=arguments.length,ut=new Array(Xe),vt=0;vt<Xe;vt++)ut[vt]=arguments[vt];var dt=ae.renderer[De].apply(Q,ut);return dt===!1&&(dt=Be.apply(Q,ut)),dt}};for(var se in ae.renderer)q(se);ce.renderer=Q}(),ae.tokenizer&&function(){var Q=je.defaults.tokenizer||new de,q=function(De){var Be=Q[De];Q[De]=function(){for(var Xe=arguments.length,ut=new Array(Xe),vt=0;vt<Xe;vt++)ut[vt]=arguments[vt];var dt=ae.tokenizer[De].apply(Q,ut);return dt===!1&&(dt=Be.apply(Q,ut)),dt}};for(var se in ae.tokenizer)q(se);ce.tokenizer=Q}(),ae.walkTokens){var ye=je.defaults.walkTokens;ce.walkTokens=function(Q){ae.walkTokens(Q),ye&&ye(Q)}}je.setOptions(ce)},je.walkTokens=function(ae,ce){for(var ye=w(ae),Q;!(Q=ye()).done;){var q=Q.value;ce(q);switch(q.type){case"table":{for(var se=w(q.tokens.header),me;!(me=se()).done;){var De=me.value;je.walkTokens(De,ce)}for(var Be=w(q.tokens.cells),Xe;!(Xe=Be()).done;)for(var ut=Xe.value,vt=w(ut),dt;!(dt=vt()).done;){var _t=dt.value;je.walkTokens(_t,ce)}break}case"list":{je.walkTokens(q.items,ce);break}default:q.tokens&&je.walkTokens(q.tokens,ce)}}},je.Parser=Ue,je.parser=Ue.parse,je.Renderer=Te,je.TextRenderer=xe,je.Lexer=Le,je.lexer=Le.lex,je.Tokenizer=de,je.Slugger=We,je.parse=je;var Ke=je;return Ke})},EJTS:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return p});var ne=U("qVdP"),W=U("jsC+"),O=U("lUTK"),k=U("BvKs"),w=U("sRBo"),D=U("kaz8"),B=U("oBTY"),M=U("7Kak"),e=U("9yH6"),C=U("tJVT"),y=U("q1tI"),c=U.n(y),d=U("9Bee"),a=U("+vTd"),i=U.n(a),o=U("xKgJ"),s=U("Is5a"),r=U.n(s),n=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],g=function(b){var _,l=b.data,f=b.selectIds,u=b.onSelectCheckBox,h=u===void 0?function(){}:u,E=b.showCheckbox,v=E===void 0?!0:E,S=Object(y.useState)(!1),L=Object(C.a)(S,2),I=L[0],A=L[1],P=function(){if(l.item_type==="JUDGMENT")return c.a.createElement("div",{className:i.a.judgmentContent},l.choices.map(function(fe,de){return c.a.createElement(e.a,{key:de,disabled:!0},fe.choice_text)}));if(l.item_type==="PROGRAM"){var oe;return c.a.createElement("div",{className:i.a.programContent},c.a.createElement(d.a,{value:(oe=l.program_attr)===null||oe===void 0?void 0:oe.description}))}if(l.item_type==="COMBINATION"){var $;return c.a.createElement("div",{className:i.a.combinationContent},l==null||(($=l.sub_item_banks)===null||$===void 0)?void 0:$.map(function(fe,de){var ee,ie="(\u9898\u76EE".concat(de+1,"-\u5355\u9009\u9898) ");return c.a.createElement(y.Fragment,null,c.a.createElement("div",{style:{marginTop:10,marginBottom:10}},c.a.createElement(d.a,{value:ie+fe.name})),fe.choices.map(function(ge,Z){return c.a.createElement("div",{key:Z,className:i.a.otherContentItem},c.a.createElement("p",null,n[Z]),c.a.createElement(d.a,{className:i.a.otehrContentHtml,value:ge.choice_text}))}),c.a.createElement("div",{className:i.a.con},c.a.createElement("b",{className:"c-grey-333 font14"}," ","\u7B54\u6848\uFF1A",t==null?void 0:t[fe==null||((ee=fe.choices)===null||ee===void 0)?void 0:ee.findIndex(function(ge){return ge==null?void 0:ge.is_answer})]," "),c.a.createElement("div",null,c.a.createElement("span",null,"\u89E3\u6790\uFF1A"),c.a.createElement(d.a,{className:i.a.parseAnswerHtml,value:fe.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return c.a.createElement("div",{className:i.a.otherContent},l.choices.map(function(fe,de){return c.a.createElement("div",{key:de,className:i.a.otherContentItem},c.a.createElement("p",null,n[de]),c.a.createElement(d.a,{className:i.a.otehrContentHtml,value:fe.choice_text}))}))},H=function(){var oe;return c.a.createElement("div",null,(oe=l.standard_answer)===null||oe===void 0?void 0:oe.map(function($,fe){return c.a.createElement(d.a,{key:fe,className:i.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat($.position,"\uFF09\uFF1A").concat($.answer_text.join("\u3001"))})}))},R=function(){var oe,$,fe,de={SUBJECTIVE:(oe=l.answer_texts)===null||oe===void 0?void 0:oe[0],JUDGMENT:($=l.choices)===null||$===void 0||((fe=$.find(function(Pe){return Pe.is_answer}))===null||fe===void 0)?void 0:fe.choice_text},ee=l.choices.map(function(Pe){return Pe.is_answer}).findIndex(function(Pe){return Pe}),ie=ee>-1?t[ee]:"",ge="";l.choices.map(function(Pe,ke){Pe.is_answer&&(ge+=t[ke])});var Z=de[l.item_type],Y={SINGLE:c.a.createElement(d.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ie||"\u65E0")}),MULTIPLE:c.a.createElement(d.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ge||"\u65E0")}),COMPLETION:H()},Se=c.a.createElement(d.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Z||"\u65E0")});return Y[l.item_type]||Se},K=function(oe){var $=Object(B.a)(f);oe.target.checked?$.push(l.id):$=$.filter(function(fe){return fe!==l.id}),h($)};return c.a.createElement("div",{className:i.a.itemWrap},c.a.createElement("div",{className:i.a.list},v&&c.a.createElement(D.a,{className:"mr10",onChange:K,checked:f.includes(l.id)}),c.a.createElement("div",{className:i.a.title},c.a.createElement(d.a,{key:1,showLines:1,showTextOnly:!0,className:i.a.topicTitleContent,value:l.name})),c.a.createElement("div",{className:i.a.line},c.a.createElement("b",{className:i.a.b1}),c.a.createElement("b",{className:i.a.b2})),c.a.createElement("div",{onClick:function(){return A(!I)},className:i.a.tr},I?"\u6536\u8D77":"\u5C55\u5F00",c.a.createElement("i",{style:{transform:I?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),c.a.createElement("aside",{style:I?{display:"block"}:{display:"none"},className:i.a.itemDetail},c.a.createElement("div",{style:{marginBottom:44}},c.a.createElement(d.a,{key:2,className:i.a.topicTitleContent,value:l.name}),c.a.createElement("div",{className:"".concat(i.a.row," mt15")},P()),c.a.createElement("div",{className:i.a.row},c.a.createElement("div",{className:i.a.updateTimeRow},c.a.createElement("div",{className:i.a.updateTimeWrap},l.item_type==="PROGRAM"&&c.a.createElement("p",{className:i.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(_=l.program_attr)===null||_===void 0?void 0:_.language))))),l.item_type!=="PROGRAM"&&l.item_type!=="COMBINATION"&&c.a.createElement("div",{className:i.a.answerWrapper},c.a.createElement("img",{src:r.a,alt:"",className:i.a.decoration}),c.a.createElement("div",{className:i.a.answer},R()),c.a.createElement("div",{className:i.a.parse},c.a.createElement("div",{className:i.a.parseText},"\u89E3\u6790\uFF1A"),c.a.createElement("div",{className:i.a.parseAnswer},l.analysis?c.a.createElement(d.a,{className:i.a.parseAnswerHtml,value:l.analysis}):"\u6682\u65E0\u89E3\u6790")))))},p=function(b){var _,l,f,u,h,E,v,S,L,I,A,P,H,R,K,z,oe=b.isProblemset,$=b.data,fe=b.user,de=b.activeTabsKey,ee=b.onPublicReview,ie=ee===void 0?function(){}:ee,ge=b.onStartExperience,Z=ge===void 0?function(){}:ge,Y=b.onSetPrivate,Se=Y===void 0?function(){}:Y,Pe=b.onCorrection,ke=Pe===void 0?function(){}:Pe,Re=b.onCollect,Me=Re===void 0?function(){}:Re,Ce=b.onSetPublic,Le=Ce===void 0?function(){}:Ce,Ne=b.onDelete,J=Ne===void 0?function(){}:Ne,pe=b.onCancel,Te=pe===void 0?function(){}:pe,xe=b.onSelect,We=xe===void 0?function(){}:xe,He=b.onMoveTo,Oe=He===void 0?function(){}:He,Ue=b.onSetShare,Qe=Ue===void 0?function(){}:Ue,Ze=b.onCancelShare,Je=Ze===void 0?function(){}:Ze,ze=b.onPublish,nt=ze===void 0?function(){}:ze,it=b.onCancelPublish,je=it===void 0?function(){}:it,Ke=$.item_type==="PROGRAM"?"/problems/".concat((_=$.program_attr)===null||_===void 0?void 0:_.identifier,"/edit"):"/problemset/edit/".concat($.id),ae=de==="0"&&!$.public&&!$.apply&&($.item_type==="PROGRAM"&&((l=$.program_attr)===null||l===void 0?void 0:l.status)!==0||$.item_type!=="PROGRAM"),ce=c.a.createElement(k.a,{forceSubMenuRender:!0,className:i.a.menu},de==="0"&&!$.public&&c.a.createElement(k.a.Item,{key:"-1"},c.a.createElement("a",{className:i.a.actionLink,target:"_blank",href:Ke},"\u7F16\u8F91")),(de==="0"||de==="3")&&$.item_type==="PROGRAM"&&((f=$.program_attr)===null||f===void 0?void 0:f.status)!==0&&!$.public&&((u=$.author)===null||u===void 0?void 0:u.login)===((h=fe.userInfo)===null||h===void 0?void 0:h.login)&&c.a.createElement(k.a.Item,{key:"0"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){var se;return je($==null||((se=$.program_attr)===null||se===void 0)?void 0:se.identifier)}},"\u64A4\u9500\u53D1\u5E03")),de==="0"&&c.a.createElement(k.a.Item,{key:"1"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Oe($.id)}},"\u79FB\u52A8\u5230")),de==="0"&&!($!=null&&$.is_share)&&c.a.createElement(k.a.Item,{key:"3"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Qe($.id)}},"\u5171\u4EAB")),(de==="0"&&($==null?void 0:$.is_share)||de==="3"&&((E=$.author)===null||E===void 0?void 0:E.login)===((v=fe.userInfo)===null||v===void 0?void 0:v.login))&&c.a.createElement(k.a.Item,{key:"3"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Je($.id)}},"\u64A4\u9500\u5171\u4EAB")),ae&&c.a.createElement(k.a.Item,{key:"4"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Le($.id)}},"\u516C\u5F00")),de==="0"&&!$.public&&$.apply&&($.item_type==="PROGRAM"&&$.program_attr.status!==0||$.item_type!=="PROGRAM")&&c.a.createElement(k.a.Item,{key:"5"},c.a.createElement("a",{className:i.a.reviewFlag,onClick:ie},"\u5BA1\u6838\u4E2D")),(de==="0"||de==="1")&&$.public&&((S=$.author)===null||S===void 0?void 0:S.login)===((L=fe.userInfo)===null||L===void 0?void 0:L.login)&&c.a.createElement(k.a.Item,{key:"6"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Se($.id)}},"\u64A4\u9500\u516C\u5F00")),de==="2"&&c.a.createElement(k.a.Item,{key:"7"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Me($.id,$.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(de==="0"||de==="3")&&$.item_type==="PROGRAM"&&((I=$.program_attr)===null||I===void 0?void 0:I.status)===0&&!$.public&&((A=$.author)===null||A===void 0?void 0:A.login)===((P=fe.userInfo)===null||P===void 0?void 0:P.login)&&c.a.createElement(k.a.Item,{key:"8"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){var se;return nt($==null||((se=$.program_attr)===null||se===void 0)?void 0:se.identifier)}},"\u53D1\u5E03")),(de==="1"||de==="3")&&!Object(o.o)()&&!Object(o.m)()&&((H=$.author)===null||H===void 0?void 0:H.login)!==((R=fe.userInfo)===null||R===void 0?void 0:R.login)&&c.a.createElement(k.a.Item,{key:"9"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Me($.id,$.is_collected)}},$.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),de!=="0"&&!Object(o.o)()&&!Object(o.m)()&&c.a.createElement(k.a.Item,{key:"10"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return ke($.id)}},"\u7EA0\u9519")),(de==="0"&&!$.public||de==="1"&&Object(o.o)()&&((K=$.author)===null||K===void 0?void 0:K.login)!==((z=fe.userInfo)===null||z===void 0?void 0:z.login))&&c.a.createElement(k.a.Item,{key:"11"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return J($.id)}},"\u5220\u9664"))),ye=c.a.createElement(k.a,{forceSubMenuRender:!0,className:i.a.menu},c.a.createElement(k.a.Item,{key:"10"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return ke($.id)}},"\u7EA0\u9519"))),Q=de!=="0"&&!Object(o.o)()&&!Object(o.m)();return c.a.createElement(c.a.Fragment,null,oe?c.a.createElement(c.a.Fragment,null,$.item_type!=="SUBJECTIVE"&&$.item_type!=="COMBINATION"&&c.a.createElement("span",{className:i.a.textBtn,style:{cursor:"pointer"},onClick:function(){return Z($)}},"\u4F53\u9A8C"),c.a.createElement(W.a,{overlay:ce},c.a.createElement("span",{style:{cursor:"default"},onClick:function(se){return se.preventDefault()}},c.a.createElement("span",{className:i.a.textBtn},"\u66F4\u591A")))):Q?c.a.createElement(W.a,{className:"ml40",overlay:ye},c.a.createElement("span",{style:{cursor:"default"},onClick:function(se){return se.preventDefault()}},c.a.createElement("span",null,"\u66F4\u591A"))):c.a.createElement("span",null))};ve.b=g},FKdj:function(qe,ve,U){qe.exports={flex_box_center:"flex_box_center___3uXpC",flex_space_between:"flex_space_between___1R5l3",flex_box_vertical_center:"flex_box_vertical_center___2whw-",flex_box_center_end:"flex_box_center_end___Jni7d",flex_box_column:"flex_box_column___bQWh0",page:"page___2wqIC",wrap:"wrap___3ThhU",title:"title___3BwkD",select:"select___2Ozsr",contentWrap:"contentWrap___3srp0",pngIcon:"pngIcon___2ckkq",tabsWrap:"tabsWrap___2Y959",searchWrap:"searchWrap___H9GsL",addQuestionBtn:"addQuestionBtn___1b8s_",search:"search___3d1EJ",searchIcon:"searchIcon___1mrzV",batchWrap:"batchWrap___j1Er3",contentListWrap:"contentListWrap___3pty2",li:"li___2UOPB",bottom:"bottom___I7MVG",actionLeftItem:"actionLeftItem___3bGeH",questionTypeName:"questionTypeName___Aiyux",more:"more___YExtS",btnAdd:"btnAdd___2RrWf",treeWrapper:"treeWrapper___U0OPC",treeHeader:"treeHeader___1LB2p",treeContent:"treeContent___Ckfqx",action:"action___Xn5RP",headerWrapper:"headerWrapper___3ECJD",exportBtn:"exportBtn___35cZE"}},FOrL:function(qe,ve,U){qe.exports=U.p+"static/nodata.a6b3f948.png"},FWmy:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return ne});function ne(W,O){if(!W)throw new Error(O?`Assertion failed (${O})`:"Assertion Failed")}},Is5a:function(qe,ve){qe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACMgAAAA6CAYAAABPwffJAAAAAXNSR0IArs4c6QAAH35JREFUeF7t3Q2MZWV9x/H/c849d17uzL6y7K4M76xLNIAKoiBQak0oRgsiYKyxUEq0LwZLYmqa0hqtpi8xodam1daKRFtbRITYBmlspRBBAXmRaHddsCyO7Bsssztzd2buveec5jl37jC7bN155l7OL7P3ewmZfTnn+Z37+f9nsjn3n+c4W8JrfHx8bGam9ZfNZutif3q1Wrl3YKDyB2NjY+NLWC74FHV+8AVzQlcC6nqr87vC4+RgAXW91fnBYJyAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACpr6/r86nBcoVUNdbnV+uNmnqevcy34WW84knto0513giz22NWef03P9qb27Vs846a9MrOiSjzg/14vjuBNT1Vud3p8fZoQLqeqvzQ704HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBMzU9/fV+fRAuQLqeqvzy9UmTV3vXucHD8g88shj/2zm3ttoNOa7wZmzJEnMnPvqOeec9euvZJuo81/J98baLxdQ11udT0+UK6Cutzq/XG3SEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBA4OgTU9/fV+UdHFZfPu1DXW52/fCp1dFyput69zg8ekLnvvu8+l+e28XDldM52XHTRW171SpZanf9KvjfWfrmAut7qfHqiXAF1vdX55WqThgACCCCAAAIIIIAAAggggAACCCCAAAIIIIDA0SGgvr+vzj86qrh83oW63ur85VOpo+NK1fXudX7wgMy3v31vnue5NZtNc84sz9sPWkqq1aLCb3vbxcFrhrSGOj/kWjm2ewF1vdX53QuyQoiAut7q/BArjkUAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIG2gPr+vjqfPihXQF1vdX652qSp693r/OBhlrvu+ve8PRiTmx+N6QzJtFsjt8sue0fwmiFtpc4PuVaO7V5AXW91fveCrBAioK63Oj/EimMRQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgLaC+v6/Opw/KFVDXW51frjZp6nr3Oj94mOX22+/0kzHWbDaK3WP8yw/JJElSDMxceeXlwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWW2/9Smcsptgx5qVdZNq/vuaa9wWvGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWb7whVvyZrN5UCf4xy055yxJqnb99dcGrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1k+85m/yZ05y4vdY/zjldpLFEMy5uyGD/9e8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjl05+++ZAdZNqPVvKvJEnsIx+5MXjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8olPfCrvPFKp/dXvHtNuDL/Yn3zspuA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy003fSxvNhsLOuGlJfwOMp/85MeD1wxpK3V+yLVybPcC6nqr87sXZIUQAXW91fkhVhyLAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACbQH1/X11Pn1QroC63ur8crVJU9e71/nBwyw33viR3O8a03nN7x4zt5PMzTd/OnjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8qEP3ZC3mi3Lbe65SvM94axaTeyzn/1M8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjluuuuf2kyxv/KrzD3Nc9zu+WWfwxeM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7z//dfkzUbjoP1j/COX/KOWqtWqffnLtwavGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWa644sp8fsuY+X7obCrj7I47bg9eM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7zjHb+Wt1rNYseY9is359z8DjLf/OZdwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWSy65NG82m0UnNJuN4muSJMVX/4ilb33r7uA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy4UXXpT73WP8kIxzZv43fgeZJKkWu8ncf/99wWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWN73pzXmr1SoGYzo7yfgdZPyQTKVSse9//3vBa4a0lTo/5Fo5tnsBdb3V+d0LskKIgLre6vwQK45FAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBtoD6/r46nz4oV0Bdb3V+udqkqevd6/zgYZazzz4nbzQaxXBMsXuM74liB5mk2EXm0UcfCV4zpK3U+SHXyrHdC6jrrc7vXpAVQgTU9Vbnh1hxLAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCLQF1Pf31fn0QbkC6nqr88vVJk1d717nBw+zbN58et7ZOabZbPjpGKtWE/OPXapWq7Zly/8ErxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1lOOeXUYkCmMyRjls8Px/gBmaeffip4zZC2UueHXCvHdi+grrc6v3tBVggRUNdbnR9ixbEIIIAAAggggAACCCCAAAIIIIAAAggggAACCCDQFlDf31fn0wflCqjrrc4vV5s0db17nR88zOIv4MCBujUafkimYa7zeKVKYsO1mv30p08HrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/MXNcyS57m75557Vq9atfbCq656951+95h6fWp+F5kkqVqtVrMkSexrX/v65RMTL9x/ySWXvOicy3vRMur8XrwH1li8gLre6vzFS3FkLwTU9Vbn98KQNRBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6DcB9f19dX6/1Vv9ftX1Vuer/fstX13vVzL//x2Q8aG+0HfffXd1zbp1v3rssSe8rzay4opzXrc5rtfr1mo1bWpqqthBZnh42DpDMo88vjWtT+2/Y/fuZ/9p754937r00ksbfp3QYRl1fr81ufr9quutzlf791u+ut7q/H6rN+8XAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIFeCKjv76vze2HIGosXUNdbnb94KY7shYC63mXlH3ZAphN+7733Dqw5ZsONGzae9Ie55aMe9o2vP714tJIfkvE7yZi5YueYzg4yDz+2pfB35iZ37njmz/ZPPP+5Cy64YKL4s0XuKKPO70UDscbiBdT1VucvXoojeyGgrrc6vxeGrIEAAggggAACCCCAAAIIIIAAAggggAACCCCAQL8JqO/vq/P7rd7q96uutzpf7d9v+ep6l5n/sgGZuXD34IMPrhpZsfrP12886beyLI98Ezhndv65ZxSDMX5Ixn/NcysGZKrVavH1gYeeLP7Mv6LIZbuf2/7Fycm9N5x33nmzZpYfaUhGnd9vza5+v+p6q/PV/v2Wr663Or/f6s37RQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgFwLq+/vq/F4YssbiBdT1VucvXoojeyGgrnfZ+QcNyCwIHxhdufbGdRtO+NPcD8f4o+amXi6+4Ozi8UqNRntAxr/845Wq1aT4+p37H2nXwU/T5GYuctmenc/+8eS+F24+0pCMOr8XDcQaixdQ11udv3gpjuyFgLre6vxeGLIGAggggAACCCCAAAIIIIAAAggggAACCCCAAAL9JqC+v6/O77d6q9+vut7qfLV/v+Wr663Inx+Q6YT70ZaHH330shNPfM2X8jwfzf2Ui5k1m6nd9i+32q23/MNBu8c45yzP8/kBmWuv+4Bd9Z7fsCSJi/Oc/8+5ye3bf3ztG9/whrv8qM3hdpJR5/dbs6vfr7re6ny1f7/lq+utzu+3evN+EUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBDohYD6/r46vxeGrLF4AXW91fmLl+LIXgio663KP3RAJnrggQfWbjjutL+t1Ubf7Ydj/MYxrVbLPv93N9vT27batm3bit1j/JxLs9kqvvqdY/zLP2Zp06ZNduqmzfbB37nRKpVKsZGMH5Kp1ye/vvPnT/3u+eef/4KZZYc+amkOQJbfiyZijcULqOutzl+8FEf2QkBdb3V+LwxZAwEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBfhNQ399X5/dbvdXvV11vdb7av9/y1fVW5RcDMgumc6IfPP7ku44/YdNXsyyL/XCMP+CuO2+zhx96wOIoth/+8Ilixxj/eCW/e8zc+ZYkSfH7M888y9IstTeee75ddvnVxXYx/rAoitKfPbvtvWe/7oxv+AGZhbvIqPP7rdnV71ddb3W+2r/f8tX1Vuf3W715vwgggAACCCCAAAIIIIAAAggggAACCCCAAAII9EJAfX9fnd8LQ9ZYvIC63ur8xUtxZC8E1PVW5i8ckInMLN761M/+YuWqtb/fGY7ZvXunfeHzf21xHFujMWNbtmwthmOKV95+XtLcnIxVk6q9evMmGxgYsjRN7foP3mDHHrth/ph9Ey/81ebTjv+omaULd5HpTAep8nvRRKyxeAF1vdX5i5fiyF4IqOutzu+FIWsggAACCCCAAAIIIIAAAggggAACCCCAAAIIINBvAur7++r8fqu3+v2q663OV/v3W7663sp8t2A6J37ooR+OverEE2+pxMkv5Zkffsnt3v+6x3705GOWZZkdODBlW7duKwZiGg0/JFOMx8w/Zsn/+aZNp1mtNup3jLHXnvF6u/itlxSPWHKRWStt/vdz27f/5rnnnjk+NyTjF/Avv4gk/9BHPfVb85f9fuk31+n5sun7Mo9+o9/6svF50wgggAACCCCAAAIIIIAAAggggAACCCCAAAJdCfD5Ap8vdNVAgSfTb/RbYMt0dXjf99vC6Zz77ntw8+mvOesbae5OzX0fZpnd/q9ftqmpSZua2metZtOeeeZZm56ents1xhWPW2rvIONscHDQTjrpBKskiY2MrLSRkVG78j3v989XMpc7i13+9JYfP/Guiy46b2tnF5m56hW71yjyGZDp6vsn+GT6jR/wwU3TxQn0G/3WRftwKgIIIIAAAggggAACCCCAAAIIIIAAAggggECfCvD5Ap8vlNn69Bv9Rr+VN5/S2UEmesYs2fPw4284/uTN/2FZXsssszxzdvttXzLnnL3w/K5iGGbHjp02NVW3RmN2buMXX67cqtWqjYyM2MaNG4rdY9asPbb483dfda25KLfIIrPI1Z956keXbHjzOT84ycxvQZN1BmRU+QzIlPntZr6H/DgV/VYue9+m0W/8g6Jvm583jgACCCCAAAIIIIAAAggggAACCCCAAAIIILBkAT5f4POFJTfPEk6k3+i3JbTNkk/p+36bA4jHxy3Z/txD55x2ypl3Z3lWy/PMbyBjd//bbRZFse3e9VzxmKVWq1XsIpOmaTEw419+gMYPxZx88olWqVSK36/fcFxxzNvfebXfQMaciyxyUX3rTx59+yknnP/w2FgxIJPOVU6Wz4DMkr93lnQi/cYP+CU1zhJPot/otyW2DqchgAACCCCAAAIIIIAAAggggAACCCCAAAII9LEAny/w+UKZ7U+/0W/0W3nzKZ0dZCo7dlgyPv74a4874dW35VF+kmX+8Umpfe+737FGs1HsINOYnSlq44dkdu7cbfV6vRiGGR4etg0bjrU4jou/HxgcsrXHrLdqUrU3v+WXzbnYLMrNZe6Znz/7k6vHxl73o40biwGZ1lyxZfkMyJT57Ta/g4ys3vRbufVWp839g4J+UxeCfAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEElpEAny8wsFBmu9Jv9Bv9Vt58ih+Qicws3rXLqnv2bD111THHfi6Kquf53WP8DjH/+/SWYjhmdna6+LqY19q16606MGjHrNtgJ596+twOM2ZZ1nhw4vndv71u3ean16+3xsIdZFT5zrnOY54W89Y4pksB+o1+67KFgk6n3+i3oIbhYAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEErPiMlM9P6YTSBOg3Ps8qrdn4+ZYeNCATxwdW7Hlx7ydXrlx1XZ47y7LcpqcP2LatT1ilUrXndz9n09P1X1ifoaGarVt/nDWbs7Zp81k2NDRsUeTMudz27Zv44rrVa25K0+H9hxuQUeQzIFPmt9vB/6BQ1Hvu3RYDYYp8+o1+K/PnK/1Wbr+RhgACCCCAAAIIIIAAAggggAACCCCAAAIIIHB0CCwcWFB8nsTnWUdHHy32XdBvDMgstld6cVzf99uhAOPj41esHxv7TJbmsR+Q8bvI7Nr5M5ua3GfORfbC8zts+sDUYe2Hhkds7TEb/dyR1UZW2PoNx8/tHuMsil26a3z8w2NjY3f8ogGZsvP5ALkX30aLX4N+4wf84rul+yPpN/qt+y5iBQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIF+E+DzBT5fKLPn6Tf6jX4rbz7loB1koqg+umfixROHhoY+lVQGf8UPx3T+f37XuDVbTYvjxOr1/Ta5f681ZmeKWvnHKY2uWGO12grLspbFccXWrR8rhmM6/zdbM/85PT39R+tWrd6eZbXJw+0go8hnQKbMb7eDd5BR1Hvu3RY7yCjy6Tf6rcyfr/Rbuf1GGgIIIIAAAggggAACCCCAAAIIIIAAAggggMDRIbBwYEHxeRKfZx0dfbTYd0G/MSCz2F7pxXF932+5f5aSWWXHDkucm6q14mTV3r3PXX7MqvUfz/J0KM/NMj8ok5pNTu61VnPGXBSbs8hc5E8tNoyxLE8tz1JLqoM2MrLGXGwWFQMy/ms8/fzEro+tWfOqOytpcyLPR+obN1rTzFpzRZTlO//sJ16lCdBv9FtpzdZ+hh4/38oEJwsBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgaNAgM8X+DyrzDam3+g3+q28+RS/g4z/ADkeH7fErZwcbh1IVuStxvqZ6ckPrBhddU2aZ1GemWV+CiY1a6Uta7WmLW2llvupGTNzLra4ElulMmSVuGLmh2PMmYvMYhdl+ycnbh0cGv17V6nuqgw39+f7Rg+MjRUDMu0FhPkMyJT57TY/sEC/lcvet2n8fOMfFH3b/LxxBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgSUL8PkCny8suXmWcCL9Rr8toW2WfErf99scQPSMWbJqwgbr2fRIVk9X5XG64cDU1EdXrFz11jTLoixr7xRTPHLJ/6LYnaHt7neJKb76//xv/K4xfjgmirJ9ExPfGRiMb06ike1RLZ6oRUNTE6ts5iQrBmT8qv4ly2dAZsnfO0s6kX7jB/ySGmeJJ9Fv9NsSW4fTEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBPpYgM8X+HyhzPan3+g3+q28+ZTODjKR38Vlzx6r5nm95lxtdDI9sDprzJyYNqavHhlZ/c4sSwczPyDj+7MzLDPXq85vQuOHZCIz/2v/5KUoimempl78Zjww8JUoGd4xGg+/mOf1Sedq9XXrrDG3e8z8gIwqnwGZMr/d5neQod/KZe/btM4/KFQ/X+bgZf3Oz7e+bX3eOAIIIIAAAggggAACCCCAAAIIIIAAAggggEAXAny+wMBCF+0TfCr9Rr8FN00XJ/R9v80BFI9Z2rHDkrRmg1FrutaaSkctydfMTmfr09bkxQNDtQuTJDkjy/Ko2EEmd/M7yfidY8zlxQ4yUeSyZrP55Ox0/f64MnrvwFC0y5pub2UknswqQ/W4bjMbN84/XmluD5pivEaSzwfIXXz3LOFU+o0f8EtomyWfQr/Rb0tuHk5EAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6FsBPl/g84Uym59+o9/ot/LmU4qHIx06JZSmU0OzrjJSaaUrGlm+Mk3z1ZY1jsvy1utdxZ1eTQbGnEUrnYtq7fOzem7ZvkZzdjxv5VsiV3nMourP49i9WI3cvlYl3j+Qt6bieGR64e4xneEUdX6ZDUcW/UYPlCug/vmizi9XmzQEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBI4OAfX9fXX+0VHF5fMu1PVW5y+fSh0dV6qutzJ/4YBM8ZCkcbOk9qJVm8364OxsZSSKWiNplI3mLh7Nm80VeWYjqbXWZ62sluX5kG+ByLnpqBLVY6vscpFNuSTZ7/J0Ms6iySyrTA0MtKaSpDZTX22NMSt2jyke0nTIgIws/+ho4+XzLhZMQdJvy6dsy/ZK6bdlWzouHAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABmQCfL8jo+zKYfuvLssvedD/3WzEg418LpnQi/6ilwUFL/JDMdB4Pu9nWUKsa1aJWo+Yq1SFrpYNZ5hLnsrh9bpRGUd60SjyTtxrTWaVarzSyej5QmR5y6QE/HDMzY825Ryv54Zjs0EcbqfNl3denwep6q/P7tOyyt62utzpfBk8wAggggAACCCCAAAIIIIAAAggggAACCCCAAALLWEB9f1+dv4xLtywvXV1vdf6yLNoyvmh1vVX5hw7I+N/7/+MdO6zih2RmZ6eqWTUeTNKhgZmZqcHKUDRQn02r1SiJs3SmGJCJ4sG0kTXT2kDcaE1ns4ODIzPNeHo2aqQzAwMjjbnhmJaZpX6eZuHuMZ2eWTClJMlfxr27LC9dXW91/rIs2jK+aHW91fnLuHRcOgIIIIAAAggggAACCCCAAAIIIIAAAggggAACMgH1/X11vgy+T4PV9Vbn92nZZW9bXW9V/vyAjJc/5CL8428qA3ssnh2wanWmnjQrUdJqumQ4GozrrcmKa7j2I5qqeV6rjLYOZDNpJcmbSStrNgZrzYFZa8yus3TMzA/HFI9VOtxwTKfq6nxZ9/VpsLre6vw+Lbvsbavrrc6XwROMAAIIIIAAAggggAACCCCAAAIIIIAAAggggMAyFlDf31fnL+PSLctLV9dbnb8si7aML1pdb0X+QQMyvnaHXIT/e//IpUqlYlGSWKUeT8Zx3UVx7IrdYzqvNM3TtJZntXQ0bTat1WpZtnHjwYMxv2g4prOOOn8Z9++yvHR1vdX5y7Joy/ii1fVW5y/j0nHpCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgjIBNT399X5Mvg+DVbXW53fp2WXvW11vcvOf9mAjJefuwj/y84jl6LOr8fHLYpjc1FU/N38K8ssT1PLx8Ze2ilm4a4xxWLO+R1kjvhS5x/xAjmgpwLqeqvze4rJYkcUUNdbnX9EIA5AAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBlwmo7++r82mJcgXU9Vbnl6tNmrreZeYfdkDGt8CCi/C/7QzKHPrrQ7uleITS3B8u/PWih2M6C6rz+TYoV0Bdb3V+udqkqeutzqcDEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAIFxAfX9fnR8uxhndCKjrrc7vxo5zwwXU9S4r//8dkFlIdsjFdP7q0HNftjvMYneMOVJ51PlHuj7+vrcC6nqr83uryWpHElDXW51/JB/+HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBF4uoL6/r86nJ8oVUNdbnV+uNmnqer+S+f8HabRiLm3R4IUAAAAASUVORK5CYII="},"Ix/O":function(qe,ve){qe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JYp7:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return ne});var ne;(function(W){function O(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}W.is=O;const k=Object.freeze([]);function w(){return k}W.empty=w;function*D(t){yield t}W.single=D;function B(t){return t||k}W.from=B;function M(t){return!t||t[Symbol.iterator]().next().done===!0}W.isEmpty=M;function e(t){return t[Symbol.iterator]().next().value}W.first=e;function C(t,g){for(const p of t)if(g(p))return!0;return!1}W.some=C;function y(t,g){for(const p of t)if(g(p))return p;return}W.find=y;function*c(t,g){for(const p of t)g(p)&&(yield p)}W.filter=c;function*d(t,g){let p=0;for(const m of t)yield g(m,p++)}W.map=d;function*a(...t){for(const g of t)for(const p of g)yield p}W.concat=a;function*i(t){for(const g of t)for(const p of g)yield p}W.concatNested=i;function o(t,g,p){let m=p;for(const b of t)m=g(m,b);return m}W.reduce=o;function*s(t,g,p=t.length){for(g<0&&(g+=t.length),p<0?p+=t.length:p>t.length&&(p=t.length);g<p;g++)yield t[g]}W.slice=s;function r(t,g=Number.POSITIVE_INFINITY){const p=[];if(g===0)return[p,t];const m=t[Symbol.iterator]();for(let b=0;b<g;b++){const _=m.next();if(_.done)return[p,W.empty()];p.push(_.value)}return[p,{[Symbol.iterator](){return m}}]}W.consume=r;function n(t,g,p=(m,b)=>m===b){const m=t[Symbol.iterator](),b=g[Symbol.iterator]();for(;;){const _=m.next(),l=b.next();if(_.done!==l.done)return!1;if(_.done)return!0;if(!p(_.value,l.value))return!1}}W.equals=n})(ne||(ne={}))},KMxT:function(qe,ve,U){"use strict";U.r(ve);var ne=U("DjyN"),W=U("NUBc"),O=U("qVdP"),k=U("jsC+"),w=U("lUTK"),D=U("BvKs"),B=U("T2oS"),M=U("W9HT"),e=U("+L6B"),C=U("2/Rp"),y=U("k1fw"),c=U("9og8"),d=U("tJVT"),a=U("PpiC"),i=U("5NDa"),o=U("5rEg"),s=U("Znn+"),r=U("ZTPi"),n=U("WmNS"),t=U.n(n),g=U("q1tI"),p=U.n(g),m=U("9kvl"),b=U("iris"),_=U("jcZT"),l=U("BdwD"),f=U("SAoR"),u=U("FKdj"),h=U.n(u),E=U("EJTS"),v=U("LE3n"),S=U("xKgJ"),L=U("SVaM"),I=U("xTzM"),A=U.n(I),P=U("1vsH"),H=U("ErOA"),R=r.a.TabPane,K=o.a.Search,z;(function($){$.Mine="0",$.Public="1",$.Collection="2",$.TeachGroupShare="3"})(z||(z={}));var oe=function(fe){var de,ee,ie,ge,Z,Y,Se,Pe,ke=fe.classroomList,Re=fe.problemset,Me=fe.user,Ce=fe.globalSetting,Le=fe.loading,Ne=fe.dispatch,J=fe.match,pe=fe.shixunHomeworks,Te=Object(a.a)(fe,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),xe=Object(P.I)(),We=Object(g.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:xe.qtype,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((de=Te.location)===null||de===void 0||((ee=de.query)===null||ee===void 0)?void 0:ee.id)||null,exam_id:(J==null||((ie=J.params)===null||ie===void 0)?void 0:ie.id)||null,exercise_id:(J==null||((ge=J.params)===null||ge===void 0)?void 0:ge.categoryId)||null}),He=Object(d.a)(We,2),Oe=He[0],Ue=He[1],Qe=Object(g.useState)(0),Ze=Object(d.a)(Qe,2),Je=Ze[0],ze=Ze[1],nt=Object(g.useState)([]),it=Object(d.a)(nt,2),je=it[0],Ke=it[1],ae=Object(g.useState)(z.Mine),ce=Object(d.a)(ae,2),ye=ce[0],Q=ce[1],q=Object(g.useState)(-1),se=Object(d.a)(q,2),me=se[0],De=se[1],Be=Object(g.useState)([]),Xe=Object(d.a)(Be,2),ut=Xe[0],vt=Xe[1],dt=Object(g.useState)([]),_t=Object(d.a)(dt,2),xt=_t[0],rt=_t[1],Yt=Object(g.useState)(!1),It=Object(d.a)(Yt,2),qt=It[0],$t=It[1],bt=Object(g.useRef)(!1),en=Object(g.useState)([]),hn=Object(d.a)(en,2),ct=hn[0],_n=hn[1],at=Object(g.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),lt=Object(d.a)(at,2),Pt=lt[0],Kt=lt[1],rn=Object(g.useState)([]),an=Object(d.a)(rn,2),Cn=an[0],bn=an[1],Wt=Object(g.useRef)(null),wn=Object(g.useState)(!1),In=Object(d.a)(wn,2),Mn=In[0],Bn=In[1],Fn=Object(g.useState)(""),Wn=Object(d.a)(Fn,2),Jn=Wn[0],Vn=Wn[1],Xn=[{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F",type:"updated_at",direction:"asc"},{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F",type:"updated_at",direction:"desc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u5347\u5E8F",type:"quotes",direction:"asc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u964D\u5E8F",type:"quotes",direction:"desc"}];Object(g.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(g.useEffect)(function(){var ht;Ne({type:"problemset/getDisciplines",payload:{source:"question"}});var ft=((ht=Te.location.query)===null||ht===void 0?void 0:ht.group_id)||0;Oe.group_id=Number(ft),Ue(Oe),fn(Oe).then(function(Et){Et!=null&&Et.status||bn(Et==null?void 0:Et.item_banks_group),Bn(!1)}),F(),li()},[]),Object(g.useEffect)(function(){return Ne({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Ne({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){Ne({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Ne({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(g.useEffect)(function(){return Ne({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Ne({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(g.useEffect)(function(){return Ne({type:"globalSetting/headerFooterToggle",payload:!1}),function(){Ne({type:"globalSetting/headerFooterToggle",payload:!0})}},[]);var li=function(){var ht=Object(c.a)(t.a.mark(function ft(){return t.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:Ne({type:"problemset/getTeachGroupData"});case 1:case"end":return kt.stop()}},ft)}));return function(){return ht.apply(this,arguments)}}(),fn=function(){var ht=Object(c.a)(t.a.mark(function ft(Et){var kt;return t.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Et.item_type=Et.item_type,Bn(!0),Zt.next=4,Ne({type:"problemset/getItemBanks",payload:Et});case 4:if(kt=Zt.sent,!(kt&&kt.status!==403&&kt.status!==401&&kt.status!==500)){Zt.next=14;break}return ze(kt.items_count||0),Ke(kt.items||[]),vt(kt.tag_disciplines||[]),T(kt.items||[]),_n([]),rt((kt==null?void 0:kt.navigation)||[]),Bn(!1),Zt.abrupt("return",kt);case 14:case"end":return Zt.stop()}},ft)}));return function(Et){return ht.apply(this,arguments)}}(),F=function(){Ne({type:"problemset/getBasketList",payload:{}})},T=function(ft){var Et=ft.every(function(kt){var dn;return((dn=kt.program_attr)===null||dn===void 0?void 0:dn.status)===0});bt.current=Et},x=function(ft,Et){if(Oe.discipline_id=ft||"",Oe.sub_discipline_id=Et||"",Oe.tag_discipline_id="",Oe.page=1,Oe.per_page=20,delete Oe.id,De(ft===null?-1:null),Ue(Oe),fn(Oe),ft===null)return},N=function(ft){Oe.difficulty=ft||"",Oe.page=1,Oe.per_page=20,delete Oe.id,Ue(Oe),fn(Oe)},G=function(ft){Oe.tag_discipline_id=ft,Oe.page=1,Oe.per_page=20,delete Oe.id,ft===-1&&(Oe.discipline_id="",Oe.sub_discipline_id="",Oe.tag_discipline_id=""),De(ft),Ue(Oe),fn(Oe)},j=Object(g.useState)(!1),_e=Object(d.a)(j,2),Ge=_e[0],tt=_e[1],st=function(ft){Ne({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:ft}}),Oe.discipline_id="",Oe.sub_discipline_id="",Oe.tag_discipline_id="",Oe.difficulty=null,Oe.type=ft,ft==="0"?Oe.group_id=0:Oe.group_id=null,ft==="3"?tt(!0):tt(!1),Oe.page=1,Oe.per_page=20,delete Oe.id,De(-1),Q(ft),Ue(Oe),fn(Oe)},Ve=function(ft,Et){Oe.page=ft,Oe.per_page=Et,Ue(Oe),fn(Oe)},yt=function(ft){Oe.discipline_id="",Oe.sub_discipline_id="",Oe.tag_discipline_id="",Oe.difficulty=null,Oe.page=1,Oe.keyword=ft,delete Oe.id,ft?($t(!0),Object(L.a)({name:ft,copywriting:ft,position:"ItemBank"})):$t(!1),De(-1),Ue(Oe),fn(Oe)},jt=function(){Oe.per_page=20,Ue(Oe),fn(Oe)},Qt=function(){var ht=Object(c.a)(t.a.mark(function ft(Et){return t.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:Ne({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(Et),group_type:z.Mine}}),Oe.page=1,Oe.per_page=20,Oe.group_id=Math.abs(Et),Ue(Oe),fn(Oe).then(function(Zt){return bn(Zt==null?void 0:Zt.item_banks_group)});case 6:case"end":return dn.stop()}},ft)}));return function(Et){return ht.apply(this,arguments)}}(),Dn=function(){Ne({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:Oe}});return},Kn=function(){Ne({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},pn=function(){var ht=Object(c.a)(t.a.mark(function ft(Et){return t.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:Ne({type:"problemset/getDisciplines",payload:{source:"question",group_id:Et,group_type:z.TeachGroupShare}}),Oe.page=1,Oe.group_id=Et||null,delete Oe.id,Ue(Object(y.a)({},Oe)),fn(Oe);case 6:case"end":return dn.stop()}},ft)}));return function(Et){return ht.apply(this,arguments)}}(),jn=function(ft){Oe.sort_by=ft.type,Oe.sort_direction=ft.direction,Oe.page=1,Oe.per_page=20,Kt(ft.name),Ue(Oe),fn(Oe)},ui=function(ft){Oe.discipline_id="",Oe.sub_discipline_id="",Oe.tag_discipline_id="",Oe.difficulty=null,Oe.page=1,Oe.per_page=20,Oe.group_id=ft,De(-1),Ue(Oe),fn(Oe).then(function(Et){return bn(Et==null?void 0:Et.item_banks_group)})},qn=function(ft){_n(ft)},Yn=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],Gn={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},ni=function(){var ht=Object(c.a)(t.a.mark(function ft(Et){var kt;return t.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:if(!(xe.type==="exercise")){Zt.next=6;break}return Zt.next=3,Object(H.a)("/api/exercises/".concat(xe.exerciseid,"/toggle_random_question.json"),{method:"post",body:{question_id:xe.qid,item_bank_id:Et}});case 3:return kt=Zt.sent,kt!=null&&kt.status||m.d.push(xe.from),Zt.abrupt("return");case 6:case"end":return Zt.stop()}},ft)}));return function(Et){return ht.apply(this,arguments)}}();return p.a.createElement("div",{className:h.a.page},p.a.createElement("section",null,p.a.createElement("div",{className:h.a.wrap},p.a.createElement("div",{className:h.a.title},"\u8BD5\u9898\u5E93"),p.a.createElement("div",{className:h.a.headerWrapper},p.a.createElement("div",{className:h.a.tabsWrap},p.a.createElement(r.a,{activeKey:ye,onChange:st,tabBarExtraContent:p.a.createElement("div",{className:h.a.searchWrap},p.a.createElement(K,{allowClear:!0,suffix:p.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(h.a.searchIcon),onClick:function(){return yt(Oe.keyword)}}),className:h.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",value:Oe.keyword,onChange:function(ft){Oe.keyword=ft.target.value,Ue(Object(y.a)({},Oe))},onSearch:yt}))},p.a.createElement(R,{tab:"\u516C\u5171",key:"1"}),((Z=Re.teachGroupData)===null||Z===void 0||((Y=Z.groups)===null||Y===void 0)?void 0:Y.length)&&p.a.createElement(R,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(S.o)()&&!Object(S.m)()&&p.a.createElement(R,{tab:"\u6536\u85CF\u5939",key:"2"}),p.a.createElement(R,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),p.a.createElement(b.a,{showSelectAll:!1,className:h.a.select,disciplinesData:(Se=Re.disciplinesData)===null||Se===void 0?void 0:Se.disciplines,knowledgeData:ut,directionValue:Oe.discipline_id,subDisciplineValue:Oe.sub_discipline_id,typeValue:Oe.item_type,isprogram_homework:!1,showItemType:!1,showKnowledge:!0,name:Jn,setname:Vn,difficultyValue:Oe.difficulty,showShixun:!1,onShixunChange:Kn,onDirectionChange:x,onTypeChange:function(){},onDifficultyChange:N,knowledgeValue:me,onKnowledgeChange:G,teachGroupData:(Pe=Re.teachGroupData)===null||Pe===void 0?void 0:Pe.groups,onTeachGroupChange:pn,teachGroupValue:Oe.group_id,showTeachGroup:Ge})),p.a.createElement("div",{className:h.a.treeWrapper,style:{display:ye===z.Mine?"block":"none"}},p.a.createElement("div",{className:h.a.treeHeader},p.a.createElement(f.a,{data:xt,onClick:Qt}),p.a.createElement(C.a,{type:"link",onClick:Dn,className:h.a.exportBtn},p.a.createElement("img",{src:A.a,alt:"",className:h.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),p.a.createElement(M.a,{spinning:Mn},p.a.createElement("div",{ref:Wt,className:h.a.treeContent},p.a.createElement(v.a,{isProblemset:!1,reloadData:jt,data:Cn,onShare:function(){},onOpen:Qt})))),p.a.createElement("div",{className:h.a.contentWrap},p.a.createElement("div",{className:h.a.batchWrap},p.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},p.a.createElement("div",{className:"font14"},p.a.createElement(k.a,{overlay:p.a.createElement(D.a,{selectedKeys:[Pt]},Xn==null?void 0:Xn.map(function(ht,ft){return p.a.createElement(D.a.Item,{key:ht.name,onClick:function(){return jn(ht)}},ht.name)}))},p.a.createElement("span",{style:{color:"#464F66"}},p.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),Pt))))),qt?p.a.createElement("div",null,p.a.createElement(C.a,{style:{paddingLeft:0},onClick:function(){Oe.page=1,Oe.keyword=null,delete Oe.id,Ue(Oe),$t(!1),fn(Oe)},type:"link"},p.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),p.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",Oe.keyword,"\u201D")):null,p.a.createElement("div",{className:h.a.contentListWrap},Je!==0?p.a.createElement(M.a,{size:"large",spinning:Le["problemset/getItemBanks"]},je.map(function(ht,ft){var Et,kt;return p.a.createElement("div",{className:h.a.li,key:ht.id},p.a.createElement("div",{className:h.a.top},p.a.createElement(E.b,{showCheckbox:!1,data:ht,selectIds:ct,onSelectCheckBox:qn})),p.a.createElement("div",{className:h.a.bottom},p.a.createElement("p",{className:"".concat(h.a.actionLeftItem," ").concat(h.a.questionTypeName)},(Et=Yn.find(function(dn){return dn.type===ht.item_type}))===null||Et===void 0?void 0:Et.name),p.a.createElement("p",{className:h.a.actionLeftItem},Gn[ht.difficulty]),p.a.createElement("p",{className:h.a.actionLeftItem},"\u521B\u5EFA\u8005",p.a.createElement("span",{className:"c-grey-333"},ht==null||((kt=ht.author)===null||kt===void 0)?void 0:kt.name)),p.a.createElement("p",{className:h.a.actionLeftItem},"\u66F4\u65B0",p.a.createElement("span",{className:"c-grey-333"},ht==null?void 0:ht.updated_at)),p.a.createElement("p",{className:h.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",p.a.createElement("span",{className:"c-grey-333"},ht==null?void 0:ht.quotes)),p.a.createElement("div",{className:h.a.more},p.a.createElement("span",{className:h.a.btnAdd,onClick:function(){return ni(ht.id)}},"\u66FF\u6362"))))})):p.a.createElement(M.a,{size:"large",spinning:Le["problemset/getItemBanks"]},p.a.createElement(l.a,null))),Je!==0&&p.a.createElement(W.a,{showQuickJumper:!0,onChange:Ve,defaultCurrent:1,pageSize:Oe==null?void 0:Oe.per_page,current:Oe.page||1,total:Je,showTotal:function(ft){return p.a.createElement("span",{className:"mr10"},"\u5171",p.a.createElement("span",{className:"c-light-primary"},ft),"\u6761\u6570\u636E")}}))),p.a.createElement(_.a,{onOk:ui})))};ve.default=Object(m.a)(function($){var fe=$.classroomList,de=$.problemset,ee=$.user,ie=$.loading,ge=$.globalSetting,Z=$.shixunHomeworks;return{classroomList:fe,problemset:de,user:ee,globalSetting:ge,loading:ie.effects,shixunHomeworks:Z}})(oe)},LE3n:function(qe,ve,U){"use strict";var ne=U("ozfa"),W=U("MJZm"),O=U("k1fw"),k=U("+L6B"),w=U("2/Rp"),D=U("5NDa"),B=U("5rEg"),M=U("2qtc"),e=U("kLXV"),C=U("miYZ"),y=U("tsqr"),c=U("9og8"),d=U("tJVT"),a=U("WmNS"),i=U.n(a),o=U("q1tI"),s=U.n(o),r=U("1vnw"),n=U.n(r),t=U("ErOA"),g=U("Ix/O"),p=U.n(g),m=U("xTzM"),b=U.n(m),_=U("WCUW"),l=U("LvDl"),f=U.n(l),u=function(v){var S=v.isProblemset,L=v.name,I=v.id,A=v.itemBanksCount,P=v.onOpen,H=P===void 0?function(){}:P,R=v.onShare,K=R===void 0?function(){}:R,z=v.onMove,oe=z===void 0?function(){}:z,$=v.onDeleteOk,fe=$===void 0?function(){}:$,de=Object(o.useState)(!1),ee=Object(d.a)(de,2),ie=ee[0],ge=ee[1],Z=Object(o.useState)(L),Y=Object(d.a)(Z,2),Se=Y[0],Pe=Y[1],ke=Object(o.useState)(L),Re=Object(d.a)(ke,2),Me=Re[0],Ce=Re[1],Le=function(){var J=Object(c.a)(i.a.mark(function pe(Te){var xe,We,He;return i.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(xe=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],Me.trim()){Ue.next=4;break}return y.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Ue.abrupt("return");case 4:if(!(Me.charAt(0)===" ")){Ue.next=7;break}return y.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Ue.abrupt("return");case 7:We=0;case 8:if(!(We<Me.length)){Ue.next=15;break}if(!xe.includes(Me.charAt(We))){Ue.next=12;break}return y.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),Ue.abrupt("return",!1);case 12:We++,Ue.next=8;break;case 15:return Ue.next=17,Object(t.a)("/api/item_banks_groups/".concat(Math.abs(Te),".json"),{method:"put",body:{name:Me}});case 17:He=Ue.sent,He.status===0&&(ge(!1),Pe(Me));case 19:case"end":return Ue.stop()}},pe)}));return function(Te){return J.apply(this,arguments)}}(),Ne=function(pe){e.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:s.a.createElement("div",null,s.a.createElement("p",null,"\u672C\u6B21\u5220\u9664\u64CD\u4F5C\u786E\u5B9A\u540E\u5185\u5BB9\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"),s.a.createElement("p",null,"\u5220\u9664\u6587\u4EF6\u5939\uFF0C\u5C06\u540C\u6B65\u5220\u9664\u5176\u6240\u5305\u542B\u7684\u5168\u90E8\u5B50\u6587\u4EF6\u5939\u548C\u8BD5\u9898\uFF0C\u8BF7\u614E\u91CD\u64CD\u4F5C\uFF01")),cancelText:"\u53D6\u6D88",onOk:function(){var Te=Object(c.a)(i.a.mark(function We(){var He;return i.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,Object(t.a)("/api/item_banks_groups/".concat(Math.abs(pe),".json"),{method:"delete",body:{}});case 2:He=Ue.sent,He.status===0&&fe(pe);case 4:case"end":return Ue.stop()}},We)}));function xe(){return Te.apply(this,arguments)}return xe}()})};return s.a.createElement("div",{className:n.a.list},ie?s.a.createElement(B.a,{style:{maxWidth:780},value:Me,onChange:function(pe){return Ce(pe.target.value)}}):s.a.createElement("div",{title:Se,onClick:function(){return H(I)},className:n.a.name},Se),S&&s.a.createElement("div",{className:n.a.btns},ie?s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{style:{height:16},onClick:function(){return Le(I)},className:"ml0"},s.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),s.a.createElement("div",{style:{height:16},onClick:function(){Ce(Se),ge(!1)},className:"ml10"},s.a.createElement("i",{className:"iconfont icon-qingchu"}))):s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{onClick:function(){return oe(I,"up")},className:"ml0"},s.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),s.a.createElement("div",{onClick:function(){return oe(I,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},s.a.createElement("i",{className:"iconfont icon-shangyi3"}))),s.a.createElement(w.a,{className:"ml10",onClick:function(){if(!A){y.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}K(Math.abs(I))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),s.a.createElement(w.a,{className:"ml10",onClick:function(){return ge(!0)},type:"link"},"\u91CD\u547D\u540D"),s.a.createElement(w.a,{onClick:function(){return Ne(I)},type:"link",danger:!0},"\u5220\u9664")))},h=function(v){var S=v.isProblemset,L=v.data,I=v.onOpen,A=I===void 0?function(){}:I,P=v.onShare,H=P===void 0?function(){}:P,R=v.reloadData,K=Object(o.useState)(),z=Object(d.a)(K,2),oe=z[0],$=z[1];Object(o.useEffect)(function(){$(L==null?void 0:L.map(function(Se){return{title:s.a.createElement(u,{isProblemset:S,name:Se.name,id:Se.id,itemBanksCount:Se.item_banks_count,onMove:de,onOpen:A,onShare:H,onDeleteOk:ie}),key:Se.id,icon:s.a.createElement("img",{src:p.a,className:n.a.folderIcon}),isLeaf:!1}}))},[L]);var fe=function Se(Pe,ke,Re){for(var Me=Object(l.cloneDeep)(Pe),Ce=0;Ce<Me.length;Ce++){if(Me[Ce].key===ke){if(Re==="up"){var Le=[Me[Ce],Me[Ce-1]];Me[Ce-1]=Le[0],Me[Ce]=Le[1]}else{var Ne=[Me[Ce+1],Me[Ce]];Me[Ce]=Ne[0],Me[Ce+1]=Ne[1]}break}Me[Ce].children&&(Me[Ce].children=Se(Me[Ce].children,ke,Re))}return Me},de=function(){var Se=Object(c.a)(i.a.mark(function Pe(ke,Re){var Me;return i.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:if(!(Re==="up")){Le.next=6;break}return Le.next=3,Object(_.I)({id:Math.abs(ke)});case 3:Le.t0=Le.sent,Le.next=9;break;case 6:return Le.next=8,Object(_.H)({id:Math.abs(ke)});case 8:Le.t0=Le.sent;case 9:Me=Le.t0,Me.status===0&&$(function(Ne){return fe(Ne,ke,Re)});case 11:case"end":return Le.stop()}},Pe)}));return function(ke,Re){return Se.apply(this,arguments)}}(),ee=function Se(Pe,ke){return Pe.filter(function(Re){return Re.key===ke?!1:(Re.children&&(Re.children=Se(Re.children,ke)),!0)})},ie=function(Pe){$(function(ke){return ee(ke,Pe)}),R()},ge=function Se(Pe,ke,Re){return Pe.map(function(Me){return Me.key===ke?Object(O.a)(Object(O.a)({},Me),Re):Me.children?Object(O.a)(Object(O.a)({},Me),{},{children:Se(Me.children,ke,Re)}):Me})},Z=function(){var Se=Object(c.a)(i.a.mark(function Pe(ke){var Re,Me,Ce,Le,Ne;return i.a.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return Re=ke.key,pe.next=3,Object(_.B)({group_id:Math.abs(Re)});case 3:Me=pe.sent,Ce=Me||{},Le=Ce.item_banks_group,Ne=Ce.item_banks_group_count,Ne>0?$(function(Te){return ge(Te,Re,{children:Le.map(function(xe){return{title:s.a.createElement(u,{isProblemset:S,name:xe.name,id:xe.id,itemBanksCount:xe.item_banks_count,onMove:de,onOpen:A,onShare:H,onDeleteOk:ie}),key:xe.id,icon:s.a.createElement("img",{src:p.a,className:n.a.folderIcon}),isLeaf:!1}})})}):$(function(Te){return ge(Te,Re,{isLeaf:!0})});case 6:case"end":return pe.stop()}},Pe)}));return function(ke){return Se.apply(this,arguments)}}(),Y=function(Pe,ke){var Re=ke.node,Me=ke.expanded;$(function(Ce){return ge(Ce,Re.key,{icon:Me?s.a.createElement("img",{src:b.a,className:n.a.folderIcon}):s.a.createElement("img",{src:p.a,className:n.a.folderIcon})})})};return(oe==null?void 0:oe.length)>0&&s.a.createElement(W.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:oe,loadData:Z,onExpand:Y,className:n.a.folderWrapper,selectable:!1})};ve.a=h},LdHM:function(qe,ve,U){"use strict";U.d(ve,"b",function(){return t}),U.d(ve,"a",function(){return p});var ne=U("1OyB"),W=U("vuIU"),O=U("Ji7U"),k=U("LK+K"),w=U("q1tI"),D=U("rePB"),B=U("Ff2n"),M=U("ODXe"),e=U("4IlW"),C=U("bX4T"),y=U("YrtM"),c=U("TSYQ"),d=U.n(c),a=U("+nKL"),i=U("8OUc"),o=function(K,z){var oe=K.prefixCls,$=K.id,fe=K.flattenOptions,de=K.childrenAsData,ee=K.values,ie=K.searchValue,ge=K.multiple,Z=K.defaultActiveFirstOption,Y=K.height,Se=K.itemHeight,Pe=K.notFoundContent,ke=K.open,Re=K.menuItemSelectedIcon,Me=K.virtual,Ce=K.onSelect,Le=K.onToggleOpen,Ne=K.onActiveValue,J=K.onScroll,pe=K.onMouseEnter,Te="".concat(oe,"-item"),xe=Object(y.a)(function(){return fe},[ke,fe],function(Ke,ae){return ae[0]&&Ke[1]!==ae[1]}),We=w.useRef(null),He=function(ae){ae.preventDefault()},Oe=function(ae){We.current&&We.current.scrollTo({index:ae})},Ue=function(ae){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ye=xe.length,Q=0;Q<ye;Q+=1){var q=(ae+Q*ce+ye)%ye,se=xe[q],me=se.group,De=se.data;if(!me&&!De.disabled)return q}return-1},Qe=w.useState(function(){return Ue(0)}),Ze=Object(M.a)(Qe,2),Je=Ze[0],ze=Ze[1],nt=function(ae){ze(ae);var ce=xe[ae];if(!ce){Ne(null,-1);return}Ne(ce.data.value,ae)};w.useEffect(function(){nt(Z!==!1?Ue(0):-1)},[xe.length,ie]),w.useEffect(function(){var Ke=setTimeout(function(){if(!ge&&ke&&ee.size===1){var ae=Array.from(ee)[0],ce=xe.findIndex(function(ye){var Q=ye.data;return Q.value===ae});nt(ce),Oe(ce)}});return function(){return clearTimeout(Ke)}},[ke]);var it=function(ae){ae!==void 0&&Ce(ae,{selected:!ee.has(ae)}),ge||Le(!1)};if(w.useImperativeHandle(z,function(){return{onKeyDown:function(ae){var ce=ae.which;switch(ce){case e.a.UP:case e.a.DOWN:{var ye=0;if(ce===e.a.UP?ye=-1:ce===e.a.DOWN&&(ye=1),ye!==0){var Q=Ue(Je+ye,ye);Oe(Q),nt(Q)}break}case e.a.ENTER:{var q=xe[Je];q&&!q.data.disabled?it(q.data.value):it(void 0),ke&&ae.preventDefault();break}case e.a.ESC:Le(!1)}},onKeyUp:function(){},scrollTo:function(ae){Oe(ae)}}}),xe.length===0)return w.createElement("div",{role:"listbox",id:"".concat($,"_list"),className:"".concat(Te,"-empty"),onMouseDown:He},Pe);function je(Ke){var ae=xe[Ke];if(!ae)return null;var ce=ae.data||{},ye=ce.value,Q=ce.label,q=ce.children,se=Object(C.a)(ce,!0),me=de?q:Q;return ae?w.createElement("div",Object.assign({"aria-label":typeof me=="string"?me:null},se,{key:Ke,role:"option",id:"".concat($,"_list_").concat(Ke),"aria-selected":ee.has(ye)}),ye):null}return w.createElement(w.Fragment,null,w.createElement("div",{role:"listbox",id:"".concat($,"_list"),style:{height:0,width:0,overflow:"hidden"}},je(Je-1),je(Je),je(Je+1)),w.createElement(a.a,{itemKey:"key",ref:We,data:xe,height:Y,itemHeight:Se,fullHeight:!1,onMouseDown:He,onScroll:J,virtual:Me,onMouseEnter:pe},function(Ke,ae){var ce,ye=Ke.group,Q=Ke.groupOption,q=Ke.data,se=q.label,me=q.key;if(ye)return w.createElement("div",{className:d()(Te,"".concat(Te,"-group"))},se!==void 0?se:me);var De=q.disabled,Be=q.value,Xe=q.title,ut=q.children,vt=q.style,dt=q.className,_t=Object(B.a)(q,["disabled","value","title","children","style","className"]),xt=ee.has(Be),rt="".concat(Te,"-option"),Yt=d()(Te,rt,dt,(ce={},Object(D.a)(ce,"".concat(rt,"-grouped"),Q),Object(D.a)(ce,"".concat(rt,"-active"),Je===ae&&!De),Object(D.a)(ce,"".concat(rt,"-disabled"),De),Object(D.a)(ce,"".concat(rt,"-selected"),xt),ce)),It=de?ut:se,qt=!Re||typeof Re=="function"||xt;return w.createElement("div",Object.assign({},_t,{"aria-selected":xt,className:Yt,title:Xe,onMouseMove:function(){if(Je===ae||De)return;nt(ae)},onClick:function(){De||it(Be)},style:vt}),w.createElement("div",{className:"".concat(rt,"-content")},It||Be),w.isValidElement(Re)||xt,qt&&w.createElement(i.a,{className:"".concat(Te,"-option-state"),customizeIcon:Re,customizeIconProps:{isSelected:xt}},xt?"\u2713":null))}))},s=w.forwardRef(o);s.displayName="OptionList";var r=s,n=function(){return null};n.isSelectOption=!0;var t=n,g=function(){return null};g.isSelectOptGroup=!0;var p=g,m=U("VTBJ"),b=U("Zm9Q");function _(R){var K=R.key,z=R.props,oe=z.children,$=z.value,fe=Object(B.a)(z,["children","value"]);return Object(m.a)({key:K,value:$!==void 0?$:K,children:oe},fe)}function l(R){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(b.a)(R).map(function(z,oe){if(!w.isValidElement(z)||!z.type)return null;var $=z.type.isSelectOptGroup,fe=z.key,de=z.props,ee=de.children,ie=Object(B.a)(de,["children"]);return K||!$?_(z):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(fe===null?oe:fe,"__"),label:fe},ie),{},{options:l(ee)})}).filter(function(z){return z})}var f=U("2Qr1"),u=U("qNPg"),h=U("U8pU"),E=U("Kwbf"),v=U("WKfj");function S(R){var K=R.mode,z=R.options,oe=R.children,$=R.backfill,fe=R.allowClear,de=R.placeholder,ee=R.getInputElement,ie=R.showSearch,ge=R.onSearch,Z=R.defaultOpen,Y=R.autoFocus,Se=R.labelInValue,Pe=R.value,ke=R.inputValue,Re=R.optionLabelProp,Me=K==="multiple"||K==="tags",Ce=ie!==void 0?ie:Me||K==="combobox",Le=z||l(oe);if(Object(E.a)(K!=="tags"||Le.every(function(Te){return!Te.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),K==="tags"||K==="combobox"){var Ne=Le.some(function(Te){return Te.options?Te.options.some(function(xe){return typeof("value"in xe?xe.value:xe.key)=="number"}):typeof("value"in Te?Te.value:Te.key)=="number"});Object(E.a)(!Ne,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(K!=="combobox"||!Re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(K==="combobox"||!$,"`backfill` only works with `combobox` mode."),Object(E.a)(K==="combobox"||!ee,"`getInputElement` only work with `combobox` mode."),Object(E.b)(K!=="combobox"||!ee||!fe||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ge&&!Ce&&K!=="combobox"&&K!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!Z||Y,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Pe!=null){var J=Object(v.d)(Pe);Object(E.a)(!Se||J.every(function(Te){return Object(h.a)(Te)==="object"&&("key"in Te||"value"in Te)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!Me||Array.isArray(Pe),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var pe=null;Object(b.a)(oe).some(function(Te){if(!w.isValidElement(Te)||!Te.type)return!1;var xe=Te.type;if(xe.isSelectOption)return!1;if(xe.isSelectOptGroup){var We=Object(b.a)(Te.props.children).every(function(He){return!w.isValidElement(He)||!Te.type||He.type.isSelectOption?!0:(pe=He.type,!1)});return!We}return pe=xe,!0}),pe&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(pe.displayName||pe.name||pe,"`.")),Object(E.a)(ke===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var L=S,I=Object(u.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:l,flattenOptions:f.d,getLabeledValue:f.e,filterOptions:f.b,isValueDisabled:f.g,findValueOption:f.c,warningProps:L,fillOptionsWithMissingValue:f.a}),A=function(R){Object(O.a)(z,R);var K=Object(k.a)(z);function z(){var oe;return Object(ne.a)(this,z),oe=K.apply(this,arguments),oe.selectRef=w.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(W.a)(z,[{key:"render",value:function(){return w.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),z}(w.Component);A.Option=t,A.OptGroup=p;var P=A,H=ve.c=P},MI8n:function(qe,ve,U){"use strict";U.d(ve,"c",function(){return w}),U.d(ve,"b",function(){return e}),U.d(ve,"e",function(){return C}),U.d(ve,"a",function(){return y}),U.d(ve,"d",function(){return c}),U.d(ve,"f",function(){return d});var ne=U("/cxE"),W=U("pmY6"),O=U("24hK"),k=U("5Y4S"),w;(function(a){a.None=()=>W.a.None;function i(S){return(L,I=null,A)=>{let P=!1,H;return H=S(R=>P?void 0:(H?H.dispose():P=!0,L.call(I,R)),null,A),P&&H.dispose(),H}}a.once=i;function o(S,L){return p((I,A=null,P)=>S(H=>I.call(A,L(H)),null,P))}a.map=o;function s(S,L){return p((I,A=null,P)=>S(H=>{L(H),I.call(A,H)},null,P))}a.forEach=s;function r(S,L){return p((I,A=null,P)=>S(H=>L(H)&&I.call(A,H),null,P))}a.filter=r;function n(S){return S}a.signal=n;function t(...S){return(L,I=null,A)=>Object(W.e)(...S.map(P=>P(H=>L.call(I,H),null,A)))}a.any=t;function g(S,L,I){let A=I;return o(S,P=>(A=L(A,P),A))}a.reduce=g;function p(S){let L;const I=new e({onFirstListenerAdd(){L=S(I.fire,I)},onLastListenerRemove(){L.dispose()}});return I.event}function m(S,L,I=100,A=!1,P){let H,R,K,z=0;const oe=new e({leakWarningThreshold:P,onFirstListenerAdd(){H=S($=>{z++,R=L(R,$),A&&!K&&(oe.fire(R),R=void 0),clearTimeout(K),K=setTimeout(()=>{const fe=R;R=void 0,K=void 0,(!A||z>1)&&oe.fire(fe),z=0},I)})},onLastListenerRemove(){H.dispose()}});return oe.event}a.debounce=m;function b(S,L=(I,A)=>I===A){let I=!0,A;return r(S,P=>{const H=I||!L(P,A);return I=!1,A=P,H})}a.latch=b;function _(S,L){return[a.filter(S,L),a.filter(S,I=>!L(I))]}a.split=_;function l(S,L=!1,I=[]){let A=I.slice(),P=S(K=>{A?A.push(K):R.fire(K)});const H=()=>{A&&A.forEach(K=>R.fire(K)),A=null},R=new e({onFirstListenerAdd(){P||(P=S(K=>R.fire(K)))},onFirstListenerDidAdd(){A&&(L?setTimeout(H):H())},onLastListenerRemove(){P&&P.dispose(),P=null}});return R.event}a.buffer=l;class f{constructor(S){this.event=S}map(S){return new f(o(this.event,S))}forEach(S){return new f(s(this.event,S))}filter(S){return new f(r(this.event,S))}reduce(S,L){return new f(g(this.event,S,L))}latch(){return new f(b(this.event))}debounce(S,L=100,I=!1,A){return new f(m(this.event,S,L,I,A))}on(S,L,I){return this.event(S,L,I)}once(S,L,I){return i(this.event)(S,L,I)}}function u(S){return new f(S)}a.chain=u;function h(S,L,I=A=>A){const A=(...K)=>R.fire(I(...K)),P=()=>S.on(L,A),H=()=>S.removeListener(L,A),R=new e({onFirstListenerAdd:P,onLastListenerRemove:H});return R.event}a.fromNodeEventEmitter=h;function E(S,L,I=A=>A){const A=(...K)=>R.fire(I(...K)),P=()=>S.addEventListener(L,A),H=()=>S.removeEventListener(L,A),R=new e({onFirstListenerAdd:P,onLastListenerRemove:H});return R.event}a.fromDOMEventEmitter=E;function v(S){return new Promise(L=>i(S)(L))}a.toPromise=v})(w||(w={}));class D{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${D._idPool++}`}start(a){this._stopWatch=new k.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}D._idPool=0;let B=-1;class M{constructor(a,i=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=i,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let i=B;if(typeof this.customThreshold=="number"&&(i=this.customThreshold),i<=0||a<i)return;this._stacks||(this._stacks=new Map);const o=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),s=this._stacks.get(o)||0;if(this._stacks.set(o,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let r,n=0;for(const[t,g]of this._stacks)(!r||n<g)&&(r=t,n=g);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${n}):`),console.warn(r)}return()=>{const r=this._stacks.get(o)||0;this._stacks.set(o,r-1)}}}class e{constructor(a){var i;this._disposed=!1,this._options=a,this._leakageMon=B>0?new M(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((i=this._options)===null||i===void 0?void 0:i._profName)?new D(this._options._profName):void 0}get event(){return this._event||(this._event=(a,i,o)=>{var s;this._listeners||(this._listeners=new O.a);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const n=this._listeners.push(i?[a,i]:a);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,i);const t=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),g=Object(W.i)(()=>{if(t&&t(),!this._disposed&&(n(),this._options&&this._options.onLastListenerRemove)){const p=this._listeners&&!this._listeners.isEmpty();p||this._options.onLastListenerRemove(this)}});return o instanceof W.b?o.add(g):Array.isArray(o)&&o.push(g),g}),this._event}fire(a){var i,o;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new O.a);for(let s of this._listeners)this._deliveryQueue.push([s,a]);for((i=this._perfMon)===null||i===void 0||i.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(n){Object(ne.f)(n)}}(o=this._perfMon)===null||o===void 0||o.stop()}}dispose(){var a,i,o,s,r;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(i=this._deliveryQueue)===null||i===void 0||i.clear(),(s=(o=this._options)===null||o===void 0?void 0:o.onLastListenerRemove)===null||s===void 0||s.call(o),(r=this._leakageMon)===null||r===void 0||r.dispose())}}class C extends e{constructor(a){super(a);this._isPaused=0,this._eventQueue=new O.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class y extends C{constructor(a){var i;super(a);this._delay=(i=a.delay)!==null&&i!==void 0?i:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class c{constructor(){this.buffers=[]}wrapEvent(a){return(i,o,s)=>a(r=>{const n=this.buffers[this.buffers.length-1];n?n.push(()=>i.call(o,r)):i.call(o,r)},void 0,s)}bufferEvents(a){const i=[];this.buffers.push(i);const o=a();return this.buffers.pop(),i.forEach(s=>s()),o}}class d{constructor(){this.listening=!1,this.inputEvent=w.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(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(qe,ve,U){"use strict";(function(ne,W){U.d(ve,"b",function(){return o}),U.d(ve,"i",function(){return t}),U.d(ve,"f",function(){return g}),U.d(ve,"d",function(){return p}),U.d(ve,"g",function(){return m}),U.d(ve,"h",function(){return b}),U.d(ve,"c",function(){return _}),U.d(ve,"k",function(){return l}),U.d(ve,"j",function(){return f}),U.d(ve,"a",function(){return u}),U.d(ve,"e",function(){return v});var O;const k="en";let w=!1,D=!1,B=!1,M=!1,e=!1,C=!1,y=!1,c,d=k,a,i;const o=typeof self=="object"?self:typeof ne=="object"?ne:{};let s;typeof o.vscode!="undefined"&&typeof o.vscode.process!="undefined"?s=o.vscode.process:typeof W!="undefined"&&(s=W);const r=typeof((O=s==null?void 0:s.versions)===null||O===void 0?void 0:O.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!r)i=navigator.userAgent,w=i.indexOf("Windows")>=0,D=i.indexOf("Macintosh")>=0,y=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,B=i.indexOf("Linux")>=0,C=!0,c=navigator.language,d=c;else if(typeof s=="object"){w=s.platform==="win32",D=s.platform==="darwin",B=s.platform==="linux",M=B&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,c=k,d=k;const S=s.env.VSCODE_NLS_CONFIG;if(S)try{const L=JSON.parse(S),I=L.availableLanguages["*"];c=L.locale,d=I||k,a=L._translationsConfigFile}catch(L){}e=!0}else console.error("Unable to resolve platform.");let n=0;D?n=1:w?n=3:B&&(n=2);const t=w,g=D,p=B,m=e,b=C,_=y,l=i,f=function(){if(o.setImmediate)return o.setImmediate.bind(o);if(typeof o.postMessage=="function"&&!o.importScripts){let I=[];o.addEventListener("message",P=>{if(P.data&&P.data.vscodeSetImmediateId)for(let H=0,R=I.length;H<R;H++){const K=I[H];if(K.id===P.data.vscodeSetImmediateId){I.splice(H,1),K.callback();return}}});let A=0;return P=>{const H=++A;I.push({id:H,callback:P}),o.postMessage({vscodeSetImmediateId:H},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const L=Promise.resolve();return I=>L.then(I)}(),u=D||y?2:w?1:3;let h=!0,E=!1;function v(){if(!E){E=!0;const S=new Uint8Array(2);S[0]=1,S[1]=2;const L=new Uint16Array(S.buffer);h=L[0]===(2<<8)+1}return h}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(qe,ve,U){"use strict";U.d(ve,"C",function(){return ne}),U.d(ve,"v",function(){return O}),U.d(ve,"s",function(){return k}),U.d(ve,"t",function(){return w}),U.d(ve,"U",function(){return D}),U.d(ve,"J",function(){return B}),U.d(ve,"O",function(){return M}),U.d(ve,"p",function(){return e}),U.d(ve,"T",function(){return C}),U.d(ve,"q",function(){return y}),U.d(ve,"N",function(){return c}),U.d(ve,"M",function(){return d}),U.d(ve,"Q",function(){return a}),U.d(ve,"u",function(){return i}),U.d(ve,"x",function(){return o}),U.d(ve,"I",function(){return s}),U.d(ve,"f",function(){return r}),U.d(ve,"h",function(){return n}),U.d(ve,"g",function(){return t}),U.d(ve,"i",function(){return g}),U.d(ve,"G",function(){return p}),U.d(ve,"H",function(){return m}),U.d(ve,"r",function(){return b}),U.d(ve,"R",function(){return _}),U.d(ve,"d",function(){return l}),U.d(ve,"e",function(){return f}),U.d(ve,"E",function(){return u}),U.d(ve,"F",function(){return h}),U.d(ve,"j",function(){return E}),U.d(ve,"z",function(){return v}),U.d(ve,"K",function(){return L}),U.d(ve,"L",function(){return I}),U.d(ve,"m",function(){return P}),U.d(ve,"k",function(){return R}),U.d(ve,"A",function(){return z}),U.d(ve,"a",function(){return oe}),U.d(ve,"n",function(){return $}),U.d(ve,"l",function(){return fe}),U.d(ve,"D",function(){return de}),U.d(ve,"B",function(){return ee}),U.d(ve,"b",function(){return ie}),U.d(ve,"S",function(){return ge}),U.d(ve,"o",function(){return Z}),U.d(ve,"P",function(){return Y}),U.d(ve,"w",function(){return Se}),U.d(ve,"c",function(){return Pe}),U.d(ve,"y",function(){return Me});function ne(J){return!J||typeof J!="string"?!0:J.trim().length===0}const W=/{(\d+)}/g;function O(J,...pe){return pe.length===0?J:J.replace(W,function(Te,xe){const We=parseInt(xe,10);return isNaN(We)||We<0||We>=pe.length?Te:pe[We]})}function k(J){return J.replace(/[<>&]/g,function(pe){switch(pe){case"<":return"<";case">":return">";case"&":return"&";default:return pe}})}function w(J){return J.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function D(J,pe=" "){const Te=B(J,pe);return M(Te,pe)}function B(J,pe){if(!J||!pe)return J;const Te=pe.length;if(Te===0||J.length===0)return J;let xe=0;for(;J.indexOf(pe,xe)===xe;)xe=xe+Te;return J.substring(xe)}function M(J,pe){if(!J||!pe)return J;const Te=pe.length,xe=J.length;if(Te===0||xe===0)return J;let We=xe,He=-1;for(;!(He=J.lastIndexOf(pe,We-1),He===-1||He+Te!==We);){if(He===0)return"";We=He}return J.substring(0,We)}function e(J){return J.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function C(J){return J.replace(/\*/g,"")}function y(J,pe,Te={}){if(!J)throw new Error("Cannot create regex from empty string");pe||(J=w(J)),Te.wholeWord&&(/\B/.test(J.charAt(0))||(J="\\b"+J),/\B/.test(J.charAt(J.length-1))||(J=J+"\\b"));let xe="";return Te.global&&(xe+="g"),Te.matchCase||(xe+="i"),Te.multiline&&(xe+="m"),Te.unicode&&(xe+="u"),new RegExp(J,xe)}function c(J){if(J.source==="^"||J.source==="^$"||J.source==="$"||J.source==="^\\s*$")return!1;const pe=J.exec("");return!!(pe&&J.lastIndex===0)}function d(J){return(J.global?"g":"")+(J.ignoreCase?"i":"")+(J.multiline?"m":"")+(J.unicode?"u":"")}function a(J){return J.split(/\r\n|\r|\n/)}function i(J){for(let pe=0,Te=J.length;pe<Te;pe++){const xe=J.charCodeAt(pe);if(xe!==32&&xe!==9)return pe}return-1}function o(J,pe=0,Te=J.length){for(let xe=pe;xe<Te;xe++){const We=J.charCodeAt(xe);if(We!==32&&We!==9)return J.substring(pe,xe)}return J.substring(pe,Te)}function s(J,pe=J.length-1){for(let Te=pe;Te>=0;Te--){const xe=J.charCodeAt(Te);if(xe!==32&&xe!==9)return Te}return-1}function r(J,pe){return J<pe?-1:J>pe?1:0}function n(J,pe,Te=0,xe=J.length,We=0,He=pe.length){for(;Te<xe&&We<He;Te++,We++){let Qe=J.charCodeAt(Te),Ze=pe.charCodeAt(We);if(Qe<Ze)return-1;if(Qe>Ze)return 1}const Oe=xe-Te,Ue=He-We;return Oe<Ue?-1:Oe>Ue?1:0}function t(J,pe){return g(J,pe,0,J.length,0,pe.length)}function g(J,pe,Te=0,xe=J.length,We=0,He=pe.length){for(;Te<xe&&We<He;Te++,We++){let Qe=J.charCodeAt(Te),Ze=pe.charCodeAt(We);if(Qe===Ze)continue;if(Qe>=128||Ze>=128)return n(J.toLowerCase(),pe.toLowerCase(),Te,xe,We,He);p(Qe)&&(Qe-=32),p(Ze)&&(Ze-=32);const Je=Qe-Ze;if(Je===0)continue;return Je}const Oe=xe-Te,Ue=He-We;return Oe<Ue?-1:Oe>Ue?1:0}function p(J){return J>=97&&J<=122}function m(J){return J>=65&&J<=90}function b(J,pe){return J.length===pe.length&&g(J,pe)===0}function _(J,pe){const Te=pe.length;return pe.length>J.length?!1:g(J,pe,0,Te)===0}function l(J,pe){let Te,xe=Math.min(J.length,pe.length);for(Te=0;Te<xe;Te++)if(J.charCodeAt(Te)!==pe.charCodeAt(Te))return Te;return xe}function f(J,pe){let Te,xe=Math.min(J.length,pe.length);const We=J.length-1,He=pe.length-1;for(Te=0;Te<xe;Te++)if(J.charCodeAt(We-Te)!==pe.charCodeAt(He-Te))return Te;return xe}function u(J){return 55296<=J&&J<=56319}function h(J){return 56320<=J&&J<=57343}function E(J,pe){return(J-55296<<10)+(pe-56320)+65536}function v(J,pe,Te){const xe=J.charCodeAt(Te);if(u(xe)&&Te+1<pe){const We=J.charCodeAt(Te+1);if(h(We))return E(xe,We)}return xe}function S(J,pe){const Te=J.charCodeAt(pe-1);if(h(Te)&&pe>1){const xe=J.charCodeAt(pe-2);if(u(xe))return E(xe,Te)}return Te}function L(J,pe){const Te=ke.getInstance(),xe=pe,We=J.length,He=v(J,We,pe);pe+=He>=65536?2:1;let Oe=Te.getGraphemeBreakType(He);for(;pe<We;){const Ue=v(J,We,pe),Qe=Te.getGraphemeBreakType(Ue);if(Pe(Oe,Qe))break;pe+=Ue>=65536?2:1,Oe=Qe}return pe-xe}function I(J,pe){const Te=ke.getInstance(),xe=pe,We=S(J,pe);pe-=We>=65536?2:1;let He=Te.getGraphemeBreakType(We);for(;pe>0;){const Oe=S(J,pe),Ue=Te.getGraphemeBreakType(Oe);if(Pe(Ue,He))break;pe-=Oe>=65536?2:1,He=Ue}return xe-pe}const A=/(?:[\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(J){return A.test(J)}const H=/(?:[\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 R(J){return H.test(J)}const K=/^[\t\n\r\x20-\x7E]*$/;function z(J){return K.test(J)}const oe=/[\u2028\u2029]/;function $(J){return oe.test(J)}function fe(J){for(let pe=0,Te=J.length;pe<Te;pe++)if(de(J.charCodeAt(pe)))return!0;return!1}function de(J){return J=+J,J>=11904&&J<=55215||J>=63744&&J<=64255||J>=65281&&J<=65374}function ee(J){return J>=127462&&J<=127487||J===8986||J===8987||J===9200||J===9203||J>=9728&&J<=10175||J===11088||J===11093||J>=127744&&J<=128591||J>=128640&&J<=128764||J>=128992&&J<=129003||J>=129280&&J<=129535||J>=129648&&J<=129750}const ie=String.fromCharCode(65279);function ge(J){return!!(J&&J.length>0&&J.charCodeAt(0)===65279)}function Z(J,pe=!1){return J?(pe&&(J=J.replace(/\\./g,"")),J.toLowerCase()!==J):!1}function Y(J){const pe=90-65+1;return J=J%(2*pe),J<pe?String.fromCharCode(97+J):String.fromCharCode(65+J-pe)}function Se(J){const pe=ke.getInstance();return pe.getGraphemeBreakType(J)}function Pe(J,pe){return J===0?pe!==5&&pe!==7:J===2&&pe===3?!1:J===4||J===2||J===3||(pe===4||pe===2||pe===3)?!0:J===8&&(pe===8||pe===9||pe===11||pe===12)||((J===11||J===9)&&(pe===9||pe===10)||((J===12||J===10)&&pe===10||(pe===5||pe===13||(pe===7||(J===1||J===13&&pe===14)))))?!1:!(J===6&&pe===6)}class ke{constructor(){this._data=Re()}static getInstance(){return ke._INSTANCE||(ke._INSTANCE=new ke),ke._INSTANCE}getGraphemeBreakType(J){if(J<32)return J===10?3:J===13?2:4;if(J<127)return 0;const pe=this._data,Te=pe.length/3;let xe=1;for(;xe<=Te;)if(J<pe[3*xe])xe=2*xe;else if(J>pe[3*xe+1])xe=2*xe+1;else return pe[3*xe+2];return 0}}ke._INSTANCE=null;function Re(){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 Me(J,pe){if(J===0)return 0;const Te=Ce(J,pe);if(Te!==void 0)return Te;const xe=S(pe,J);return J-=Le(xe),J}function Ce(J,pe){let Te=S(pe,J);for(J-=Le(Te);Ne(Te)||Te===65039||Te===8419;){if(J===0)return;Te=S(pe,J),J-=Le(Te)}if(!ee(Te))return;if(J>=0){const xe=S(pe,J);xe===8205&&(J-=Le(xe))}return J}function Le(J){return J>=65536?2:1}function Ne(J){return 127995<=J&&J<=127999}},NvD2:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return D});var ne=U("Kwbf");function W(B,M){var e=new Set;return B.forEach(function(C){M.has(C)||e.add(C)}),e}function O(B){var M=B||{},e=M.disabled,C=M.disableCheckbox,y=M.checkable;return!!(e||C)||y===!1}function k(B,M,e,C){for(var y=new Set(B),c=new Set,d=0;d<=e;d+=1){var a=M.get(d)||new Set;a.forEach(function(r){var n=r.key,t=r.node,g=r.children,p=g===void 0?[]:g;y.has(n)&&!C(t)&&p.filter(function(m){return!C(m.node)}).forEach(function(m){y.add(m.key)})})}for(var i=new Set,o=e;o>=0;o-=1){var s=M.get(o)||new Set;s.forEach(function(r){var n=r.parent,t=r.node;if(C(t)||!r.parent||i.has(r.parent.key))return;if(C(r.parent.node)){i.add(n.key);return}var g=!0,p=!1;(n.children||[]).filter(function(m){return!C(m.node)}).forEach(function(m){var b=m.key,_=y.has(b);g&&!_&&(g=!1),!p&&(_||c.has(b))&&(p=!0)}),g&&y.add(n.key),p&&c.add(n.key),i.add(n.key)})}return{checkedKeys:Array.from(y),halfCheckedKeys:Array.from(W(c,y))}}function w(B,M,e,C,y){for(var c=new Set(B),d=new Set(M),a=0;a<=C;a+=1){var i=e.get(a)||new Set;i.forEach(function(n){var t=n.key,g=n.node,p=n.children,m=p===void 0?[]:p;!c.has(t)&&!d.has(t)&&!y(g)&&m.filter(function(b){return!y(b.node)}).forEach(function(b){c.delete(b.key)})})}d=new Set;for(var o=new Set,s=C;s>=0;s-=1){var r=e.get(s)||new Set;r.forEach(function(n){var t=n.parent,g=n.node;if(y(g)||!n.parent||o.has(n.parent.key))return;if(y(n.parent.node)){o.add(t.key);return}var p=!0,m=!1;(t.children||[]).filter(function(b){return!y(b.node)}).forEach(function(b){var _=b.key,l=c.has(_);p&&!l&&(p=!1),!m&&(l||d.has(_))&&(m=!0)}),p||c.delete(t.key),m&&d.add(t.key),o.add(t.key)})}return{checkedKeys:Array.from(c),halfCheckedKeys:Array.from(W(d,c))}}function D(B,M,e,C){var y=[],c;C?c=C:c=O;var d=new Set(B.filter(function(s){var r=!!e[s];return r||y.push(s),r})),a=new Map,i=0;Object.keys(e).forEach(function(s){var r=e[s],n=r.level,t=a.get(n);t||(t=new Set,a.set(n,t)),t.add(r),i=Math.max(i,n)}),Object(ne.a)(!y.length,"Tree missing follow keys: ".concat(y.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var o;return M===!0?o=k(d,a,i,c):o=w(d,M.halfCheckedKeys,a,i,c),o}},OZM5:function(qe,ve,U){"use strict";U.d(ve,"b",function(){return C}),U.d(ve,"a",function(){return y}),U.d(ve,"k",function(){return c}),U.d(ve,"h",function(){return d}),U.d(ve,"i",function(){return a}),U.d(ve,"g",function(){return i}),U.d(ve,"c",function(){return o}),U.d(ve,"d",function(){return s}),U.d(ve,"j",function(){return t}),U.d(ve,"e",function(){return g}),U.d(ve,"f",function(){return p});var ne=U("KQm4"),W=U("U8pU"),O=U("Ff2n"),k=U("q1tI"),w=U.n(k),D=U("Kwbf"),B=U("WaYH"),M=.25,e=2;function C(m,b){var _=m.slice(),l=_.indexOf(b);return l>=0&&_.splice(l,1),_}function y(m,b){var _=m.slice();return _.indexOf(b)===-1&&_.push(b),_}function c(m){return m.split("-")}function d(m,b){return"".concat(m,"-").concat(b)}function a(m){return m&&m.type&&m.type.isTreeNode}function i(m,b){var _=[m],l=b[m];function f(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u.forEach(function(h){var E=h.key,v=h.children;_.push(E),f(v)})}return f(l.children),_}function o(m,b){var _=m.clientY,l=b.selectHandle.getBoundingClientRect(),f=l.top,u=l.bottom,h=l.height,E=Math.max(h*M,e);return _<=f+E?-1:_>=u-E?1:0}function s(m,b){if(!m)return;var _=b.multiple;return _?m.slice():m.length?[m[0]]:m}var r=function(b){return b};function n(m,b){if(!m)return[];var _=b||{},l=_.processProps,f=l===void 0?r:l,u=Array.isArray(m)?m:[m];return u.map(function(h){var E=h.children,v=Object(O.a)(h,["children"]),S=n(E,b);return w.a.createElement(B.a,Object.assign({},f(v)),S)})}function t(m){if(!m)return null;var b;if(Array.isArray(m))b={checkedKeys:m,halfCheckedKeys:void 0};else if(Object(W.a)(m)==="object")b={checkedKeys:m.checked||void 0,halfCheckedKeys:m.halfChecked||void 0};else return Object(D.a)(!1,"`checkedKeys` is not an array or an object"),null;return b}function g(m,b){var _=new Set;function l(f){if(_.has(f))return;var u=b[f];if(!u)return;_.add(f);var h=u.parent,E=u.node;if(E.disabled)return;h&&l(h.key)}return(m||[]).forEach(function(f){l(f)}),Object(ne.a)(_)}function p(m){var b={};return Object.keys(m).forEach(function(_){(_.startsWith("data-")||_.startsWith("aria-"))&&(b[_]=m[_])}),b}},"P/tu":function(qe,ve,U){"use strict";var ne=U("ozfa"),W=U("MJZm"),O=U("0Owb"),k=U("9og8"),w=U("tJVT"),D=U("PpiC"),B=U("WmNS"),M=U.n(B),e=U("q1tI"),C=U.n(e),y=U("WCUW"),c=U("spXi"),d=U.n(c),a=function(o){var s=o.value,r=o.onChange,n=o.defaultValue,t=o.disabled,g=Object(D.a)(o,["value","onChange","defaultValue","disabled"]),p=Object(e.useState)([]),m=Object(w.a)(p,2),b=m[0],_=m[1],l=Object(e.useState)("1"),f=Object(w.a)(l,2),u=f[0],h=f[1];Object(e.useEffect)(function(){E()},[]);var E=function(){var L=Object(k.a)(M.a.mark(function I(){var A,P;return M.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,Object(y.A)({});case 2:A=R.sent,A!=null&&A.data&&(P=[{title:C.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:d.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:C.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:v(A.data||[])}],_(P),h("2"));case 4:case"end":return R.stop()}},I)}));return function(){return L.apply(this,arguments)}}(),v=function(I){function A(P){var H=P.children,R=Array.isArray(H)&&H.length>0,K=P==null?void 0:P.group_id;return{title:C.a.createElement("div",{title:P==null?void 0:P.name,className:d.a.name},P==null?void 0:P.name),value:K,key:K,icon:C.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:R?H==null?void 0:H.map(function(z){return A(z)}):[]}}return I==null?void 0:I.map(function(P){return A(P)})},S=n?{defaultExpandedKeys:[0]}:{selectedKeys:s,defaultExpandedKeys:s};return C.a.createElement("div",{className:d.a.customTree},C.a.createElement(W.a,Object(O.a)({key:u},S,{showIcon:!0,treeData:b,onSelect:r,disabled:t},g)))};ve.a=a},Q0Vu:function(qe,ve,U){qe.exports={flex_box_center:"flex_box_center___3fHaw",flex_space_between:"flex_space_between___1tu3K",flex_box_vertical_center:"flex_box_vertical_center___3kmTT",flex_box_center_end:"flex_box_center_end___19OcD",flex_box_column:"flex_box_column___1aMoy",main:"main___JkLSb",wrap:"wrap___1k_Ib",content:"content___1by-P",programName:"programName___1mMSD",name:"name___2mlTd",directionContentWrap:"directionContentWrap___3qsxQ",directionItem:"directionItem___2aAvu",active:"active___ACZqb",subActive:"subActive___2RkoB",subItem:"subItem___3tJgX",subMenu:"subMenu___Y_7S_",action:"action___xqgFs"}},SAoR:function(qe,ve,U){"use strict";var ne=U("Q9mQ"),W=U("diRs"),O=U("q1tI"),k=U.n(O),w=U("+z73"),D=U.n(w),B=function(e){var C=e.data,y=C===void 0?[]:C,c=e.onClick,d=function(){return y.map(function(o,s){return k.a.createElement("div",{key:s,className:D.a.few},k.a.createElement("b",{title:o.name,style:{color:s===0?"#333333":"#999999"},onClick:function(){return c(o.id)}},o.name),s<y.length-1&&k.a.createElement("span",null,"/"))})},a=function(){var o=!0,s=y.slice(2,-2),r=k.a.createElement("div",{className:D.a.pWrap},s.map(function(n){return k.a.createElement("span",{title:n.name,onClick:function(){return c(n.id)},key:n.id},n.name)}));return y.map(function(n,t){var g=null;return t>1&&t<y.length-2?o&&(g=k.a.createElement(W.a,{key:t,placement:"bottom",content:r},k.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),o=!1):g=k.a.createElement("div",{key:t,className:D.a.few},k.a.createElement("b",{title:n.name,style:{color:t===0?"#333333":"#999999"},onClick:function(){return c(n.id)}},n.name),t<y.length-1&&k.a.createElement("span",null,"/")),g})};return k.a.createElement("aside",{style:{overflowX:"auto"}},(y==null?void 0:y.length)>5?a():d())};ve.a=B},SJMd:function(qe,ve){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var U,ne,W,O=!1,k,w;window.PR_SHOULD_USE_CONTINUATION=!0;var D,B;(function(){var M=window,e=["break,continue,do,else,for,if,return,while"],C=[e,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],y=[C,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],c=[y,"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"],d=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[y,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],i="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",o=[y,"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"],n=[e,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],t=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],g=[c,a,d,o,s,r,n,t],p=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",b="kwd",_="com",l="typ",f="lit",u="pun",h="pln",E="tag",v="dec",S="src",L="atn",I="atv",A="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(Ce){for(var Le=0,Ne=!1,J=!1,pe=0,Te=Ce.length;pe<Te;++pe){var xe=Ce[pe];if(xe.ignoreCase)J=!0;else if(/[a-z]/i.test(xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ne=!0,J=!1;break}}var We={b:8,t:9,n:10,v:11,f:12,r:13};function He(Je){var ze=Je.charCodeAt(0);if(ze!==92)return ze;var nt=Je.charAt(1);return ze=We[nt],ze||("0"<=nt&&nt<="7"?parseInt(Je.substring(1),8):nt==="u"||nt==="x"?parseInt(Je.substring(2),16):Je.charCodeAt(1))}function Oe(Je){if(Je<32)return(Je<16?"\\x0":"\\x")+Je.toString(16);var ze=String.fromCharCode(Je);return ze==="\\"||ze==="-"||ze==="]"||ze==="^"?"\\"+ze:ze}function Ue(Je){var ze=Je.substring(1,Je.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")),nt=[],it=ze[0]==="^",je=["["];it&&je.push("^");for(var Ke=it?1:0,ae=ze.length;Ke<ae;++Ke){var ce=ze[Ke];if(/\\[bdsw]/i.test(ce))je.push(ce);else{var ye=He(ce),Q;Ke+2<ae&&ze[Ke+1]==="-"?(Q=He(ze[Ke+2]),Ke+=2):Q=ye,nt.push([ye,Q]),Q<65||ye>122||(Q<65||ye>90||nt.push([Math.max(65,ye)|32,Math.min(Q,90)|32]),Q<97||ye>122||nt.push([Math.max(97,ye)&~32,Math.min(Q,122)&~32]))}}nt.sort(function(De,Be){return De[0]-Be[0]||Be[1]-De[1]});for(var q=[],se=[],Ke=0;Ke<nt.length;++Ke){var me=nt[Ke];me[0]<=se[1]+1?se[1]=Math.max(se[1],me[1]):q.push(se=me)}for(var Ke=0;Ke<q.length;++Ke){var me=q[Ke];je.push(Oe(me[0])),me[1]>me[0]&&(me[1]+1>me[0]&&je.push("-"),je.push(Oe(me[1])))}return je.push("]"),je.join("")}function Qe(Je){for(var ze=Je.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")),nt=ze.length,it=[],je=0,Ke=0;je<nt;++je){var ae=ze[je];if(ae==="(")++Ke;else if(ae.charAt(0)==="\\"){var ce=+ae.substring(1);ce&&(ce<=Ke?it[ce]=-1:ze[je]=Oe(ce))}}for(var je=1;je<it.length;++je)it[je]===-1&&(it[je]=++Le);for(var je=0,Ke=0;je<nt;++je){var ae=ze[je];if(ae==="(")++Ke,it[Ke]||(ze[je]="(?:");else if(ae.charAt(0)==="\\"){var ce=+ae.substring(1);ce&&ce<=Ke&&(ze[je]="\\"+it[ce])}}for(var je=0;je<nt;++je)ze[je]==="^"&&ze[je+1]!=="^"&&(ze[je]="");if(Je.ignoreCase&&Ne)for(var je=0;je<nt;++je){var ae=ze[je],ye=ae.charAt(0);ae.length>=2&&ye==="["?ze[je]=Ue(ae):ye!=="\\"&&(ze[je]=ae.replace(/[a-zA-Z]/g,function(se){var me=se.charCodeAt(0);return"["+String.fromCharCode(me&~32,me|32)+"]"}))}return ze.join("")}for(var Ze=[],pe=0,Te=Ce.length;pe<Te;++pe){var xe=Ce[pe];if(xe.global||xe.multiline)throw new Error(""+xe);Ze.push("(?:"+Qe(xe)+")")}return new RegExp(Ze.join("|"),J?"gi":"g")}function R(Ce,Le){var Ne=/(?:^|\s)nocode(?:\s|$)/,J=[],pe=0,Te=[],xe=0;function We(He){var Oe=He.nodeType;if(Oe==1){if(Ne.test(He.className))return;for(var Ue=He.firstChild;Ue;Ue=Ue.nextSibling)We(Ue);var Qe=He.nodeName.toLowerCase();(Qe==="br"||Qe==="li")&&(J[xe]=`
|
|
`,Te[xe<<1]=pe++,Te[xe++<<1|1]=He)}else if(Oe==3||Oe==4){var Ze=He.nodeValue;Ze.length&&(Le?Ze=Ze.replace(/\r\n?/g,`
|
|
`):Ze=Ze.replace(/[ \t\r\n]+/g," "),J[xe]=Ze,Te[xe<<1]=pe,pe+=Ze.length,Te[xe++<<1|1]=He)}}return We(Ce),{sourceCode:J.join("").replace(/\n$/,""),spans:Te}}function K(Ce,Le,Ne,J,pe){if(!Ne)return;var Te={sourceNode:Ce,pre:1,langExtension:null,numberLines:null,sourceCode:Ne,spans:null,basePos:Le,decorations:null};J(Te),pe.push.apply(pe,Te.decorations)}var z=/\S/;function oe(Ce){for(var Le=void 0,Ne=Ce.firstChild;Ne;Ne=Ne.nextSibling){var J=Ne.nodeType;Le=J===1?Le?Ce:Ne:J===3&&z.test(Ne.nodeValue)?Ce:Le}return Le===Ce?void 0:Le}function $(Ce,Le){var Ne={},J;(function(){for(var xe=Ce.concat(Le),We=[],He={},Oe=0,Ue=xe.length;Oe<Ue;++Oe){var Qe=xe[Oe],Ze=Qe[3];if(Ze)for(var Je=Ze.length;--Je>=0;)Ne[Ze.charAt(Je)]=Qe;var ze=Qe[1],nt=""+ze;He.hasOwnProperty(nt)||(We.push(ze),He[nt]=null)}We.push(/[\0-\uffff]/),J=H(We)})();var pe=Le.length,Te=function(xe){for(var We=xe.sourceCode,He=xe.basePos,Oe=xe.sourceNode,Ue=[He,h],Qe=0,Ze=We.match(J)||[],Je={},ze=0,nt=Ze.length;ze<nt;++ze){var it=Ze[ze],je=Je[it],Ke=void 0,ae;if(typeof je=="string")ae=!1;else{var ce=Ne[it.charAt(0)];if(ce)Ke=it.match(ce[1]),je=ce[0];else{for(var ye=0;ye<pe;++ye)if(ce=Le[ye],Ke=it.match(ce[1]),Ke){je=ce[0];break}Ke||(je=h)}ae=je.length>=5&&je.substring(0,5)==="lang-",ae&&!(Ke&&typeof Ke[1]=="string")&&(ae=!1,je=S),ae||(Je[it]=je)}var Q=Qe;if(Qe+=it.length,!ae)Ue.push(He+Q,je);else{var q=Ke[1],se=it.indexOf(q),me=se+q.length;Ke[2]&&(me=it.length-Ke[2].length,se=me-q.length);var De=je.substring(5);K(Oe,He+Q,it.substring(0,se),Te,Ue),K(Oe,He+Q+se,q,Y(De,q),Ue),K(Oe,He+Q+me,it.substring(me),Te,Ue)}}xe.decorations=Ue};return Te}function fe(Ce){var Le=[],Ne=[];Ce.tripleQuotedStrings?Le.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ce.multiLineStrings?Le.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Le.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ce.verbatimStrings&&Ne.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var J=Ce.hashComments;J&&(Ce.cStyleComments?(J>1?Le.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Le.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ne.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Le.push([_,/^#[^\r\n]*/,null,"#"])),Ce.cStyleComments&&(Ne.push([_,/^\/\/[^\r\n]*/,null]),Ne.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var pe=Ce.regexLiterals;if(pe){var Te=pe>1?"":`
|
|
\r`,xe=Te?".":"[\\S\\s]",We="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+xe+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+xe+")*(?:\\x5D|$))+/";Ne.push(["lang-regex",RegExp("^"+P+"("+We+")")])}var He=Ce.types;He&&Ne.push([l,He]);var Oe=(""+Ce.keywords).replace(/^ | $/g,"");Oe.length&&Ne.push([b,new RegExp("^(?:"+Oe.replace(/[\s,]+/g,"|")+")\\b"),null]),Le.push([h,/^\s+/,null,` \r
|
|
\xA0`]);var Ue="^.[^\\s\\w.$@'\"`/\\\\]*";return Ce.regexLiterals&&(Ue+="(?!s*/)"),Ne.push([f,/^@[a-z_$][a-z_$@0-9]*/i,null],[l,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[f,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[u,new RegExp(Ue),null]),$(Le,Ne)}var de=fe({keywords:g,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ee(Ce,Le,Ne){for(var J=/(?:^|\s)nocode(?:\s|$)/,pe=/\r\n?|\n/,Te=Ce.ownerDocument,xe=Te.createElement("li");Ce.firstChild;)xe.appendChild(Ce.firstChild);var We=[xe];function He(ze){var nt=ze.nodeType;if(nt==1&&!J.test(ze.className))if(ze.nodeName==="br")Oe(ze),ze.parentNode&&ze.parentNode.removeChild(ze);else for(var it=ze.firstChild;it;it=it.nextSibling)He(it);else if((nt==3||nt==4)&&Ne){var je=ze.nodeValue,Ke=je.match(pe);if(Ke){var ae=je.substring(0,Ke.index);ze.nodeValue=ae;var ce=je.substring(Ke.index+Ke[0].length);if(ce){var ye=ze.parentNode;ye.insertBefore(Te.createTextNode(ce),ze.nextSibling)}Oe(ze),ae||ze.parentNode.removeChild(ze)}}}function Oe(ze){for(;!ze.nextSibling;)if(ze=ze.parentNode,!ze)return;function nt(Ke,ae){var ce=ae?Ke.cloneNode(!1):Ke,ye=Ke.parentNode;if(ye){var Q=nt(ye,1),q=Ke.nextSibling;Q.appendChild(ce);for(var se=q;se;se=q)q=se.nextSibling,Q.appendChild(se)}return ce}for(var it=nt(ze.nextSibling,0),je;(je=it.parentNode)&&je.nodeType===1;)it=je;We.push(it)}for(var Ue=0;Ue<We.length;++Ue)He(We[Ue]);Le===(Le|0)&&We[0].setAttribute("value",Le);var Qe=Te.createElement("ol");Qe.className="linenums";for(var Ze=Math.max(0,Le-1|0)||0,Ue=0,Je=We.length;Ue<Je;++Ue)xe=We[Ue],xe.className="L"+(Ue+Ze)%10,xe.firstChild||xe.appendChild(Te.createTextNode("\xA0")),Qe.appendChild(xe);Ce.appendChild(Qe)}function ie(Ce){var Le=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Le=Le&&+Le[1]<=8;var Ne=/\n/g,J=Ce.sourceCode,pe=J.length,Te=0,xe=Ce.spans,We=xe.length,He=0,Oe=Ce.decorations,Ue=Oe.length,Qe=0;Oe[Ue]=pe;var Ze,Je;for(Je=Ze=0;Je<Ue;)Oe[Je]!==Oe[Je+2]?(Oe[Ze++]=Oe[Je++],Oe[Ze++]=Oe[Je++]):Je+=2;for(Ue=Ze,Je=Ze=0;Je<Ue;){for(var ze=Oe[Je],nt=Oe[Je+1],it=Je+2;it+2<=Ue&&Oe[it+1]===nt;)it+=2;Oe[Ze++]=ze,Oe[Ze++]=nt,Je=it}Ue=Oe.length=Ze;var je=Ce.sourceNode,Ke="";je&&(Ke=je.style.display,je.style.display="none");try{for(var ae=null;He<We;){var ce=xe[He],ye=xe[He+2]||pe,Q=Oe[Qe+2]||pe,it=Math.min(ye,Q),q=xe[He+1],se;if(q.nodeType!==1&&(se=J.substring(Te,it))){Le&&(se=se.replace(Ne,"\r")),q.nodeValue=se;var me=q.ownerDocument,De=me.createElement("span");De.className=Oe[Qe+1];var Be=q.parentNode;Be.replaceChild(De,q),De.appendChild(q),Te<ye&&(xe[He+1]=q=me.createTextNode(J.substring(it,ye)),Be.insertBefore(q,De.nextSibling))}Te=it,Te>=ye&&(He+=2),Te>=Q&&(Qe+=2)}}finally{je&&(je.style.display=Ke)}}var ge={};function Z(Ce,Le){for(var Ne=Le.length;--Ne>=0;){var J=Le[Ne];ge.hasOwnProperty(J)?M.console&&console.warn("cannot override language handler %s",J):ge[J]=Ce}}function Y(Ce,Le){return Ce&&ge.hasOwnProperty(Ce)||(Ce=/^\s*</.test(Le)?"default-markup":"default-code"),ge[Ce]}Z(de,["default-code"]),Z($([],[[h,/^[^<?]+/],[v,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Z($([[h,/^[\s]+/,null,` \r
|
|
`],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[L,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Z($([],[[I,/^[\s\S]+/]]),["uq.val"]),Z(fe({keywords:c,hashComments:!0,cStyleComments:!0,types:p}),["c","cc","cpp","cxx","cyc","m"]),Z(fe({keywords:"null,true,false"}),["json"]),Z(fe({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:p}),["cs"]),Z(fe({keywords:d,cStyleComments:!0}),["java"]),Z(fe({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Z(fe({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Z(fe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Z(fe({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Z(fe({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Z(fe({keywords:i,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Z($([],[[m,/^[\s\S]+/]]),["regex"]);function Se(Ce){var Le=Ce.langExtension;try{var Ne=R(Ce.sourceNode,Ce.pre),J=Ne.sourceCode;Ce.sourceCode=J,Ce.spans=Ne.spans,Ce.basePos=0,Y(Le,J)(Ce),ie(Ce)}catch(pe){M.console&&console.log(pe&&pe.stack||pe)}}function Pe(Ce,Le,Ne){var J=Ne||!1,pe=Le||null,Te=document.createElement("div");Te.innerHTML="<pre>"+Ce+"</pre>",Te=Te.firstChild,J&&ee(Te,J,!0);var xe={langExtension:pe,numberLines:J,sourceNode:Te,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Se(xe),Te.innerHTML}function ke(Ce,Le){var Ne=Le||document.body,J=Ne.ownerDocument||document;function pe(ce){return Ne.getElementsByTagName(ce)}for(var Te=[pe("pre"),pe("code"),pe("xmp")],xe=[],We=0;We<Te.length;++We)for(var He=0,Oe=Te[We].length;He<Oe;++He)xe.push(Te[We][He]);Te=null;var Ue=Date;Ue.now||(Ue={now:function(){return+new Date}});var Qe=0,Ze=/\blang(?:uage)?-([\w.]+)(?!\S)/,Je=/\bprettyprint\b/,ze=/\bprettyprinted\b/,nt=/pre|xmp/i,it=/^code$/i,je=/^(?:pre|code|xmp)$/i,Ke={};function ae(){for(var ce=M.PR_SHOULD_USE_CONTINUATION?Ue.now()+250:Infinity;Qe<xe.length&&Ue.now()<ce;Qe++){for(var ye=xe[Qe],Q=Ke,q=ye;q=q.previousSibling;){var se=q.nodeType,me=(se===7||se===8)&&q.nodeValue;if(me?!/^\??prettify\b/.test(me):se!==3||/\S/.test(q.nodeValue))break;if(me){Q={},me.replace(/\b(\w+)=([\w:.%+-]+)/g,function($t,bt,en){Q[bt]=en});break}}var De=ye.className;if((Q!==Ke||Je.test(De))&&!ze.test(De)){for(var Be=!1,Xe=ye.parentNode;Xe;Xe=Xe.parentNode){var ut=Xe.tagName;if(je.test(ut)&&Xe.className&&Je.test(Xe.className)){Be=!0;break}}if(!Be){ye.className+=" prettyprinted";var vt=Q.lang;if(!vt){vt=De.match(Ze);var dt;!vt&&(dt=oe(ye))&&it.test(dt.tagName)&&(vt=dt.className.match(Ze)),vt&&(vt=vt[1])}var _t;if(nt.test(ye.tagName))_t=1;else{var xt=ye.currentStyle,rt=J.defaultView,Yt=xt?xt.whiteSpace:rt&&rt.getComputedStyle?rt.getComputedStyle(ye,null).getPropertyValue("white-space"):0;_t=Yt&&Yt.substring(0,3)==="pre"}var It=Q.linenums;(It=It==="true"||+It)||(It=De.match(/\blinenums\b(?::(\d+))?/),It=It?It[1]&&It[1].length?+It[1]:!0:!1),It&&ee(ye,It,_t);var qt={langExtension:vt,sourceNode:ye,numberLines:It,pre:_t,sourceCode:null,basePos:null,spans:null,decorations:null};Se(qt)}}}Qe<xe.length?M.setTimeout(ae,250):typeof Ce=="function"&&Ce()}ae()}var Re=M.PR={createSimpleLexer:$,registerLangHandler:Z,sourceDecorator:fe,PR_ATTRIB_NAME:L,PR_ATTRIB_VALUE:I,PR_COMMENT:_,PR_DECLARATION:v,PR_KEYWORD:b,PR_LITERAL:f,PR_NOCODE:A,PR_PLAIN:h,PR_PUNCTUATION:u,PR_SOURCE:S,PR_STRING:m,PR_TAG:E,PR_TYPE:l,prettyPrintOne:O?M.prettyPrintOne=Pe:D=Pe,prettyPrint:B=O?M.prettyPrint=ke:B=ke},Me=M.define;typeof Me=="function"&&Me.amd&&Me("google-code-prettify",[],function(){return Re})})()},T8No:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return B}),U.d(ve,"e",function(){return M}),U.d(ve,"c",function(){return u}),U.d(ve,"b",function(){return h}),U.d(ve,"d",function(){return E}),U.d(ve,"f",function(){return L});var ne=U("MNsG"),W=U("N0LK"),O=U("Cg/j");let k=ne.k||"";const w=new Map;w.set("false",!1),w.set("true",!0),w.set("isMac",ne.f),w.set("isLinux",ne.d),w.set("isWindows",ne.i),w.set("isWeb",ne.h),w.set("isMacNative",ne.f&&!ne.h),w.set("isEdge",k.indexOf("Edg/")>=0),w.set("isFirefox",k.indexOf("Firefox")>=0),w.set("isChrome",k.indexOf("Chrome")>=0),w.set("isSafari",k.indexOf("Safari")>=0);const D=Object.prototype.hasOwnProperty;class B{static has(A){return c.create(A)}static equals(A,P){return d.create(A,P)}static regex(A,P){return m.create(A,P)}static not(A){return s.create(A)}static and(...A){return l.create(A,null)}static or(...A){return f.create(A,null,!0)}static deserialize(A,P=!1){return A?this._deserializeOrExpression(A,P):void 0}static _deserializeOrExpression(A,P){let H=A.split("||");return f.create(H.map(R=>this._deserializeAndExpression(R,P)),null,!0)}static _deserializeAndExpression(A,P){let H=A.split("&&");return l.create(H.map(R=>this._deserializeOne(R,P)),null)}static _deserializeOne(A,P){if(A=A.trim(),A.indexOf("!=")>=0){let H=A.split("!=");return o.create(H[0].trim(),this._deserializeValue(H[1],P))}if(A.indexOf("==")>=0){let H=A.split("==");return d.create(H[0].trim(),this._deserializeValue(H[1],P))}if(A.indexOf("=~")>=0){let H=A.split("=~");return m.create(H[0].trim(),this._deserializeRegexValue(H[1],P))}if(A.indexOf(" in ")>=0){let H=A.split(" in ");return a.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const H=A.split(">=");return t.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const H=A.split(">");return n.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const H=A.split("<=");return p.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const H=A.split("<");return g.create(H[0].trim(),H[1].trim())}return/^\!\s*/.test(A)?s.create(A.substr(1).trim()):c.create(A)}static _deserializeValue(A,P){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let H=/^'([^']*)'$/.exec(A);return H?H[1].trim():A}static _deserializeRegexValue(A,P){if(Object(W.C)(A)){if(P)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let H=A.indexOf("/"),R=A.lastIndexOf("/");if(H===R||H<0){if(P)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let K=A.slice(H+1,R),z=A[R+1]==="i"?"i":"";try{return new RegExp(K,z)}catch(oe){if(P)throw new Error(`bad regexp-value '${A}', parse error: ${oe}`);return console.warn(`bad regexp-value '${A}', parse error: ${oe}`),null}}}function M(A,P){const H=A?A.substituteConstants():void 0,R=P?P.substituteConstants():void 0;return!H&&!R?!0:!H||!R?!1:H.equals(R)}function e(A,P){return A.cmp(P)}class C{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return y.INSTANCE}}C.INSTANCE=new C;class y{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return C.INSTANCE}}y.INSTANCE=new y;class c{constructor(A,P){this.key=A,this.negated=P,this.type=2}static create(A,P=null){const H=w.get(A);return typeof H=="boolean"?H?y.INSTANCE:C.INSTANCE:new c(A,P)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=w.get(this.key);return typeof A=="boolean"?A?y.INSTANCE:C.INSTANCE:this}evaluate(A){return!!A.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 d{constructor(A,P,H){this.key=A,this.value=P,this.negated=H,this.type=4}static create(A,P,H=null){if(typeof P=="boolean")return P?c.create(A,H):s.create(A,H);const R=w.get(A);if(typeof R=="boolean"){const K=R?"true":"false";return P===K?y.INSTANCE:C.INSTANCE}return new d(A,P,H)}cmp(A){return A.type!==this.type?this.type-A.type:S(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=w.get(this.key);if(typeof A=="boolean"){const P=A?"true":"false";return this.value===P?y.INSTANCE:C.INSTANCE}return this}evaluate(A){return A.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 a{constructor(A,P){this.key=A,this.valueKey=P,this.type=10,this.negated=null}static create(A,P){return new a(A,P)}cmp(A){return A.type!==this.type?this.type-A.type:S(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const P=A.getValue(this.valueKey),H=A.getValue(this.key);return Array.isArray(P)?P.indexOf(H)>=0:typeof H=="string"&&typeof P=="object"&&P!==null?D.call(P,H):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=i.create(this)),this.negated}}class i{constructor(A){this._actual=A,this.type=11}static create(A){return new i(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class o{constructor(A,P,H){this.key=A,this.value=P,this.negated=H,this.type=5}static create(A,P,H=null){if(typeof P=="boolean")return P?s.create(A,H):c.create(A,H);const R=w.get(A);if(typeof R=="boolean"){const K=R?"true":"false";return P===K?C.INSTANCE:y.INSTANCE}return new o(A,P,H)}cmp(A){return A.type!==this.type?this.type-A.type:S(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=w.get(this.key);if(typeof A=="boolean"){const P=A?"true":"false";return this.value===P?C.INSTANCE:y.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class s{constructor(A,P){this.key=A,this.negated=P,this.type=3}static create(A,P=null){const H=w.get(A);return typeof H=="boolean"?H?C.INSTANCE:y.INSTANCE:new s(A,P)}cmp(A){return A.type!==this.type?this.type-A.type:v(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=w.get(this.key);return typeof A=="boolean"?A?C.INSTANCE:y.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this)),this.negated}}function r(A,P){if(typeof A=="string"){const H=parseFloat(A);isNaN(H)||(A=H)}return typeof A=="string"||typeof A=="number"?P(A):C.INSTANCE}class n{constructor(A,P,H){this.key=A,this.value=P,this.negated=H,this.type=12}static create(A,P,H=null){return r(P,R=>new n(A,R,H))}cmp(A){return A.type!==this.type?this.type-A.type:S(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class t{constructor(A,P,H){this.key=A,this.value=P,this.negated=H,this.type=13}static create(A,P,H=null){return r(P,R=>new t(A,R,H))}cmp(A){return A.type!==this.type?this.type-A.type:S(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this.value,this)),this.negated}}class g{constructor(A,P,H){this.key=A,this.value=P,this.negated=H,this.type=14}static create(A,P,H=null){return r(P,R=>new g(A,R,H))}cmp(A){return A.type!==this.type?this.type-A.type:S(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.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 p{constructor(A,P,H){this.key=A,this.value=P,this.negated=H,this.type=15}static create(A,P,H=null){return r(P,R=>new p(A,R,H))}cmp(A){return A.type!==this.type?this.type-A.type:S(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class m{constructor(A,P){this.key=A,this.regexp=P,this.type=7,this.negated=null}static create(A,P){return new m(A,P)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const P=this.regexp?this.regexp.source:"",H=A.regexp?A.regexp.source:"";return P<H?-1:P>H?1:0}equals(A){if(A.type===this.type){const P=this.regexp?this.regexp.source:"",H=A.regexp?A.regexp.source:"";return this.key===A.key&&P===H}return!1}substituteConstants(){return this}evaluate(A){let P=A.getValue(this.key);return this.regexp?this.regexp.test(P):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this)),this.negated}}class b{constructor(A){this._actual=A,this.type=8}static create(A){return new b(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function _(A){let P=null;for(let H=0,R=A.length;H<R;H++){const K=A[H].substituteConstants();if(A[H]!==K&&P===null){P=[];for(let z=0;z<H;z++)P[z]=A[z]}P!==null&&(P[H]=K)}return P===null?A:P}class l{constructor(A,P){this.expr=A,this.negated=P,this.type=6}static create(A,P){return l._normalizeArr(A,P)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let P=0,H=this.expr.length;P<H;P++){const R=e(this.expr[P],A.expr[P]);if(R!==0)return R}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].equals(A.expr[P]))return!1;return!0}return!1}substituteConstants(){const A=_(this.expr);return A===this.expr?this:l.create(A,this.negated)}evaluate(A){for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].evaluate(A))return!1;return!0}static _normalizeArr(A,P){const H=[];let R=!1;for(const K of A){if(!K)continue;if(K.type===1){R=!0;continue}if(K.type===0)return C.INSTANCE;if(K.type===6){H.push(...K.expr);continue}H.push(K)}if(H.length===0&&R)return y.INSTANCE;if(H.length===0)return;if(H.length===1)return H[0];H.sort(e);for(let K=1;K<H.length;K++)H[K-1].equals(H[K])&&(H.splice(K,1),K--);if(H.length===1)return H[0];for(;H.length>1;){const K=H[H.length-1];if(K.type!==9)break;H.pop();const z=H.pop(),oe=H.length===0,$=f.create(K.expr.map(fe=>l.create([fe,z],null)),null,oe);$&&(H.push($),H.sort(e))}return H.length===1?H[0]:new l(H,P)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let P of this.expr)A.push(...P.keys());return A}negate(){if(!this.negated){const A=[];for(let P of this.expr)A.push(P.negate());this.negated=f.create(A,this,!0)}return this.negated}}class f{constructor(A,P){this.expr=A,this.negated=P,this.type=9}static create(A,P,H){return f._normalizeArr(A,P,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let P=0,H=this.expr.length;P<H;P++){const R=e(this.expr[P],A.expr[P]);if(R!==0)return R}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].equals(A.expr[P]))return!1;return!0}return!1}substituteConstants(){const A=_(this.expr);return A===this.expr?this:f.create(A,this.negated,!1)}evaluate(A){for(let P=0,H=this.expr.length;P<H;P++)if(this.expr[P].evaluate(A))return!0;return!1}static _normalizeArr(A,P,H){let R=[],K=!1;if(A){for(let z=0,oe=A.length;z<oe;z++){const $=A[z];if(!$)continue;if($.type===0){K=!0;continue}if($.type===1)return y.INSTANCE;if($.type===9){R=R.concat($.expr);continue}R.push($)}if(R.length===0&&K)return C.INSTANCE;R.sort(e)}if(R.length===0)return;if(R.length===1)return R[0];for(let z=1;z<R.length;z++)R[z-1].equals(R[z])&&(R.splice(z,1),z--);if(R.length===1)return R[0];if(H){for(let z=0;z<R.length;z++)for(let oe=z+1;oe<R.length;oe++)L(R[z],R[oe])&&(R.splice(oe,1),oe--);if(R.length===1)return R[0]}return new f(R,P)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let P of this.expr)A.push(...P.keys());return A}negate(){if(!this.negated){let A=[];for(let P of this.expr)A.push(P.negate());for(;A.length>1;){const P=A.shift(),H=A.shift(),R=[];for(const z of I(P))for(const oe of I(H))R.push(l.create([z,oe],null));const K=A.length===0;A.unshift(f.create(R,null,K))}this.negated=A[0]}return this.negated}}class u extends c{constructor(A,P,H){super(A,null);this._defaultValue=P,typeof H=="object"?u._info.push(Object.assign(Object.assign({},H),{key:A})):H!==!0&&u._info.push({key:A,description:H,type:P!=null?typeof P:void 0})}static all(){return u._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return d.create(this.key,A)}}u._info=[];const h=Object(O.c)("contextKeyService"),E="setContext";function v(A,P){return A<P?-1:A>P?1:0}function S(A,P,H,R){return A<H?-1:A>H?1:P<R?-1:P>R?1:0}function L(A,P){if(P.type===6&&A.type!==9&&A.type!==6){for(const K of P.expr)if(A.equals(K))return!0}const H=A.negate(),R=I(H).concat(I(P));R.sort(e);for(let K=0;K<R.length;K++){const z=R[K],oe=z.negate();for(let $=K+1;$<R.length;$++){const fe=R[$];if(oe.equals(fe))return!0}}return!1}function I(A){return A.type===9?A.expr:[A]}},TXwP:function(qe,ve,U){var ne,W;(function(){var O;(function(){"use strict";var w=[,,function(e){function C(d){this.__parent=d,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}C.prototype.clone_empty=function(){var d=new C(this.__parent);return d.set_indent(this.__indent_count,this.__alignment_count),d},C.prototype.item=function(d){return d<0?this.__items[this.__items.length+d]:this.__items[d]},C.prototype.has_match=function(d){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(d))return!0;return!1},C.prototype.set_indent=function(d,a){this.is_empty()&&(this.__indent_count=d||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},C.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},C.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},C.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var d=this.__parent.current_line;return d.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),d.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),d.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,d.__items[0]===" "&&(d.__items.splice(0,1),d.__character_count-=1),!0}return!1},C.prototype.is_empty=function(){return this.__items.length===0},C.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},C.prototype.push=function(d){this.__items.push(d);var a=d.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=d.length-a:this.__character_count+=d.length},C.prototype.pop=function(){var d=null;return this.is_empty()||(d=this.__items.pop(),this.__character_count-=d.length),d},C.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},C.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},C.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},C.prototype.toString=function(){var d="";return this.is_empty()?this.__parent.indent_empty_lines&&(d=this.__parent.get_indent_string(this.__indent_count)):(d=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),d+=this.__items.join("")),d};function y(d,a){this.__cache=[""],this.__indent_size=d.indent_size,this.__indent_string=d.indent_char,d.indent_with_tabs||(this.__indent_string=new Array(d.indent_size+1).join(d.indent_char)),a=a||"",d.indent_level>0&&(a=new Array(d.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}y.prototype.get_indent_size=function(d,a){var i=this.__base_string_length;return a=a||0,d<0&&(i=0),i+=d*this.__indent_size,i+=a,i},y.prototype.get_indent_string=function(d,a){var i=this.__base_string;return a=a||0,d<0&&(d=0,i=""),a+=d*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},y.prototype.__ensure_cache=function(d){for(;d>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var d=this.__cache.length,a=0,i="";this.__indent_size&&d>=this.__indent_size&&(a=Math.floor(d/this.__indent_size),d-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),d&&(i+=new Array(d+1).join(" ")),this.__cache.push(i)};function c(d,a){this.__indent_cache=new y(d,a),this.raw=!1,this._end_with_newline=d.end_with_newline,this.indent_size=d.indent_size,this.wrap_line_length=d.wrap_line_length,this.indent_empty_lines=d.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new C(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(d,a){return this.__indent_cache.get_indent_string(d,a)},c.prototype.get_indent_size=function(d,a){return this.__indent_cache.get_indent_size(d,a)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(d){return this.is_empty()||!d&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(d){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
|
|
`);return d!==`
|
|
`&&(i=i.replace(/[\n]/g,d)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(d,a){return d=d||0,a=a||0,this.next_line.set_indent(d,a),this.__lines.length>1?(this.current_line.set_indent(d,a),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(d){for(var a=0;a<d.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(d.whitespace_before),this.current_line.push(d.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(d){this.__add_space_before_token(),this.current_line.push(d),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.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(" "))},c.prototype.remove_indent=function(d){for(var a=this.__lines.length;d<a;)this.__lines[d]._remove_indent(),d++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(d){for(d=d===void 0?!1:d,this.current_line.trim();d&&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},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(d,a){for(var i=this.__lines.length-2;i>=0;){var o=this.__lines[i];if(o.is_empty())break;if(o.item(0).indexOf(d)!==0&&o.item(-1)!==a){this.__lines.splice(i+1,0,new C(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=c},,,,function(e){function C(d,a){this.raw_options=y(d,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}C.prototype._get_array=function(d,a){var i=this.raw_options[d],o=a||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(o=i.concat()):typeof i=="string"&&(o=i.split(/[^a-zA-Z0-9_\/\-]+/)),o},C.prototype._get_boolean=function(d,a){var i=this.raw_options[d],o=i===void 0?!!a:!!i;return o},C.prototype._get_characters=function(d,a){var i=this.raw_options[d],o=a||"";return typeof i=="string"&&(o=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},C.prototype._get_number=function(d,a){var i=this.raw_options[d];a=parseInt(a,10),isNaN(a)&&(a=0);var o=parseInt(i,10);return isNaN(o)&&(o=a),o},C.prototype._get_selection=function(d,a,i){var o=this._get_selection_list(d,a,i);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+d+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[d]+"'");return o[0]},C.prototype._get_selection_list=function(d,a,i){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[a[0]],!this._is_valid_selection(i,a))throw new Error("Invalid Default Value!");var o=this._get_array(d,i);if(!this._is_valid_selection(o,a))throw new Error("Invalid Option Value: The option '"+d+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[d]+"'");return o},C.prototype._is_valid_selection=function(d,a){return d.length&&a.length&&!d.some(function(i){return a.indexOf(i)===-1})};function y(d,a){var i={};d=c(d);var o;for(o in d)o!==a&&(i[o]=d[o]);if(a&&d[a])for(o in d[a])i[o]=d[a][o];return i}function c(d){var a={},i;for(i in d){var o=i.replace(/-/g,"_");a[o]=d[i]}return a}e.exports.Options=C,e.exports.normalizeOpts=c,e.exports.mergeOpts=y},,function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function y(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},y.prototype.peek=function(c){var d=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(d=this.__input.charAt(c)),d},y.prototype.__match=function(c,d){c.lastIndex=d;var a=c.exec(this.__input);return a&&!(C&&c.sticky)&&(a.index!==d&&(a=null)),a},y.prototype.test=function(c,d){return d=d||0,d+=this.__position,d>=0&&d<this.__input_length?!!this.__match(c,d):!1},y.prototype.testChar=function(c,d){var a=this.peek(d);return c.lastIndex=0,a!==null&&c.test(a)},y.prototype.match=function(c){var d=this.__match(c,this.__position);return d?this.__position+=d[0].length:d=null,d},y.prototype.read=function(c,d,a){var i="",o;return c&&(o=this.match(c),o&&(i+=o[0])),d&&(o||!c)&&(i+=this.readUntil(d,a)),i},y.prototype.readUntil=function(c,d){var a="",i=this.__position;c.lastIndex=this.__position;var o=c.exec(this.__input);return o?(i=o.index,d&&(i+=o[0].length)):i=this.__input_length,a=this.__input.substring(this.__position,i),this.__position=i,a},y.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},y.prototype.get_regexp=function(c,d){var a=null,i="g";return d&&C&&(i="y"),typeof c=="string"&&c!==""?a=new RegExp(c,i):c&&(a=new RegExp(c.source,i)),a},y.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(c){var d=this.__position,a=this.readUntilAfter(c);return this.__position=d,a},y.prototype.lookBack=function(c){var d=this.__position-1;return d>=c.length&&this.__input.substring(d-c.length,d).toLowerCase()===c},e.exports.InputScanner=y},,,,,function(e){function C(y,c){y=typeof y=="string"?y:y.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+c,"g")}C.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var d=this.__directive_pattern.exec(y);d;)c[d[1]]=d[2],d=this.__directive_pattern.exec(y);return c},C.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},,function(e,C,y){var c=y(16).Beautifier,d=y(17).Options;function a(i,o){var s=new c(i,o);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new d}},function(e,C,y){var c=y(17).Options,d=y(2).Output,a=y(8).InputScanner,i=y(13).Directives,o=new i(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,n=/\s/,t=/(?:\s|\n)+/g,g=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,p=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function m(b,_){this._source_text=b||"",this._options=new c(_),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}m.prototype.eatString=function(b){var _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(b.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return _},m.prototype.eatWhitespace=function(b){for(var _=n.test(this._input.peek()),l=0;n.test(this._input.peek());)this._ch=this._input.next(),b&&this._ch===`
|
|
`&&((l===0||l<this._options.max_preserve_newlines)&&(l++,this._output.add_new_line(!0)));return _},m.prototype.foundNestedPseudoClass=function(){for(var b=0,_=1,l=this._input.peek(_);l;){if(l==="{")return!0;if(l==="(")b+=1;else if(l===")"){if(b===0)return!1;b-=1}else if(l===";"||l==="}")return!1;_++,l=this._input.peek(_)}return!1},m.prototype.print_string=function(b){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(b)},m.prototype.preserveSingleSpace=function(b){b&&(this._output.space_before_token=!0)},m.prototype.indent=function(){this._indentLevel++},m.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b=this._source_text,_=this._options.eol;_==="auto"&&(_=`
|
|
`,b&&s.test(b||"")&&(_=b.match(s)[0])),b=b.replace(r,`
|
|
`);var l=b.match(/^[\t ]*/)[0];this._output=new d(this._options,l),this._input=new a(b),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f=0,u=!1,h=!1,E=!1,v=!1,S=!1,L=!1,I=this._ch,A=!1,P,H,R;P=this._input.read(t),H=P!=="",R=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 K=this._input.read(g),z=o.get_directives(K);z&&z.ignore==="start"&&(K+=o.readIgnored(this._input)),this.print_string(K),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(p)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(H),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var oe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);oe.match(/[ :]$/)&&(oe=this.eatString(": ").replace(/\s$/,""),this.print_string(oe),this._output.space_before_token=!0),oe=oe.replace(/\s$/,""),oe==="extend"?v=!0:oe==="import"&&(S=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!u&&f===0&&oe.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(H),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),E?(E=!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)):(R==="("?this._output.space_before_token=!1:R!==","&&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(),R==="{"&&this._output.trim(!0),S=!1,v=!1,h&&(this.outdent(),h=!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 $=0;$<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;$++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[$])){A=!0;break}(u||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!v&&f===0?(this.print_string(":"),h||(h=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var fe=R==='"'||R==="'";this.preserveSingleSpace(fe||H),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,f===0?(h&&(this.outdent(),h=!1),v=!1,S=!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(),f++,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(")")),f&&(f--,this.outdent()));else{var de=!1;this._input.lookBack("with")&&(de=!0),this.preserveSingleSpace(H||de),this.print_string(this._ch),h&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),L=!0):(this.eatWhitespace(),f++,this.indent())}else if(this._ch===")")f&&(f--,this.outdent()),L&&this._input.peek()===";"&&this._options.selector_separator_newline&&(L=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!h||L)&&f===0&&!S&&!v?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&f===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&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(H),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.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 ee=R==='"'||R==="'";this.preserveSingleSpace(ee||H),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&A&&this._output.add_new_line()}var ie=this._output.get_code(_);return ie},e.exports.Beautifier=m},function(e,C,y){var c=y(6).Options;function d(a){c.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var i=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||i;var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<o.length;s++)o[s]!=="expand"?this.brace_style="collapse":this.brace_style=o[s]}d.prototype=new c,e.exports.Options=d}],D={};function B(e){var C=D[e];if(C!==void 0)return C.exports;var y=D[e]={exports:{}};return w[e](y,y.exports,B),y.exports}var M=B(15);O=M})();var k=O;!(ne=[],W=function(){return{css_beautify:k}}.apply(ve,ne),W!==void 0&&(qe.exports=W))})()},Vhoy:function(qe,ve,U){"use strict";U.d(ve,"d",function(){return k}),U.d(ve,"e",function(){return w}),U.d(ve,"c",function(){return D}),U.d(ve,"b",function(){return B}),U.d(ve,"a",function(){return M});var ne=U("MI8n");class W{constructor(){this._icons=new Map,this._onDidRegister=new ne.b}add(e){const C=this._icons.get(e.id);C?e.description?C.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const O=new W,k=O;function w(e,C){return new B(e,C)}function D(e){return e?e.replace(/\$\((.*?)\)/g,(C,y)=>` ${y} `).trim():""}class B{constructor(e,C,y){this.id=e,this.definition=C,this.description=y,O.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var M;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const C=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function y(a){if(a instanceof B)return["codicon","codicon-"+a.id];const i=C.exec(a.id);if(!i)return y(B.error);let[,o,s]=i;const r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s.substr(1)),r}e.asClassNameArray=y;function c(a){return y(a).join(" ")}e.asClassName=c;function d(a){return"."+y(a).join(".")}e.asCSSSelector=d})(M||(M={})),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"})}(B||(B={}))},WaYH:function(qe,ve,U){"use strict";var ne=U("rePB"),W=U("Ff2n"),O=U("VTBJ"),k=U("1OyB"),w=U("vuIU"),D=U("JX7q"),B=U("Ji7U"),M=U("LK+K"),e=U("q1tI"),C=U("TSYQ"),y=U.n(C),c=U("sboe"),d=U("OZM5"),a=function(b){var _=b.prefixCls,l=b.level,f=b.isStart,u=b.isEnd;if(!l)return null;for(var h="".concat(_,"-indent-unit"),E=[],v=0;v<l;v+=1){var S;E.push(e.createElement("span",{key:v,className:y()(h,(S={},Object(ne.a)(S,"".concat(h,"-start"),f[v+1]),Object(ne.a)(S,"".concat(h,"-end"),u[v+1]),Object(ne.a)(S,"".concat(h,"-end-first-level"),!v&&u[0]),S))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(_,"-indent")},E)},i=a,o=U("815F"),s="open",r="close",n="---",t=function(m){Object(B.a)(_,m);var b=Object(M.a)(_);function _(){var l;return Object(k.a)(this,_),l=b.apply(this,arguments),l.state={dragNodeHighlight:!1},l.onSelectorClick=function(f){var u=l.props.context.onNodeClick;u(f,Object(o.b)(l.props)),l.isSelectable()?l.onSelect(f):l.onCheck(f)},l.onSelectorDoubleClick=function(f){var u=l.props.context.onNodeDoubleClick;u(f,Object(o.b)(l.props))},l.onSelect=function(f){if(l.isDisabled())return;var u=l.props.context.onNodeSelect;f.preventDefault(),u(f,Object(o.b)(l.props))},l.onCheck=function(f){if(l.isDisabled())return;var u=l.props,h=u.disableCheckbox,E=u.checked,v=l.props.context.onNodeCheck;if(!l.isCheckable()||h)return;f.preventDefault();var S=!E;v(f,Object(o.b)(l.props),S)},l.onMouseEnter=function(f){var u=l.props.context.onNodeMouseEnter;u(f,Object(o.b)(l.props))},l.onMouseLeave=function(f){var u=l.props.context.onNodeMouseLeave;u(f,Object(o.b)(l.props))},l.onContextMenu=function(f){var u=l.props.context.onNodeContextMenu;u(f,Object(o.b)(l.props))},l.onDragStart=function(f){var u=l.props.context.onNodeDragStart;f.stopPropagation(),l.setState({dragNodeHighlight:!0}),u(f,Object(D.a)(l));try{f.dataTransfer.setData("text/plain","")}catch(h){}},l.onDragEnter=function(f){var u=l.props.context.onNodeDragEnter;f.preventDefault(),f.stopPropagation(),u(f,Object(D.a)(l))},l.onDragOver=function(f){var u=l.props.context.onNodeDragOver;f.preventDefault(),f.stopPropagation(),u(f,Object(D.a)(l))},l.onDragLeave=function(f){var u=l.props.context.onNodeDragLeave;f.stopPropagation(),u(f,Object(D.a)(l))},l.onDragEnd=function(f){var u=l.props.context.onNodeDragEnd;f.stopPropagation(),l.setState({dragNodeHighlight:!1}),u(f,Object(D.a)(l))},l.onDrop=function(f){var u=l.props.context.onNodeDrop;f.preventDefault(),f.stopPropagation(),l.setState({dragNodeHighlight:!1}),u(f,Object(D.a)(l))},l.onExpand=function(f){var u=l.props.context.onNodeExpand;u(f,Object(o.b)(l.props))},l.setSelectHandle=function(f){l.selectHandle=f},l.getNodeState=function(){var f=l.props.expanded;return l.isLeaf()?null:f?s:r},l.hasChildren=function(){var f=l.props.eventKey,u=l.props.context.keyEntities,h=u[f]||{},E=h.children;return!!(E||[]).length},l.isLeaf=function(){var f=l.props,u=f.isLeaf,h=f.loaded,E=l.props.context.loadData,v=l.hasChildren();return u===!1?!1:u||!E&&!v||E&&h&&!v},l.isDisabled=function(){var f=l.props.disabled,u=l.props.context.disabled;return!!(u||f)},l.isCheckable=function(){var f=l.props.checkable,u=l.props.context.checkable;return!u||f===!1?!1:u},l.syncLoadData=function(f){var u=f.expanded,h=f.loading,E=f.loaded,v=l.props.context,S=v.loadData,L=v.onNodeLoad;if(h)return;S&&u&&!l.isLeaf()&&(!l.hasChildren()&&!E&&L(Object(o.b)(l.props)))},l.renderSwitcher=function(){var f=l.props,u=f.expanded,h=f.switcherIcon,E=l.props.context,v=E.prefixCls,S=E.switcherIcon,L=h||S;if(l.isLeaf())return e.createElement("span",{className:y()("".concat(v,"-switcher"),"".concat(v,"-switcher-noop"))},typeof L=="function"?L(Object(O.a)(Object(O.a)({},l.props),{},{isLeaf:!0})):L);var I=y()("".concat(v,"-switcher"),"".concat(v,"-switcher_").concat(u?s:r));return e.createElement("span",{onClick:l.onExpand,className:I},typeof L=="function"?L(Object(O.a)(Object(O.a)({},l.props),{},{isLeaf:!1})):L)},l.renderCheckbox=function(){var f=l.props,u=f.checked,h=f.halfChecked,E=f.disableCheckbox,v=l.props.context.prefixCls,S=l.isDisabled(),L=l.isCheckable();if(!L)return null;var I=typeof L!="boolean"?L:null;return e.createElement("span",{className:y()("".concat(v,"-checkbox"),u&&"".concat(v,"-checkbox-checked"),!u&&h&&"".concat(v,"-checkbox-indeterminate"),(S||E)&&"".concat(v,"-checkbox-disabled")),onClick:l.onCheck},I)},l.renderIcon=function(){var f=l.props.loading,u=l.props.context.prefixCls;return e.createElement("span",{className:y()("".concat(u,"-iconEle"),"".concat(u,"-icon__").concat(l.getNodeState()||"docu"),f&&"".concat(u,"-icon_loading"))})},l.renderSelector=function(){var f=l.state.dragNodeHighlight,u=l.props,h=u.title,E=u.selected,v=u.icon,S=u.loading,L=u.data,I=l.props.context,A=I.prefixCls,P=I.showIcon,H=I.icon,R=I.draggable,K=I.loadData,z=I.titleRender,oe=l.isDisabled(),$="".concat(A,"-node-content-wrapper"),fe;if(P){var de=v||H;fe=de?e.createElement("span",{className:y()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof de=="function"?de(l.props):de):l.renderIcon()}else K&&S&&(fe=l.renderIcon());var ee;typeof h=="function"?ee=h(L):z?ee=z(L):ee=h;var ie=e.createElement("span",{className:"".concat(A,"-title")},ee);return e.createElement("span",{ref:l.setSelectHandle,title:typeof h=="string"?h:"",className:y()("".concat($),"".concat($,"-").concat(l.getNodeState()||"normal"),!oe&&(E||f)&&"".concat(A,"-node-selected"),!oe&&R&&"draggable"),draggable:!oe&&R||void 0,"aria-grabbed":!oe&&R||void 0,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,onContextMenu:l.onContextMenu,onClick:l.onSelectorClick,onDoubleClick:l.onSelectorDoubleClick,onDragStart:R?l.onDragStart:void 0},fe,ie)},l}return Object(w.a)(_,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var f=this.props.selectable,u=this.props.context.selectable;return typeof f=="boolean"?f:u}},{key:"render",value:function(){var f,u=this.props,h=u.eventKey,E=u.className,v=u.style,S=u.dragOver,L=u.dragOverGapTop,I=u.dragOverGapBottom,A=u.isLeaf,P=u.isStart,H=u.isEnd,R=u.expanded,K=u.selected,z=u.checked,oe=u.halfChecked,$=u.loading,fe=u.domRef,de=u.active,ee=u.onMouseMove,ie=Object(W.a)(u,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ge=this.props.context,Z=ge.prefixCls,Y=ge.filterTreeNode,Se=ge.draggable,Pe=ge.keyEntities,ke=this.isDisabled(),Re=Object(d.f)(ie),Me=Pe[h]||{},Ce=Me.level,Le=H[H.length-1];return e.createElement("div",Object.assign({ref:fe,className:y()(E,"".concat(Z,"-treenode"),(f={},Object(ne.a)(f,"".concat(Z,"-treenode-disabled"),ke),Object(ne.a)(f,"".concat(Z,"-treenode-switcher-").concat(R?"open":"close"),!A),Object(ne.a)(f,"".concat(Z,"-treenode-checkbox-checked"),z),Object(ne.a)(f,"".concat(Z,"-treenode-checkbox-indeterminate"),oe),Object(ne.a)(f,"".concat(Z,"-treenode-selected"),K),Object(ne.a)(f,"".concat(Z,"-treenode-loading"),$),Object(ne.a)(f,"".concat(Z,"-treenode-active"),de),Object(ne.a)(f,"".concat(Z,"-treenode-leaf-last"),Le),Object(ne.a)(f,"drag-over",!ke&&S),Object(ne.a)(f,"drag-over-gap-top",!ke&&L),Object(ne.a)(f,"drag-over-gap-bottom",!ke&&I),Object(ne.a)(f,"filter-node",Y&&Y(Object(o.b)(this.props))),f)),style:v,onDragEnter:Se?this.onDragEnter:void 0,onDragOver:Se?this.onDragOver:void 0,onDragLeave:Se?this.onDragLeave:void 0,onDrop:Se?this.onDrop:void 0,onDragEnd:Se?this.onDragEnd:void 0,onMouseMove:ee},Re),e.createElement(i,{prefixCls:Z,level:Ce,isStart:P,isEnd:H}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),_}(e.Component),g=function(b){return e.createElement(c.a.Consumer,null,function(_){return e.createElement(t,Object.assign({},b,{context:_}))})};g.displayName="TreeNode",g.defaultProps={title:n},g.isTreeNode=1;var p=ve.a=g},Y1PL:function(qe,ve,U){"use strict";U.r(ve),U.d(ve,"ResizableTextArea",function(){return oe});var ne=U("wx14"),W=U("1OyB"),O=U("vuIU"),k=U("Ji7U"),w=U("LK+K"),D=U("q1tI"),B=U("VTBJ"),M=U("rePB"),e=U("Zm9Q"),C=U("Kwbf"),y=U("c+Xe"),c=U("m+aA"),d=U("bdgK"),a=new Map;function i(de){de.forEach(function(ee){var ie,ge=ee.target;(ie=a.get(ge))===null||ie===void 0||ie.forEach(function(Z){return Z(ge)})})}var o=new d.default(i),s=null,r=null;function n(de,ee){a.has(de)||(a.set(de,new Set),o.observe(de)),a.get(de).add(ee)}function t(de,ee){a.has(de)&&(a.get(de).delete(ee),a.get(de).size||(o.unobserve(de),a.delete(de)))}var g=function(de){Object(k.a)(ie,de);var ee=Object(w.a)(ie);function ie(){return Object(W.a)(this,ie),ee.apply(this,arguments)}return Object(O.a)(ie,[{key:"render",value:function(){return this.props.children}}]),ie}(D.Component),p=D.createContext(null);function m(de){var ee=de.children,ie=de.onBatchResize,ge=D.useRef(0),Z=D.useRef([]),Y=D.useContext(p),Se=D.useCallback(function(Pe,ke,Re){ge.current+=1;var Me=ge.current;Z.current.push({size:Pe,element:ke,data:Re}),Promise.resolve().then(function(){Me===ge.current&&(ie==null||ie(Z.current),Z.current=[])}),Y==null||Y(Pe,ke,Re)},[ie,Y]);return D.createElement(p.Provider,{value:Se},ee)}function b(de){var ee=de.children,ie=de.disabled,ge=D.useRef(null),Z=D.useRef(null),Y=D.useContext(p),Se=D.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Pe=D.isValidElement(ee)&&Object(y.c)(ee),ke=Pe?ee.ref:null,Re=D.useMemo(function(){return Object(y.a)(ke,ge)},[ke,ge]),Me=D.useRef(de);Me.current=de;var Ce=D.useCallback(function(Le){var Ne=Me.current,J=Ne.onResize,pe=Ne.data,Te=Le.getBoundingClientRect(),xe=Te.width,We=Te.height,He=Le.offsetWidth,Oe=Le.offsetHeight,Ue=Math.floor(xe),Qe=Math.floor(We);if(Se.current.width!==Ue||Se.current.height!==Qe||Se.current.offsetWidth!==He||Se.current.offsetHeight!==Oe){var Ze={width:Ue,height:Qe,offsetWidth:He,offsetHeight:Oe};Se.current=Ze;var Je=He===Math.round(xe)?xe:He,ze=Oe===Math.round(We)?We:Oe,nt=Object(B.a)(Object(B.a)({},Ze),{},{offsetWidth:Je,offsetHeight:ze});Y==null||Y(nt,Le,pe),J&&Promise.resolve().then(function(){J(nt,Le)})}},[]);return D.useEffect(function(){var Le=Object(c.a)(ge.current)||Object(c.a)(Z.current);return Le&&!ie&&n(Le,Ce),function(){return t(Le,Ce)}},[ge.current,ie]),D.createElement(g,{ref:Z},Pe?D.cloneElement(ee,{ref:Re}):ee)}var _="rc-observer-key";function l(de){var ee=de.children,ie=Object(e.a)(ee);return ie.map(function(ge,Z){var Y=(ge==null?void 0:ge.key)||"".concat(_,"-").concat(Z);return D.createElement(b,Object(ne.a)({},de,{key:Y}),ge)})}l.Collection=m;var f=l,u=U("bT9E"),h=U("TSYQ"),E=U.n(h),v=`
|
|
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
|
|
`,S=["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"],L={},I;function A(de){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ie=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(ee&&L[ie])return L[ie];var ge=window.getComputedStyle(de),Z=ge.getPropertyValue("box-sizing")||ge.getPropertyValue("-moz-box-sizing")||ge.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(ge.getPropertyValue("padding-bottom"))+parseFloat(ge.getPropertyValue("padding-top")),Se=parseFloat(ge.getPropertyValue("border-bottom-width"))+parseFloat(ge.getPropertyValue("border-top-width")),Pe=S.map(function(Re){return"".concat(Re,":").concat(ge.getPropertyValue(Re))}).join(";"),ke={sizingStyle:Pe,paddingSize:Y,borderSize:Se,boxSizing:Z};return ee&&ie&&(L[ie]=ke),ke}function P(de){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ge=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)),de.getAttribute("wrap")?I.setAttribute("wrap",de.getAttribute("wrap")):I.removeAttribute("wrap");var Z=A(de,ee),Y=Z.paddingSize,Se=Z.borderSize,Pe=Z.boxSizing,ke=Z.sizingStyle;I.setAttribute("style","".concat(ke,";").concat(v)),I.value=de.value||de.placeholder||"";var Re=Number.MIN_SAFE_INTEGER,Me=Number.MAX_SAFE_INTEGER,Ce=I.scrollHeight,Le;if(Pe==="border-box"?Ce+=Se:Pe==="content-box"&&(Ce-=Y),ie!==null||ge!==null){I.value=" ";var Ne=I.scrollHeight-Y;ie!==null&&(Re=Ne*ie,Pe==="border-box"&&(Re=Re+Y+Se),Ce=Math.max(Re,Ce)),ge!==null&&(Me=Ne*ge,Pe==="border-box"&&(Me=Me+Y+Se),Le=Ce>Me?"":"hidden",Ce=Math.min(Me,Ce))}return{height:Ce,minHeight:Re,maxHeight:Me,overflowY:Le,resize:"none"}}var H=U("Gytx"),R=U.n(H),K;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(K||(K={}));var z=function(de){Object(k.a)(ie,de);var ee=Object(w.a)(ie);function ie(ge){var Z;return Object(W.a)(this,ie),Z=ee.call(this,ge),Z.nextFrameActionId=void 0,Z.resizeFrameId=void 0,Z.textArea=void 0,Z.saveTextArea=function(Y){Z.textArea=Y},Z.handleResize=function(Y){var Se=Z.state.resizeStatus,Pe=Z.props,ke=Pe.autoSize,Re=Pe.onResize;if(Se!==K.NONE)return;typeof Re=="function"&&Re(Y),ke&&Z.resizeOnNextFrame()},Z.resizeOnNextFrame=function(){cancelAnimationFrame(Z.nextFrameActionId),Z.nextFrameActionId=requestAnimationFrame(Z.resizeTextarea)},Z.resizeTextarea=function(){var Y=Z.props.autoSize;if(!Y||!Z.textArea)return;var Se=Y.minRows,Pe=Y.maxRows,ke=P(Z.textArea,!1,Se,Pe);Z.setState({textareaStyles:ke,resizeStatus:K.RESIZING},function(){cancelAnimationFrame(Z.resizeFrameId),Z.resizeFrameId=requestAnimationFrame(function(){Z.setState({resizeStatus:K.RESIZED},function(){Z.resizeFrameId=requestAnimationFrame(function(){Z.setState({resizeStatus:K.NONE}),Z.fixFirefoxAutoScroll()})})})})},Z.renderTextArea=function(){var Y=Z.props,Se=Y.prefixCls,Pe=Se===void 0?"rc-textarea":Se,ke=Y.autoSize,Re=Y.onResize,Me=Y.className,Ce=Y.disabled,Le=Z.state,Ne=Le.textareaStyles,J=Le.resizeStatus,pe=Object(u.a)(Z.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Te=E()(Pe,Me,Object(M.a)({},"".concat(Pe,"-disabled"),Ce));"value"in pe&&(pe.value=pe.value||"");var xe=Object(B.a)(Object(B.a)(Object(B.a)({},Z.props.style),Ne),J===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return D.createElement(f,{onResize:Z.handleResize,disabled:!(ke||Re)},D.createElement("textarea",Object(ne.a)({},pe,{className:Te,style:xe,ref:Z.saveTextArea})))},Z.state={textareaStyles:{},resizeStatus:K.NONE},Z}return Object(O.a)(ie,[{key:"componentDidUpdate",value:function(Z){(Z.value!==this.props.value||!R()(Z.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 Z=this.textArea.selectionStart,Y=this.textArea.selectionEnd;this.textArea.setSelectionRange(Z,Y)}}catch(Se){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ie}(D.Component),oe=z,$=function(de){Object(k.a)(ie,de);var ee=Object(w.a)(ie);function ie(ge){var Z;Object(W.a)(this,ie),Z=ee.call(this,ge),Z.resizableTextArea=void 0,Z.focus=function(){Z.resizableTextArea.textArea.focus()},Z.saveTextArea=function(Se){Z.resizableTextArea=Se},Z.handleChange=function(Se){var Pe=Z.props.onChange;Z.setValue(Se.target.value,function(){Z.resizableTextArea.resizeTextarea()}),Pe&&Pe(Se)},Z.handleKeyDown=function(Se){var Pe=Z.props,ke=Pe.onPressEnter,Re=Pe.onKeyDown;Se.keyCode===13&&ke&&ke(Se),Re&&Re(Se)};var Y=typeof ge.value=="undefined"||ge.value===null?ge.defaultValue:ge.value;return Z.state={value:Y},Z}return Object(O.a)(ie,[{key:"setValue",value:function(Z,Y){"value"in this.props||this.setState({value:Z},Y)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return D.createElement(oe,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Z){return"value"in Z?{value:Z.value}:null}}]),ie}(D.Component),fe=ve.default=$},ZW9T:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return H});var ne=U("k1fw"),W=U("oBTY"),O=U("miYZ"),k=U("tsqr"),w=U("rAM+"),D=U("tJVT"),B=U("PpiC"),M=U("q1tI"),e=U.n(M),C=U("bdgK"),y=U("9og8"),c=U("WmNS"),d=U.n(c),a={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},i={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},o={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=U("5VLF"),n=U.n(r),t={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},g=function(K,z){return z.map(function(oe){return{label:oe,kind:K.languages.CompletionItemKind.Keyword,insertText:oe}})},p=function(K){return Object.keys(t.tables).map(function(z){return{label:z,kind:K.languages.CompletionItemKind.Variable,insertText:z}})},m=function(K,z){var oe=t.tables[K];return oe?oe.map(function($){return{label:$,kind:z.languages.CompletionItemKind.Field,insertText:$}}):[]};function b(R,K,z,oe,$){var fe=K.getWordUntilPosition(z),de={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:fe.startColumn,endColumn:fe.endColumn},ee=oe.map(function(ie){return{label:ie,kind:R.languages.CompletionItemKind.Keyword,insertText:ie,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:de}});return $.map(function(ie){ee.push(Object(ne.a)(Object(ne.a)({},ie),{},{range:de}))}),ee}var _=function(R){t.languages.map(function($){return R.languages.registerDocumentFormattingEditProvider($,{provideDocumentFormattingEdits:function(de,ee,ie){return Object(y.a)(d.a.mark(function ge(){var Z;return d.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Z=n()(de.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}),Se.abrupt("return",[{range:de.getFullModelRange(),text:Z}]);case 2:case"end":return Se.stop()}},ge)}))()}}),$});var K=o.quickKey.map(function($){return{label:$.label,kind:R.languages.CompletionItemKind.Method,insertText:$.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),z=s.quickKey.map(function($){return{label:$.label,kind:R.languages.CompletionItemKind.Method,insertText:$.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),oe=i.quickKey.map(function($){return{label:$.label,kind:R.languages.CompletionItemKind.Method,insertText:$.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}});R.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(fe,de){var ee=fe.getWordUntilPosition(de),ie={startLineNumber:de.lineNumber,endLineNumber:de.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn},ge=fe.getLineContent(de.lineNumber).substring(ee.startColumn-2,ee.endColumn);return{suggestions:[].concat(Object(W.a)(o.keywords.map(function(Z){return{label:Z,kind:R.languages.CompletionItemKind.Function,documentation:Z,insertText:Z,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}})),Object(W.a)(o.quickKey.map(function(Z){return{label:Z.label,kind:R.languages.CompletionItemKind.Function,documentation:Z.content,insertText:ge.startsWith("#")?Z.content.replace(/#/,""):Z.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}})))}}}),R.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(fe,de){var ee=fe.getWordUntilPosition(de),ie={startLineNumber:de.lineNumber,endLineNumber:de.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn};return{suggestions:Object(W.a)(a.keywords.map(function(ge){return{label:ge,kind:R.languages.CompletionItemKind.Function,documentation:ge,insertText:ge,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}}))}}}),R.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(fe,de){var ee=fe.getWordUntilPosition(de),ie={startLineNumber:de.lineNumber,endLineNumber:de.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn},ge=fe.getLineContent(de.lineNumber).substring(ee.startColumn-2,ee.endColumn);return{suggestions:[].concat(Object(W.a)(i.keywords.map(function(Z){return{label:Z,kind:R.languages.CompletionItemKind.Function,documentation:Z,insertText:Z,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}})),Object(W.a)(i.quickKey.map(function(Z){return{label:Z.label,kind:R.languages.CompletionItemKind.Function,documentation:Z.content,insertText:ge.startsWith("#")?Z.content.replace(/#/,""):Z.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}})))}}}),R.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(fe,de){var ee=fe.getWordUntilPosition(de),ie={startLineNumber:de.lineNumber,endLineNumber:de.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn},ge=fe.getLineContent(de.lineNumber).substring(ee.startColumn-2,ee.endColumn);return{suggestions:[].concat(Object(W.a)(s.keywords.map(function(Z){return{label:Z,kind:R.languages.CompletionItemKind.Function,documentation:Z,insertText:Z,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}})),Object(W.a)(s.quickKey.map(function(Z){return{label:Z.label,kind:R.languages.CompletionItemKind.Function,documentation:Z.content,insertText:ge.startsWith("#")?Z.content.replace(/#/,""):Z.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ie}})))}}})},l="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",f=U("fjLI"),u=U("LvDl"),h=U("+ua5");function E(R){return/^\d+$/.test(R)?"".concat(R,"px"):R}function v(){}var S=!1,L={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function I(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],K=R;if(Array.isArray(R)){for(var z=0;z<R.length;z++){var oe=L[R[z]];if(oe)return oe}return K[0]}return L[K]||K}var A=null,P=ve.b=function(R){var K=R.width,z=K===void 0?"100%":K,oe=R.height,$=oe===void 0?"100%":oe,fe=R.value,de=R.language,ee=de===void 0?"javascript":de,ie=R.style,ge=ie===void 0?{}:ie,Z=R.options,Y=Z===void 0?{}:Z,Se=R.overrideServices,Pe=Se===void 0?{}:Se,ke=R.theme,Re=ke===void 0?"vs-dark":ke,Me=R.onEditBlur,Ce=R.onSave,Le=R.autoHeight,Ne=Le===void 0?!1:Le,J=R.forbidCopy,pe=J===void 0?!1:J,Te=R.onChange,xe=Te===void 0?v:Te,We=R.editorDidMount,He=We===void 0?v:We,Oe=R.onFocus,Ue=Oe===void 0?v:Oe,Qe=R.filename,Ze=Qe===void 0?"educoder.txt":Qe,Je=R.errorLine,ze=R.errorContent,nt=ze===void 0?"":ze,it=Object(B.a)(R,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),je=Object(M.useRef)(),Ke=Object(M.useRef)({}),ae=Object(M.useRef)(),ce=Object(M.useRef)(),ye=Object(M.useRef)(!1),Q=Object(M.useRef)(),q=Object(M.useState)(!1),se=Object(D.a)(q,2),me=se[0],De=se[1];function Be(){var at;return je.current&&(at=new C.default(function(lt){var Pt=Object(w.a)(lt),Kt;try{for(Pt.s();!(Kt=Pt.n()).done;){var rn=Kt.value;(rn.target.offsetHeight>0||rn.target.offsetWidth>0)&&Ke.current.instance.layout()}}catch(an){Pt.e(an)}finally{Pt.f()}}),at.observe(je.current)),at}function Xe(){k.b.warn(decodeURIComponent(l))}var ut=function(){var lt=Ke.current.instance;if(fe!=null&<&&me){var Pt=lt.getModel();Pt&&fe!==Pt.getValue()&&(S=!0,Pt.setValue(fe),lt.layout(),S=!1)}};Object(M.useEffect)(function(){ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){ut()},500)},[fe,me,Ke.current]),Object(M.useEffect)(function(){if(Je&&Ke.current&&Ke.current.instance){var at=Ke.current.instance;at.changeViewZones(function(Pt){var Kt=document.createElement("div");Kt.style.padding="10px 20px",Kt.style.width="calc(100% - 20px)",Kt.className="my-error-line-wrp",Kt.innerHTML=nt,Pt.addZone({afterLineNumber:Je||11,heightInLines:3,domNode:Kt})});var lt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};at.addOverlayWidget(lt),at.revealPositionInCenter({lineNumber:20,column:1})}},[Je,Ke.current,me]);function vt(){var at=Ke.current.instance;if(at){var lt=at.getSelection(),Pt=Ke.current.pastePos||{},Kt=new A.Range(Pt.startLineNumber||lt.endLineNumber,Pt.startColumn||lt.endColumn,Pt.endLineNumber||lt.endLineNumber,Pt.endColumn||lt.endColumn);setTimeout(function(){at.executeEdits("",[{range:Kt,text:""}])},300)}}function dt(at){(window.navigator.platform.match("Mac")?at.metaKey:at.ctrlKey)&&at.keyCode==83&&(at.preventDefault(),Ce())}var _t=function(){if(Ne&&Ke.current.instance){var lt=Ke.current.instance.getContentHeight();ct(lt<$?$:lt)}else ct($)};function xt(at){var lt=document.createEvent("MouseEvents");lt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),at.dispatchEvent(lt)}function rt(at,lt){var Pt=window.URL||window.webkitURL||window,Kt=new Blob([lt]),rn=document.createElementNS("http://www.w3.org/1999/xhtml","a");rn.href=Pt.createObjectURL(Kt),rn.download=at,xt(rn)}Object(M.useEffect)(function(){_t()},[_t]),Object(M.useEffect)(function(){je.current&&!me&&Promise.all([U.e(15),U.e(27)]).then(U.t.bind(null,"M/lh",7)).then(function(at){try{A=at,Ke.current.instance=A.editor.create(je.current,{value:fe,language:I(ee),theme:Re,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Pe);var lt=Ke.current.instance,Pt=f.d._menuItems,Kt=Object(W.a)(Pt).find(function(Wt){return Wt[0]._debugName=="EditorContext"}),rn=Kt[1],an=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Cn=function(wn,In){var Mn=wn._first;do{var Bn,Fn,Wn=In.includes((Bn=Mn.element)===null||Bn===void 0||((Fn=Bn.command)===null||Fn===void 0)?void 0:Fn.id);Wn&&wn._remove(Mn)}while(Mn=Mn.next)};if(He(lt,A),setTimeout(function(){_t(),Ke.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){rt(Ze||"educoder.txt",lt.getValue())}}),lt.getDomNode().addEventListener("input",function(){ae.current.autoFormat&<.getAction("editor.action.formatDocument").run()})},500),Ke.current.subscription=lt.onDidChangeModelContent(function(Wt){ye.current?clearTimeout(Q.current):(_t(),xe(lt.getValue(),Wt)),Q.current=setTimeout(function(){ye.current=!1},500)}),window.Monaco||_(A,I(ee)),pe&&(Cn(rn,an),je.current.classList.add("noCopyPaste"),lt.onKeyDown(function(Wt){var wn=Wt.keyCode,In=Wt.ctrlKey,Mn=Wt.metaKey;(wn===33||wn===52)&&(Mn||In)&&(Xe(),Wt.preventDefault())})),window.Monaco=A,Me&<.onDidBlurEditorWidget(function(){Me(lt.getValue())}),Ue&<.onDidFocusEditorText(function(){Ue(lt.getValue())}),pe){lt.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return Xe(),null}),lt.onDidPaste(function(Wt){Ke.current.pastePos=Wt});try{window.addEventListener("paste",vt)}catch(Wt){}}var bn=Be();return De(!0),function(){var Wt=Ke.current.instance;Wt.dispose();var wn=Wt.getModel();wn&&wn.dispose(),Ke.current.subscription&&Ke.current.subscription.dispose(),pe&&window.removeEventListener("paste",vt),bn.unobserve(je.current)}}catch(Wt){}})},[]),Object(M.useEffect)(function(){var at=Ke.current.instance;if(at&&me)return document.addEventListener("keydown",dt,!1),function(){document.removeEventListener("keydown",dt)}},[Ce,me]),Object(M.useEffect)(function(){var at=Ke.current.instance;if(at&&me){var lt=I(ee);A.editor.setModelLanguage(at.getModel(),lt),console.log("language:",ee,at.getModel(),lt)}},[ee,me]),Object(M.useEffect)(function(){var at=Ke.current.instance;at&&me&&A.editor.setTheme(Re)},[Re,me]),Object(M.useEffect)(function(){var at=Ke.current.instance;ae.current=Y,at&&me&&(at.updateOptions(Object(ne.a)({},Y)),setTimeout(function(){at.getModel().updateOptions(Object(ne.a)({},Y))},200))},[JSON.stringify(Y),me]),Object(M.useEffect)(function(){var at=Ke.current.instance;at&&me&&at.layout()},[z,$,me]);var Yt=Object(M.useState)(E(z)),It=Object(D.a)(Yt,2),qt=It[0],$t=It[1],bt=Object(M.useState)(E($)),en=Object(D.a)(bt,2),hn=en[0],ct=en[1],_n=Object(ne.a)(Object(ne.a)({},ge),{},{width:qt,height:hn});return e.a.createElement("div",{className:"my-monaco-editor",ref:je,style:_n})};function H(R){var K=R.width,z=K===void 0?"100%":K,oe=R.height,$=oe===void 0?"100%":oe,fe=R.original,de=R.modified,ee=R.language,ie=R.options,ge=ie===void 0?{}:ie,Z=Object(M.useRef)(),Y=Object(M.useState)(null),Se=Object(D.a)(Y,2),Pe=Se[0],ke=Se[1];function Re(Ne){var J;return Z.current&&(J=new C.default(function(pe){var Te=Object(w.a)(pe),xe;try{for(Te.s();!(xe=Te.n()).done;){var We=xe.value;(We.target.offsetHeight>0||We.target.offsetWidth>0)&&Ne.layout()}}catch(He){Te.e(He)}finally{Te.f()}}),J.observe(Z.current)),J}Object(M.useEffect)(function(){Z.current&&Promise.all([U.e(15),U.e(27)]).then(U.t.bind(null,"M/lh",7)).then(function(Ne){A=Ne;var J=A.editor.createDiffEditor(Z.current,Object(ne.a)(Object(ne.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},ge),{},{wordWrap:!0}));ke(J);var pe=Re(J);return function(){J.dispose();var Te=J.getModel();Te&&Te.dispose(),pe.unobserve(Z.current)}})},[]),Object(M.useEffect)(function(){Pe&&Pe.setModel({original:A.editor.createModel(fe,ee),modified:A.editor.createModel(de,ee)})},[fe,de,ee,Pe]);var Me=E(z),Ce=E($),Le={width:Me,height:Ce};return e.a.createElement("div",{className:"my-diff-editor",ref:Z,style:Le})}},bT9E:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return W});var ne=U("VTBJ");function W(O,k){var w=Object(ne.a)({},O);return Array.isArray(k)&&k.forEach(function(D){delete w[D]}),w}},d5o6:function(qe,ve,U){qe.exports={flex_box_center:"flex_box_center___2-Tej",flex_space_between:"flex_space_between___1Q3vH",flex_box_vertical_center:"flex_box_vertical_center___2x9ha",flex_box_center_end:"flex_box_center_end___1fvRI",flex_box_column:"flex_box_column___2RmOE",addModal:"addModal___2Pv06",row:"row___2XmSi",label:"label___1L8pt"}},fAei:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return t.a});var ne=U("rePB"),W=U("VTBJ"),O=U("KQm4"),k=U("1OyB"),w=U("vuIU"),D=U("Ji7U"),B=U("LK+K"),M=U("q1tI"),e=U("4IlW"),C=U("Kwbf"),y=U("TSYQ"),c=U.n(y),d=U("sboe"),a=U("OZM5"),i=U("815F"),o=U("ODXe"),s=U("Ff2n"),r=U("+nKL"),n=U("8XRh"),t=U("WaYH"),g=function(fe,de){var ee=fe.className,ie=fe.style,ge=fe.motion,Z=fe.motionNodes,Y=fe.motionType,Se=fe.onMotionStart,Pe=fe.onMotionEnd,ke=fe.active,Re=fe.treeNodeRequiredProps,Me=Object(s.a)(fe,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Ce=M.useState(!0),Le=Object(o.a)(Ce,2),Ne=Le[0],J=Le[1],pe=M.useContext(d.a),Te=pe.prefixCls,xe=M.useRef(!1),We=function(){xe.current||Pe(),xe.current=!0};return Object(M.useEffect)(function(){Z&&Y==="hide"&&Ne&&J(!1)},[Z]),Object(M.useEffect)(function(){return Z&&Se(),function(){Z&&We()}},[]),Z?M.createElement(n.default,Object.assign({ref:de,visible:Ne},ge,{motionAppear:Y==="show",onAppearEnd:We,onLeaveEnd:We}),function(He,Oe){var Ue=He.className,Qe=He.style;return M.createElement("div",{ref:Oe,className:c()("".concat(Te,"-treenode-motion"),Ue),style:Qe},Z.map(function(Ze){var Je=Ze.data,ze=Je.key,nt=Object(s.a)(Je,["key"]),it=Ze.isStart,je=Ze.isEnd;delete nt.children;var Ke=Object(i.f)(ze,Re);return M.createElement(t.a,Object.assign({},nt,Ke,{active:ke,data:Ze.data,key:ze,isStart:it,isEnd:je}))}))}):M.createElement(t.a,Object.assign({domRef:de,className:ee,style:ie},Me,{active:ke}))};g.displayName="MotionTreeNode";var p=M.forwardRef(g),m=p;function b(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],de=$.length,ee=fe.length;if(Math.abs(de-ee)!==1)return{add:!1,key:null};function ie(ge,Z){var Y=new Map;ge.forEach(function(Pe){Y.set(Pe,!0)});var Se=Z.filter(function(Pe){return!Y.has(Pe)});return Se.length===1?Se[0]:null}return de<ee?{add:!0,key:ie($,fe)}:{add:!1,key:ie(fe,$)}}function _($,fe,de){var ee=$.findIndex(function(Y){var Se=Y.data;return Se.key===de}),ie=$[ee+1],ge=fe.findIndex(function(Y){var Se=Y.data;return Se.key===de});if(ie){var Z=fe.findIndex(function(Y){var Se=Y.data;return Se.key===ie.data.key});return fe.slice(ge+1,Z)}return fe.slice(ge+1)}var l={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},f=function(){},u="RC_TREE_MOTION_".concat(Math.random()),h={key:u},E={key:u,level:0,index:0,pos:"0",node:h},v={parent:null,children:[],pos:E.pos,data:h,isStart:[],isEnd:[]};function S($,fe,de,ee){return fe===!1||!de?$:$.slice(0,Math.ceil(de/ee)+1)}function L($){var fe=$.data.key,de=$.pos;return Object(i.e)(fe,de)}function I($){for(var fe=String($.data.key),de=$;de.parent;)de=de.parent,fe="".concat(de.data.key," > ").concat(fe);return fe}var A=function(fe,de){var ee=fe.prefixCls,ie=fe.data,ge=fe.selectable,Z=fe.checkable,Y=fe.expandedKeys,Se=fe.selectedKeys,Pe=fe.checkedKeys,ke=fe.loadedKeys,Re=fe.loadingKeys,Me=fe.halfCheckedKeys,Ce=fe.keyEntities,Le=fe.disabled,Ne=fe.dragging,J=fe.dragOverNodeKey,pe=fe.dropPosition,Te=fe.motion,xe=fe.height,We=fe.itemHeight,He=fe.virtual,Oe=fe.focusable,Ue=fe.activeItem,Qe=fe.focused,Ze=fe.tabIndex,Je=fe.onKeyDown,ze=fe.onFocus,nt=fe.onBlur,it=fe.onActiveChange,je=fe.onListChangeStart,Ke=fe.onListChangeEnd,ae=Object(s.a)(fe,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),ce=M.useRef(null);M.useImperativeHandle(de,function(){return{scrollTo:function(lt){ce.current.scrollTo(lt)}}});var ye=M.useState(Y),Q=Object(o.a)(ye,2),q=Q[0],se=Q[1],me=M.useState(ie),De=Object(o.a)(me,2),Be=De[0],Xe=De[1],ut=M.useState(ie),vt=Object(o.a)(ut,2),dt=vt[0],_t=vt[1],xt=M.useState([]),rt=Object(o.a)(xt,2),Yt=rt[0],It=rt[1],qt=M.useState(null),$t=Object(o.a)(qt,2),bt=$t[0],en=$t[1];function hn(){Xe(ie),_t(ie),It([]),en(null),Ke()}M.useEffect(function(){se(Y);var at=b(q,Y);if(at.key!==null)if(at.add){var lt=Be.findIndex(function(bn){var Wt=bn.data.key;return Wt===at.key}),Pt=S(_(Be,ie,at.key),He,xe,We),Kt=Be.slice();Kt.splice(lt+1,0,v),_t(Kt),It(Pt),en("show")}else{var rn=ie.findIndex(function(bn){var Wt=bn.data.key;return Wt===at.key}),an=S(_(ie,Be,at.key),He,xe,We),Cn=ie.slice();Cn.splice(rn+1,0,v),_t(Cn),It(an),en("hide")}else Be!==ie&&(Xe(ie),_t(ie))},[Y,ie]),M.useEffect(function(){Ne||hn()},[Ne]);var ct=Te?dt:ie,_n={expandedKeys:Y,selectedKeys:Se,loadedKeys:ke,loadingKeys:Re,checkedKeys:Pe,halfCheckedKeys:Me,dragOverNodeKey:J,dropPosition:pe,keyEntities:Ce};return M.createElement(M.Fragment,null,Qe&&Ue&&M.createElement("span",{style:l,"aria-live":"assertive"},I(Ue)),M.createElement("div",{role:"tree"},M.createElement("input",{style:l,disabled:Oe===!1||Le,tabIndex:Oe!==!1?Ze:null,onKeyDown:Je,onFocus:ze,onBlur:nt,value:"",onChange:f})),M.createElement(r.a,Object.assign({},ae,{data:ct,itemKey:L,height:xe,fullHeight:!1,virtual:He,itemHeight:We,prefixCls:"".concat(ee,"-list"),ref:ce}),function(at){var lt=at.pos,Pt=at.data,Kt=Pt.key,rn=Object(s.a)(Pt,["key"]),an=at.isStart,Cn=at.isEnd,bn=Object(i.e)(Kt,lt);delete rn.children;var Wt=Object(i.f)(bn,_n);return M.createElement(m,Object.assign({},rn,Wt,{active:Ue&&Kt===Ue.data.key,pos:lt,data:at.data,isStart:an,isEnd:Cn,motion:Te,motionNodes:Kt===u?Yt:null,motionType:bt,onMotionStart:je,onMotionEnd:hn,treeNodeRequiredProps:_n,onMouseMove:function(){it(null)}}))}))},P=M.forwardRef(A);P.displayName="NodeList";var H=P,R=U("NvD2"),K=function($){Object(D.a)(de,$);var fe=Object(B.a)(de);function de(){var ee;return Object(k.a)(this,de),ee=fe.apply(this,arguments),ee.destroyed=!1,ee.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ee.listRef=M.createRef(),ee.onNodeDragStart=function(ie,ge){var Z=ee.state,Y=Z.expandedKeys,Se=Z.keyEntities,Pe=ee.props.onDragStart,ke=ge.props.eventKey;ee.dragNode=ge;var Re=Object(a.b)(Y,ke);ee.setState({dragging:!0,dragNodesKeys:Object(a.g)(ke,Se)}),ee.setExpandedKeys(Re),Pe&&Pe({event:ie,node:Object(i.b)(ge.props)})},ee.onNodeDragEnter=function(ie,ge){var Z=ee.state,Y=Z.expandedKeys,Se=Z.keyEntities,Pe=Z.dragNodesKeys,ke=ee.props.onDragEnter,Re=ge.props,Me=Re.pos,Ce=Re.eventKey;if(!ee.dragNode||Pe.indexOf(Ce)!==-1)return;var Le=Object(a.c)(ie,ge);if(ee.dragNode.props.eventKey===Ce&&Le===0){ee.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ee.setState({dragOverNodeKey:Ce,dropPosition:Le}),ee.delayedDragEnterLogic||(ee.delayedDragEnterLogic={}),Object.keys(ee.delayedDragEnterLogic).forEach(function(Ne){clearTimeout(ee.delayedDragEnterLogic[Ne])}),ee.delayedDragEnterLogic[Me]=window.setTimeout(function(){if(!ee.state.dragging)return;var Ne=Object(O.a)(Y),J=Se[Ce];J&&(J.children||[]).length&&(Ne=Object(a.a)(Y,Ce)),"expandedKeys"in ee.props||ee.setExpandedKeys(Ne),ke&&ke({event:ie,node:Object(i.b)(ge.props),expandedKeys:Ne})},400)},0)},ee.onNodeDragOver=function(ie,ge){var Z=ee.state.dragNodesKeys,Y=ee.props.onDragOver,Se=ge.props.eventKey;if(Z.indexOf(Se)!==-1)return;if(ee.dragNode&&Se===ee.state.dragOverNodeKey){var Pe=Object(a.c)(ie,ge);if(Pe===ee.state.dropPosition)return;ee.setState({dropPosition:Pe})}Y&&Y({event:ie,node:Object(i.b)(ge.props)})},ee.onNodeDragLeave=function(ie,ge){var Z=ee.props.onDragLeave;ee.setState({dragOverNodeKey:""}),Z&&Z({event:ie,node:Object(i.b)(ge.props)})},ee.onNodeDragEnd=function(ie,ge){var Z=ee.props.onDragEnd;ee.setState({dragOverNodeKey:""}),ee.cleanDragState(),Z&&Z({event:ie,node:Object(i.b)(ge.props)}),ee.dragNode=null},ee.onNodeDrop=function(ie,ge){var Z=ee.state,Y=Z.dragNodesKeys,Se=Y===void 0?[]:Y,Pe=Z.dropPosition,ke=ee.props.onDrop,Re=ge.props,Me=Re.eventKey,Ce=Re.pos;if(ee.setState({dragOverNodeKey:""}),ee.cleanDragState(),Se.indexOf(Me)!==-1){Object(C.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Le=Object(a.k)(Ce),Ne={event:ie,node:Object(i.b)(ge.props),dragNode:ee.dragNode?Object(i.b)(ee.dragNode.props):null,dragNodesKeys:Se.slice(),dropPosition:Pe+Number(Le[Le.length-1]),dropToGap:!1};Pe!==0&&(Ne.dropToGap=!0),ke&&ke(Ne),ee.dragNode=null},ee.cleanDragState=function(){var ie=ee.state.dragging;ie&&ee.setState({dragging:!1})},ee.onNodeClick=function(ie,ge){var Z=ee.props.onClick;Z&&Z(ie,ge)},ee.onNodeDoubleClick=function(ie,ge){var Z=ee.props.onDoubleClick;Z&&Z(ie,ge)},ee.onNodeSelect=function(ie,ge){var Z=ee.state.selectedKeys,Y=ee.state.keyEntities,Se=ee.props,Pe=Se.onSelect,ke=Se.multiple,Re=ge.selected,Me=ge.key,Ce=!Re;Ce?ke?Z=Object(a.a)(Z,Me):Z=[Me]:Z=Object(a.b)(Z,Me);var Le=Z.map(function(Ne){var J=Y[Ne];return J?J.node:null}).filter(function(Ne){return Ne});ee.setUncontrolledState({selectedKeys:Z}),Pe&&Pe(Z,{event:"select",selected:Ce,node:ge,selectedNodes:Le,nativeEvent:ie.nativeEvent})},ee.onNodeCheck=function(ie,ge,Z){var Y=ee.state,Se=Y.keyEntities,Pe=Y.checkedKeys,ke=Y.halfCheckedKeys,Re=ee.props,Me=Re.checkStrictly,Ce=Re.onCheck,Le=ge.key,Ne,J={event:"check",node:ge,checked:Z,nativeEvent:ie.nativeEvent};if(Me){var pe=Z?Object(a.a)(Pe,Le):Object(a.b)(Pe,Le),Te=Object(a.b)(ke,Le);Ne={checked:pe,halfChecked:Te},J.checkedNodes=pe.map(function(Qe){return Se[Qe]}).filter(function(Qe){return Qe}).map(function(Qe){return Qe.node}),ee.setUncontrolledState({checkedKeys:pe})}else{var xe=Object(R.a)([].concat(Object(O.a)(Pe),[Le]),!0,Se),We=xe.checkedKeys,He=xe.halfCheckedKeys;if(!Z){var Oe=new Set(We);Oe.delete(Le);var Ue=Object(R.a)(Array.from(Oe),{checked:!1,halfCheckedKeys:He},Se);We=Ue.checkedKeys,He=Ue.halfCheckedKeys}Ne=We,J.checkedNodes=[],J.checkedNodesPositions=[],J.halfCheckedKeys=He,We.forEach(function(Qe){var Ze=Se[Qe];if(!Ze)return;var Je=Ze.node,ze=Ze.pos;J.checkedNodes.push(Je),J.checkedNodesPositions.push({node:Je,pos:ze})}),ee.setUncontrolledState({checkedKeys:We},!1,{halfCheckedKeys:He})}Ce&&Ce(Ne,J)},ee.onNodeLoad=function(ie){return new Promise(function(ge){ee.setState(function(Z){var Y=Z.loadedKeys,Se=Y===void 0?[]:Y,Pe=Z.loadingKeys,ke=Pe===void 0?[]:Pe,Re=ee.props,Me=Re.loadData,Ce=Re.onLoad,Le=ie.key;if(!Me||Se.indexOf(Le)!==-1||ke.indexOf(Le)!==-1)return{};var Ne=Me(ie);return Ne.then(function(){var J=ee.state,pe=J.loadedKeys,Te=J.loadingKeys,xe=Object(a.a)(pe,Le),We=Object(a.b)(Te,Le);Ce&&Ce(xe,{event:"load",node:ie}),ee.setUncontrolledState({loadedKeys:xe}),ee.setState({loadingKeys:We}),ge()}),{loadingKeys:Object(a.a)(ke,Le)}})})},ee.onNodeMouseEnter=function(ie,ge){var Z=ee.props.onMouseEnter;Z&&Z({event:ie,node:ge})},ee.onNodeMouseLeave=function(ie,ge){var Z=ee.props.onMouseLeave;Z&&Z({event:ie,node:ge})},ee.onNodeContextMenu=function(ie,ge){var Z=ee.props.onRightClick;Z&&(ie.preventDefault(),Z({event:ie,node:ge}))},ee.onFocus=function(){var ie=ee.props.onFocus;ee.setState({focused:!0}),ie&&ie.apply(void 0,arguments)},ee.onBlur=function(){var ie=ee.props.onBlur;ee.setState({focused:!1}),ee.onActiveChange(null),ie&&ie.apply(void 0,arguments)},ee.getTreeNodeRequiredProps=function(){var ie=ee.state,ge=ie.expandedKeys,Z=ie.selectedKeys,Y=ie.loadedKeys,Se=ie.loadingKeys,Pe=ie.checkedKeys,ke=ie.halfCheckedKeys,Re=ie.dragOverNodeKey,Me=ie.dropPosition,Ce=ie.keyEntities;return{expandedKeys:ge||[],selectedKeys:Z||[],loadedKeys:Y||[],loadingKeys:Se||[],checkedKeys:Pe||[],halfCheckedKeys:ke||[],dragOverNodeKey:Re,dropPosition:Me,keyEntities:Ce}},ee.setExpandedKeys=function(ie){var ge=ee.state.treeData,Z=Object(i.d)(ge,ie);ee.setUncontrolledState({expandedKeys:ie,flattenNodes:Z},!0)},ee.onNodeExpand=function(ie,ge){var Z=ee.state.expandedKeys,Y=ee.state.listChanging,Se=ee.props,Pe=Se.onExpand,ke=Se.loadData,Re=ge.key,Me=ge.expanded;if(Y)return;var Ce=Z.indexOf(Re),Le=!Me;if(Object(C.a)(Me&&Ce!==-1||!Me&&Ce===-1,"Expand state not sync with index check"),Le?Z=Object(a.a)(Z,Re):Z=Object(a.b)(Z,Re),ee.setExpandedKeys(Z),Pe&&Pe(Z,{node:ge,expanded:Le,nativeEvent:ie.nativeEvent}),Le&&ke){var Ne=ee.onNodeLoad(ge);Ne&&Ne.then(function(){var J=Object(i.d)(ee.state.treeData,Z);ee.setUncontrolledState({flattenNodes:J})})}},ee.onListChangeStart=function(){ee.setUncontrolledState({listChanging:!0})},ee.onListChangeEnd=function(){setTimeout(function(){ee.setUncontrolledState({listChanging:!1})})},ee.onActiveChange=function(ie){var ge=ee.state.activeKey,Z=ee.props.onActiveChange;if(ge===ie)return;ee.setState({activeKey:ie}),ie!==null&&ee.scrollTo({key:ie}),Z&&Z(ie)},ee.getActiveItem=function(){var ie=ee.state,ge=ie.activeKey,Z=ie.flattenNodes;return ge===null?null:Z.find(function(Y){var Se=Y.data.key;return Se===ge})||null},ee.offsetActiveKey=function(ie){var ge=ee.state,Z=ge.flattenNodes,Y=ge.activeKey,Se=Z.findIndex(function(Re){var Me=Re.data.key;return Me===Y});Se===-1&&ie<0&&(Se=Z.length),Se=(Se+ie+Z.length)%Z.length;var Pe=Z[Se];if(Pe){var ke=Pe.data.key;ee.onActiveChange(ke)}else ee.onActiveChange(null)},ee.onKeyDown=function(ie){var ge=ee.state,Z=ge.activeKey,Y=ge.expandedKeys,Se=ge.checkedKeys,Pe=ee.props,ke=Pe.onKeyDown,Re=Pe.checkable,Me=Pe.selectable;switch(ie.which){case e.a.UP:{ee.offsetActiveKey(-1),ie.preventDefault();break}case e.a.DOWN:{ee.offsetActiveKey(1),ie.preventDefault();break}}var Ce=ee.getActiveItem();if(Ce&&Ce.data){var Le=ee.getTreeNodeRequiredProps(),Ne=Ce.data.isLeaf===!1||!!(Ce.data.children||[]).length,J=Object(i.b)(Object(W.a)(Object(W.a)({},Object(i.f)(Z,Le)),{},{data:Ce.data,active:!0}));switch(ie.which){case e.a.LEFT:{Ne&&Y.includes(Z)?ee.onNodeExpand({},J):Ce.parent&&ee.onActiveChange(Ce.parent.data.key),ie.preventDefault();break}case e.a.RIGHT:{Ne&&!Y.includes(Z)?ee.onNodeExpand({},J):Ce.children&&Ce.children.length&&ee.onActiveChange(Ce.children[0].data.key),ie.preventDefault();break}case e.a.ENTER:case e.a.SPACE:{Re&&!J.disabled&&J.checkable!==!1&&!J.disableCheckbox?ee.onNodeCheck({},J,!Se.includes(Z)):!Re&&Me&&!J.disabled&&J.selectable!==!1&&ee.onNodeSelect({},J);break}}}ke&&ke(ie)},ee.setUncontrolledState=function(ie){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ee.destroyed)return;var Y=!1,Se=!0,Pe={};Object.keys(ie).forEach(function(ke){if(ke in ee.props){Se=!1;return}Y=!0,Pe[ke]=ie[ke]}),Y&&(!ge||Se)&&ee.setState(Object(W.a)(Object(W.a)({},Pe),Z))},ee.scrollTo=function(ie){ee.listRef.current.scrollTo(ie)},ee}return Object(w.a)(de,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ie,ge=this.state,Z=ge.focused,Y=ge.flattenNodes,Se=ge.keyEntities,Pe=ge.dragging,ke=ge.activeKey,Re=this.props,Me=Re.prefixCls,Ce=Re.className,Le=Re.style,Ne=Re.showLine,J=Re.focusable,pe=Re.tabIndex,Te=pe===void 0?0:pe,xe=Re.selectable,We=Re.showIcon,He=Re.icon,Oe=Re.switcherIcon,Ue=Re.draggable,Qe=Re.checkable,Ze=Re.checkStrictly,Je=Re.disabled,ze=Re.motion,nt=Re.loadData,it=Re.filterTreeNode,je=Re.height,Ke=Re.itemHeight,ae=Re.virtual,ce=Re.titleRender,ye=Re.onContextMenu,Q=Object(a.f)(this.props);return M.createElement(d.a.Provider,{value:{prefixCls:Me,selectable:xe,showIcon:We,icon:He,switcherIcon:Oe,draggable:Ue,checkable:Qe,checkStrictly:Ze,disabled:Je,keyEntities:Se,loadData:nt,filterTreeNode:it,titleRender:ce,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},M.createElement("div",{className:c()(Me,Ce,(ie={},Object(ne.a)(ie,"".concat(Me,"-show-line"),Ne),Object(ne.a)(ie,"".concat(Me,"-focused"),Z),Object(ne.a)(ie,"".concat(Me,"-active-focused"),ke!==null),ie))},M.createElement(H,Object.assign({ref:this.listRef,prefixCls:Me,style:Le,data:Y,disabled:Je,selectable:xe,checkable:!!Qe,motion:ze,dragging:Pe,height:je,itemHeight:Ke,virtual:ae,focusable:J,focused:Z,tabIndex:Te,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ye},this.getTreeNodeRequiredProps(),Q))))}}],[{key:"getDerivedStateFromProps",value:function(ie,ge){var Z=ge.prevProps,Y={prevProps:ie};function Se(He){return!Z&&He in ie||Z&&Z[He]!==ie[He]}var Pe;if(Se("treeData")?Pe=ie.treeData:Se("children")&&(Object(C.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Pe=Object(i.c)(ie.children)),Pe){Y.treeData=Pe;var ke=Object(i.a)(Pe);Y.keyEntities=Object(W.a)(Object(ne.a)({},u,E),ke.keyEntities)}var Re=Y.keyEntities||ge.keyEntities;if(Se("expandedKeys")||Z&&Se("autoExpandParent"))Y.expandedKeys=ie.autoExpandParent||!Z&&ie.defaultExpandParent?Object(a.e)(ie.expandedKeys,Re):ie.expandedKeys;else if(!Z&&ie.defaultExpandAll){var Me=Object(W.a)({},Re);delete Me[u],Y.expandedKeys=Object.keys(Me).map(function(He){return Me[He].key})}else!Z&&ie.defaultExpandedKeys&&(Y.expandedKeys=ie.autoExpandParent||ie.defaultExpandParent?Object(a.e)(ie.defaultExpandedKeys,Re):ie.defaultExpandedKeys);if(Y.expandedKeys||delete Y.expandedKeys,Pe||Y.expandedKeys){var Ce=Object(i.d)(Pe||ge.treeData,Y.expandedKeys||ge.expandedKeys);Y.flattenNodes=Ce}if(ie.selectable&&(Se("selectedKeys")?Y.selectedKeys=Object(a.d)(ie.selectedKeys,ie):!Z&&ie.defaultSelectedKeys&&(Y.selectedKeys=Object(a.d)(ie.defaultSelectedKeys,ie))),ie.checkable){var Le;if(Se("checkedKeys")?Le=Object(a.j)(ie.checkedKeys)||{}:!Z&&ie.defaultCheckedKeys?Le=Object(a.j)(ie.defaultCheckedKeys)||{}:Pe&&(Le=Object(a.j)(ie.checkedKeys)||{checkedKeys:ge.checkedKeys,halfCheckedKeys:ge.halfCheckedKeys}),Le){var Ne=Le,J=Ne.checkedKeys,pe=J===void 0?[]:J,Te=Ne.halfCheckedKeys,xe=Te===void 0?[]:Te;if(!ie.checkStrictly){var We=Object(R.a)(pe,!0,Re);pe=We.checkedKeys,xe=We.halfCheckedKeys}Y.checkedKeys=pe,Y.halfCheckedKeys=xe}}return Se("loadedKeys")&&(Y.loadedKeys=ie.loadedKeys),Y}}]),de}(M.Component);K.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},K.TreeNode=t.a;var z=K,oe=ve.b=z},fjLI:function(qe,ve,U){"use strict";U.d(ve,"f",function(){return d}),U.d(ve,"b",function(){return a}),U.d(ve,"a",function(){return i}),U.d(ve,"d",function(){return o}),U.d(ve,"e",function(){return s}),U.d(ve,"c",function(){return r});var ne=U("8HAY"),W=U("Vhoy"),O=U("MI8n"),k=U("JYp7"),w=U("pmY6"),D=U("24hK"),B=U("nnTU"),M=U("T8No"),e=U("Cg/j"),C=U("t9D7"),y=function(n,t,g,p){var m=arguments.length,b=m<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,g):p,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,t,g,p);else for(var l=n.length-1;l>=0;l--)(_=n[l])&&(b=(m<3?_(b):m>3?_(t,g,b):_(t,g))||b);return m>3&&b&&Object.defineProperty(t,g,b),b},c=function(n,t){return function(g,p){t(g,p,n)}};function d(n){return n.command!==void 0}class a{constructor(n){this.id=a._idPool++,this._debugName=n}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const i=Object(e.c)("menuService"),o=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new O.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:n=>n===a.CommandPalette}}addCommand(n){return this.addCommands(k.a.single(n))}addCommands(n){for(const t of n)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(w.i)(()=>{let t=!1;for(const g of n)t=this._commands.delete(g.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((t,g)=>n.set(g,t)),n}appendMenuItem(n,t){return this.appendMenuItems(k.a.single({id:n,item:t}))}appendMenuItems(n){const t=new Set,g=new D.a;for(const{id:p,item:m}of n){let b=this._menuItems.get(p);b||(b=new D.a,this._menuItems.set(p,b)),g.push(b.push(m)),t.add(p)}return this._onDidChangeMenu.fire(t),Object(w.i)(()=>{if(g.size>0){for(let p of g)p();this._onDidChangeMenu.fire(t),g.clear()}})}getMenuItems(n){let t;return this._menuItems.has(n)?t=[...this._menuItems.get(n)]:t=[],n===a.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(n){const t=new Set;for(const g of n)d(g)&&(t.add(g.command.id),g.alt&&t.add(g.alt.id));this._commands.forEach((g,p)=>{t.has(p)||n.push({command:g})})}};class s extends ne.e{constructor(n,t,g,p){super(`submenuitem.${n.submenu.id}`,typeof n.title=="string"?n.title:n.title.value,[],"submenu");this.item=n,this._menuService=t,this._contextKeyService=g,this._options=p}get actions(){const n=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),g=t.getActions(this._options);t.dispose();for(const[,p]of g)p.length>0&&(n.push(...p),n.push(new ne.d));return n.length&&n.pop(),n}}let r=class n{constructor(t,g,p,m,b){var _,l;if(this._commandService=b,this.id=t.id,this.label=(p==null?void 0:p.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(l=typeof t.tooltip=="string"?t.tooltip:(_=t.tooltip)===null||_===void 0?void 0:_.value)!==null&&l!==void 0?l:"",this.enabled=!t.precondition||m.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const f=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=m.contextMatchesRules(f.condition),this.checked&&f.tooltip&&(this.tooltip=typeof f.tooltip=="string"?f.tooltip:f.tooltip.value),f.title&&(this.label=typeof f.title=="string"?f.title:f.title.value)}this.item=t,this.alt=g?new n(g,void 0,p,m,b):void 0,this._options=p,C.d.isThemeIcon(t.icon)&&(this.class=W.a.asClassName(t.icon))}dispose(){}run(...t){var g,p;let m=[];return((g=this._options)===null||g===void 0?void 0:g.arg)&&(m=[...m,this._options.arg]),((p=this._options)===null||p===void 0?void 0:p.shouldForwardArgs)&&(m=[...m,...t]),this._commandService.executeCommand(this.id,...m)}};r=y([c(3,M.b),c(4,B.b)],r)},ic2d:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return k});var ne=U("FWmy"),W=U("746U");class O{constructor(){this.data=new Map}add(w,D){ne.a(W.l(w)),ne.a(W.k(D)),ne.a(!this.data.has(w),"There is already an extension with this id"),this.data.set(w,D)}as(w){return this.data.get(w)||null}}const k=new O},iris:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return d});var ne=U("qVdP"),W=U("jsC+"),O=U("lUTK"),k=U("BvKs"),w=U("tJVT"),D=U("q1tI"),B=U.n(D),M=U("Q0Vu"),e=U.n(M),C=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u7EC4\u5408\u9898",value:"COMBINATION"}],y=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],c=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],d=function(i){var o=i.showSelectAll,s=o===void 0?!1:o,r=i.disciplinesData,n=r===void 0?[]:r,t=i.knowledgeData,g=t===void 0?[]:t,p=i.directionValue,m=i.subDisciplineValue,b=i.typeValue,_=i.knowledgeValue,l=i.showKnowledge,f=l===void 0?!1:l,u=i.showRandomType,h=u===void 0?!1:u,E=i.difficultyValue,v=i.randomValue,S=i.selectAll,L=i.languagesvalue,I=i.className,A=i.languages,P=A===void 0?[]:A,H=i.isprogram_homework,R=i.showShixun,K=R===void 0?!1:R,z=i.showItemType,oe=z===void 0?!0:z,$=i.onShixunChange,fe=$===void 0?function(){}:$,de=i.onDirectionChange,ee=de===void 0?function(){}:de,ie=i.onTypeChange,ge=ie===void 0?function(){}:ie,Z=i.onDifficultyChange,Y=Z===void 0?function(){}:Z,Se=i.handlelanguagesChange,Pe=Se===void 0?function(){}:Se,ke=i.onKnowledgeChange,Re=ke===void 0?function(){}:ke,Me=i.onRandomChange,Ce=Me===void 0?function(){}:Me,Le=i.showTeachGroup,Ne=Le===void 0?!1:Le,J=i.teachGroupData,pe=J===void 0?[]:J,Te=i.onTeachGroupChange,xe=Te===void 0?function(){}:Te,We=i.teachGroupValue,He=Object(D.useState)(0),Oe=Object(w.a)(He,2),Ue=Oe[0],Qe=Oe[1],Ze=Object(D.useRef)(null),Je=Object(D.useState)(0),ze=Object(w.a)(Je,2),nt=ze[0],it=ze[1],je=Object(D.useRef)(null);Object(D.useEffect)(function(){if(n.length!==0){var ae;(Ze==null||((ae=Ze.current)===null||ae===void 0)?void 0:ae.clientHeight)>108?Qe(1):Qe(0)}n.length===0&&Qe(0)},[n]),Object(D.useEffect)(function(){if(console.log(g.length===0,"\u6570\u91CF"),g.length!==0){var ae,ce;console.log(je==null||((ae=je.current)===null||ae===void 0)?void 0:ae.clientHeight,"\u9AD8\u5EA6"),(je==null||((ce=je.current)===null||ce===void 0)?void 0:ce.clientHeight)>108?it(1):it(0)}g.length===0&&it(0)},[g]);var Ke=function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=arguments.length>1?arguments[1]:void 0;return B.a.createElement(k.a,{className:e.a.subMenu},ce.map(function(Q){return B.a.createElement(k.a.Item,{key:Q.id},B.a.createElement("a",{className:"".concat(e.a.subItem," ").concat(m===Q.id?e.a.subActive:""),onClick:function(){return ee(ye,Q.id)}},Q.name))}))};return B.a.createElement("aside",{className:I?"".concat(e.a.main," ").concat(I):e.a.main},B.a.createElement("div",{className:e.a.wrap},H&&B.a.createElement("div",{className:e.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Ne&&B.a.createElement("div",{className:e.a.content},B.a.createElement("span",{className:e.a.name},"\u56E2\u961F"),B.a.createElement("div",{className:e.a.directionContentWrap},B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(We?"":e.a.active," "),onClick:function(){return xe(null)}},"\u5168\u90E8"),pe==null?void 0:pe.map(function(ae){return B.a.createElement("li",{key:ae.group_id,className:"".concat(e.a.directionItem," ").concat(We===ae.group_id?e.a.active:""," "),onClick:function(){return xe(ae.group_id)}},ae.name)}))),B.a.createElement("div",{className:e.a.content},B.a.createElement("span",{className:e.a.name},"\u65B9\u5411"),B.a.createElement("span",null),B.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:Ue===1?88:"auto"}},B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p?"":e.a.active," "),onClick:function(){return ee(null)}},"\u5168\u90E8"),n.map(function(ae){var ce;return B.a.createElement(B.a.Fragment,{key:ae.id},((ce=ae.sub_disciplines)===null||ce===void 0?void 0:ce.length)>0?B.a.createElement(W.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(Q){return Q.parentNode},overlay:function(){return Ke(ae.sub_disciplines,ae.id)}},B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===ae.id?e.a.active:""," "),onClick:function(){return ee(ae.id)}},ae.name)):B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===ae.id?e.a.active:""," "),onClick:function(){return ee(ae.id)}},ae.name))})),B.a.createElement("div",{className:e.a.directionContentWrap,ref:Ze,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},n.map(function(ae){var ce;return B.a.createElement(B.a.Fragment,{key:ae.id},((ce=ae.sub_disciplines)===null||ce===void 0?void 0:ce.length)>0?B.a.createElement(W.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(Q){return Q.parentNode},overlay:function(){return Ke(ae.sub_disciplines,ae.id)}},B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===ae.id?e.a.active:""," "),onClick:function(){return ee(ae.id)}},ae.name)):B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===ae.id?e.a.active:""," "),onClick:function(){return ee(ae.id)}},ae.name))})),!!Ue&&B.a.createElement("div",{className:e.a.action},Ue===1&&B.a.createElement("span",{onClick:function(){return Qe(2)}},"\u5C55\u5F00",B.a.createElement("i",{className:"iconfont icon-xiala"})),Ue===2&&B.a.createElement("span",{onClick:function(){return Qe(1)}},"\u6536\u8D77",B.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),f&&B.a.createElement("div",{className:e.a.content},B.a.createElement("span",{className:e.a.name},"\u77E5\u8BC6\u70B9"),B.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:nt===1?106:"auto"}},B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(_===-1?e.a.active:""," "),onClick:function(){return Re(-1)}},"\u5168\u90E8"),g.map(function(ae){return B.a.createElement("li",{key:ae.id,className:"".concat(e.a.directionItem," ").concat(_===ae.id?e.a.active:""," "),onClick:function(){return Re(ae.id)}},ae.name)})),B.a.createElement("div",{ref:je,className:e.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},g.map(function(ae){return B.a.createElement("li",{key:ae.id,className:"".concat(e.a.directionItem," ").concat(_===ae.id?e.a.active:""," "),onClick:function(){return Re(ae.id)}},ae.name)})),!!nt&&B.a.createElement("div",{className:e.a.action},nt===1&&B.a.createElement("span",{onClick:function(){return it(2)}},"\u5C55\u5F00",B.a.createElement("i",{className:"iconfont icon-xiala"})),nt===2&&B.a.createElement("span",{onClick:function(){return it(1)}},"\u6536\u8D77",B.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),oe&&!H&&B.a.createElement("div",{className:e.a.content},B.a.createElement("span",{className:e.a.name},"\u9898\u578B"),B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(b?"":e.a.active," "),onClick:function(){return ge(null)}},"\u5168\u90E8"),B.a.createElement("div",{className:e.a.directionContentWrap},C.map(function(ae){return B.a.createElement("li",{key:ae.name,className:"".concat(e.a.directionItem," ").concat(b===ae.value?e.a.active:""," "),onClick:function(){return ge(ae.value)}},ae.name)}),K&&B.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:e.a.directionItem,onClick:function(){return fe()}},"\u5B9E\u8BAD\u9898"))),B.a.createElement("div",{className:e.a.content},B.a.createElement("span",{className:e.a.name},"\u96BE\u5EA6"),B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(E?"":e.a.active," "),onClick:function(){return Y(null)}},"\u5168\u90E8"),B.a.createElement("div",{className:e.a.directionContentWrap},y.map(function(ae){return B.a.createElement("li",{key:ae.name,className:"".concat(e.a.directionItem," ").concat(E===ae.value?e.a.active:""," "),onClick:function(){return Y(ae.value)}},ae.name)}))),h&&B.a.createElement("div",{className:e.a.content},B.a.createElement("span",{className:e.a.name},"\u7C7B\u578B"),B.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(v?"":e.a.active," "),onClick:function(){return Ce(null)}},"\u5168\u90E8"),B.a.createElement("div",{className:e.a.directionContentWrap},c.map(function(ae){return B.a.createElement("li",{key:ae.name,className:"".concat(e.a.directionItem," ").concat(v===ae.value?e.a.active:""," "),onClick:function(){return Ce(ae.value)}},ae.name)})))))}},jcZT:function(qe,ve,U){"use strict";var ne=U("2qtc"),W=U("kLXV"),O=U("5NDa"),k=U("5rEg"),w=U("miYZ"),D=U("tsqr"),B=U("9og8"),M=U("tJVT"),e=U("WmNS"),C=U.n(e),y=U("q1tI"),c=U.n(y),d=U("d5o6"),a=U.n(d),i=U("P/tu"),o=U("WCUW"),s=U("9kvl"),r=function(t){var g=t.problemset,p=t.dispatch,m=t.onOk,b=Object(y.useState)(""),_=Object(M.a)(b,2),l=_[0],f=_[1],u=Object(y.useState)([0]),h=Object(M.a)(u,2),E=h[0],v=h[1],S=function(){p({type:"problemset/setActionTabs",payload:{}})};Object(y.useEffect)(function(){if(g.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var I,A;v([(I=g.actionTabs)===null||I===void 0||((A=I.params)===null||A===void 0)?void 0:A.group_id]),f("")}},[g.actionTabs.key]);var L=function(){var I=Object(B.a)(C.a.mark(function A(){var P,H,R;return C.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(P=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],l.trim()){z.next=4;break}return D.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),z.abrupt("return");case 4:if(!(l.charAt(0)===" ")){z.next=7;break}return D.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),z.abrupt("return");case 7:H=0;case 8:if(!(H<l.length)){z.next=15;break}if(!P.includes(l.charAt(H))){z.next=12;break}return D.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),z.abrupt("return",!1);case 12:H++,z.next=8;break;case 15:return z.next=17,Object(o.p)({parent_id:E.length>0?E[0]:0,name:l});case 17:R=z.sent,R.status===0&&(S(),m(R==null?void 0:R.id));case 19:case"end":return z.stop()}},A)}));return function(){return I.apply(this,arguments)}}();return c.a.createElement(W.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:g.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:S,onOk:L,destroyOnClose:!0},c.a.createElement("div",{className:a.a.addModal},c.a.createElement("div",{className:a.a.row},c.a.createElement("span",{className:a.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),c.a.createElement(k.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:l,onChange:function(A){return f(A.target.value)}})),c.a.createElement("div",{className:a.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},c.a.createElement("span",{className:a.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),c.a.createElement(i.a,{value:E,onChange:function(A){return v(A)}}))))};ve.a=Object(s.a)(function(n){var t=n.problemset;return{problemset:t}})(r)},k3GJ:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return $i});var ne=U("rePB"),W=U("ODXe"),O=U("Ff2n"),k=U("VTBJ"),w=U("q1tI"),D=U("TSYQ"),B=U.n(D),M=U("Zm9Q"),e=U("6cGi"),C=U("KQm4"),y=U("xEkU"),c=U.n(y),d=U("t23M");function a(re){var be=Object(w.useRef)(),Ae=Object(w.useRef)(!1);function ue(){for(var V=arguments.length,te=new Array(V),X=0;X<V;X++)te[X]=arguments[X];Ae.current||(c.a.cancel(be.current),be.current=c()(function(){re.apply(void 0,te)}))}return Object(w.useEffect)(function(){return function(){Ae.current=!0,c.a.cancel(be.current)}},[]),ue}function i(re){var be=Object(w.useRef)([]),Ae=Object(w.useState)({}),ue=Object(W.a)(Ae,2),V=ue[1],te=Object(w.useRef)(typeof re=="function"?re():re),X=a(function(){var he=te.current;be.current.forEach(function(we){he=we(he)}),be.current=[],te.current=he,V({})});function le(he){be.current.push(he),X()}return[te.current,le]}var o=U("4IlW");function s(re,be){var Ae,ue=re.prefixCls,V=re.id,te=re.active,X=re.rtl,le=re.tab,he=le.key,we=le.tab,Ee=le.disabled,Ie=le.closeIcon,Fe=re.tabBarGutter,$e=re.tabPosition,Ye=re.closable,et=re.renderWrapper,gt=re.removeAriaLabel,wt=re.editable,Tt=re.onClick,Ot=re.onRemove,Ct=re.onFocus,St="".concat(ue,"-tab");w.useEffect(function(){return Ot},[]);var At={};$e==="top"||$e==="bottom"?At[X?"marginLeft":"marginRight"]=Fe:At.marginBottom=Fe;var Nt=wt&&Ye!==!1&&!Ee;function Rt(mt){if(Ee)return;Tt(mt)}function ln(mt){mt.preventDefault(),mt.stopPropagation(),wt.onEdit("remove",{key:he,event:mt})}var Gt=w.createElement("div",{key:he,ref:be,className:B()(St,(Ae={},Object(ne.a)(Ae,"".concat(St,"-with-remove"),Nt),Object(ne.a)(Ae,"".concat(St,"-active"),te),Object(ne.a)(Ae,"".concat(St,"-disabled"),Ee),Ae)),style:At,onClick:Rt},w.createElement("div",{role:"tab","aria-selected":te,id:V&&"".concat(V,"-tab-").concat(he),className:"".concat(St,"-btn"),"aria-controls":V&&"".concat(V,"-panel-").concat(he),"aria-disabled":Ee,tabIndex:Ee?null:0,onClick:function(pt){pt.stopPropagation(),Rt(pt)},onKeyDown:function(pt){[o.a.SPACE,o.a.ENTER].includes(pt.which)&&(pt.preventDefault(),Rt(pt))},onFocus:Ct},we),Nt&&w.createElement("button",{type:"button","aria-label":gt||"remove",tabIndex:0,className:"".concat(St,"-remove"),onClick:function(pt){pt.stopPropagation(),ln(pt)}},Ie||wt.removeIcon||"\xD7"));return et&&(Gt=et(Gt)),Gt}var r=w.forwardRef(s),n={width:0,height:0,left:0,top:0};function t(re,be,Ae){return Object(w.useMemo)(function(){for(var ue,V=new Map,te=be.get((ue=re[0])===null||ue===void 0?void 0:ue.key)||n,X=te.left+te.width,le=0;le<re.length;le+=1){var he=re[le].key,we=be.get(he);if(!we){var Ee;we=be.get((Ee=re[le-1])===null||Ee===void 0?void 0:Ee.key)||n}var Ie=V.get(he)||Object(k.a)({},we);Ie.right=X-Ie.left-Ie.width,V.set(he,Ie)}return V},[re.map(function(ue){return ue.key}).join("_"),be,Ae])}var g={width:0,height:0,left:0,top:0,right:0};function p(re,be,Ae,ue,V){var te=V.tabs,X=V.tabPosition,le=V.rtl,he,we,Ee;["top","bottom"].includes(X)?(he="width",we=le?"right":"left",Ee=Math.abs(be.left)):(he="height",we="top",Ee=-be.top);var Ie=be[he],Fe=Ae[he],$e=ue[he],Ye=Ie;return Fe+$e>Ie&&(Ye=Ie-$e),Object(w.useMemo)(function(){if(!te.length)return[0,0];for(var et=te.length,gt=et,wt=0;wt<et;wt+=1){var Tt=re.get(te[wt].key)||g;if(Tt[we]+Tt[he]>Ee+Ye){gt=wt-1;break}}for(var Ot=0,Ct=et-1;Ct>=0;Ct-=1){var St=re.get(te[Ct].key)||g;if(St[we]<Ee){Ot=Ct+1;break}}return[Ot,gt]},[re,Ee,Ye,X,te.map(function(et){return et.key}).join("_"),le])}var m=U("wx14"),b=U("1OyB"),_=U("vuIU"),l=U("JX7q"),f=U("Ji7U"),u=U("LK+K"),h=U("I8Z2"),E=U("bT9E"),v=U("2GS6"),S=U("Gytx"),L=U.n(S),I=U("U8pU"),A=/iPhone/i,P=/iPod/i,H=/iPad/i,R=/\bAndroid(?:.+)Mobile\b/i,K=/Android/i,z=/\bAndroid(?:.+)SD4930UR\b/i,oe=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,$=/Windows Phone/i,fe=/\bWindows(?:.+)ARM\b/i,de=/BlackBerry/i,ee=/BB10/i,ie=/Opera Mini/i,ge=/\b(CriOS|Chrome)(?:.+)Mobile/i,Z=/Mobile(?:.+)Firefox\b/i;function Y(re,be){return re.test(be)}function Se(re){var be=re||(typeof navigator!="undefined"?navigator.userAgent:""),Ae=(be||"").split("[FBAN");if(typeof Ae[1]!="undefined"){var ue=Ae,V=Object(W.a)(ue,1);be=V[0]}if(Ae=be.split("Twitter"),typeof Ae[1]!="undefined"){var te=Ae,X=Object(W.a)(te,1);be=X[0]}var le={apple:{phone:Y(A,be)&&!Y($,be),ipod:Y(P,be),tablet:!Y(A,be)&&Y(H,be)&&!Y($,be),device:(Y(A,be)||Y(P,be)||Y(H,be))&&!Y($,be)},amazon:{phone:Y(z,be),tablet:!Y(z,be)&&Y(oe,be),device:Y(z,be)||Y(oe,be)},android:{phone:!Y($,be)&&Y(z,be)||!Y($,be)&&Y(R,be),tablet:!Y($,be)&&!Y(z,be)&&!Y(R,be)&&(Y(oe,be)||Y(K,be)),device:!Y($,be)&&(Y(z,be)||Y(oe,be)||Y(R,be)||Y(K,be))||Y(/\bokhttp\b/i,be)},windows:{phone:Y($,be),tablet:Y(fe,be),device:Y($,be)||Y(fe,be)},other:{blackberry:Y(de,be),blackberry10:Y(ee,be),opera:Y(ie,be),firefox:Y(Z,be),chrome:Y(ge,be),device:Y(de,be)||Y(ee,be)||Y(ie,be)||Y(Z,be)||Y(ge,be)},any:null,phone:null,tablet:null};return le.any=le.apple.device||le.android.device||le.windows.device||le.other.device,le.phone=le.apple.phone||le.android.phone||le.windows.phone,le.tablet=le.apple.tablet||le.android.tablet||le.windows.tablet,le}var Pe=Object(k.a)(Object(k.a)({},Se()),{},{isMobile:Se}),ke=Pe;function Re(){}function Me(re,be,Ae){var ue=be||"";return re.key||"".concat(ue,"item_").concat(Ae)}function Ce(re){return"".concat(re,"-menu-")}function Le(re,be){var Ae=-1;w.Children.forEach(re,function(ue){Ae+=1,ue&&ue.type&&ue.type.isMenuItemGroup?w.Children.forEach(ue.props.children,function(V){Ae+=1,be(V,Ae)}):be(ue,Ae)})}function Ne(re,be,Ae){if(!re||Ae.find)return;w.Children.forEach(re,function(ue){if(ue){var V=ue.type;if(!V||!(V.isSubMenu||V.isMenuItem||V.isMenuItemGroup))return;be.indexOf(ue.key)!==-1?Ae.find=!0:ue.props.children&&Ne(ue.props.children,be,Ae)}})}var J=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],pe=function(be){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ue=be&&typeof be.getBoundingClientRect=="function"&&be.getBoundingClientRect().width;if(ue){if(Ae){var V=getComputedStyle(be),te=V.marginLeft,X=V.marginRight;ue+=+te.replace("px","")+ +X.replace("px","")}ue=+ue.toFixed(6)}return ue||0},Te=function(be,Ae,ue){be&&Object(I.a)(be.style)==="object"&&(be.style[Ae]=ue)},xe=function(){return ke.any},We=U("bdgK"),He=U("i8i4"),Oe=U.n(He),Ue=U("wgJM"),Qe=U("l4aY"),Ze=U("m+aA"),Je=U("c+Xe"),ze=U("zT1h"),nt=U("QC+M");function it(re,be,Ae){return Ae?re[0]===be[0]:re[0]===be[0]&&re[1]===be[1]}function je(re,be,Ae){var ue=re[be]||{};return Object(k.a)(Object(k.a)({},ue),Ae)}function Ke(re,be,Ae,ue){for(var V=Ae.points,te=Object.keys(re),X=0;X<te.length;X+=1){var le=te[X];if(it(re[le].points,V,ue))return"".concat(be,"-placement-").concat(le)}return""}var ae=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var re=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(re)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(re==null?void 0:re.substr(0,4)))},ce=U("MNnm");function ye(re,be){var Ae={};return Ae[re.toLowerCase()]=be.toLowerCase(),Ae["Webkit".concat(re)]="webkit".concat(be),Ae["Moz".concat(re)]="moz".concat(be),Ae["ms".concat(re)]="MS".concat(be),Ae["O".concat(re)]="o".concat(be.toLowerCase()),Ae}function Q(re,be){var Ae={animationend:ye("Animation","AnimationEnd"),transitionend:ye("Transition","TransitionEnd")};return re&&("AnimationEvent"in be||delete Ae.animationend.animation,"TransitionEvent"in be||delete Ae.transitionend.transition),Ae}var q=Q(Object(ce.a)(),typeof window!="undefined"?window:{}),se={};if(Object(ce.a)()){var me=document.createElement("div");se=me.style}var De={};function Be(re){if(De[re])return De[re];var be=q[re];if(be)for(var Ae=Object.keys(be),ue=Ae.length,V=0;V<ue;V+=1){var te=Ae[V];if(Object.prototype.hasOwnProperty.call(be,te)&&te in se)return De[re]=be[te],De[re]}return""}var Xe=Be("animationend"),ut=Be("transitionend"),vt=!!(Xe&&ut),dt=Xe||"animationend",_t=ut||"transitionend";function xt(re,be){if(!re)return null;if(Object(I.a)(re)==="object"){var Ae=be.replace(/-\w/g,function(ue){return ue[1].toUpperCase()});return re[Ae]}return"".concat(re,"-").concat(be)}var rt="none",Yt="appear",It="enter",qt="leave",$t="none",bt="prepare",en="start",hn="active",ct="end";function _n(re){var be=Object(w.useRef)(!1),Ae=Object(w.useState)(re),ue=Object(W.a)(Ae,2),V=ue[0],te=ue[1];function X(le){be.current||te(le)}return Object(w.useEffect)(function(){return function(){be.current=!0}},[]),[V,X]}var at=Object(ce.a)()?w.useLayoutEffect:w.useEffect,lt=at,Pt=function(){var re=w.useRef(null);function be(){Ue.a.cancel(re.current)}function Ae(ue){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;be();var te=Object(Ue.a)(function(){V<=1?ue({isCanceled:function(){return te!==re.current}}):Ae(ue,V-1)});re.current=te}return w.useEffect(function(){return function(){be()}},[]),[Ae,be]},Kt=[bt,en,hn,ct],rn=!1,an=!0;function Cn(re){return re===hn||re===ct}var bn=function(re,be){var Ae=w.useState($t),ue=Object(W.a)(Ae,2),V=ue[0],te=ue[1],X=Pt(),le=Object(W.a)(X,2),he=le[0],we=le[1];function Ee(){te(bt)}return lt(function(){if(V!==$t&&V!==ct){var Ie=Kt.indexOf(V),Fe=Kt[Ie+1],$e=be(V);$e===rn?te(Fe):he(function(Ye){function et(){if(Ye.isCanceled())return;te(Fe)}$e===!0?et():Promise.resolve($e).then(et)})}},[re,V]),w.useEffect(function(){return function(){we()}},[]),[Ee,V]},Wt=function(re){var be=Object(w.useRef)(),Ae=Object(w.useRef)(re);Ae.current=re;var ue=w.useCallback(function(X){Ae.current(X)},[]);function V(X){X&&(X.removeEventListener(_t,ue),X.removeEventListener(dt,ue))}function te(X){be.current&&be.current!==X&&V(be.current),X&&X!==be.current&&(X.addEventListener(_t,ue),X.addEventListener(dt,ue),be.current=X)}return w.useEffect(function(){return function(){V(be.current)}},[]),[te,V]};function wn(re,be,Ae,ue){var V=ue.motionEnter,te=V===void 0?!0:V,X=ue.motionAppear,le=X===void 0?!0:X,he=ue.motionLeave,we=he===void 0?!0:he,Ee=ue.motionDeadline,Ie=ue.motionLeaveImmediately,Fe=ue.onAppearPrepare,$e=ue.onEnterPrepare,Ye=ue.onLeavePrepare,et=ue.onAppearStart,gt=ue.onEnterStart,wt=ue.onLeaveStart,Tt=ue.onAppearActive,Ot=ue.onEnterActive,Ct=ue.onLeaveActive,St=ue.onAppearEnd,At=ue.onEnterEnd,Nt=ue.onLeaveEnd,Rt=ue.onVisibleChanged,ln=_n(),Gt=Object(W.a)(ln,2),mt=Gt[0],pt=Gt[1],Dt=_n(rt),Mt=Object(W.a)(Dt,2),ot=Mt[0],Ut=Mt[1],tn=_n(null),Bt=Object(W.a)(tn,2),Xt=Bt[0],sn=Bt[1],xn=Object(w.useRef)(!1),Ln=Object(w.useRef)(null),un=Object(w.useRef)(!1),Pn=Object(w.useRef)(null);function Hn(){var nn=Ae();return nn||Pn.current}var kn=Object(w.useRef)(!1);function Nn(nn){var Ht=Hn();if(nn&&!nn.deadline&&nn.target!==Ht)return;var An;ot===Yt&&kn.current?An=St==null?void 0:St(Ht,nn):ot===It&&kn.current?An=At==null?void 0:At(Ht,nn):ot===qt&&kn.current&&(An=Nt==null?void 0:Nt(Ht,nn)),An!==!1&&!un.current&&(Ut(rt),sn(null))}var cn=Wt(Nn),Rn=Object(W.a)(cn,1),Sn=Rn[0],vn=w.useMemo(function(){var nn,Ht,An;switch(ot){case"appear":return nn={},Object(ne.a)(nn,bt,Fe),Object(ne.a)(nn,en,et),Object(ne.a)(nn,hn,Tt),nn;case"enter":return Ht={},Object(ne.a)(Ht,bt,$e),Object(ne.a)(Ht,en,gt),Object(ne.a)(Ht,hn,Ot),Ht;case"leave":return An={},Object(ne.a)(An,bt,Ye),Object(ne.a)(An,en,wt),Object(ne.a)(An,hn,Ct),An;default:return{}}},[ot]),$n=bn(ot,function(nn){if(nn===bt){var Ht=vn[bt];return Ht?Ht(Hn()):rn}if(Jt in vn){var An;sn(((An=vn[Jt])===null||An===void 0?void 0:An.call(vn,Hn(),null))||null)}return Jt===hn&&(Sn(Hn()),Ee>0&&(clearTimeout(Ln.current),Ln.current=setTimeout(function(){Nn({deadline:!0})},Ee))),an}),Qn=Object(W.a)($n,2),ei=Qn[0],Jt=Qn[1],zn=Cn(Jt);kn.current=zn,lt(function(){pt(be);var nn=xn.current;if(xn.current=!0,!re)return;var Ht;!nn&&be&&le&&(Ht=Yt),nn&&be&&te&&(Ht=It),(nn&&!be&&we||!nn&&Ie&&!be&&we)&&(Ht=qt),Ht&&(Ut(Ht),ei())},[be]),Object(w.useEffect)(function(){(ot===Yt&&!le||ot===It&&!te||ot===qt&&!we)&&Ut(rt)},[le,te,we]),Object(w.useEffect)(function(){return function(){clearTimeout(Ln.current),un.current=!0}},[]),Object(w.useEffect)(function(){mt!==void 0&&ot===rt&&(Rt==null||Rt(mt))},[mt,ot]);var ti=Xt;return vn[bt]&&Jt===en&&(ti=Object(k.a)({transition:"none"},ti)),[ot,Jt,ti,mt!=null?mt:be]}var In=function(re){Object(f.a)(Ae,re);var be=Object(u.a)(Ae);function Ae(){return Object(b.a)(this,Ae),be.apply(this,arguments)}return Object(_.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(w.Component),Mn=In;function Bn(re){var be=re;Object(I.a)(re)==="object"&&(be=re.transitionSupport);function Ae(V){return!!(V.motionName&&be)}var ue=w.forwardRef(function(V,te){var X=V.visible,le=X===void 0?!0:X,he=V.removeOnLeave,we=he===void 0?!0:he,Ee=V.forceRender,Ie=V.children,Fe=V.motionName,$e=V.leavedClassName,Ye=V.eventProps,et=Ae(V),gt=Object(w.useRef)(),wt=Object(w.useRef)();function Tt(){try{return Object(Ze.a)(gt.current||wt.current)}catch(Ut){return null}}var Ot=wn(et,le,Tt,V),Ct=Object(W.a)(Ot,4),St=Ct[0],At=Ct[1],Nt=Ct[2],Rt=Ct[3],ln=w.useRef(Rt);Rt&&(ln.current=!0);var Gt=Object(w.useRef)(te);Gt.current=te;var mt=w.useCallback(function(Ut){gt.current=Ut,Object(Je.b)(Gt.current,Ut)},[]),pt,Dt=Object(k.a)(Object(k.a)({},Ye),{},{visible:le});if(!Ie)pt=null;else if(St===rt||!Ae(V))Rt?pt=Ie(Object(k.a)({},Dt),mt):!we&&ln.current?pt=Ie(Object(k.a)(Object(k.a)({},Dt),{},{className:$e}),mt):Ee?pt=Ie(Object(k.a)(Object(k.a)({},Dt),{},{style:{display:"none"}}),mt):pt=null;else{var Mt,ot;At===bt?ot="prepare":Cn(At)?ot="active":At===en&&(ot="start"),pt=Ie(Object(k.a)(Object(k.a)({},Dt),{},{className:B()(xt(Fe,St),(Mt={},Object(ne.a)(Mt,xt(Fe,"".concat(St,"-").concat(ot)),ot),Object(ne.a)(Mt,Fe,typeof Fe=="string"),Mt)),style:Nt}),mt)}return w.createElement(Mn,{ref:wt},pt)});return ue.displayName="CSSMotion",ue}var Fn=Bn(vt),Wn="add",Jn="keep",Vn="remove",Xn="removed";function li(re){var be;return re&&Object(I.a)(re)==="object"&&"key"in re?be=re:be={key:re},Object(k.a)(Object(k.a)({},be),{},{key:String(be.key)})}function fn(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return re.map(li)}function F(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ae=[],ue=0,V=be.length,te=fn(re),X=fn(be);te.forEach(function(we){for(var Ee=!1,Ie=ue;Ie<V;Ie+=1){var Fe=X[Ie];if(Fe.key===we.key){ue<Ie&&(Ae=Ae.concat(X.slice(ue,Ie).map(function($e){return Object(k.a)(Object(k.a)({},$e),{},{status:Wn})})),ue=Ie),Ae.push(Object(k.a)(Object(k.a)({},Fe),{},{status:Jn})),ue+=1,Ee=!0;break}}Ee||Ae.push(Object(k.a)(Object(k.a)({},we),{},{status:Vn}))}),ue<V&&(Ae=Ae.concat(X.slice(ue).map(function(we){return Object(k.a)(Object(k.a)({},we),{},{status:Wn})})));var le={};Ae.forEach(function(we){var Ee=we.key;le[Ee]=(le[Ee]||0)+1});var he=Object.keys(le).filter(function(we){return le[we]>1});return he.forEach(function(we){Ae=Ae.filter(function(Ee){var Ie=Ee.key,Fe=Ee.status;return Ie!==we||Fe!==Vn}),Ae.forEach(function(Ee){Ee.key===we&&(Ee.status=Jn)})}),Ae}var T=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function x(re){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fn,Ae=function(ue){Object(f.a)(te,ue);var V=Object(u.a)(te);function te(){var X;return Object(b.a)(this,te),X=V.apply(this,arguments),X.state={keyEntities:[]},X.removeKey=function(le){X.setState(function(he){var we=he.keyEntities;return{keyEntities:we.map(function(Ee){return Ee.key!==le?Ee:Object(k.a)(Object(k.a)({},Ee),{},{status:Xn})})}})},X}return Object(_.a)(te,[{key:"render",value:function(){var le=this,he=this.state.keyEntities,we=this.props,Ee=we.component,Ie=we.children,Fe=we.onVisibleChanged,$e=Object(O.a)(we,["component","children","onVisibleChanged"]),Ye=Ee||w.Fragment,et={};return T.forEach(function(gt){et[gt]=$e[gt],delete $e[gt]}),delete $e.keys,w.createElement(Ye,$e,he.map(function(gt){var wt=gt.status,Tt=Object(O.a)(gt,["status"]),Ot=wt===Wn||wt===Jn;return w.createElement(be,Object(m.a)({},et,{key:Tt.key,visible:Ot,eventProps:Tt,onVisibleChanged:function(St){Fe==null||Fe(St,{key:Tt.key}),St||le.removeKey(Tt.key)}}),Ie)}))}}],[{key:"getDerivedStateFromProps",value:function(le,he){var we=le.keys,Ee=he.keyEntities,Ie=fn(we),Fe=F(Ee,Ie);return{keyEntities:Fe.filter(function($e){var Ye=Ee.find(function(et){var gt=et.key;return $e.key===gt});return!(Ye&&Ye.status===Xn&&$e.status===Vn)})}}}]),te}(w.Component);return Ae.defaultProps={component:"div"},Ae}var N=x(vt),G=Fn;function j(re){var be=re.prefixCls,Ae=re.motion,ue=re.animation,V=re.transitionName;return Ae||(ue?{motionName:"".concat(be,"-").concat(ue)}:V?{motionName:V}:null)}function _e(re){var be=re.prefixCls,Ae=re.visible,ue=re.zIndex,V=re.mask,te=re.maskMotion,X=re.maskAnimation,le=re.maskTransitionName;if(!V)return null;var he={};return(te||le||X)&&(he=Object(k.a)({motionAppear:!0},j({motion:te,prefixCls:be,transitionName:le,animation:X}))),w.createElement(G,Object(m.a)({},he,{visible:Ae,removeOnLeave:!0}),function(we){var Ee=we.className;return w.createElement("div",{style:{zIndex:ue},className:B()("".concat(be,"-mask"),Ee)})})}var Ge=U("9mu1"),tt=U("o0o1"),st=U.n(tt),Ve=U("HaE+"),yt=["measure","align",null,"motion"],jt=function(re,be){var Ae=Object(w.useState)(null),ue=Object(W.a)(Ae,2),V=ue[0],te=ue[1],X=Object(w.useRef)(),le=Object(w.useRef)(!1);function he(Ie){le.current||te(Ie)}function we(){Ue.a.cancel(X.current)}function Ee(Ie){we(),X.current=Object(Ue.a)(function(){he(function(Fe){switch(V){case"align":return"motion";case"motion":return"stable";default:}return Fe}),Ie==null||Ie()})}return Object(w.useEffect)(function(){he("measure")},[re]),Object(w.useEffect)(function(){switch(V){case"measure":be();break;default:}V&&(X.current=Object(Ue.a)(Object(Ve.a)(st.a.mark(function Ie(){var Fe,$e;return st.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:Fe=yt.indexOf(V),$e=yt[Fe+1],$e&&Fe!==-1&&he($e);case 3:case"end":return et.stop()}},Ie)}))))},[V]),Object(w.useEffect)(function(){return function(){le.current=!0,we()}},[]),[V,Ee]},Qt=function(re){var be=w.useState({width:0,height:0}),Ae=Object(W.a)(be,2),ue=Ae[0],V=Ae[1];function te(le){V({width:le.offsetWidth,height:le.offsetHeight})}var X=w.useMemo(function(){var le={};if(re){var he=ue.width,we=ue.height;re.indexOf("height")!==-1&&we?le.height=we:re.indexOf("minHeight")!==-1&&we&&(le.minHeight=we),re.indexOf("width")!==-1&&he?le.width=he:re.indexOf("minWidth")!==-1&&he&&(le.minWidth=he)}return le},[re,ue]);return[X,te]},Dn=w.forwardRef(function(re,be){var Ae=re.visible,ue=re.prefixCls,V=re.className,te=re.style,X=re.children,le=re.zIndex,he=re.stretch,we=re.destroyPopupOnHide,Ee=re.forceRender,Ie=re.align,Fe=re.point,$e=re.getRootDomNode,Ye=re.getClassNameFromAlign,et=re.onAlign,gt=re.onMouseEnter,wt=re.onMouseLeave,Tt=re.onMouseDown,Ot=re.onTouchStart,Ct=Object(w.useRef)(),St=Object(w.useRef)(),At=Object(w.useState)(),Nt=Object(W.a)(At,2),Rt=Nt[0],ln=Nt[1],Gt=Qt(he),mt=Object(W.a)(Gt,2),pt=mt[0],Dt=mt[1];function Mt(){he&&Dt($e())}var ot=jt(Ae,Mt),Ut=Object(W.a)(ot,2),tn=Ut[0],Bt=Ut[1],Xt=Object(w.useRef)();function sn(){return Fe||$e}function xn(){var cn;(cn=Ct.current)===null||cn===void 0||cn.forceAlign()}function Ln(cn,Rn){var Sn=Ye(Rn);Rt!==Sn&&ln(Sn),tn==="align"&&(Rt!==Sn?Promise.resolve().then(function(){xn()}):Bt(function(){var vn;(vn=Xt.current)===null||vn===void 0||vn.call(Xt)}),et==null||et(cn,Rn))}var un=Object(k.a)({},j(re));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(cn){var Rn=un[cn];un[cn]=function(Sn,vn){return Bt(),Rn==null?void 0:Rn(Sn,vn)}});function Pn(){return new Promise(function(cn){Xt.current=cn})}w.useEffect(function(){!un.motionName&&tn==="motion"&&Bt()},[un.motionName,tn]),w.useImperativeHandle(be,function(){return{forceAlign:xn,getElement:function(){return St.current}}});var Hn=Object(k.a)(Object(k.a)({},pt),{},{zIndex:le,opacity:tn==="motion"||tn==="stable"||!Ae?void 0:0,pointerEvents:tn==="stable"?void 0:"none"},te),kn=!0;(Ie==null?void 0:Ie.points)&&(tn==="align"||tn==="stable")&&(kn=!1);var Nn=X;return w.Children.count(X)>1&&(Nn=w.createElement("div",{className:"".concat(ue,"-content")},X)),w.createElement(G,Object(m.a)({visible:Ae,ref:St,leavedClassName:"".concat(ue,"-hidden")},un,{onAppearPrepare:Pn,onEnterPrepare:Pn,removeOnLeave:we,forceRender:Ee}),function(cn,Rn){var Sn=cn.className,vn=cn.style,$n=B()(ue,V,Rt,Sn);return w.createElement(Ge.a,{target:sn(),key:"popup",ref:Ct,monitorWindowResize:!0,disabled:kn,align:Ie,onAlign:Ln},w.createElement("div",{ref:Rn,className:$n,onMouseEnter:gt,onMouseLeave:wt,onMouseDownCapture:Tt,onTouchStartCapture:Ot,style:Object(k.a)(Object(k.a)({},vn),Hn)},Nn))})});Dn.displayName="PopupInner";var Kn=Dn,pn=w.forwardRef(function(re,be){var Ae=re.prefixCls,ue=re.visible,V=re.zIndex,te=re.children,X=re.mobile;X=X===void 0?{}:X;var le=X.popupClassName,he=X.popupStyle,we=X.popupMotion,Ee=we===void 0?{}:we,Ie=X.popupRender,Fe=w.useRef();w.useImperativeHandle(be,function(){return{forceAlign:function(){},getElement:function(){return Fe.current}}});var $e=Object(k.a)({zIndex:V},he),Ye=te;return w.Children.count(te)>1&&(Ye=w.createElement("div",{className:"".concat(Ae,"-content")},te)),Ie&&(Ye=Ie(Ye)),w.createElement(G,Object(m.a)({visible:ue,ref:Fe,removeOnLeave:!0},Ee),function(et,gt){var wt=et.className,Tt=et.style,Ot=B()(Ae,le,wt);return w.createElement("div",{ref:gt,className:Ot,style:Object(k.a)(Object(k.a)({},Tt),$e)},Ye)})});pn.displayName="MobilePopupInner";var jn=pn,ui=["visible","mobile"],qn=w.forwardRef(function(re,be){var Ae=re.visible,ue=re.mobile,V=Object(O.a)(re,ui),te=Object(w.useState)(Ae),X=Object(W.a)(te,2),le=X[0],he=X[1],we=Object(w.useState)(!1),Ee=Object(W.a)(we,2),Ie=Ee[0],Fe=Ee[1],$e=Object(k.a)(Object(k.a)({},V),{},{visible:le});Object(w.useEffect)(function(){he(Ae),Ae&&ue&&Fe(ae())},[Ae,ue]);var Ye=Ie?w.createElement(jn,Object(m.a)({},$e,{mobile:ue,ref:be})):w.createElement(Kn,Object(m.a)({},$e,{ref:be}));return w.createElement("div",null,w.createElement(_e,$e),Ye)});qn.displayName="Popup";var Yn=qn,Gn=w.createContext(null),ni=Gn;function ht(){}function ft(){return""}function Et(re){return re?re.ownerDocument:window.document}var kt=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function dn(re){var be=function(Ae){Object(f.a)(V,Ae);var ue=Object(u.a)(V);function V(te){var X;Object(b.a)(this,V),X=ue.call(this,te),X.popupRef=w.createRef(),X.triggerRef=w.createRef(),X.attachId=void 0,X.clickOutsideHandler=void 0,X.touchOutsideHandler=void 0,X.contextMenuOutsideHandler1=void 0,X.contextMenuOutsideHandler2=void 0,X.mouseDownTimeout=void 0,X.focusTime=void 0,X.preClickTime=void 0,X.preTouchTime=void 0,X.delayTimer=void 0,X.hasPopupMouseDown=void 0,X.onMouseEnter=function(he){var we=X.props.mouseEnterDelay;X.fireEvents("onMouseEnter",he),X.delaySetPopupVisible(!0,we,we?null:he)},X.onMouseMove=function(he){X.fireEvents("onMouseMove",he),X.setPoint(he)},X.onMouseLeave=function(he){X.fireEvents("onMouseLeave",he),X.delaySetPopupVisible(!1,X.props.mouseLeaveDelay)},X.onPopupMouseEnter=function(){X.clearDelayTimer()},X.onPopupMouseLeave=function(he){var we;if(he.relatedTarget&&!he.relatedTarget.setTimeout&&Object(Qe.a)((we=X.popupRef.current)===null||we===void 0?void 0:we.getElement(),he.relatedTarget))return;X.delaySetPopupVisible(!1,X.props.mouseLeaveDelay)},X.onFocus=function(he){X.fireEvents("onFocus",he),X.clearDelayTimer(),X.isFocusToShow()&&(X.focusTime=Date.now(),X.delaySetPopupVisible(!0,X.props.focusDelay))},X.onMouseDown=function(he){X.fireEvents("onMouseDown",he),X.preClickTime=Date.now()},X.onTouchStart=function(he){X.fireEvents("onTouchStart",he),X.preTouchTime=Date.now()},X.onBlur=function(he){X.fireEvents("onBlur",he),X.clearDelayTimer(),X.isBlurToHide()&&X.delaySetPopupVisible(!1,X.props.blurDelay)},X.onContextMenu=function(he){he.preventDefault(),X.fireEvents("onContextMenu",he),X.setPopupVisible(!0,he)},X.onContextMenuClose=function(){X.isContextMenuToShow()&&X.close()},X.onClick=function(he){if(X.fireEvents("onClick",he),X.focusTime){var we;if(X.preClickTime&&X.preTouchTime?we=Math.min(X.preClickTime,X.preTouchTime):X.preClickTime?we=X.preClickTime:X.preTouchTime&&(we=X.preTouchTime),Math.abs(we-X.focusTime)<20)return;X.focusTime=0}X.preClickTime=0,X.preTouchTime=0,X.isClickToShow()&&(X.isClickToHide()||X.isBlurToHide())&&he&&he.preventDefault&&he.preventDefault();var Ee=!X.state.popupVisible;(X.isClickToHide()&&!Ee||Ee&&X.isClickToShow())&&X.setPopupVisible(!X.state.popupVisible,he)},X.onPopupMouseDown=function(){if(X.hasPopupMouseDown=!0,clearTimeout(X.mouseDownTimeout),X.mouseDownTimeout=window.setTimeout(function(){X.hasPopupMouseDown=!1},0),X.context){var he;(he=X.context).onPopupMouseDown.apply(he,arguments)}},X.onDocumentClick=function(he){if(X.props.mask&&!X.props.maskClosable)return;var we=he.target,Ee=X.getRootDomNode(),Ie=X.getPopupDomNode();(!Object(Qe.a)(Ee,we)||X.isContextMenuOnly())&&!Object(Qe.a)(Ie,we)&&!X.hasPopupMouseDown&&X.close()},X.getRootDomNode=function(){var he=X.props.getTriggerDOMNode;if(he)return he(X.triggerRef.current);try{var we=Object(Ze.a)(X.triggerRef.current);if(we)return we}catch(Ee){}return Oe.a.findDOMNode(Object(l.a)(X))},X.getPopupClassNameFromAlign=function(he){var we=[],Ee=X.props,Ie=Ee.popupPlacement,Fe=Ee.builtinPlacements,$e=Ee.prefixCls,Ye=Ee.alignPoint,et=Ee.getPopupClassNameFromAlign;return Ie&&Fe&&we.push(Ke(Fe,$e,he,Ye)),et&&we.push(et(he)),we.join(" ")},X.getComponent=function(){var he=X.props,we=he.prefixCls,Ee=he.destroyPopupOnHide,Ie=he.popupClassName,Fe=he.onPopupAlign,$e=he.popupMotion,Ye=he.popupAnimation,et=he.popupTransitionName,gt=he.popupStyle,wt=he.mask,Tt=he.maskAnimation,Ot=he.maskTransitionName,Ct=he.maskMotion,St=he.zIndex,At=he.popup,Nt=he.stretch,Rt=he.alignPoint,ln=he.mobile,Gt=he.forceRender,mt=X.state,pt=mt.popupVisible,Dt=mt.point,Mt=X.getPopupAlign(),ot={};return X.isMouseEnterToShow()&&(ot.onMouseEnter=X.onPopupMouseEnter),X.isMouseLeaveToHide()&&(ot.onMouseLeave=X.onPopupMouseLeave),ot.onMouseDown=X.onPopupMouseDown,ot.onTouchStart=X.onPopupMouseDown,w.createElement(Yn,Object(m.a)({prefixCls:we,destroyPopupOnHide:Ee,visible:pt,point:Rt&&Dt,className:Ie,align:Mt,onAlign:Fe,animation:Ye,getClassNameFromAlign:X.getPopupClassNameFromAlign},ot,{stretch:Nt,getRootDomNode:X.getRootDomNode,style:gt,mask:wt,zIndex:St,transitionName:et,maskAnimation:Tt,maskTransitionName:Ot,maskMotion:Ct,ref:X.popupRef,motion:$e,mobile:ln,forceRender:Gt}),typeof At=="function"?At():At)},X.attachParent=function(he){Ue.a.cancel(X.attachId);var we=X.props,Ee=we.getPopupContainer,Ie=we.getDocument,Fe=X.getRootDomNode(),$e;Ee?(Fe||Ee.length===0)&&($e=Ee(Fe)):$e=Ie(X.getRootDomNode()).body,$e?$e.appendChild(he):X.attachId=Object(Ue.a)(function(){X.attachParent(he)})},X.getContainer=function(){var he=X.props.getDocument,we=he(X.getRootDomNode()).createElement("div");return we.style.position="absolute",we.style.top="0",we.style.left="0",we.style.width="100%",X.attachParent(we),we},X.setPoint=function(he){var we=X.props.alignPoint;if(!we||!he)return;X.setState({point:{pageX:he.pageX,pageY:he.pageY}})},X.handlePortalUpdate=function(){X.state.prevPopupVisible!==X.state.popupVisible&&X.props.afterPopupVisibleChange(X.state.popupVisible)},X.triggerContextValue={onPopupMouseDown:X.onPopupMouseDown};var le;return"popupVisible"in te?le=!!te.popupVisible:le=!!te.defaultPopupVisible,X.state={prevPopupVisible:le,popupVisible:le},kt.forEach(function(he){X["fire".concat(he)]=function(we){X.fireEvents(he,we)}}),X}return Object(_.a)(V,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var X=this.props,le=this.state;if(le.popupVisible){var he;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(he=X.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(ze.a)(he,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(he=he||X.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(ze.a)(he,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(he=he||X.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(ze.a)(he,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(ze.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Ue.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var X;return((X=this.popupRef.current)===null||X===void 0?void 0:X.getElement())||null}},{key:"getPopupAlign",value:function(){var X=this.props,le=X.popupPlacement,he=X.popupAlign,we=X.builtinPlacements;return le&&we?je(we,le,he):he}},{key:"setPopupVisible",value:function(X,le){var he=this.props.alignPoint,we=this.state.popupVisible;this.clearDelayTimer(),we!==X&&("popupVisible"in this.props||this.setState({popupVisible:X,prevPopupVisible:we}),this.props.onPopupVisibleChange(X)),he&&le&&X&&this.setPoint(le)}},{key:"delaySetPopupVisible",value:function(X,le,he){var we=this,Ee=le*1e3;if(this.clearDelayTimer(),Ee){var Ie=he?{pageX:he.pageX,pageY:he.pageY}:null;this.delayTimer=window.setTimeout(function(){we.setPopupVisible(X,Ie),we.clearDelayTimer()},Ee)}else this.setPopupVisible(X,he)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(X){var le=this.props.children.props,he=this.props;return le[X]&&he[X]?this["fire".concat(X)]:le[X]||he[X]}},{key:"isClickToShow",value:function(){var X=this.props,le=X.action,he=X.showAction;return le.indexOf("click")!==-1||he.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var X=this.props.action;return X==="contextMenu"||X.length===1&&X[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var X=this.props,le=X.action,he=X.showAction;return le.indexOf("contextMenu")!==-1||he.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var X=this.props,le=X.action,he=X.hideAction;return le.indexOf("click")!==-1||he.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var X=this.props,le=X.action,he=X.showAction;return le.indexOf("hover")!==-1||he.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var X=this.props,le=X.action,he=X.hideAction;return le.indexOf("hover")!==-1||he.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var X=this.props,le=X.action,he=X.showAction;return le.indexOf("focus")!==-1||he.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var X=this.props,le=X.action,he=X.hideAction;return le.indexOf("focus")!==-1||he.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var X;(X=this.popupRef.current)===null||X===void 0||X.forceAlign()}}},{key:"fireEvents",value:function(X,le){var he=this.props.children.props[X];he&&he(le);var we=this.props[X];we&&we(le)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var X=this.state.popupVisible,le=this.props,he=le.children,we=le.forceRender,Ee=le.alignPoint,Ie=le.className,Fe=le.autoDestroy,$e=w.Children.only(he),Ye={key:"trigger"};this.isContextMenuToShow()?Ye.onContextMenu=this.onContextMenu:Ye.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Ye.onClick=this.onClick,Ye.onMouseDown=this.onMouseDown,Ye.onTouchStart=this.onTouchStart):(Ye.onClick=this.createTwoChains("onClick"),Ye.onMouseDown=this.createTwoChains("onMouseDown"),Ye.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Ye.onMouseEnter=this.onMouseEnter,Ee&&(Ye.onMouseMove=this.onMouseMove)):Ye.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Ye.onMouseLeave=this.onMouseLeave:Ye.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Ye.onFocus=this.onFocus,Ye.onBlur=this.onBlur):(Ye.onFocus=this.createTwoChains("onFocus"),Ye.onBlur=this.createTwoChains("onBlur"));var et=B()($e&&$e.props&&$e.props.className,Ie);et&&(Ye.className=et);var gt=Object(k.a)({},Ye);Object(Je.c)($e)&&(gt.ref=Object(Je.a)(this.triggerRef,$e.ref));var wt=w.cloneElement($e,gt),Tt;return(X||this.popupRef.current||we)&&(Tt=w.createElement(re,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!X&&Fe&&(Tt=null),w.createElement(ni.Provider,{value:this.triggerContextValue},wt,Tt)}}],[{key:"getDerivedStateFromProps",value:function(X,le){var he=X.popupVisible,we={};return he!==void 0&&le.popupVisible!==he&&(we.popupVisible=he,we.prevPopupVisible=le.popupVisible),we}}]),V}(w.Component);return be.contextType=ni,be.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:ft,getDocument:Et,onPopupVisibleChange:ht,afterPopupVisibleChange:ht,onPopupAlign:ht,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},be}var Zt=dn(nt.a),En={adjustX:1,adjustY:1},ii={topLeft:{points:["bl","tl"],overflow:En,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:En,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:En,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:En,offset:[4,0]}},xi={topLeft:{points:["bl","tl"],overflow:En,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:En,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:En,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:En,offset:[4,0]}},Bi=ii,mn=0,Vt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},gn=function(be,Ae,ue){var V=Ce(Ae),te=be.getState();be.setState({defaultActiveFirst:Object(k.a)(Object(k.a)({},te.defaultActiveFirst),{},Object(ne.a)({},V,ue))})},Ft=function(re){Object(f.a)(Ae,re);var be=Object(u.a)(Ae);function Ae(ue){var V;Object(b.a)(this,Ae),V=be.call(this,ue),V.onDestroy=function(Ee){V.props.onDestroy(Ee)},V.onKeyDown=function(Ee){var Ie=Ee.keyCode,Fe=V.menuInstance,$e=V.props.store,Ye=V.getVisible();if(Ie===o.a.ENTER)return V.onTitleClick(Ee),gn($e,V.props.eventKey,!0),!0;if(Ie===o.a.RIGHT)return Ye?Fe.onKeyDown(Ee):(V.triggerOpenChange(!0),gn($e,V.props.eventKey,!0)),!0;if(Ie===o.a.LEFT){var et;if(Ye)et=Fe.onKeyDown(Ee);else return;return et||(V.triggerOpenChange(!1),et=!0),et}return Ye&&(Ie===o.a.UP||Ie===o.a.DOWN)?Fe.onKeyDown(Ee):void 0},V.onOpenChange=function(Ee){V.props.onOpenChange(Ee)},V.onPopupVisibleChange=function(Ee){V.triggerOpenChange(Ee,Ee?"mouseenter":"mouseleave")},V.onMouseEnter=function(Ee){var Ie=V.props,Fe=Ie.eventKey,$e=Ie.onMouseEnter,Ye=Ie.store;gn(Ye,V.props.eventKey,!1),$e({key:Fe,domEvent:Ee})},V.onMouseLeave=function(Ee){var Ie=V.props,Fe=Ie.parentMenu,$e=Ie.eventKey,Ye=Ie.onMouseLeave;Fe.subMenuInstance=Object(l.a)(V),Ye({key:$e,domEvent:Ee})},V.onTitleMouseEnter=function(Ee){var Ie=V.props,Fe=Ie.eventKey,$e=Ie.onItemHover,Ye=Ie.onTitleMouseEnter;$e({key:Fe,hover:!0}),Ye({key:Fe,domEvent:Ee})},V.onTitleMouseLeave=function(Ee){var Ie=V.props,Fe=Ie.parentMenu,$e=Ie.eventKey,Ye=Ie.onItemHover,et=Ie.onTitleMouseLeave;Fe.subMenuInstance=Object(l.a)(V),Ye({key:$e,hover:!1}),et({key:$e,domEvent:Ee})},V.onTitleClick=function(Ee){var Ie=Object(l.a)(V),Fe=Ie.props;if(Fe.onTitleClick({key:Fe.eventKey,domEvent:Ee}),Fe.triggerSubMenuAction==="hover")return;V.triggerOpenChange(!V.getVisible(),"click"),gn(Fe.store,V.props.eventKey,!1)},V.onSubMenuClick=function(Ee){typeof V.props.onClick=="function"&&V.props.onClick(V.addKeyPath(Ee))},V.onSelect=function(Ee){V.props.onSelect(Ee)},V.onDeselect=function(Ee){V.props.onDeselect(Ee)},V.getPrefixCls=function(){return"".concat(V.props.rootPrefixCls,"-submenu")},V.getActiveClassName=function(){return"".concat(V.getPrefixCls(),"-active")},V.getDisabledClassName=function(){return"".concat(V.getPrefixCls(),"-disabled")},V.getSelectedClassName=function(){return"".concat(V.getPrefixCls(),"-selected")},V.getOpenClassName=function(){return"".concat(V.props.rootPrefixCls,"-submenu-open")},V.getVisible=function(){return V.state.isOpen},V.getMode=function(){return V.state.mode},V.saveMenuInstance=function(Ee){V.menuInstance=Ee},V.addKeyPath=function(Ee){return Object(k.a)(Object(k.a)({},Ee),{},{keyPath:(Ee.keyPath||[]).concat(V.props.eventKey)})},V.triggerOpenChange=function(Ee,Ie){var Fe=V.props.eventKey,$e=function(){V.onOpenChange({key:Fe,item:Object(l.a)(V),trigger:Ie,open:Ee})};Ie==="mouseenter"?V.mouseenterTimeout=setTimeout(function(){$e()},0):$e()},V.isChildrenSelected=function(){var Ee={find:!1};return Ne(V.props.children,V.props.selectedKeys,Ee),Ee.find},V.isInlineMode=function(){return V.getMode()==="inline"},V.adjustWidth=function(){if(!V.subMenuTitle||!V.menuInstance)return;var Ee=He.findDOMNode(V.menuInstance);if(Ee.offsetWidth>=V.subMenuTitle.offsetWidth)return;Ee.style.minWidth="".concat(V.subMenuTitle.offsetWidth,"px")},V.saveSubMenuTitle=function(Ee){V.subMenuTitle=Ee},V.getBaseProps=function(){var Ee=Object(l.a)(V),Ie=Ee.props,Fe=V.getMode();return{mode:Fe==="horizontal"?"vertical":Fe,visible:V.getVisible(),level:Ie.level+1,inlineIndent:Ie.inlineIndent,focusable:!1,onClick:V.onSubMenuClick,onSelect:V.onSelect,onDeselect:V.onDeselect,onDestroy:V.onDestroy,selectedKeys:Ie.selectedKeys,eventKey:"".concat(Ie.eventKey,"-menu-"),openKeys:Ie.openKeys,motion:Ie.motion,onOpenChange:V.onOpenChange,subMenuOpenDelay:Ie.subMenuOpenDelay,parentMenu:Object(l.a)(V),subMenuCloseDelay:Ie.subMenuCloseDelay,forceSubMenuRender:Ie.forceSubMenuRender,triggerSubMenuAction:Ie.triggerSubMenuAction,builtinPlacements:Ie.builtinPlacements,defaultActiveFirst:Ie.store.getState().defaultActiveFirst[Ce(Ie.eventKey)],multiple:Ie.multiple,prefixCls:Ie.rootPrefixCls,id:V.internalMenuId,manualRef:V.saveMenuInstance,itemIcon:Ie.itemIcon,expandIcon:Ie.expandIcon,direction:Ie.direction}},V.getMotion=function(Ee,Ie){var Fe=Object(l.a)(V),$e=Fe.haveRendered,Ye=V.props,et=Ye.motion,gt=Ye.rootPrefixCls,wt=Object(k.a)(Object(k.a)({},et),{},{leavedClassName:"".concat(gt,"-hidden"),removeOnLeave:!1,motionAppear:$e||!Ie||Ee!=="inline"});return wt};var te=ue.store,X=ue.eventKey,le=te.getState(),he=le.defaultActiveFirst;V.isRootMenu=!1;var we=!1;return he&&(we=he[X]),gn(te,X,we),V.state={mode:ue.mode,isOpen:ue.isOpen},V}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var V=this,te=this.props,X=te.mode,le=te.parentMenu,he=te.manualRef,we=te.isOpen,Ee=function(){V.setState({mode:X,isOpen:we})},Ie=we!==this.state.isOpen,Fe=X!==this.state.mode;if((Fe||Ie)&&(Ue.a.cancel(this.updateStateRaf),Fe?this.updateStateRaf=Object(Ue.a)(Ee):Ee()),he&&he(this),X!=="horizontal"||!(le==null?void 0:le.isRootMenu)||!we)return;this.minWidthTimeout=setTimeout(function(){return V.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var V=this.props,te=V.onDestroy,X=V.eventKey;te&&te(X),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Ue.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(V,te){var X=this.getBaseProps();return w.createElement(Fi,Object(m.a)({},X,{id:this.internalMenuId,className:V,style:te}),this.props.children)}},{key:"renderChildren",value:function(){var V=this,te=this.getBaseProps(),X=te.mode,le=te.visible,he=te.forceSubMenuRender,we=te.direction,Ee=this.getMotion(X,le);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||le||he,!this.haveOpened)return w.createElement("div",null);var Ie=B()("".concat(te.prefixCls,"-sub"),Object(ne.a)({},"".concat(te.prefixCls,"-rtl"),we==="rtl"));return this.isInlineMode()?w.createElement(G,Object(m.a)({visible:te.visible,forceRender:he},Ee),function(Fe){var $e=Fe.className,Ye=Fe.style,et=B()(Ie,$e);return V.renderPopupMenu(et,Ye)}):this.renderPopupMenu(Ie)}},{key:"render",value:function(){var V,te,X,le=Object(k.a)({},this.props),he=this.getVisible(),we=this.getPrefixCls(),Ee=this.isInlineMode(),Ie=this.getMode(),Fe=B()(we,"".concat(we,"-").concat(Ie),(V={},Object(ne.a)(V,le.className,!!le.className),Object(ne.a)(V,this.getOpenClassName(),he),Object(ne.a)(V,this.getActiveClassName(),le.active||he&&!Ee),Object(ne.a)(V,this.getDisabledClassName(),le.disabled),Object(ne.a)(V,this.getSelectedClassName(),this.isChildrenSelected()),V));this.internalMenuId||(le.eventKey?this.internalMenuId="".concat(le.eventKey,"$Menu"):(mn+=1,this.internalMenuId="$__$".concat(mn,"$Menu")));var $e={},Ye={},et={};le.disabled||($e={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ye={onClick:this.onTitleClick},et={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var gt={},wt=le.direction,Tt=wt==="rtl";Ee&&(Tt?gt.paddingRight=le.inlineIndent*le.level:gt.paddingLeft=le.inlineIndent*le.level);var Ot={};this.getVisible()&&(Ot={"aria-owns":this.internalMenuId});var Ct=null;Ie!=="horizontal"&&(Ct=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Ct=w.createElement(this.props.expandIcon,Object(k.a)({},this.props))));var St=w.createElement("div",Object(m.a)({ref:this.saveSubMenuTitle,style:gt,className:"".concat(we,"-title"),role:"button"},et,Ye,{"aria-expanded":he},Ot,{"aria-haspopup":"true",title:typeof le.title=="string"?le.title:void 0}),le.title,Ct||w.createElement("i",{className:"".concat(we,"-arrow")})),At=this.renderChildren(),Nt=((te=le.parentMenu)===null||te===void 0?void 0:te.isRootMenu)?le.parentMenu.props.getPopupContainer:function(sn){return sn.parentNode},Rt=Vt[Ie],ln=le.popupOffset?{offset:le.popupOffset}:{},Gt=B()((X={},Object(ne.a)(X,le.popupClassName,le.popupClassName&&!Ee),Object(ne.a)(X,"".concat(we,"-rtl"),Tt),X)),mt=le.disabled,pt=le.triggerSubMenuAction,Dt=le.subMenuOpenDelay,Mt=le.forceSubMenuRender,ot=le.subMenuCloseDelay,Ut=le.builtinPlacements;J.forEach(function(sn){return delete le[sn]}),delete le.onClick;var tn=Tt?Object(k.a)(Object(k.a)({},xi),Ut):Object(k.a)(Object(k.a)({},ii),Ut);delete le.direction;var Bt=this.getBaseProps(),Xt=Ee?null:this.getMotion(Bt.mode,Bt.visible);return w.createElement("li",Object(m.a)({},le,$e,{className:Fe,role:"menuitem"}),w.createElement(Zt,{prefixCls:we,popupClassName:B()("".concat(we,"-popup"),Gt),getPopupContainer:Nt,builtinPlacements:tn,popupPlacement:Rt,popupVisible:Ee?!1:he,popupAlign:ln,popup:Ee?null:At,action:mt||Ee?[]:[pt],mouseEnterDelay:Dt,mouseLeaveDelay:ot,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Mt,popupMotion:Xt},St),Ee?At:null)}}]),Ae}(w.Component);Ft.defaultProps={onMouseEnter:Re,onMouseLeave:Re,onTitleMouseEnter:Re,onTitleMouseLeave:Re,onTitleClick:Re,manualRef:Re,mode:"vertical",title:""};var On=Object(h.b)(function(re,be){var Ae=re.openKeys,ue=re.activeKey,V=re.selectedKeys,te=be.eventKey,X=be.subMenuKey;return{isOpen:Ae.indexOf(te)>-1,active:ue[X]===te,selectedKeys:V}})(Ft);On.isSubMenu=!0;var on=On,ri="menuitem-overflowed",Tn=.5,di=function(re){Object(f.a)(Ae,re);var be=Object(u.a)(Ae);function Ae(){var ue;return Object(b.a)(this,Ae),ue=be.apply(this,arguments),ue.resizeObserver=null,ue.mutationObserver=null,ue.originalTotalWidth=0,ue.overflowedItems=[],ue.menuItemSizes=[],ue.cancelFrameId=null,ue.state={lastVisibleIndex:void 0},ue.childRef=w.createRef(),ue.getMenuItemNodes=function(){var V=ue.props.prefixCls,te=ue.childRef.current;return te?[].slice.call(te.children).filter(function(X){return X.className.split(" ").indexOf("".concat(V,"-overflowed-submenu"))<0}):[]},ue.getOverflowedSubMenuItem=function(V,te,X){var le=ue.props,he=le.overflowedIndicator,we=le.level,Ee=le.mode,Ie=le.prefixCls,Fe=le.theme;if(we!==1||Ee!=="horizontal")return null;var $e=ue.props.children[0],Ye=$e.props,et=Ye.children,gt=Ye.title,wt=Ye.style,Tt=Object(O.a)(Ye,["children","title","style"]),Ot=Object(k.a)({},wt),Ct="".concat(V,"-overflowed-indicator"),St="".concat(V,"-overflowed-indicator");te.length===0&&X!==!0?Ot=Object(k.a)(Object(k.a)({},Ot),{},{display:"none"}):X&&(Ot=Object(k.a)(Object(k.a)({},Ot),{},{visibility:"hidden",position:"absolute"}),Ct="".concat(Ct,"-placeholder"),St="".concat(St,"-placeholder"));var At=Fe?"".concat(Ie,"-").concat(Fe):"",Nt={};return J.forEach(function(Rt){Tt[Rt]!==void 0&&(Nt[Rt]=Tt[Rt])}),w.createElement(on,Object(m.a)({title:he,className:"".concat(Ie,"-overflowed-submenu"),popupClassName:At},Nt,{key:Ct,eventKey:St,disabled:!1,style:Ot}),te)},ue.setChildrenWidthAndResize=function(){if(ue.props.mode!=="horizontal")return;var V=ue.childRef.current;if(!V)return;var te=V.children;if(!te||te.length===0)return;var X=V.children[te.length-1];Te(X,"display","inline-block");var le=ue.getMenuItemNodes(),he=le.filter(function(we){return we.className.split(" ").indexOf(ri)>=0});he.forEach(function(we){Te(we,"display","inline-block")}),ue.menuItemSizes=le.map(function(we){return pe(we,!0)}),he.forEach(function(we){Te(we,"display","none")}),ue.overflowedIndicatorWidth=pe(V.children[V.children.length-1],!0),ue.originalTotalWidth=ue.menuItemSizes.reduce(function(we,Ee){return we+Ee},0),ue.handleResize(),Te(X,"display","none")},ue.handleResize=function(){if(ue.props.mode!=="horizontal")return;var V=ue.childRef.current;if(!V)return;var te=pe(V);ue.overflowedItems=[];var X=0,le;ue.originalTotalWidth>te+Tn&&(le=-1,ue.menuItemSizes.forEach(function(he){X+=he,X+ue.overflowedIndicatorWidth<=te&&(le+=1)})),ue.setState({lastVisibleIndex:le})},ue}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){var V=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var te=this.childRef.current;if(!te)return;this.resizeObserver=new We.default(function(X){X.forEach(function(){var le=V.cancelFrameId;cancelAnimationFrame(le),V.cancelFrameId=requestAnimationFrame(V.setChildrenWidthAndResize)})}),[].slice.call(te.children).concat(te).forEach(function(X){V.resizeObserver.observe(X)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){V.resizeObserver.disconnect(),[].slice.call(te.children).concat(te).forEach(function(X){V.resizeObserver.observe(X)}),V.setChildrenWidthAndResize()}),this.mutationObserver.observe(te,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(V){var te=this,X=this.state.lastVisibleIndex;return(V||[]).reduce(function(le,he,we){var Ee=he;if(te.props.mode==="horizontal"){var Ie=te.getOverflowedSubMenuItem(he.props.eventKey,[]);X!==void 0&&te.props.className.indexOf("".concat(te.props.prefixCls,"-root"))!==-1&&(we>X&&(Ee=w.cloneElement(he,{style:{display:"none"},eventKey:"".concat(he.props.eventKey,"-hidden"),className:"".concat(ri)})),we===X+1&&(te.overflowedItems=V.slice(X+1).map(function($e){return w.cloneElement($e,{key:$e.props.eventKey,mode:"vertical-left"})}),Ie=te.getOverflowedSubMenuItem(he.props.eventKey,te.overflowedItems)));var Fe=[].concat(Object(C.a)(le),[Ie,Ee]);return we===V.length-1&&Fe.push(te.getOverflowedSubMenuItem(he.props.eventKey,[],!0)),Fe}return[].concat(Object(C.a)(le),[Ee])},[])}},{key:"render",value:function(){var V=this.props,te=V.visible,X=V.prefixCls,le=V.overflowedIndicator,he=V.mode,we=V.level,Ee=V.tag,Ie=V.children,Fe=V.theme,$e=Object(O.a)(V,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Ye=Ee;return w.createElement(Ye,Object(m.a)({ref:this.childRef},$e),this.renderChildren(Ie))}}]),Ae}(w.Component);di.defaultProps={tag:"div",className:""};var Si=di;function Ai(re){return re.length?re.every(function(be){return!!be.props.disabled}):!0}function _i(re,be,Ae){var ue=re.getState();re.setState({activeKey:Object(k.a)(Object(k.a)({},ue.activeKey),{},Object(ne.a)({},be,Ae))})}function ai(re){return re.eventKey||"0-menu-"}function bi(re,be){var Ae=be,ue=re.children,V=re.eventKey;if(Ae){var te;if(Le(ue,function(X,le){X&&X.props&&!X.props.disabled&&Ae===Me(X,V,le)&&(te=!0)}),te)return Ae}return Ae=null,re.defaultActiveFirst&&Le(ue,function(X,le){!Ae&&X&&!X.props.disabled&&(Ae=Me(X,V,le))}),Ae}function Tr(re){if(!re)return;var be=this.instanceArray.indexOf(re);be!==-1?this.instanceArray[be]=re:this.instanceArray.push(re)}var ji=function(re){Object(f.a)(Ae,re);var be=Object(u.a)(Ae);function Ae(ue){var V;return Object(b.a)(this,Ae),V=be.call(this,ue),V.onKeyDown=function(te,X){var le=te.keyCode,he;if(V.getFlatInstanceArray().forEach(function(Ee){Ee&&Ee.props.active&&Ee.onKeyDown&&(he=Ee.onKeyDown(te))}),he)return 1;var we=null;return(le===o.a.UP||le===o.a.DOWN)&&(we=V.step(le===o.a.UP?-1:1)),we?(te.preventDefault(),_i(V.props.store,ai(V.props),we.props.eventKey),typeof X=="function"&&X(we),1):void 0},V.onItemHover=function(te){var X=te.key,le=te.hover;_i(V.props.store,ai(V.props),le?X:null)},V.onDeselect=function(te){V.props.onDeselect(te)},V.onSelect=function(te){V.props.onSelect(te)},V.onClick=function(te){V.props.onClick(te)},V.onOpenChange=function(te){V.props.onOpenChange(te)},V.onDestroy=function(te){V.props.onDestroy(te)},V.getFlatInstanceArray=function(){return V.instanceArray},V.step=function(te){var X=V.getFlatInstanceArray(),le=V.props.store.getState().activeKey[ai(V.props)],he=X.length;if(!he)return null;te<0&&(X=X.concat().reverse());var we=-1;if(X.every(function($e,Ye){return $e&&$e.props.eventKey===le?(we=Ye,!1):!0}),!V.props.defaultActiveFirst&&we!==-1&&Ai(X.slice(we,he-1)))return;var Ee=(we+1)%he,Ie=Ee;do{var Fe=X[Ie];if(!Fe||Fe.props.disabled)Ie=(Ie+1)%he;else return Fe}while(Ie!==Ee);return null},V.renderCommonMenuItem=function(te,X,le){var he=V.props.store.getState(),we=Object(l.a)(V),Ee=we.props,Ie=Me(te,Ee.eventKey,X),Fe=te.props;if(!Fe||typeof te.type=="string")return te;var $e=Ie===he.activeKey,Ye=Object(k.a)(Object(k.a)({mode:Fe.mode||Ee.mode,level:Ee.level,inlineIndent:Ee.inlineIndent,renderMenuItem:V.renderMenuItem,rootPrefixCls:Ee.prefixCls,index:X,parentMenu:Ee.parentMenu,manualRef:Fe.disabled?void 0:Object(v.a)(te.ref,Tr.bind(Object(l.a)(V))),eventKey:Ie,active:!Fe.disabled&&$e,multiple:Ee.multiple,onClick:function(gt){(Fe.onClick||Re)(gt),V.onClick(gt)},onItemHover:V.onItemHover,motion:Ee.motion,subMenuOpenDelay:Ee.subMenuOpenDelay,subMenuCloseDelay:Ee.subMenuCloseDelay,forceSubMenuRender:Ee.forceSubMenuRender,onOpenChange:V.onOpenChange,onDeselect:V.onDeselect,onSelect:V.onSelect,builtinPlacements:Ee.builtinPlacements,itemIcon:Fe.itemIcon||V.props.itemIcon,expandIcon:Fe.expandIcon||V.props.expandIcon},le),{},{direction:Ee.direction});return(Ee.mode==="inline"||xe())&&(Ye.triggerSubMenuAction="click"),w.cloneElement(te,Object(k.a)(Object(k.a)({},Ye),{},{key:Ie||X}))},V.renderMenuItem=function(te,X,le){if(!te)return null;var he=V.props.store.getState(),we={openKeys:he.openKeys,selectedKeys:he.selectedKeys,triggerSubMenuAction:V.props.triggerSubMenuAction,subMenuKey:le};return V.renderCommonMenuItem(te,X,we)},ue.store.setState({activeKey:Object(k.a)(Object(k.a)({},ue.store.getState().activeKey),{},Object(ne.a)({},ue.eventKey,bi(ue,ue.activeKey)))}),V.instanceArray=[],V}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(V){return this.props.visible||V.visible||this.props.className!==V.className||!L()(this.props.style,V.style)}},{key:"componentDidUpdate",value:function(V){var te=this.props,X="activeKey"in te?te.activeKey:te.store.getState().activeKey[ai(te)],le=bi(te,X);if(le!==X)_i(te.store,ai(te),le);else if("activeKey"in V){var he=bi(V,V.activeKey);le!==he&&_i(te.store,ai(te),le)}}},{key:"render",value:function(){var V=this,te=Object(m.a)({},this.props);this.instanceArray=[];var X=B()(te.prefixCls,te.className,"".concat(te.prefixCls,"-").concat(te.mode)),le={className:X,role:te.role||"menu"};te.id&&(le.id=te.id),te.focusable&&(le.tabIndex=0,le.onKeyDown=this.onKeyDown);var he=te.prefixCls,we=te.eventKey,Ee=te.visible,Ie=te.level,Fe=te.mode,$e=te.overflowedIndicator,Ye=te.theme;return J.forEach(function(et){return delete te[et]}),delete te.onClick,w.createElement(Si,Object(m.a)({},te,{prefixCls:he,mode:Fe,tag:"ul",level:Ie,theme:Ye,visible:Ee,overflowedIndicator:$e},le),Object(M.a)(te.children).map(function(et,gt){return V.renderMenuItem(et,gt,we||"0-menu-")}))}}]),Ae}(w.Component);ji.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Re};var xr=Object(h.b)()(ji),Fi=xr,Sr=U("Kwbf");function Ar(re,be,Ae){var ue=re.prefixCls,V=re.motion,te=re.defaultMotions,X=te===void 0?{}:te,le=re.openAnimation,he=re.openTransitionName,we=be.switchingModeFromInline;if(V)return V;if(Object(I.a)(le)==="object"&&le)Object(Sr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof le=="string")return{motionName:"".concat(ue,"-open-").concat(le)};if(he)return{motionName:he};var Ee=X[Ae];return Ee||(we?null:X.other)}var Wi=function(re){Object(f.a)(Ae,re);var be=Object(u.a)(Ae);function Ae(ue){var V;Object(b.a)(this,Ae),V=be.call(this,ue),V.onSelect=function(le){var he=Object(l.a)(V),we=he.props;if(we.selectable){var Ee=V.store.getState(),Ie=Ee.selectedKeys,Fe=le.key;we.multiple?Ie=Ie.concat([Fe]):Ie=[Fe],"selectedKeys"in we||V.store.setState({selectedKeys:Ie}),we.onSelect(Object(k.a)(Object(k.a)({},le),{},{selectedKeys:Ie}))}},V.onClick=function(le){var he=V.getRealMenuMode(),we=Object(l.a)(V),Ee=we.store,Ie=we.props.onOpenChange;he!=="inline"&&!("openKeys"in V.props)&&(Ee.setState({openKeys:[]}),Ie([])),V.props.onClick(le)},V.onKeyDown=function(le,he){V.innerMenu.getWrappedInstance().onKeyDown(le,he)},V.onOpenChange=function(le){var he=Object(l.a)(V),we=he.props,Ee=V.store.getState().openKeys.concat(),Ie=!1,Fe=function(Ye){var et=!1;if(Ye.open)et=Ee.indexOf(Ye.key)===-1,et&&Ee.push(Ye.key);else{var gt=Ee.indexOf(Ye.key);et=gt!==-1,et&&Ee.splice(gt,1)}Ie=Ie||et};Array.isArray(le)?le.forEach(Fe):Fe(le),Ie&&("openKeys"in V.props||V.store.setState({openKeys:Ee}),we.onOpenChange(Ee))},V.onDeselect=function(le){var he=Object(l.a)(V),we=he.props;if(we.selectable){var Ee=V.store.getState().selectedKeys.concat(),Ie=le.key,Fe=Ee.indexOf(Ie);Fe!==-1&&Ee.splice(Fe,1),"selectedKeys"in we||V.store.setState({selectedKeys:Ee}),we.onDeselect(Object(k.a)(Object(k.a)({},le),{},{selectedKeys:Ee}))}},V.onMouseEnter=function(le){V.restoreModeVerticalFromInline();var he=V.props.onMouseEnter;he&&he(le)},V.onTransitionEnd=function(le){var he=le.propertyName==="width"&&le.target===le.currentTarget,we=le.target.className,Ee=Object.prototype.toString.call(we)==="[object SVGAnimatedString]"?we.animVal:we,Ie=le.propertyName==="font-size"&&Ee.indexOf("anticon")>=0;(he||Ie)&&V.restoreModeVerticalFromInline()},V.setInnerMenu=function(le){V.innerMenu=le},V.isRootMenu=!0;var te=ue.defaultSelectedKeys,X=ue.defaultOpenKeys;return"selectedKeys"in ue&&(te=ue.selectedKeys||[]),"openKeys"in ue&&(X=ue.openKeys||[]),V.store=Object(h.c)({selectedKeys:te,openKeys:X,activeKey:{"0-menu-":bi(ue,ue.activeKey)}}),V.state={switchingModeFromInline:!1,prevProps:ue,inlineOpenKeys:[],store:V.store},V}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(V){var te=this.props,X=te.siderCollapsed,le=te.inlineCollapsed,he=te.onOpenChange;(!V.inlineCollapsed&&le||!V.siderCollapsed&&X)&&he([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var V=this.props.collapsedWidth,te=this.store,X=this.prevOpenKeys,le=this.getInlineCollapsed()&&(V===0||V==="0"||V==="0px");le?(this.prevOpenKeys=te.getState().openKeys.concat(),this.store.setState({openKeys:[]})):X&&(this.store.setState({openKeys:X}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var V=this.props.mode,te=this.state.switchingModeFromInline,X=this.getInlineCollapsed();return te&&X?"inline":X?"vertical":V}},{key:"getInlineCollapsed",value:function(){var V=this.props,te=V.inlineCollapsed,X=V.siderCollapsed;return X!==void 0?X:te}},{key:"restoreModeVerticalFromInline",value:function(){var V=this.state.switchingModeFromInline;V&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var V=Object(k.a)({},Object(E.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),te=this.getRealMenuMode();return V.className+=" ".concat(V.prefixCls,"-root"),V.direction==="rtl"&&(V.className+=" ".concat(V.prefixCls,"-rtl")),V=Object(k.a)(Object(k.a)({},V),{},{mode:te,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ar(this.props,this.state,te)}),delete V.openAnimation,delete V.openTransitionName,w.createElement(h.a,{store:this.store},w.createElement(Fi,Object(m.a)({},V,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(V,te){var X=te.prevProps,le=te.store,he=le.getState(),we={},Ee={prevProps:V};return X.mode==="inline"&&V.mode!=="inline"&&(Ee.switchingModeFromInline=!0),"openKeys"in V?we.openKeys=V.openKeys||[]:((V.inlineCollapsed&&!X.inlineCollapsed||V.siderCollapsed&&!X.siderCollapsed)&&(Ee.switchingModeFromInline=!0,Ee.inlineOpenKeys=he.openKeys,we.openKeys=[]),(!V.inlineCollapsed&&X.inlineCollapsed||!V.siderCollapsed&&X.siderCollapsed)&&(we.openKeys=te.inlineOpenKeys,Ee.inlineOpenKeys=[])),Object.keys(we).length&&le.setState(we),Ee}}]),Ae}(w.Component);Wi.defaultProps={selectable:!0,onClick:Re,onSelect:Re,onOpenChange:Re,onDeselect:Re,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:w.createElement("span",null,"\xB7\xB7\xB7")};var wr=Wi,wi=function(re){Object(f.a)(Ae,re);var be=Object(u.a)(Ae);function Ae(){var ue;return Object(b.a)(this,Ae),ue=be.apply(this,arguments),ue.onKeyDown=function(V){var te=V.keyCode;return te===o.a.ENTER?(ue.onClick(V),!0):void 0},ue.onMouseLeave=function(V){var te=ue.props,X=te.eventKey,le=te.onItemHover,he=te.onMouseLeave;le({key:X,hover:!1}),he({key:X,domEvent:V})},ue.onMouseEnter=function(V){var te=ue.props,X=te.eventKey,le=te.onItemHover,he=te.onMouseEnter;le({key:X,hover:!0}),he({key:X,domEvent:V})},ue.onClick=function(V){var te=ue.props,X=te.eventKey,le=te.multiple,he=te.onClick,we=te.onSelect,Ee=te.onDeselect,Ie=te.isSelected,Fe={key:X,keyPath:[X],item:Object(l.a)(ue),domEvent:V};he(Fe),le?Ie?Ee(Fe):we(Fe):Ie||we(Fe)},ue.saveNode=function(V){ue.node=V},ue}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var V=this.props;V.onDestroy&&V.onDestroy(V.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var V,te=Object(k.a)({},this.props),X=B()(this.getPrefixCls(),te.className,(V={},Object(ne.a)(V,this.getActiveClassName(),!te.disabled&&te.active),Object(ne.a)(V,this.getSelectedClassName(),te.isSelected),Object(ne.a)(V,this.getDisabledClassName(),te.disabled),V)),le=Object(k.a)(Object(k.a)({},te.attribute),{},{title:typeof te.title=="string"?te.title:void 0,className:X,role:te.role||"menuitem","aria-disabled":te.disabled});te.role==="option"?le=Object(k.a)(Object(k.a)({},le),{},{role:"option","aria-selected":te.isSelected}):(te.role===null||te.role==="none")&&(le.role="none");var he={onClick:te.disabled?null:this.onClick,onMouseLeave:te.disabled?null:this.onMouseLeave,onMouseEnter:te.disabled?null:this.onMouseEnter},we=Object(k.a)({},te.style);te.mode==="inline"&&(te.direction==="rtl"?we.paddingRight=te.inlineIndent*te.level:we.paddingLeft=te.inlineIndent*te.level),J.forEach(function(Ie){return delete te[Ie]}),delete te.direction;var Ee=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ee=w.createElement(this.props.itemIcon,this.props)),w.createElement("li",Object(m.a)({},Object(E.a)(te,["onClick","onMouseEnter","onMouseLeave","onSelect"]),le,he,{style:we,ref:this.saveNode}),te.children,Ee)}}]),Ae}(w.Component);wi.isMenuItem=!0,wi.defaultProps={onSelect:Re,onMouseEnter:Re,onMouseLeave:Re,manualRef:Re};var Cr=Object(h.b)(function(re,be){var Ae=re.activeKey,ue=re.selectedKeys,V=be.eventKey,te=be.subMenuKey;return{active:Ae[te]===V,isSelected:Array.isArray(ue)?ue.indexOf(V)!==-1:ue===V}})(wi),Or=Cr,Ci=function(re){Object(f.a)(Ae,re);var be=Object(u.a)(Ae);function Ae(){var ue;return Object(b.a)(this,Ae),ue=be.apply(this,arguments),ue.renderInnerMenuItem=function(V){var te=ue.props,X=te.renderMenuItem,le=te.index;return X(V,le,ue.props.subMenuKey)},ue}return Object(_.a)(Ae,[{key:"render",value:function(){var V=Object(m.a)({},this.props),te=V.className,X=te===void 0?"":te,le=V.rootPrefixCls,he="".concat(le,"-item-group-title"),we="".concat(le,"-item-group-list"),Ee=V.title,Ie=V.children;return J.forEach(function(Fe){return delete V[Fe]}),delete V.direction,w.createElement("li",Object(m.a)({},V,{onClick:function($e){return $e.stopPropagation()},className:"".concat(X," ").concat(le,"-item-group")}),w.createElement("div",{className:he,title:typeof Ee=="string"?Ee:void 0},Ee),w.createElement("ul",{className:we},w.Children.map(Ie,this.renderInnerMenuItem)))}}]),Ae}(w.Component);Ci.isMenuItemGroup=!0,Ci.defaultProps={disabled:!0};var fa=Ci,Hi=function(be){var Ae=be.className,ue=be.rootPrefixCls,V=be.style;return w.createElement("li",{className:"".concat(Ae," ").concat(ue,"-item-divider"),style:V})};Hi.defaultProps={disabled:!0,className:"",style:{}};var pa=Hi,Rr=wr,Ir=U("eDIo");function Dr(re,be){var Ae=re.prefixCls,ue=re.editable,V=re.locale,te=re.style;return!ue||ue.showAdd===!1?null:w.createElement("button",{ref:be,type:"button",className:"".concat(Ae,"-nav-add"),style:te,"aria-label":(V==null?void 0:V.addAriaLabel)||"Add tab",onClick:function(le){ue.onEdit("add",{event:le})}},ue.addIcon||"+")}var Ki=w.forwardRef(Dr);function Lr(re,be){var Ae=re.prefixCls,ue=re.id,V=re.tabs,te=re.locale,X=re.mobile,le=re.moreIcon,he=le===void 0?"More":le,we=re.moreTransitionName,Ee=re.style,Ie=re.className,Fe=re.editable,$e=re.tabBarGutter,Ye=re.rtl,et=re.onTabClick,gt=Object(w.useState)(!1),wt=Object(W.a)(gt,2),Tt=wt[0],Ot=wt[1],Ct=Object(w.useState)(null),St=Object(W.a)(Ct,2),At=St[0],Nt=St[1],Rt="".concat(ue,"-more-popup"),ln="".concat(Ae,"-dropdown"),Gt=At!==null?"".concat(Rt,"-").concat(At):null,mt=te==null?void 0:te.dropdownAriaLabel,pt=w.createElement(Rr,{onClick:function(Xt){var sn=Xt.key,xn=Xt.domEvent;et(sn,xn),Ot(!1)},id:Rt,tabIndex:-1,role:"listbox","aria-activedescendant":Gt,selectedKeys:[At],"aria-label":mt!==void 0?mt:"expanded dropdown"},V.map(function(Bt){return w.createElement(Or,{key:Bt.key,id:"".concat(Rt,"-").concat(Bt.key),role:"option","aria-controls":ue&&"".concat(ue,"-panel-").concat(Bt.key),disabled:Bt.disabled},Bt.tab)}));function Dt(Bt){for(var Xt=V.filter(function(Pn){return!Pn.disabled}),sn=Xt.findIndex(function(Pn){return Pn.key===At})||0,xn=Xt.length,Ln=0;Ln<xn;Ln+=1){sn=(sn+Bt+xn)%xn;var un=Xt[sn];if(!un.disabled){Nt(un.key);return}}}function Mt(Bt){var Xt=Bt.which;if(!Tt){[o.a.DOWN,o.a.SPACE,o.a.ENTER].includes(Xt)&&(Ot(!0),Bt.preventDefault());return}switch(Xt){case o.a.UP:Dt(-1),Bt.preventDefault();break;case o.a.DOWN:Dt(1),Bt.preventDefault();break;case o.a.ESC:Ot(!1);break;case o.a.SPACE:case o.a.ENTER:At!==null&&et(At,Bt);break}}Object(w.useEffect)(function(){var Bt=document.getElementById(Gt);Bt&&Bt.scrollIntoView&&Bt.scrollIntoView(!1)},[At]),Object(w.useEffect)(function(){Tt||Nt(null)},[Tt]);var ot=Object(ne.a)({},Ye?"marginLeft":"marginRight",$e);V.length||(ot.visibility="hidden",ot.order=1);var Ut=B()(Object(ne.a)({},"".concat(ln,"-rtl"),Ye)),tn=X?null:w.createElement(Ir.a,{prefixCls:ln,overlay:pt,trigger:["hover"],visible:Tt,transitionName:we,onVisibleChange:Ot,overlayClassName:Ut,mouseEnterDelay:.1,mouseLeaveDelay:.1},w.createElement("button",{type:"button",className:"".concat(Ae,"-nav-more"),style:ot,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Rt,id:"".concat(ue,"-more"),"aria-expanded":Tt,onKeyDown:Mt},he));return w.createElement("div",{className:B()("".concat(Ae,"-nav-operations"),Ie),style:Ee,ref:be},tn,w.createElement(Ki,{prefixCls:Ae,locale:te,editable:Fe}))}var Pr=w.forwardRef(Lr),Oi=Object(w.createContext)(null),Mr=.1,Gi=.01,Ei=20,zi=Math.pow(.995,Ei);function kr(){var re=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(re)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(re.substr(0,4)))}function Nr(re,be){var Ae=Object(w.useState)(),ue=Object(W.a)(Ae,2),V=ue[0],te=ue[1],X=Object(w.useState)(0),le=Object(W.a)(X,2),he=le[0],we=le[1],Ee=Object(w.useState)(0),Ie=Object(W.a)(Ee,2),Fe=Ie[0],$e=Ie[1],Ye=Object(w.useState)(),et=Object(W.a)(Ye,2),gt=et[0],wt=et[1],Tt=Object(w.useRef)();function Ot(mt){var pt=mt.touches[0],Dt=pt.screenX,Mt=pt.screenY;te({x:Dt,y:Mt}),window.clearInterval(Tt.current)}function Ct(mt){if(!V)return;mt.preventDefault();var pt=mt.touches[0],Dt=pt.screenX,Mt=pt.screenY;te({x:Dt,y:Mt});var ot=Dt-V.x,Ut=Mt-V.y;be(ot,Ut);var tn=Date.now();we(tn),$e(tn-he),wt({x:ot,y:Ut})}function St(){if(!V)return;if(te(null),wt(null),gt){var mt=gt.x/Fe,pt=gt.y/Fe,Dt=Math.abs(mt),Mt=Math.abs(pt);if(Math.max(Dt,Mt)<Mr)return;var ot=mt,Ut=pt;Tt.current=window.setInterval(function(){if(Math.abs(ot)<Gi&&Math.abs(Ut)<Gi){window.clearInterval(Tt.current);return}ot*=zi,Ut*=zi,be(ot*Ei,Ut*Ei)},Ei)}}var At=Object(w.useRef)(0),Nt=Object(w.useRef)(!1),Rt=Object(w.useRef)();function ln(mt){var pt=mt.deltaX,Dt=mt.deltaY,Mt=0,ot=Math.abs(pt),Ut=Math.abs(Dt);ot===Ut?Mt=Rt.current==="x"?pt:Dt:ot>Ut?(Mt=pt,Rt.current="x"):(Mt=Dt,Rt.current="y");var tn=Date.now();tn-At.current>100&&(Nt.current=!1),(be(-Mt,-Mt)||Nt.current)&&(mt.preventDefault(),Nt.current=!0),At.current=tn}var Gt=Object(w.useRef)(null);Gt.current={onTouchStart:Ot,onTouchMove:Ct,onTouchEnd:St,onWheel:ln},w.useEffect(function(){function mt(ot){Gt.current.onTouchStart(ot)}function pt(ot){Gt.current.onTouchMove(ot)}function Dt(ot){Gt.current.onTouchEnd(ot)}function Mt(ot){Gt.current.onWheel(ot)}return document.addEventListener("touchmove",pt,{passive:!1}),document.addEventListener("touchend",Dt,{passive:!1}),re.current.addEventListener("touchstart",mt,{passive:!1}),re.current.addEventListener("wheel",Mt),function(){document.removeEventListener("touchmove",pt),document.removeEventListener("touchend",Dt)}},[])}function Ur(){var re=Object(w.useRef)(new Map);function be(ue){return re.current.has(ue)||re.current.set(ue,w.createRef()),re.current.get(ue)}function Ae(ue){re.current.delete(ue)}return[be,Ae]}function Vi(re,be){var Ae=w.useRef(re),ue=w.useState({}),V=Object(W.a)(ue,2),te=V[1];function X(le){var he=typeof le=="function"?le(Ae.current):le;he!==Ae.current&&be(he,Ae.current),Ae.current=he,te({})}return[Ae.current,X]}var Xi=function(be){var Ae=be.position,ue=be.prefixCls,V=be.extra;if(!V)return null;var te,X=V;return Ae==="right"&&(te=X.right||!X.left&&X||null),Ae==="left"&&(te=X.left||null),te?w.createElement("div",{className:"".concat(ue,"-extra-content")},te):null};function Br(re,be){var Ae,ue=w.useContext(Oi),V=ue.prefixCls,te=ue.tabs,X=re.className,le=re.style,he=re.id,we=re.animated,Ee=re.activeKey,Ie=re.rtl,Fe=re.extra,$e=re.editable,Ye=re.locale,et=re.tabPosition,gt=re.tabBarGutter,wt=re.children,Tt=re.onTabClick,Ot=re.onTabScroll,Ct=Object(w.useRef)(),St=Object(w.useRef)(),At=Object(w.useRef)(),Nt=Object(w.useRef)(),Rt=Ur(),ln=Object(W.a)(Rt,2),Gt=ln[0],mt=ln[1],pt=et==="top"||et==="bottom",Dt=Vi(0,function(zt,Lt){pt&&Ot&&Ot({direction:zt>Lt?"left":"right"})}),Mt=Object(W.a)(Dt,2),ot=Mt[0],Ut=Mt[1],tn=Vi(0,function(zt,Lt){!pt&&Ot&&Ot({direction:zt>Lt?"top":"bottom"})}),Bt=Object(W.a)(tn,2),Xt=Bt[0],sn=Bt[1],xn=Object(w.useState)(0),Ln=Object(W.a)(xn,2),un=Ln[0],Pn=Ln[1],Hn=Object(w.useState)(0),kn=Object(W.a)(Hn,2),Nn=kn[0],cn=kn[1],Rn=Object(w.useState)(0),Sn=Object(W.a)(Rn,2),vn=Sn[0],$n=Sn[1],Qn=Object(w.useState)(0),ei=Object(W.a)(Qn,2),Jt=ei[0],zn=ei[1],ti=Object(w.useState)(null),nn=Object(W.a)(ti,2),Ht=nn[0],An=nn[1],Kr=Object(w.useState)(null),Ji=Object(W.a)(Kr,2),si=Ji[0],Gr=Ji[1],zr=Object(w.useState)(0),qi=Object(W.a)(zr,2),Vr=qi[0],Xr=qi[1],Yr=Object(w.useState)(0),er=Object(W.a)(Yr,2),$r=er[0],Qr=er[1],Zr=i(new Map),tr=Object(W.a)(Zr,2),Jr=tr[0],qr=tr[1],Ti=t(te,Jr,un),nr="".concat(V,"-nav-operations-hidden"),ci=0,hi=0;pt?Ie?(ci=0,hi=Math.max(0,un-Ht)):(ci=Math.min(0,Ht-un),hi=0):(ci=Math.min(0,si-Nn),hi=0);function Ri(zt){return zt<ci?[ci,!1]:zt>hi?[hi,!1]:[zt,!0]}var ir=Object(w.useRef)(),ea=Object(w.useState)(),rr=Object(W.a)(ea,2),Ii=rr[0],ar=rr[1];function Di(){ar(Date.now())}function Li(){window.clearTimeout(ir.current)}Nr(Ct,function(zt,Lt){var yn=!1;function Un(pi,mi){pi(function(gi){var vi=Ri(gi+mi),oi=Object(W.a)(vi,2),Ni=oi[0],Ui=oi[1];return yn=Ui,Ni})}if(pt){if(Ht>=un)return yn;Un(Ut,zt)}else{if(si>=Nn)return yn;Un(sn,Lt)}return Li(),Di(),yn}),Object(w.useEffect)(function(){return Li(),Ii&&(ir.current=window.setTimeout(function(){ar(0)},100)),Li},[Ii]);function sr(){var zt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ee,Lt=Ti.get(zt);if(!Lt)return;if(pt){var yn=ot;Ie?Lt.right<ot?yn=Lt.right:Lt.right+Lt.width>ot+Ht&&(yn=Lt.right+Lt.width-Ht):Lt.left<-ot?yn=-Lt.left:Lt.left+Lt.width>-ot+Ht&&(yn=-(Lt.left+Lt.width-Ht)),sn(0),Ut(Ri(yn)[0])}else{var Un=Xt;Lt.top<-Xt?Un=-Lt.top:Lt.top+Lt.height>-Xt+si&&(Un=-(Lt.top+Lt.height-si)),Ut(0),sn(Ri(Un)[0])}}var ta=p(Ti,{width:Ht,height:si,left:ot,top:Xt},{width:vn,height:Jt},{width:Vr,height:$r},Object(k.a)(Object(k.a)({},re),{},{tabs:te})),or=Object(W.a)(ta,2),na=or[0],ia=or[1],ra=te.map(function(zt){var Lt=zt.key;return w.createElement(r,{id:he,prefixCls:V,key:Lt,rtl:Ie,tab:zt,closable:zt.closable,editable:$e,active:Lt===Ee,tabPosition:et,tabBarGutter:gt,renderWrapper:wt,removeAriaLabel:Ye==null?void 0:Ye.removeAriaLabel,ref:Gt(Lt),onClick:function(Un){Tt(Lt,Un)},onRemove:function(){mt(Lt)},onFocus:function(){sr(Lt),Di(),Ie||(Ct.current.scrollLeft=0),Ct.current.scrollTop=0}})}),Pi=a(function(){var zt,Lt,yn,Un,pi,mi,gi,vi,oi,Ni=((zt=Ct.current)===null||zt===void 0?void 0:zt.offsetWidth)||0,Ui=((Lt=Ct.current)===null||Lt===void 0?void 0:Lt.offsetHeight)||0,mr=((yn=Nt.current)===null||yn===void 0?void 0:yn.offsetWidth)||0,gr=((Un=Nt.current)===null||Un===void 0?void 0:Un.offsetHeight)||0,da=((pi=At.current)===null||pi===void 0?void 0:pi.offsetWidth)||0,ca=((mi=At.current)===null||mi===void 0?void 0:mi.offsetHeight)||0;An(Ni),Gr(Ui),Xr(mr),Qr(gr);var vr=(((gi=St.current)===null||gi===void 0?void 0:gi.offsetWidth)||0)-mr,yr=(((vi=St.current)===null||vi===void 0?void 0:vi.offsetHeight)||0)-gr;Pn(vr),cn(yr);var _r=(oi=At.current)===null||oi===void 0?void 0:oi.className.includes(nr);$n(vr-(_r?0:da)),zn(yr-(_r?0:ca)),qr(function(){var br=new Map;return te.forEach(function(ha){var Er=ha.key,yi=Gt(Er).current;yi&&br.set(Er,{width:yi.offsetWidth,height:yi.offsetHeight,left:yi.offsetLeft,top:yi.offsetTop})}),br})}),aa=te.slice(0,na),sa=te.slice(ia+1),lr=[].concat(Object(C.a)(aa),Object(C.a)(sa)),oa=Object(w.useState)(),ur=Object(W.a)(oa,2),la=ur[0],ua=ur[1],Zn=Ti.get(Ee),dr=Object(w.useRef)();function cr(){c.a.cancel(dr.current)}Object(w.useEffect)(function(){var zt={};return Zn&&(pt?(Ie?zt.right=Zn.right:zt.left=Zn.left,zt.width=Zn.width):(zt.top=Zn.top,zt.height=Zn.height)),cr(),dr.current=c()(function(){ua(zt)}),cr},[Zn,pt,Ie]),Object(w.useEffect)(function(){sr()},[Ee,Zn,Ti,pt]),Object(w.useEffect)(function(){Pi()},[Ie,gt,Ee,te.map(function(zt){return zt.key}).join("_")]);var hr=!!lr.length,fi="".concat(V,"-nav-wrap"),Mi,ki,fr,pr;return pt?Ie?(ki=ot>0,Mi=ot+Ht<un):(Mi=ot<0,ki=-ot+Ht<un):(fr=Xt<0,pr=-Xt+si<Nn),w.createElement("div",{ref:be,role:"tablist",className:B()("".concat(V,"-nav"),X),style:le,onKeyDown:function(){Di()}},w.createElement(Xi,{position:"left",extra:Fe,prefixCls:V}),w.createElement(d.a,{onResize:Pi},w.createElement("div",{className:B()(fi,(Ae={},Object(ne.a)(Ae,"".concat(fi,"-ping-left"),Mi),Object(ne.a)(Ae,"".concat(fi,"-ping-right"),ki),Object(ne.a)(Ae,"".concat(fi,"-ping-top"),fr),Object(ne.a)(Ae,"".concat(fi,"-ping-bottom"),pr),Ae)),ref:Ct},w.createElement(d.a,{onResize:Pi},w.createElement("div",{ref:St,className:"".concat(V,"-nav-list"),style:{transform:"translate(".concat(ot,"px, ").concat(Xt,"px)"),transition:Ii?"none":void 0}},ra,w.createElement(Ki,{ref:Nt,prefixCls:V,locale:Ye,editable:$e,style:{visibility:hr?"hidden":null}}),w.createElement("div",{className:B()("".concat(V,"-ink-bar"),Object(ne.a)({},"".concat(V,"-ink-bar-animated"),we.inkBar)),style:la}))))),w.createElement(Pr,Object.assign({},re,{ref:At,prefixCls:V,tabs:lr,className:!hr&&nr})),w.createElement(Xi,{position:"right",extra:Fe,prefixCls:V}))}var Yi=w.forwardRef(Br);function jr(re){var be=re.id,Ae=re.activeKey,ue=re.animated,V=re.tabPosition,te=re.rtl,X=re.destroyInactiveTabPane,le=w.useContext(Oi),he=le.prefixCls,we=le.tabs,Ee=ue.tabPane,Ie=we.findIndex(function(Fe){return Fe.key===Ae});return w.createElement("div",{className:B()("".concat(he,"-content-holder"))},w.createElement("div",{className:B()("".concat(he,"-content"),"".concat(he,"-content-").concat(V),Object(ne.a)({},"".concat(he,"-content-animated"),Ee)),style:Ie&&Ee?Object(ne.a)({},te?"marginRight":"marginLeft","-".concat(Ie,"00%")):null},we.map(function(Fe){return w.cloneElement(Fe.node,{key:Fe.key,prefixCls:he,tabKey:Fe.key,id:be,animated:Ee,active:Fe.key===Ae,destroyInactiveTabPane:X})})))}function $i(re){var be=re.prefixCls,Ae=re.forceRender,ue=re.className,V=re.style,te=re.id,X=re.active,le=re.animated,he=re.destroyInactiveTabPane,we=re.tabKey,Ee=re.children,Ie=w.useState(Ae),Fe=Object(W.a)(Ie,2),$e=Fe[0],Ye=Fe[1];w.useEffect(function(){X?Ye(!0):he&&Ye(!1)},[X,he]);var et={};return X||(le?(et.visibility="hidden",et.height=0,et.overflowY="hidden"):et.display="none"),w.createElement("div",{id:te&&"".concat(te,"-panel-").concat(we),role:"tabpanel",tabIndex:X?0:-1,"aria-labelledby":te&&"".concat(te,"-tab-").concat(we),"aria-hidden":!X,style:Object(k.a)(Object(k.a)({},et),V),className:B()("".concat(be,"-tabpane"),X&&"".concat(be,"-tabpane-active"),ue)},(X||$e||Ae)&&Ee)}var Qi=0;function Fr(re){return Object(M.a)(re).map(function(be){if(w.isValidElement(be)){var Ae=be.key!==void 0?String(be.key):void 0;return Object(k.a)(Object(k.a)({key:Ae},be.props),{},{node:be})}return null}).filter(function(be){return be})}function Wr(re,be){var Ae,ue=re.id,V=re.prefixCls,te=V===void 0?"rc-tabs":V,X=re.className,le=re.children,he=re.direction,we=re.activeKey,Ee=re.defaultActiveKey,Ie=re.editable,Fe=re.animated,$e=re.tabPosition,Ye=$e===void 0?"top":$e,et=re.tabBarGutter,gt=re.tabBarStyle,wt=re.tabBarExtraContent,Tt=re.locale,Ot=re.moreIcon,Ct=re.moreTransitionName,St=re.destroyInactiveTabPane,At=re.renderTabBar,Nt=re.onChange,Rt=re.onTabClick,ln=re.onTabScroll,Gt=Object(O.a)(re,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),mt=Fr(le),pt=he==="rtl",Dt;Fe===!1?Dt={inkBar:!1,tabPane:!1}:Dt=Object(k.a)({inkBar:!0,tabPane:!1},Fe!==!0?Fe:null);var Mt=Object(w.useState)(!1),ot=Object(W.a)(Mt,2),Ut=ot[0],tn=ot[1];Object(w.useEffect)(function(){tn(kr())},[]);var Bt=Object(e.a)(function(){var Jt;return(Jt=mt[0])===null||Jt===void 0?void 0:Jt.key},{value:we,defaultValue:Ee}),Xt=Object(W.a)(Bt,2),sn=Xt[0],xn=Xt[1],Ln=Object(w.useState)(function(){return mt.findIndex(function(Jt){return Jt.key===sn})}),un=Object(W.a)(Ln,2),Pn=un[0],Hn=un[1];Object(w.useEffect)(function(){var Jt=mt.findIndex(function(ti){return ti.key===sn});if(Jt===-1){var zn;Jt=Math.max(0,Math.min(Pn,mt.length-1)),xn((zn=mt[Jt])===null||zn===void 0?void 0:zn.key)}Hn(Jt)},[mt.map(function(Jt){return Jt.key}).join("_"),sn,Pn]);var kn=Object(e.a)(null,{value:ue}),Nn=Object(W.a)(kn,2),cn=Nn[0],Rn=Nn[1],Sn=Ye;Ut&&!["left","right"].includes(Ye)&&(Sn="top"),Object(w.useEffect)(function(){ue||(Rn("rc-tabs-".concat(Qi)),Qi+=1)},[]);function vn(Jt,zn){Rt==null||Rt(Jt,zn),xn(Jt),Nt==null||Nt(Jt)}var $n={id:cn,activeKey:sn,animated:Dt,tabPosition:Sn,rtl:pt,mobile:Ut},Qn,ei=Object(k.a)(Object(k.a)({},$n),{},{editable:Ie,locale:Tt,moreIcon:Ot,moreTransitionName:Ct,tabBarGutter:et,onTabClick:vn,onTabScroll:ln,extra:wt,style:gt,panes:le});return At?Qn=At(ei,Yi):Qn=w.createElement(Yi,Object.assign({},ei)),w.createElement(Oi.Provider,{value:{tabs:mt,prefixCls:te}},w.createElement("div",Object.assign({ref:be,id:ue,className:B()(te,"".concat(te,"-").concat(Sn),(Ae={},Object(ne.a)(Ae,"".concat(te,"-mobile"),Ut),Object(ne.a)(Ae,"".concat(te,"-editable"),Ie),Object(ne.a)(Ae,"".concat(te,"-rtl"),pt),Ae),X)},Gt),Qn,w.createElement(jr,Object.assign({destroyInactiveTabPane:St},$n,{animated:Dt}))))}var Zi=w.forwardRef(Wr);Zi.TabPane=$i;var Hr=Zi,ma=ve.b=Hr},nEHx:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return ne});var ne;(function(W){W.DARK="dark",W.LIGHT="light",W.HIGH_CONTRAST="hc"})(ne||(ne={}))},nnTU:function(qe,ve,U){"use strict";U.d(ve,"b",function(){return B}),U.d(ve,"a",function(){return M});var ne=U("MI8n"),W=U("JYp7"),O=U("pmY6"),k=U("24hK"),w=U("746U"),D=U("Cg/j");const B=Object(D.c)("commandService"),M=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,C){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!C)throw new Error("invalid command");return this.registerCommand({id:e,handler:C})}if(e.description){const i=[];for(let s of e.description.args)i.push(s.constraint);const o=e.handler;e.handler=function(s,...r){return Object(w.o)(r,i),o(s,...r)}}const{id:y}=e;let c=this._commands.get(y);c||(c=new k.a,this._commands.set(y,c));let d=c.unshift(e),a=Object(O.i)(()=>{d();const i=this._commands.get(y);(i==null?void 0:i.isEmpty())&&this._commands.delete(y)});return this._onDidRegisterCommand.fire(y),a}registerCommandAlias(e,C){return M.registerCommand(e,(y,...c)=>y.get(B).executeCommand(C,...c))}getCommand(e){const C=this._commands.get(e);return!C||C.isEmpty()?void 0:W.a.first(C)}getCommands(){const e=new Map;for(const C of this._commands.keys()){const y=this.getCommand(C);y&&e.set(C,y)}return e}};M.registerCommand("noop",()=>{})},p5ED:function(qe,ve,U){"use strict";var ne=U("+L6B"),W=U("2/Rp"),O=U("5Dmo"),k=U("3S7+"),w=U("k1fw"),D=U("tJVT"),B=U("q1tI"),M=U.n(B),e=U("vHTk"),C=U.n(e),y=U("yEEn"),c=U("ZW9T"),d=U("1vsH");ve.a=function(a){var i=a.name,o=a.data,s=a.theme,r=a.type,n=a.filename,t=a.monacoEditor,g=a.className,p=a.style,m=a.close,b=a.onClose,_=a.hasMask,l=Object(B.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),f=Object(D.a)(l,2),u=f[0],h=f[1],E=Object(B.useState)(""),v=Object(D.a)(E,2),S=v[0],L=v[1],I,A=1024*1024,P=10*A,H=Object(B.useRef)();r==="office"&&(I=Object(d.T)(o).filesize,I>P&&(r="other")),n&&(t.filename=n),Object(B.useEffect)(function(){var z,oe,$=(z=document.cookie)===null||z===void 0||((oe=z.replace(/\s/g,""))===null||oe===void 0)?void 0:oe.split(";");$==null||$.map(function(fe){var de=fe.split("=");de[0]==="_educoder_session"&&L(de[1])})},[]);var R=function(){if(o.startsWith("http")||o.startsWith("/")){K();return}Object(d.z)(n||"educoder",o,n)},K=function(){Object(d.x)(n||i,o)};return console.log("data:",o,"fileanme:",n," name:",i),M.a.createElement("div",{style:Object(w.a)({},p||{}),className:"".concat(_&&C.a.bgBlack," ").concat(r?C.a.wrp:"hide")},m&&M.a.createElement("div",{className:C.a.close,ref:H},M.a.createElement(k.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return H.current}},M.a.createElement("span",{onClick:K},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(k.a,{title:"\u5173\u95ED",getPopupContainer:function(){return H.current}},M.a.createElement("span",{className:"",onClick:b},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(C.a[g]," ").concat(g," ").concat(C.a.monaco," ").concat(r==="txt"?"show":"hide")},r==="txt"&&M.a.createElement(c.b,t)),r==="audio"&&M.a.createElement("audio",{src:"".concat(o!=null&&o.startsWith("/")||(o==null?void 0:o.indexOf("https://"))>-1?o:"data:audio/mp3;base64,").concat(o),autoPlay:!0}),r==="video"&&M.a.createElement(M.a.Fragment,null,o!=null&&o.startsWith("/")?M.a.createElement("video",{controls:!0,src:"".concat(o),autoPlay:!0}):M.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(o),autoPlay:!0})),r==="html"&&M.a.createElement("iframe",{src:o+"&disposition=inline"}),r==="pdf"&&M.a.createElement("embed",{className:C.a.embed,src:o}),r==="image"&&M.a.createElement(M.a.Fragment,null,M.a.createElement("img",{src:"".concat(o!=null&&o.startsWith("/")||(o==null?void 0:o.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(o)})),r==="other"&&M.a.createElement("div",null,M.a.createElement(W.a,{type:"primary",size:"large",onClick:R},M.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(r==="download"||r==="office")&&M.a.createElement(W.a,{type:"primary",size:"large",onClick:R},M.a.createElement(y.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(qe,ve,U){"use strict";U.d(ve,"h",function(){return C}),U.d(ve,"g",function(){return c}),U.d(ve,"f",function(){return d}),U.d(ve,"e",function(){return a}),U.d(ve,"i",function(){return i}),U.d(ve,"b",function(){return o}),U.d(ve,"a",function(){return s}),U.d(ve,"d",function(){return r}),U.d(ve,"c",function(){return n});var ne=U("C/vA"),W=U("JYp7");const O=!1;let k=null;function w(t){k=t}if(O){const t="__is_disposable_tracked__";w(new class{trackDisposable(g){const p=new Error("Potentially leaked disposable").stack;setTimeout(()=>{g[t]||console.log(p)},3e3)}setParent(g,p){if(g&&g!==s.None)try{g[t]=!0}catch(m){}}markAsDisposed(g){if(g&&g!==s.None)try{g[t]=!0}catch(p){}}markAsSingleton(g){}})}function D(t){return k==null||k.trackDisposable(t),t}function B(t){k==null||k.markAsDisposed(t)}function M(t,g){k==null||k.setParent(t,g)}function e(t,g){if(!k)return;for(const p of t)k.setParent(p,g)}function C(t){return k==null||k.markAsSingleton(t),t}class y extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function c(t){return typeof t.dispose=="function"&&t.dispose.length===0}function d(t){if(W.a.is(t)){let g=[];for(const p of t)if(p)try{p.dispose()}catch(m){g.push(m)}if(g.length===1)throw g[0];if(g.length>1)throw new y(g);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function a(...t){const g=i(()=>d(t));return e(t,g),g}function i(t){const g=D({dispose:Object(ne.a)(()=>{B(g),t()})});return g}class o{constructor(){this._toDispose=new Set,this._isDisposed=!1,D(this)}dispose(){if(this._isDisposed)return;B(this),this._isDisposed=!0,this.clear()}clear(){try{d(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return M(t,this),this._isDisposed?o.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}o.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new o,D(this),M(this._store,this)}dispose(){B(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}s.None=Object.freeze({dispose(){}});class r{constructor(){this._isDisposed=!1,D(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var g;if(this._isDisposed||t===this._value)return;(g=this._value)===null||g===void 0||g.dispose(),t&&M(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,B(this),(t=this._value)===null||t===void 0||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&M(t,null),t}}class n{constructor(t){this.object=t}dispose(){}}},psGv:function(qe,ve,U){var ne,W;(function(){var O;(function(){"use strict";var B=[,,function(y){function c(i){this.__parent=i,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}c.prototype.clone_empty=function(){var i=new c(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},c.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},c.prototype.has_match=function(i){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(i))return!0;return!1},c.prototype.set_indent=function(i,o){this.is_empty()&&(this.__indent_count=i||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},c.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var i=this.__parent.current_line;return i.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),i.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),i.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,i.__items[0]===" "&&(i.__items.splice(0,1),i.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(i){this.__items.push(i);var o=i.lastIndexOf(`
|
|
`);o!==-1?this.__character_count=i.length-o:this.__character_count+=i.length},c.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var i="";return this.is_empty()?this.__parent.indent_empty_lines&&(i=this.__parent.get_indent_string(this.__indent_count)):(i=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),i+=this.__items.join("")),i};function d(i,o){this.__cache=[""],this.__indent_size=i.indent_size,this.__indent_string=i.indent_char,i.indent_with_tabs||(this.__indent_string=new Array(i.indent_size+1).join(i.indent_char)),o=o||"",i.indent_level>0&&(o=new Array(i.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}d.prototype.get_indent_size=function(i,o){var s=this.__base_string_length;return o=o||0,i<0&&(s=0),s+=i*this.__indent_size,s+=o,s},d.prototype.get_indent_string=function(i,o){var s=this.__base_string;return o=o||0,i<0&&(i=0,s=""),o+=i*this.__indent_size,this.__ensure_cache(o),s+=this.__cache[o],s},d.prototype.__ensure_cache=function(i){for(;i>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var i=this.__cache.length,o=0,s="";this.__indent_size&&i>=this.__indent_size&&(o=Math.floor(i/this.__indent_size),i-=o*this.__indent_size,s=new Array(o+1).join(this.__indent_string)),i&&(s+=new Array(i+1).join(" ")),this.__cache.push(s)};function a(i,o){this.__indent_cache=new d(i,o),this.raw=!1,this._end_with_newline=i.end_with_newline,this.indent_size=i.indent_size,this.wrap_line_length=i.wrap_line_length,this.indent_empty_lines=i.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(i,o){return this.__indent_cache.get_indent_string(i,o)},a.prototype.get_indent_size=function(i,o){return this.__indent_cache.get_indent_size(i,o)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(i){return this.is_empty()||!i&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(i){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
|
|
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return i!==`
|
|
`&&(s=s.replace(/[\n]/g,i)),s},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(i,o){return i=i||0,o=o||0,this.next_line.set_indent(i,o),this.__lines.length>1?(this.current_line.set_indent(i,o),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(i){for(var o=0;o<i.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(i.whitespace_before),this.current_line.push(i.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(i){this.__add_space_before_token(),this.current_line.push(i),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},a.prototype.remove_indent=function(i){for(var o=this.__lines.length;i<o;)this.__lines[i]._remove_indent(),i++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(i){for(i=i===void 0?!1:i,this.current_line.trim();i&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(i,o){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(i)!==0&&r.item(-1)!==o){this.__lines.splice(s+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},y.exports.Output=a},function(y){function c(d,a,i,o){this.type=d,this.text=a,this.comments_before=null,this.newlines=i||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}y.exports.Token=c},,,function(y){function c(i,o){this.raw_options=d(i,o),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}c.prototype._get_array=function(i,o){var s=this.raw_options[i],r=o||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},c.prototype._get_boolean=function(i,o){var s=this.raw_options[i],r=s===void 0?!!o:!!s;return r},c.prototype._get_characters=function(i,o){var s=this.raw_options[i],r=o||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),r},c.prototype._get_number=function(i,o){var s=this.raw_options[i];o=parseInt(o,10),isNaN(o)&&(o=0);var r=parseInt(s,10);return isNaN(r)&&(r=o),r},c.prototype._get_selection=function(i,o,s){var r=this._get_selection_list(i,o,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+i+`' can only be one of the following values:
|
|
`+o+`
|
|
You passed in: '`+this.raw_options[i]+"'");return r[0]},c.prototype._get_selection_list=function(i,o,s){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[o[0]],!this._is_valid_selection(s,o))throw new Error("Invalid Default Value!");var r=this._get_array(i,s);if(!this._is_valid_selection(r,o))throw new Error("Invalid Option Value: The option '"+i+`' can contain only the following values:
|
|
`+o+`
|
|
You passed in: '`+this.raw_options[i]+"'");return r},c.prototype._is_valid_selection=function(i,o){return i.length&&o.length&&!i.some(function(s){return o.indexOf(s)===-1})};function d(i,o){var s={};i=a(i);var r;for(r in i)r!==o&&(s[r]=i[r]);if(o&&i[o])for(r in i[o])s[r]=i[o][r];return s}function a(i){var o={},s;for(s in i){var r=s.replace(/-/g,"_");o[r]=i[s]}return o}y.exports.Options=c,y.exports.normalizeOpts=a,y.exports.mergeOpts=d},,function(y){var c=RegExp.prototype.hasOwnProperty("sticky");function d(a){this.__input=a||"",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 a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},d.prototype.peek=function(a){var i=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(i=this.__input.charAt(a)),i},d.prototype.__match=function(a,i){a.lastIndex=i;var o=a.exec(this.__input);return o&&!(c&&a.sticky)&&(o.index!==i&&(o=null)),o},d.prototype.test=function(a,i){return i=i||0,i+=this.__position,i>=0&&i<this.__input_length?!!this.__match(a,i):!1},d.prototype.testChar=function(a,i){var o=this.peek(i);return a.lastIndex=0,o!==null&&a.test(o)},d.prototype.match=function(a){var i=this.__match(a,this.__position);return i?this.__position+=i[0].length:i=null,i},d.prototype.read=function(a,i,o){var s="",r;return a&&(r=this.match(a),r&&(s+=r[0])),i&&(r||!a)&&(s+=this.readUntil(i,o)),s},d.prototype.readUntil=function(a,i){var o="",s=this.__position;a.lastIndex=this.__position;var r=a.exec(this.__input);return r?(s=r.index,i&&(s+=r[0].length)):s=this.__input_length,o=this.__input.substring(this.__position,s),this.__position=s,o},d.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},d.prototype.get_regexp=function(a,i){var o=null,s="g";return i&&c&&(s="y"),typeof a=="string"&&a!==""?o=new RegExp(a,s):a&&(o=new RegExp(a.source,s)),o},d.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},d.prototype.peekUntilAfter=function(a){var i=this.__position,o=this.readUntilAfter(a);return this.__position=i,o},d.prototype.lookBack=function(a){var i=this.__position-1;return i>=a.length&&this.__input.substring(i-a.length,i).toLowerCase()===a},y.exports.InputScanner=d},function(y,c,d){var a=d(8).InputScanner,i=d(3).Token,o=d(10).TokenStream,s=d(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(t,g){this._input=new a(t),this._options=g||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var t,g=new i(r.START,""),p=null,m=[],b=new o;g.type!==r.EOF;){for(t=this._get_next_token(g,p);this._is_comment(t);)b.add(t),t=this._get_next_token(g,p);b.isEmpty()||(t.comments_before=b,b=new o),t.parent=p,this._is_opening(t)?(m.push(p),p=t):p&&this._is_closing(t,p)&&(t.opened=p,p.closed=t,p=m.pop(),t.parent=p),t.previous=g,g.next=t,this.__tokens.add(t),g=t}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(t,g){this._readWhitespace();var p=this._input.read(/.+/g);return p?this._create_token(r.RAW,p):this._create_token(r.EOF,"")},n.prototype._is_comment=function(t){return!1},n.prototype._is_opening=function(t){return!1},n.prototype._is_closing=function(t,g){return!1},n.prototype._create_token=function(t,g){var p=new i(t,g,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return p},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},y.exports.Tokenizer=n,y.exports.TOKEN=r},function(y){function c(d){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=d}c.prototype.restart=function(){this.__position=0},c.prototype.isEmpty=function(){return this.__tokens_length===0},c.prototype.hasNext=function(){return this.__position<this.__tokens_length},c.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__tokens[this.__position],this.__position+=1),d},c.prototype.peek=function(d){var a=null;return d=d||0,d+=this.__position,d>=0&&d<this.__tokens_length&&(a=this.__tokens[d]),a},c.prototype.add=function(d){this.__parent_token&&(d.parent=this.__parent_token),this.__tokens.push(d),this.__tokens_length+=1},y.exports.TokenStream=c},function(y,c,d){var a=d(12).Pattern;function i(o,s){a.call(this,o,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}i.prototype=new a,i.prototype.__set_whitespace_patterns=function(o,s){o+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},i.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var o=this._input.read(this._match_pattern);if(o===" ")this.whitespace_before_token=" ";else if(o){var s=this.__split(this._newline_regexp,o);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return o},i.prototype.matching=function(o,s){var r=this._create();return r.__set_whitespace_patterns(o,s),r._update(),r},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(o,s){o.lastIndex=0;for(var r=0,n=[],t=o.exec(s);t;)n.push(s.substring(r,t.index)),r=t.index+t[0].length,t=o.exec(s);return r<s.length?n.push(s.substring(r,s.length)):n.push(""),n},y.exports.WhitespacePattern=i},function(y){function c(d,a){this._input=d,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}c.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},c.prototype.read_match=function(){return this._input.match(this._match_pattern)},c.prototype.until_after=function(d){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(d),a._update(),a},c.prototype.until=function(d){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(d),a._update(),a},c.prototype.starting_with=function(d){var a=this._create();return a._starting_pattern=this._input.get_regexp(d,!0),a._update(),a},c.prototype.matching=function(d){var a=this._create();return a._match_pattern=this._input.get_regexp(d,!0),a._update(),a},c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){},y.exports.Pattern=c},function(y){function c(d,a){d=typeof d=="string"?d:d.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(d+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(d+/\sbeautify\signore:end\s/.source+a,"g")}c.prototype.get_directives=function(d){if(!d.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(d);i;)a[i[1]]=i[2],i=this.__directive_pattern.exec(d);return a},c.prototype.readIgnored=function(d){return d.readUntilAfter(this.__directives_end_ignore_pattern)},y.exports.Directives=c},function(y,c,d){var a=d(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(s,r){a.call(this,s,r),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),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 n=new a(s);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new a,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},o.prototype.read_options=function(s){var r=this._create();for(var n in i)r._disabled[n]=s.templating.indexOf(n)===-1;return r._update(),r},o.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},o.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},o.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("|")+")")},o.prototype._read_template=function(){var s="",r=this._input.peek();if(r==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(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},y.exports.TemplatablePattern=o},,,,function(y,c,d){var a=d(19).Beautifier,i=d(20).Options;function o(s,r,n,t){var g=new a(s,r,n,t);return g.beautify()}y.exports=o,y.exports.defaultOptions=function(){return new i}},function(y,c,d){var a=d(20).Options,i=d(2).Output,o=d(21).Tokenizer,s=d(21).TOKEN,r=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,t=function(E,v){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new i(E,v)};t.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},t.prototype.set_space_before_token=function(E,v){this._output.space_before_token=E,this._output.non_breaking_space=v},t.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},t.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},t.prototype.print_preserved_newlines=function(E){var v=0;E.type!==s.TEXT&&E.previous.type!==s.TEXT&&(v=E.newlines?1:0),this.preserve_newlines&&(v=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var S=0;S<v;S++)this.print_newline(S>0);return v!==0},t.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},t.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},t.prototype.print_newline=function(E){this._output.add_new_line(E)},t.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var g=function(E){for(var v=null,S=E.next;S.type!==s.EOF&&E.closed!==S;){if(S.type===s.ATTRIBUTE&&S.text==="type"){S.next&&S.next.type===s.EQUALS&&S.next.next&&S.next.next.type===s.VALUE&&(v=S.next.next.text);break}S=S.next}return v},p=function(E,v){var S=null,L=null;return v.closed?(E==="script"?S="text/javascript":E==="style"&&(S="text/css"),S=g(v)||S,S.search("text/css")>-1?L="css":S.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?L="javascript":S.search(/(text|application|dojo)\/(x-)?(html)/)>-1?L="html":S.search(/test\/null/)>-1&&(L="null"),L):null};function m(E,v){return v.indexOf(E)!==-1}function b(E,v,S){this.parent=E||null,this.tag=v?v.tag_name:"",this.indent_level=S||0,this.parser_token=v||null}function _(E){this._printer=E,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(E){var v=new b(this._current_frame,E,this._printer.indent_level);this._current_frame=v},_.prototype._try_pop_frame=function(E){var v=null;return E&&(v=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),v},_.prototype._get_frame=function(E,v){for(var S=this._current_frame;S&&!(E.indexOf(S.tag)!==-1);){if(v&&v.indexOf(S.tag)!==-1){S=null;break}S=S.parent}return S},_.prototype.try_pop=function(E,v){var S=this._get_frame([E],v);return this._try_pop_frame(S)},_.prototype.indent_to_tag=function(E){var v=this._get_frame(E);v&&(this._printer.indent_level=v.indent_level)};function l(E,v,S,L){this._source_text=E||"",v=v||{},this._js_beautify=S,this._css_beautify=L,this._tag_stack=null;var I=new a(v,"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"}l.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,v=this._options.eol;this._options.eol==="auto"&&(v=`
|
|
`,E&&r.test(E)&&(v=E.match(r)[0])),E=E.replace(n,`
|
|
`);var S=E.match(/^[\t ]*/)[0],L={text:"",type:""},I=new f,A=new t(this._options,S),P=new o(E,this._options).tokenize();this._tag_stack=new _(A);for(var H=null,R=P.next();R.type!==s.EOF;)R.type===s.TAG_OPEN||R.type===s.COMMENT?(H=this._handle_tag_open(A,R,I,L),I=H):R.type===s.ATTRIBUTE||R.type===s.EQUALS||R.type===s.VALUE||R.type===s.TEXT&&!I.tag_complete?H=this._handle_inside_tag(A,R,I,P):R.type===s.TAG_CLOSE?H=this._handle_tag_close(A,R,I):R.type===s.TEXT?H=this._handle_text(A,R,I):A.add_raw_token(R),L=H,R=P.next();var K=A._output.get_code(v);return K},l.prototype._handle_tag_close=function(E,v,S){var L={text:v.text,type:v.type};return E.alignment_size=0,S.tag_complete=!0,E.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),S.is_unformatted?E.add_raw_token(v):(S.tag_start_char==="<"&&(E.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&S.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(v)),S.indent_content&&!(S.is_unformatted||S.is_content_unformatted)&&(E.indent(),S.indent_content=!1),!S.is_inline_element&&!(S.is_unformatted||S.is_content_unformatted)&&E.set_wrap_point(),L},l.prototype._handle_inside_tag=function(E,v,S,L){var I=S.has_wrapped_attrs,A={text:v.text,type:v.type};if(E.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),S.is_unformatted)E.add_raw_token(v);else if(S.tag_start_char==="{"&&v.type===s.TEXT)E.print_preserved_newlines(v)?(v.newlines=0,E.add_raw_token(v)):E.print_token(v);else{if(v.type===s.ATTRIBUTE?(E.set_space_before_token(!0),S.attr_count+=1):(v.type===s.EQUALS||v.type===s.VALUE&&v.previous.type===s.EQUALS)&&E.set_space_before_token(!1),v.type===s.ATTRIBUTE&&S.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(v),I=I||v.newlines!==0),this._is_wrap_attributes_force)){var P=S.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&S.attr_count===1){var H=!0,R=0,K;do{if(K=L.peek(R),K.type===s.ATTRIBUTE){H=!1;break}R+=1}while(R<4&&K.type!==s.EOF&&K.type!==s.TAG_CLOSE);P=!H}P&&(E.print_newline(!1),I=!0)}E.print_token(v),I=I||E.previous_token_wrapped(),S.has_wrapped_attrs=I}return A},l.prototype._handle_text=function(E,v,S){var L={text:v.text,type:"TK_CONTENT"};return S.custom_beautifier_name?this._print_custom_beatifier_text(E,v,S):S.is_unformatted||S.is_content_unformatted?E.add_raw_token(v):(E.traverse_whitespace(v),E.print_token(v)),L},l.prototype._print_custom_beatifier_text=function(E,v,S){var L=this;if(v.text!==""){var I=v.text,A,P=1,H="",R="";S.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:S.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:S.custom_beautifier_name==="html"&&(A=function(de,ee){var ie=new l(de,ee,L._js_beautify,L._css_beautify);return ie.beautify()}),this._options.indent_scripts==="keep"?P=0:this._options.indent_scripts==="separate"&&(P=-E.indent_level);var K=E.get_full_indent(P);if(I=I.replace(/\n[ \t]*$/,""),S.custom_beautifier_name!=="html"&&I[0]==="<"&&I.match(/^(<!--|<!\[CDATA\[)/)){var z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(I);if(!z){E.add_raw_token(v);return}H=K+z[1]+`
|
|
`,I=z[4],z[5]&&(R=K+z[5]),I=I.replace(/\n[ \t]*$/,""),(z[2]||z[3].indexOf(`
|
|
`)!==-1)&&(z=z[3].match(/[ \t]+$/),z&&(v.whitespace_before=z[0]))}if(I)if(A){var oe=function(){this.eol=`
|
|
`};oe.prototype=this._options.raw_options;var $=new oe;I=A(K+I,$)}else{var fe=v.whitespace_before;fe&&(I=I.replace(new RegExp(`
|
|
(`+fe+")?","g"),`
|
|
`)),I=K+I.replace(/\n/g,`
|
|
`+K)}H&&(I?I=H+I+`
|
|
`+R:I=H+R),E.print_newline(!1),I&&(v.text=I,v.whitespace_before="",v.newlines=0,E.add_raw_token(v),E.print_newline(!0))}},l.prototype._handle_tag_open=function(E,v,S,L){var I=this._get_tag_open_token(v);return(S.is_unformatted||S.is_content_unformatted)&&!S.is_empty_element&&v.type===s.TAG_OPEN&&v.text.indexOf("</")===0?(E.add_raw_token(v),I.start_tag_token=this._tag_stack.try_pop(I.tag_name)):(E.traverse_whitespace(v),this._set_tag_position(E,v,I,S,L),I.is_inline_element||E.set_wrap_point(),E.print_token(v)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(I.alignment_size=v.text.length+1),!I.tag_complete&&!I.is_unformatted&&(E.alignment_size=I.alignment_size),I};var f=function(E,v){if(this.parent=E||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="",!v)this.tag_complete=!0;else{var S;this.tag_start_char=v.text[0],this.text=v.text,this.tag_start_char==="<"?(S=v.text.match(/^<([^\s>]*)/),this.tag_check=S?S[1]:""):(S=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=S?S[1]:"",(v.text.startsWith("{{#>")||v.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&v.next!==null?this.tag_check=v.next.text.split(" ")[0]:this.tag_check=v.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),v.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||v.closed&&v.closed.text==="/>";var L=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(L=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(L)))}};l.prototype._get_tag_open_token=function(E){var v=new f(this._tag_stack.get_parser_token(),E);return v.alignment_size=this._options.wrap_attributes_indent_size,v.is_end_tag=v.is_end_tag||m(v.tag_check,this._options.void_elements),v.is_empty_element=v.tag_complete||v.is_start_tag&&v.is_end_tag,v.is_unformatted=!v.tag_complete&&m(v.tag_check,this._options.unformatted),v.is_content_unformatted=!v.is_empty_element&&m(v.tag_check,this._options.content_unformatted),v.is_inline_element=m(v.tag_name,this._options.inline)||v.tag_name.includes("-")||v.tag_start_char==="{",v},l.prototype._set_tag_position=function(E,v,S,L,I){if(S.is_empty_element||(S.is_end_tag?S.start_tag_token=this._tag_stack.try_pop(S.tag_name):(this._do_optional_end_element(S)&&(S.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(S),(S.tag_name==="script"||S.tag_name==="style")&&!(S.is_unformatted||S.is_content_unformatted)&&(S.custom_beautifier_name=p(S.tag_check,v)))),m(S.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),S.is_empty_element){if(S.tag_start_char==="{"&&S.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),S.indent_content=!0;var A=E.current_line_has_match(/{{#if/);A||E.print_newline(!1)}S.tag_name==="!--"&&I.type===s.TAG_CLOSE&&L.is_end_tag&&S.text.indexOf(`
|
|
`)===-1||(S.is_inline_element||S.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,S))}else if(S.is_end_tag){var P=!1;P=S.start_tag_token&&S.start_tag_token.multiline_content,P=P||!S.is_inline_element&&!(L.is_inline_element||L.is_unformatted)&&!(I.type===s.TAG_CLOSE&&S.start_tag_token===L)&&I.type!=="TK_CONTENT",(S.is_content_unformatted||S.is_unformatted)&&(P=!1),P&&E.print_newline(!1)}else S.indent_content=!S.custom_beautifier_name,S.tag_start_char==="<"&&(S.tag_name==="html"?S.indent_content=this._options.indent_inner_html:S.tag_name==="head"?S.indent_content=this._options.indent_head_inner_html:S.tag_name==="body"&&(S.indent_content=this._options.indent_body_inner_html)),!(S.is_inline_element||S.is_unformatted)&&(I.type!=="TK_CONTENT"||S.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,S)},l.prototype._calcluate_parent_multiline=function(E,v){v.parent&&E._output.just_added_newline()&&!((v.is_inline_element||v.is_unformatted)&&v.parent.is_inline_element)&&(v.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"],h=["a","audio","del","ins","map","noscript","video"];l.prototype._do_optional_end_element=function(E){var v=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")v=v||this._tag_stack.try_pop("head");else if(E.tag_name==="li")v=v||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")v=v||this._tag_stack.try_pop("dt",["dl"]),v=v||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&u.indexOf(E.tag_name)!==-1){var S=E.parent.parent;(!S||h.indexOf(S.tag_name)===-1)&&(v=v||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(v=v||this._tag_stack.try_pop("rt",["ruby","rtc"]),v=v||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?v=v||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?v=v||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?v=v||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("thead",["table"]),v=v||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(v=v||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),v=v||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),v},y.exports.Beautifier=l},function(y,c,d){var a=d(6).Options;function i(o){a.call(this,o,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}i.prototype=new a,y.exports.Options=i},function(y,c,d){var a=d(9).Tokenizer,i=d(9).TOKEN,o=d(13).Directives,s=d(14).TemplatablePattern,r=d(12).Pattern,n={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},t=new o(/<\!--/,/-->/),g=function(p,m){a.call(this,p,m),this._current_tag_name="";var b=new s(this._input).read_options(this._options),_=new r(this._input);if(this.__patterns={word:b.until(/[\n\r\t <]/),single_quote:b.until_after(/'/),double_quote:b.until_after(/"/),attribute:b.until(/[\n\r\t =>]|\/>/),element_name:b.until(/[\n\r\t >\/]/),handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),handlebars_open:_.until(/[\n\r\t }]/),handlebars_raw_close:_.until(/}}/),comment:_.starting_with(/<!--/).until_after(/-->/),cdata:_.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:_.starting_with(/<!\[/).until_after(/]>/),processing:_.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var l=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=_.matching(l).until_after(l)}};g.prototype=new a,g.prototype._is_comment=function(p){return!1},g.prototype._is_opening=function(p){return p.type===n.TAG_OPEN},g.prototype._is_closing=function(p,m){return p.type===n.TAG_CLOSE&&m&&((p.text===">"||p.text==="/>")&&m.text[0]==="<"||p.text==="}}"&&m.text[0]==="{"&&m.text[1]==="{")},g.prototype._reset=function(){this._current_tag_name=""},g.prototype._get_next_token=function(p,m){var b=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(n.EOF,""):(b=b||this._read_open_handlebars(_,m),b=b||this._read_attribute(_,p,m),b=b||this._read_close(_,m),b=b||this._read_raw_content(_,p,m),b=b||this._read_content_word(_),b=b||this._read_comment_or_cdata(_),b=b||this._read_processing(_),b=b||this._read_open(_,m),b=b||this._create_token(n.UNKNOWN,this._input.next()),b)},g.prototype._read_comment_or_cdata=function(p){var m=null,b=null,_=null;if(p==="<"){var l=this._input.peek(1);l==="!"&&(b=this.__patterns.comment.read(),b?(_=t.get_directives(b),_&&_.ignore==="start"&&(b+=t.readIgnored(this._input))):b=this.__patterns.cdata.read()),b&&(m=this._create_token(n.COMMENT,b),m.directives=_)}return m},g.prototype._read_processing=function(p){var m=null,b=null,_=null;if(p==="<"){var l=this._input.peek(1);(l==="!"||l==="?")&&(b=this.__patterns.conditional_comment.read(),b=b||this.__patterns.processing.read()),b&&(m=this._create_token(n.COMMENT,b),m.directives=_)}return m},g.prototype._read_open=function(p,m){var b=null,_=null;return m||p==="<"&&(b=this._input.next(),this._input.peek()==="/"&&(b+=this._input.next()),b+=this.__patterns.element_name.read(),_=this._create_token(n.TAG_OPEN,b)),_},g.prototype._read_open_handlebars=function(p,m){var b=null,_=null;return m||this._options.indent_handlebars&&p==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(b=this.__patterns.handlebars_comment.read(),b=b||this.__patterns.handlebars.read(),_=this._create_token(n.COMMENT,b)):(b=this.__patterns.handlebars_open.read(),_=this._create_token(n.TAG_OPEN,b))),_},g.prototype._read_close=function(p,m){var b=null,_=null;return m&&(m.text[0]==="<"&&(p===">"||p==="/"&&this._input.peek(1)===">")?(b=this._input.next(),p==="/"&&(b+=this._input.next()),_=this._create_token(n.TAG_CLOSE,b)):m.text[0]==="{"&&p==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(n.TAG_CLOSE,"}}"))),_},g.prototype._read_attribute=function(p,m,b){var _=null,l="";if(b&&b.text[0]==="<")if(p==="=")_=this._create_token(n.EQUALS,this._input.next());else if(p==='"'||p==="'"){var f=this._input.next();p==='"'?f+=this.__patterns.double_quote.read():f+=this.__patterns.single_quote.read(),_=this._create_token(n.VALUE,f)}else l=this.__patterns.attribute.read(),l&&(m.type===n.EQUALS?_=this._create_token(n.VALUE,l):_=this._create_token(n.ATTRIBUTE,l));return _},g.prototype._is_content_unformatted=function(p){return this._options.void_elements.indexOf(p)===-1&&(this._options.content_unformatted.indexOf(p)!==-1||this._options.unformatted.indexOf(p)!==-1)},g.prototype._read_raw_content=function(p,m,b){var _="";if(b&&b.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(m.type===n.TAG_CLOSE&&m.opened.text[0]==="<"&&m.text[0]!=="/"){var l=m.opened.text.substr(1).toLowerCase();if(l==="script"||l==="style"){var f=this._read_comment_or_cdata(p);if(f)return f.type=n.TEXT,f;_=this._input.readUntil(new RegExp("</"+l+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(l)&&(_=this._input.readUntil(new RegExp("</"+l+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(n.TEXT,_):null},g.prototype._read_content_word=function(p){var m="";if(this._options.unformatted_content_delimiter&&(p===this._options.unformatted_content_delimiter[0]&&(m=this.__patterns.unformatted_content_delimiter.read())),m||(m=this.__patterns.word.read()),m)return this._create_token(n.TEXT,m)},y.exports.Tokenizer=g,y.exports.TOKEN=n}],M={};function e(y){var c=M[y];if(c!==void 0)return c.exports;var d=M[y]={exports:{}};return B[y](d,d.exports,e),d.exports}var C=e(18);O=C})();var k=O;if(!0)!(ne=[U,U("6UM0"),U("TXwP")],W=function(B){var M=U("6UM0"),e=U("TXwP");return{html_beautify:function(C,y){return k(C,y,M.js_beautify,e.css_beautify)}}}.apply(ve,ne),W!==void 0&&(qe.exports=W));else var w,D})()},"rAM+":function(qe,ve,U){"use strict";U.d(ve,"a",function(){return W});var ne=U("Qw5x");function W(O,k){var w;if(typeof Symbol=="undefined"||O[Symbol.iterator]==null){if(Array.isArray(O)||(w=Object(ne.a)(O))||k&&O&&typeof O.length=="number"){w&&(O=w);var D=0,B=function(){};return{s:B,n:function(){return D>=O.length?{done:!0}:{done:!1,value:O[D++]}},e:function(c){throw c},f:B}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var M=!0,e=!1,C;return{s:function(){w=O[Symbol.iterator]()},n:function(){var c=w.next();return M=c.done,c},e:function(c){e=!0,C=c},f:function(){try{!M&&w.return!=null&&w.return()}finally{if(e)throw C}}}}},rUJ1:function(qe,ve){const U=/[&<>"']/,ne=/[&<>"']/g,W=/[<>"']|&(?!#?\w+;)/,O=/[<>"']|&(?!#?\w+;)/g,k={"&":"&","<":"<",">":">",'"':""","'":"'"},w=_=>k[_];function D(_,l){if(l){if(U.test(_))return _.replace(ne,w)}else if(W.test(_))return _.replace(O,w);return _}const B=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(_){return _.replace(B,(l,f)=>(f=f.toLowerCase(),f==="colon"?":":f.charAt(0)==="#"?f.charAt(1)==="x"?String.fromCharCode(parseInt(f.substring(2),16)):String.fromCharCode(+f.substring(1)):""))}const e=/(^|[^\[])\^/g;function C(_,l){_=_.source||_,l=l||"";const f={replace:(u,h)=>(h=h.source||h,h=h.replace(e,"$1"),_=_.replace(u,h),f),getRegex:()=>new RegExp(_,l)};return f}const y=/[^\w:]/g,c=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(_,l,f){if(_){let u;try{u=decodeURIComponent(M(f)).replace(y,"").toLowerCase()}catch(h){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}l&&!c.test(f)&&(f=r(l,f));try{f=encodeURI(f).replace(/%25/g,"%")}catch(u){return null}return f}const a={},i=/^[^:]+:\/*[^/]*$/,o=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(_,l){a[" "+_]||(i.test(_)?a[" "+_]=_+"/":a[" "+_]=p(_,"/",!0)),_=a[" "+_];const f=_.indexOf(":")===-1;return l.substring(0,2)==="//"?f?l:_.replace(o,"$1")+l:l.charAt(0)==="/"?f?l:_.replace(s,"$1")+l:_+l}const n={exec:function(){}};function t(_){let l=1,f,u;for(;l<arguments.length;l++){f=arguments[l];for(u in f)Object.prototype.hasOwnProperty.call(f,u)&&(_[u]=f[u])}return _}function g(_,l){const f=_.replace(/\|/g,(E,v,S)=>{let L=!1,I=v;for(;--I>=0&&S[I]==="\\";)L=!L;return L?"|":" |"}),u=f.split(/ \|/);let h=0;if(u.length>l)u.splice(l);else for(;u.length<l;)u.push("");for(;h<u.length;h++)u[h]=u[h].trim().replace(/\\\|/g,"|");return u}function p(_,l,f){const u=_.length;if(u===0)return"";let h=0;for(;h<u;){const E=_.charAt(u-h-1);if(E===l&&!f)h++;else if(E!==l&&f)h++;else break}return _.substr(0,u-h)}function m(_,l){if(_.indexOf(l[1])===-1)return-1;const f=_.length;let u=0,h=0;for(;h<f;h++)if(_[h]==="\\")h++;else if(_[h]===l[0])u++;else if(_[h]===l[1]&&(u--,u<0))return h;return-1}function b(_){_&&_.sanitize&&!_.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}qe.exports={escape:D,unescape:M,edit:C,cleanUrl:d,resolveUrl:r,noopTest:n,merge:t,splitCells:g,rtrim:p,findClosingBracket:m,checkSanitizeDeprecation:b}},sboe:function(qe,ve,U){"use strict";U.d(ve,"a",function(){return O});var ne=U("q1tI"),W=U.n(ne),O=ne.createContext(null)},spXi:function(qe,ve,U){qe.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t23M:function(qe,ve,U){"use strict";var ne=U("VTBJ"),W=U("1OyB"),O=U("vuIU"),k=U("Ji7U"),w=U("LK+K"),D=U("q1tI"),B=U.n(D),M=U("m+aA"),e=U("Zm9Q"),C=U("Kwbf"),y=U("c+Xe"),c=U("bdgK"),d="rc-observer-key",a=function(i){Object(k.a)(s,i);var o=Object(w.a)(s);function s(){var r;return Object(W.a)(this,s),r=o.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(n){var t=r.props.onResize,g=n[0].target,p=g.getBoundingClientRect(),m=p.width,b=p.height,_=g.offsetWidth,l=g.offsetHeight,f=Math.floor(m),u=Math.floor(b);if(r.state.width!==f||r.state.height!==u||r.state.offsetWidth!==_||r.state.offsetHeight!==l){var h={width:f,height:u,offsetWidth:_,offsetHeight:l};r.setState(h),t&&Promise.resolve().then(function(){t(Object(ne.a)(Object(ne.a)({},h),{},{offsetWidth:_,offsetHeight:l}))})}},r.setChildNode=function(n){r.childNode=n},r}return Object(O.a)(s,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var n=this.props.disabled;if(n){this.destroyObserver();return}var t=Object(M.a)(this.childNode||this),g=t!==this.currentElement;g&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new c.default(this.onResize),this.resizeObserver.observe(t))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var n=this.props.children,t=Object(e.a)(n);if(t.length>1)Object(C.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(t.length===0)return Object(C.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var g=t[0];if(D.isValidElement(g)&&Object(y.c)(g)){var p=g.ref;t[0]=D.cloneElement(g,{ref:Object(y.a)(p,this.setChildNode)})}return t.length===1?t[0]:t.map(function(m,b){return!D.isValidElement(m)||"key"in m&&m.key!==null?m:D.cloneElement(m,{key:"".concat(d,"-").concat(b)})})}}]),s}(D.Component);a.displayName="ResizeObserver",ve.a=a},t9D7:function(qe,ve,U){"use strict";U.d(ve,"b",function(){return B}),U.d(ve,"g",function(){return e}),U.d(ve,"d",function(){return C}),U.d(ve,"e",function(){return y}),U.d(ve,"a",function(){return c}),U.d(ve,"f",function(){return i}),U.d(ve,"c",function(){return o});var ne=U("Vhoy"),W=U("MI8n"),O=U("pmY6"),k=U("Cg/j"),w=U("ic2d"),D=U("nEHx");const B=Object(k.c)("themeService");var M;(function(s){function r(n){return n&&typeof n=="object"&&typeof n.id=="string"}s.isThemeColor=r})(M||(M={}));function e(s){return{id:s}}var C;(function(s){function r(b){return b&&typeof b=="object"&&typeof b.id=="string"&&(typeof b.color=="undefined"||M.isThemeColor(b.color))}s.isThemeIcon=r;const n=new RegExp(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.a.iconModifierExpression})?)\\)$`);function t(b){const _=n.exec(b);if(!_)return;let[,l]=_;return{id:l}}s.fromString=t;function g(b,_){let l=b.id;const f=l.lastIndexOf("~");return f!==-1&&(l=l.substring(0,f)),_&&(l=`${l}~${_}`),{id:l}}s.modify=g;function p(b,_){var l,f;return b.id===_.id&&((l=b.color)===null||l===void 0?void 0:l.id)===((f=_.color)===null||f===void 0?void 0:f.id)}s.isEqual=p;function m(b,_){return{id:b.id,color:_?e(_):void 0}}s.asThemeIcon=m,s.asClassNameArray=ne.a.asClassNameArray,s.asClassName=ne.a.asClassName,s.asCSSSelector=ne.a.asCSSSelector})(C||(C={}));function y(s){switch(s){case D.a.DARK:return"vs-dark";case D.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const c={ThemingContribution:"base.contributions.theming"};class d{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new W.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(O.i)(()=>{const r=this.themingParticipants.indexOf(s);this.themingParticipants.splice(r,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new d;w.a.add(c.ThemingContribution,a);function i(s){return a.onColorThemeChange(s)}class o extends O.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(qe,ve,U){typeof window!="undefined"&&function(W,O){qe.exports=O()}(this,function(){return function(ne){var W={};function O(k){if(W[k])return W[k].exports;var w=W[k]={i:k,l:!1,exports:{}};return ne[k].call(w.exports,w,w.exports,O),w.l=!0,w.exports}return O.m=ne,O.c=W,O.d=function(k,w,D){O.o(k,w)||Object.defineProperty(k,w,{enumerable:!0,get:D})},O.r=function(k){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},O.t=function(k,w){if(w&1&&(k=O(k)),w&8)return k;if(w&4&&typeof k=="object"&&k&&k.__esModule)return k;var D=Object.create(null);if(O.r(D),Object.defineProperty(D,"default",{enumerable:!0,value:k}),w&2&&typeof k!="string")for(var B in k)O.d(D,B,function(M){return k[M]}.bind(null,B));return D},O.n=function(k){var w=k&&k.__esModule?function(){return k.default}:function(){return k};return O.d(w,"a",w),w},O.o=function(k,w){return Object.prototype.hasOwnProperty.call(k,w)},O.p="/dist/",O(O.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,W,O){"use strict";var k=Object.prototype.hasOwnProperty,w="~";function D(){}Object.create&&(D.prototype=Object.create(null),new D().__proto__||(w=!1));function B(y,c,d){this.fn=y,this.context=c,this.once=d||!1}function M(y,c,d,a,i){if(typeof d!="function")throw new TypeError("The listener must be a function");var o=new B(d,a||y,i),s=w?w+c:c;return y._events[s]?y._events[s].fn?y._events[s]=[y._events[s],o]:y._events[s].push(o):(y._events[s]=o,y._eventsCount++),y}function e(y,c){--y._eventsCount===0?y._events=new D:delete y._events[c]}function C(){this._events=new D,this._eventsCount=0}C.prototype.eventNames=function(){var c=[],d,a;if(this._eventsCount===0)return c;for(a in d=this._events)k.call(d,a)&&c.push(w?a.slice(1):a);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},C.prototype.listeners=function(c){var d=w?w+c:c,a=this._events[d];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,o=a.length,s=new Array(o);i<o;i++)s[i]=a[i].fn;return s},C.prototype.listenerCount=function(c){var d=w?w+c:c,a=this._events[d];return a?a.fn?1:a.length:0},C.prototype.emit=function(c,d,a,i,o,s){var r=w?w+c:c;if(!this._events[r])return!1;var n=this._events[r],t=arguments.length,g,p;if(n.fn){n.once&&this.removeListener(c,n.fn,void 0,!0);switch(t){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,d),!0;case 3:return n.fn.call(n.context,d,a),!0;case 4:return n.fn.call(n.context,d,a,i),!0;case 5:return n.fn.call(n.context,d,a,i,o),!0;case 6:return n.fn.call(n.context,d,a,i,o,s),!0}for(p=1,g=new Array(t-1);p<t;p++)g[p-1]=arguments[p];n.fn.apply(n.context,g)}else{var m=n.length,b;for(p=0;p<m;p++){n[p].once&&this.removeListener(c,n[p].fn,void 0,!0);switch(t){case 1:n[p].fn.call(n[p].context);break;case 2:n[p].fn.call(n[p].context,d);break;case 3:n[p].fn.call(n[p].context,d,a);break;case 4:n[p].fn.call(n[p].context,d,a,i);break;default:if(!g)for(b=1,g=new Array(t-1);b<t;b++)g[b-1]=arguments[b];n[p].fn.apply(n[p].context,g)}}}return!0},C.prototype.on=function(c,d,a){return M(this,c,d,a,!1)},C.prototype.once=function(c,d,a){return M(this,c,d,a,!0)},C.prototype.removeListener=function(c,d,a,i){var o=w?w+c:c;if(!this._events[o])return this;if(!d)return e(this,o),this;var s=this._events[o];if(s.fn)s.fn===d&&(!i||s.once)&&(!a||s.context===a)&&e(this,o);else{for(var r=0,n=[],t=s.length;r<t;r++)(s[r].fn!==d||i&&!s[r].once||a&&s[r].context!==a)&&n.push(s[r]);n.length?this._events[o]=n.length===1?n[0]:n:e(this,o)}return this},C.prototype.removeAllListeners=function(c){var d;return c?(d=w?w+c:c,this._events[d]&&e(this,d)):(this._events=new D,this._eventsCount=0),this},C.prototype.off=C.prototype.removeListener,C.prototype.addListener=C.prototype.on,C.prefixed=w,C.EventEmitter=C,ne.exports=C},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,W,O){(function(k){var w=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,D=/^([^\/?#]*)([^]*)$/,B=/(?:\/|^)\.(?=\/)/g,M=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(C,y,c){if(c=c||{},C=C.trim(),y=y.trim(),!y){if(!c.alwaysNormalize)return C;var d=e.parseURL(C);if(!d)throw new Error("Error trying to parse base URL.");return d.path=e.normalizePath(d.path),e.buildURLFromParts(d)}var a=e.parseURL(y);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return c.alwaysNormalize?(a.path=e.normalizePath(a.path),e.buildURLFromParts(a)):y;var i=e.parseURL(C);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&i.path[0]!=="/"){var o=D.exec(i.path);i.netLoc=o[1],i.path=o[2]}i.netLoc&&!i.path&&(i.path="/");var s={scheme:i.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(s.netLoc=i.netLoc,a.path[0]!=="/"))if(!a.path)s.path=i.path,a.params||(s.params=i.params,a.query||(s.query=i.query));else{var r=i.path,n=r.substring(0,r.lastIndexOf("/")+1)+a.path;s.path=e.normalizePath(n)}return s.path===null&&(s.path=c.alwaysNormalize?e.normalizePath(a.path):a.path),e.buildURLFromParts(s)},parseURL:function(C){var y=w.exec(C);return y?{scheme:y[1]||"",netLoc:y[2]||"",path:y[3]||"",params:y[4]||"",query:y[5]||"",fragment:y[6]||""}:null},normalizePath:function(C){for(C=C.split("").reverse().join("").replace(B,"");C.length!==(C=C.replace(M,"")).length;);return C.split("").reverse().join("")},buildURLFromParts:function(C){return C.scheme+C.netLoc+C.path+C.params+C.query+C.fragment}};ne.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,W,O){function k(c){var d={};function a(o){if(d[o])return d[o].exports;var s=d[o]={i:o,l:!1,exports:{}};return c[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=c,a.c=d,a.i=function(o){return o},a.d=function(o,s,r){a.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:r})},a.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="/",a.oe=function(o){throw console.error(o),o};var i=a(a.s=ENTRY_MODULE);return i.default||i}var w="[\\.|\\-|\\+|\\w|/|@]+",D="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+w+").*?\\)";function B(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function M(c){return!isNaN(1*c)}function e(c,d,a){var i={};i[a]=[];var o=d.toString(),s=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return i;for(var r=s[1],n=new RegExp("(\\\\n|\\W)"+B(r)+D,"g"),t;t=n.exec(o);){if(t[3]==="dll-reference")continue;i[a].push(t[3])}for(n=new RegExp("\\("+B(r)+'\\("(dll-reference\\s('+w+'))"\\)\\)'+D,"g");t=n.exec(o);)c[t[2]]||(i[a].push(t[1]),c[t[2]]=O(t[1]).m),i[t[2]]=i[t[2]]||[],i[t[2]].push(t[4]);for(var g=Object.keys(i),p=0;p<g.length;p++)for(var m=0;m<i[g[p]].length;m++)M(i[g[p]][m])&&(i[g[p]][m]=1*i[g[p]][m]);return i}function C(c){var d=Object.keys(c);return d.reduce(function(a,i){return a||c[i].length>0},!1)}function y(c,d){for(var a={main:[d]},i={main:[]},o={main:{}};C(a);)for(var s=Object.keys(a),r=0;r<s.length;r++){var n=s[r],t=a[n],g=t.pop();if(o[n]=o[n]||{},o[n][g]||!c[n][g])continue;o[n][g]=!0,i[n]=i[n]||[],i[n].push(g);for(var p=e(c,c[n][g],n),m=Object.keys(p),b=0;b<m.length;b++)a[m[b]]=a[m[b]]||[],a[m[b]]=a[m[b]].concat(p[m[b]])}return i}ne.exports=function(c,d){d=d||{};var a={main:O.m},i=d.all?{main:Object.keys(a.main)}:y(a,c),o="";Object.keys(i).filter(function(g){return g!=="main"}).forEach(function(g){for(var p=0;i[g][p];)p++;i[g].push(p),a[g][p]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+g+" = ("+k.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+i[g].map(function(m){return""+JSON.stringify(m)+": "+a[g][m].toString()}).join(",")+`});
|
|
`}),o=o+"new (("+k.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+i.main.map(function(g){return""+JSON.stringify(g)+": "+a.main[g].toString()}).join(",")+"}))(self);";var s=new window.Blob([o],{type:"text/javascript"});if(d.bare)return s;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,n=r.createObjectURL(s),t=new window.Worker(n);return t.objectURL=n,t}},"./src/config.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"hlsDefaultConfig",function(){return b}),O.d(W,"mergeConfig",function(){return l}),O.d(W,"enableStreamingMode",function(){return f});var k=O("./src/controller/abr-controller.ts"),w=O("./src/controller/audio-stream-controller.ts"),D=O("./src/controller/audio-track-controller.ts"),B=O("./src/controller/subtitle-stream-controller.ts"),M=O("./src/controller/subtitle-track-controller.ts"),e=O("./src/controller/buffer-controller.ts"),C=O("./src/controller/timeline-controller.ts"),y=O("./src/controller/cap-level-controller.ts"),c=O("./src/controller/fps-controller.ts"),d=O("./src/controller/eme-controller.ts"),a=O("./src/controller/cmcd-controller.ts"),i=O("./src/utils/xhr-loader.ts"),o=O("./src/utils/fetch-loader.ts"),s=O("./src/utils/cues.ts"),r=O("./src/utils/mediakeys-helper.ts"),n=O("./src/utils/logger.ts");function t(){return t=Object.assign||function(u){for(var h=1;h<arguments.length;h++){var E=arguments[h];for(var v in E)Object.prototype.hasOwnProperty.call(E,v)&&(u[v]=E[v])}return u},t.apply(this,arguments)}function g(u,h){var E=Object.keys(u);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(u);h&&(v=v.filter(function(S){return Object.getOwnPropertyDescriptor(u,S).enumerable})),E.push.apply(E,v)}return E}function p(u){for(var h=1;h<arguments.length;h++){var E=arguments[h]!=null?arguments[h]:{};h%2?g(Object(E),!0).forEach(function(v){m(u,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(E)):g(Object(E)).forEach(function(v){Object.defineProperty(u,v,Object.getOwnPropertyDescriptor(E,v))})}return u}function m(u,h,E){return h in u?Object.defineProperty(u,h,{value:E,enumerable:!0,configurable:!0,writable:!0}):u[h]=E,u}var b=p(p({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:i.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:k.default,bufferController:e.default,capLevelController:y.default,fpsController:c.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},_()),{},{subtitleStreamController:B.SubtitleStreamController,subtitleTrackController:M.default,timelineController:C.TimelineController,audioStreamController:w.default,audioTrackController:D.default,emeController:d.default,cmcdController:a.default});function _(){return{cueHandler:s.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function l(u,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},u,h)}function f(u){var h=u.loader;if(h!==o.default&&h!==i.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var E=Object(o.fetchSupported)();E&&(u.loader=o.default,u.progressive=!0,u.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/polyfills/number.ts"),w=O("./src/utils/ewma-bandwidth-estimator.ts"),D=O("./src/events.ts"),B=O("./src/utils/buffer-helper.ts"),M=O("./src/errors.ts"),e=O("./src/types/loader.ts"),C=O("./src/utils/logger.ts");function y(a,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function c(a,i,o){return i&&y(a.prototype,i),o&&y(a,o),a}var d=function(){function a(o){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=o;var s=o.config;this.bwEstimator=new w.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var i=a.prototype;return i.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)},i.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)},i.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},i.onFragLoading=function(s,r){var n=r.frag;if(n.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=n,this.partCurrent=(t=r.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},i.onLevelLoaded=function(s,r){var n=this.hls.config;r.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},i._abandonRulesCheck=function(){var s=this.fragCurrent,r=this.partCurrent,n=this.hls,t=n.autoLevelEnabled,g=n.config,p=n.media;if(!s||!p)return;var m=r?r.stats:s.stats,b=r?r.duration:s.duration;if(m.aborted){C.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||p.paused||!p.playbackRate||!p.readyState)return;var _=performance.now()-m.loading.start,l=Math.abs(p.playbackRate);if(_<=500*b/l)return;var f=n.levels,u=n.minAutoLevel,h=f[s.level],E=m.total||Math.max(m.loaded,Math.round(b*h.maxBitrate/8)),v=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/_),S=(E-m.loaded)/v,L=p.currentTime,I=(B.BufferHelper.bufferInfo(p,L,g.maxBufferHole).end-L)/l;if(I>=2*b/l||S<=I)return;var A=Number.POSITIVE_INFINITY,P;for(P=s.level-1;P>u;P--){var H=f[P].maxBitrate;if(A=b*H/(8*.8*v),A<I)break}if(A>=S)return;var R=this.bwEstimator.getEstimate();C.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(k.isFiniteNumber)(R)?(R/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+S.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+A.toFixed(3)+` s
|
|
Time to underbuffer: `+I.toFixed(3)+" s"),n.nextLoadLevel=P,this.bwEstimator.sample(_,m.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),n.trigger(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:r,stats:m})},i.onFragLoaded=function(s,r){var n=r.frag,t=r.part;if(n.type===e.PlaylistLevelType.MAIN&&Object(k.isFiniteNumber)(n.sn)){var g=t?t.stats:n.stats,p=t?t.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[n.level],b=(m.loaded?m.loaded.bytes:0)+g.loaded,_=(m.loaded?m.loaded.duration:0)+p;m.loaded={bytes:b,duration:_},m.realBitrate=Math.round(8*b/_)}if(n.bitrateTest){var l={stats:g,frag:n,part:t,id:n.type};this.onFragBuffered(D.Events.FRAG_BUFFERED,l),n.bitrateTest=!1}}},i.onFragBuffered=function(s,r){var n=r.frag,t=r.part,g=t?t.stats:n.stats;if(g.aborted)return;if(n.type!==e.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var p=g.parsing.end-g.loading.start;this.bwEstimator.sample(p,g.loaded),g.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=p/1e3:this.bitrateTestDelay=0},i.onError=function(s,r){switch(r.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},i.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},i.getNextABRAutoLevel=function(){var s=this.fragCurrent,r=this.partCurrent,n=this.hls,t=n.maxAutoLevel,g=n.config,p=n.minAutoLevel,m=n.media,b=r?r.duration:s?s.duration:0,_=m?m.currentTime:0,l=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,f=this.bwEstimator?this.bwEstimator.getEstimate():g.abrEwmaDefaultEstimate,u=(B.BufferHelper.bufferInfo(m,_,g.maxBufferHole).end-_)/l,h=this.findBestLevel(f,p,t,u,g.abrBandWidthFactor,g.abrBandWidthUpFactor);if(h>=0)return h;C.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=b?Math.min(b,g.maxStarvationDelay):g.maxStarvationDelay,v=g.abrBandWidthFactor,S=g.abrBandWidthUpFactor;if(!u){var L=this.bitrateTestDelay;if(L){var I=b?Math.min(b,g.maxLoadingDelay):g.maxLoadingDelay;E=I-L,C.logger.trace("bitrate test took "+Math.round(1e3*L)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),v=S=1}}return h=this.findBestLevel(f,p,t,u+E,v,S),Math.max(h,0)},i.findBestLevel=function(s,r,n,t,g,p){for(var m,b=this.fragCurrent,_=this.partCurrent,l=this.lastLoadedFragLevel,f=this.hls.levels,u=f[l],h=!!(u!=null&&(m=u.details)!==null&&m!==void 0&&m.live),E=u==null?void 0:u.codecSet,v=_?_.duration:b?b.duration:0,S=n;S>=r;S--){var L=f[S];if(!L||E&&L.codecSet!==E)continue;var I=L.details,A=(_?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||v,P=void 0;S<=l?P=g*s:P=p*s;var H=f[S].maxBitrate,R=H*A/P;if(C.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+S+"/"+Math.round(P)+"/"+H+"/"+A+"/"+t+"/"+R),P>H&&(!R||h&&!this.bitrateTestDelay||R<t))return S}return-1},c(a,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,r=this.bwEstimator;if(s!==-1&&(!r||!r.canEstimate()))return s;var n=this.getNextABRAutoLevel();return s!==-1&&(n=Math.min(s,n)),n},set:function(s){this._nextAutoLevel=s}}]),a}();W.default=d},"./src/controller/audio-stream-controller.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/polyfills/number.ts"),w=O("./src/controller/base-stream-controller.ts"),D=O("./src/events.ts"),B=O("./src/utils/buffer-helper.ts"),M=O("./src/controller/fragment-tracker.ts"),e=O("./src/types/level.ts"),C=O("./src/types/loader.ts"),y=O("./src/loader/fragment.ts"),c=O("./src/demux/chunk-cache.ts"),d=O("./src/demux/transmuxer-interface.ts"),a=O("./src/types/transmuxer.ts"),i=O("./src/controller/fragment-finders.ts"),o=O("./src/utils/discontinuities.ts"),s=O("./src/errors.ts"),r=O("./src/utils/logger.ts");function n(){return n=Object.assign||function(b){for(var _=1;_<arguments.length;_++){var l=arguments[_];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(b[f]=l[f])}return b},n.apply(this,arguments)}function t(b,_){b.prototype=Object.create(_.prototype),b.prototype.constructor=b,g(b,_)}function g(b,_){return g=Object.setPrototypeOf||function(f,u){return f.__proto__=u,f},g(b,_)}var p=100,m=function(b){t(_,b);function _(f,u){var h;return h=b.call(this,f,u,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var l=_.prototype;return l.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},l._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)},l._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)},l.onInitPtsFound=function(u,h){var E=h.frag,v=h.id,S=h.initPTS;if(v==="main"){var L=E.cc;this.initPTS[E.cc]=S,this.log("InitPTS for cc: "+L+" found from main: "+S),this.videoTrackCC=L,this.state===w.State.WAITING_INIT_PTS&&this.tick()}},l.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=w.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(p),this.fragLoadError=0,h>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=w.State.IDLE):(this.loadedmetadata=!1,this.state=w.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},l.doTick=function(){switch(this.state){case w.State.IDLE:this.doTickIdle();break;case w.State.WAITING_TRACK:{var u,h=this.levels,E=this.trackId,v=h==null||((u=h[E])===null||u===void 0)?void 0:u.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=w.State.WAITING_INIT_PTS}break}case w.State.FRAG_LOADING_WAITING_RETRY:{var S,L=performance.now(),I=this.retryDate;(!I||L>=I||(S=this.media)!==null&&S!==void 0&&S.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=w.State.IDLE);break}case w.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var P=A.frag,H=A.part,R=A.cache,K=A.complete;if(this.initPTS[P.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=w.State.FRAG_LOADING;var z=R.flush(),oe={frag:P,part:H,payload:z,networkDetails:null};this._handleFragmentLoadProgress(oe),K&&b.prototype._handleFragmentLoadComplete.call(this,oe)}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 $=this.getLoadPosition(),fe=B.BufferHelper.bufferInfo(this.mediaBuffer,$,this.config.maxBufferHole),de=Object(i.fragmentWithinToleranceTest)(fe.end,this.config.maxFragLookUpTolerance,P);de<0&&(r.logger.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=w.State.IDLE}}this.onTickEnd()},l.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=w.State.IDLE)},l.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:u,E=h.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},l.doTickIdle=function(){var u,h,E=this.hls,v=this.levels,S=this.media,L=this.trackId,I=E.config;if(!v||!v[L])return;if(!S&&(this.startFragRequested||!I.startFragPrefetch))return;var A=v[L],P=A.details;if(!P||P.live&&this.levelLastLoaded!==L||this.waitForCdnTuneIn(P)){this.state=w.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,y.ElementaryStreamTypes.AUDIO,C.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,C.PlaylistLevelType.AUDIO);if(H===null)return;var R=H.len,K=this.getMaxBufferLength(),z=this.audioSwitch;if(R>=K&&!z)return;if(!z&&this._streamEnded(H,P)){E.trigger(D.Events.BUFFER_EOS,{type:"audio"}),this.state=w.State.ENDED;return}var oe=P.fragments,$=oe[0].start,fe=H.end;if(z){var de=this.getLoadPosition();fe=de,P.PTSKnown&&de<$&&((H.end>$||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),S.currentTime=$+.05))}var ee=this.getNextFragment(fe,P);if(!ee){this.bufferFlushed=!0;return}((u=ee.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((h=ee.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(ee,P):this.loadFragment(ee,P,fe)},l.getMaxBufferLength=function(){var u=b.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,C.PlaylistLevelType.MAIN);return h===null?u:Math.max(u,h.len)},l.onMediaDetaching=function(){this.videoBuffer=null,b.prototype.onMediaDetaching.call(this)},l.onAudioTracksUpdated=function(u,h){var E=h.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(v){return new e.Level(v)})},l.onAudioTrackSwitching=function(u,h){var E=!!h.url;this.trackId=h.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(p):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=w.State.IDLE):this.state=w.State.STOPPED,this.tick()},l.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},l.onLevelLoaded=function(u,h){this.mainDetails=h.details},l.onAudioTrackLoaded=function(u,h){var E,v=this.levels,S=h.details,L=h.id;if(!v){this.warn("Audio tracks were reset while loading level "+L);return}this.log("Track "+L+" loaded ["+S.startSN+","+S.endSN+"],duration:"+S.totalduration);var I=v[L],A=0;if(S.live||(E=I.details)!==null&&E!==void 0&&E.live){var P=this.mainDetails;if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed||!P)return;!I.details&&S.hasProgramDateTime&&P.hasProgramDateTime?(Object(o.alignMediaPlaylistByPDT)(S,P),A=S.fragments[0].start):A=this.alignPlaylists(S,I.details)}I.details=S,this.levelLastLoaded=L,!this.startFragRequested&&(this.mainDetails||!S.live)&&this.setStartPosition(I.details,A),this.state===w.State.WAITING_TRACK&&!this.waitForCdnTuneIn(S)&&(this.state=w.State.IDLE),this.tick()},l._handleFragmentLoadProgress=function(u){var h,E=u.frag,v=u.part,S=u.payload,L=this.config,I=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var P=A[I];console.assert(P,"Audio track is defined on fragment load progress");var H=P.details;console.assert(H,"Audio track details are defined on fragment load progress");var R=L.defaultAudioCodec||P.audioCodec||"mp4a.40.2",K=this.transmuxer;K||(K=this.transmuxer=new d.default(this.hls,C.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[E.cc],oe=(h=E.initSegment)===null||h===void 0?void 0:h.data;if(z!==void 0){var $=!1,fe=v?v.index:-1,de=fe!==-1,ee=new a.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,S.byteLength,fe,de);K.push(S,oe,R,"",E,v,H.totalduration,$,ee,z)}else{r.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+I);var ie=this.waitingData=this.waitingData||{frag:E,part:v,cache:new c.default,complete:!1},ge=ie.cache;ge.push(new Uint8Array(S)),this.waitingVideoCC=this.videoTrackCC,this.state=w.State.WAITING_INIT_PTS}},l._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}b.prototype._handleFragmentLoadComplete.call(this,u)},l.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},l.onBufferCreated=function(u,h){var E=h.tracks.audio;E&&(this.mediaBuffer=E.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},l.onFragBuffered=function(u,h){var E=h.frag,v=h.part;if(E.type!==C.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(v?" p: "+v.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,v)},l.onError=function(u,h){switch(h.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(C.PlaylistLevelType.AUDIO,h);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==w.State.ERROR&&this.state!==w.State.STOPPED&&(this.state=h.fatal?w.State.ERROR:w.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===w.State.PARSING||this.state===w.State.PARSED)){var E=!0,v=this.getFwdBufferInfo(this.mediaBuffer,C.PlaylistLevelType.AUDIO);v&&v.len>.5&&(E=!this.reduceMaxBufferLength(v.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,b.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},l.onBufferFlushed=function(u,h){var E=h.type;E===y.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},l._handleTransmuxComplete=function(u){var h,E="audio",v=this.hls,S=u.remuxResult,L=u.chunkMeta,I=this.getCurrentContext(L);if(!I){this.warn("The loading context changed while buffering fragment "+L.sn+" of level "+L.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(L.level);return}var A=I.frag,P=I.part,H=S.audio,R=S.text,K=S.id3,z=S.initSegment;if(this.fragContextChanged(A))return;if(this.state=w.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),z!=null&&z.tracks&&(this._bufferInitSegment(z.tracks,A,L),v.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:E,tracks:z.tracks})),H){var oe=H.startPTS,$=H.endPTS,fe=H.startDTS,de=H.endDTS;P&&(P.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:$,startDTS:fe,endDTS:de}),A.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,oe,$,fe,de),this.bufferFragmentData(H,A,P,L)}if(K!=null&&(h=K.samples)!==null&&h!==void 0&&h.length){var ee=n({frag:A,id:E},K);v.trigger(D.Events.FRAG_PARSING_METADATA,ee)}if(R){var ie=n({frag:A,id:E},R);v.trigger(D.Events.FRAG_PARSING_USERDATA,ie)}},l._bufferInitSegment=function(u,h,E){if(this.state!==w.State.PARSING)return;u.video&&delete u.video;var v=u.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(D.Events.BUFFER_CODECS,u);var S=v.initSegment;if(S!=null&&S.byteLength){var L={type:"audio",frag:h,part:null,chunkMeta:E,parent:h.type,data:S};this.hls.trigger(D.Events.BUFFER_APPENDING,L)}this.tick()},l.loadFragment=function(u,h,E){var v=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||v===M.FragmentState.NOT_LOADED||v===M.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):h.live&&!Object(k.isFiniteNumber)(this.initPTS[u.cc])?(this.log("Waiting for video PTS in continuity counter "+u.cc+" of live stream before loading audio fragment "+u.sn+" of level "+this.trackId),this.state=w.State.WAITING_INIT_PTS):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,u,h,E)))},l.completeAudioSwitch=function(){var u=this.hls,h=this.media,E=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),b.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:E})},_}(w.default);W.default=m},"./src/controller/audio-track-controller.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/events.ts"),w=O("./src/errors.ts"),D=O("./src/controller/base-playlist-controller.ts"),B=O("./src/types/loader.ts");function M(d,a){for(var i=0;i<a.length;i++){var o=a[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(d,o.key,o)}}function e(d,a,i){return a&&M(d.prototype,a),i&&M(d,i),d}function C(d,a){d.prototype=Object.create(a.prototype),d.prototype.constructor=d,y(d,a)}function y(d,a){return y=Object.setPrototypeOf||function(o,s){return o.__proto__=s,o},y(d,a)}var c=function(d){C(a,d);function a(o){var s;return s=d.call(this,o,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var i=a.prototype;return i.registerListeners=function(){var s=this.hls;s.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(k.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var s=this.hls;s.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(k.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(k.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,d.prototype.destroy.call(this)},i.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},i.onManifestParsed=function(s,r){this.tracks=r.audioTracks||[]},i.onAudioTrackLoaded=function(s,r){var n=r.id,t=r.details,g=this.tracksInGroup[n];if(!g){this.warn("Invalid audio track id "+n);return}var p=g.details;g.details=r.details,this.log("audioTrack "+n+" loaded ["+t.startSN+"-"+t.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,r,p))},i.onLevelLoading=function(s,r){this.switchLevel(r.level)},i.onLevelSwitching=function(s,r){this.switchLevel(r.level)},i.switchLevel=function(s){var r=this.hls.levels[s];if(!(r!=null&&r.audioGroupIds))return;var n=r.audioGroupIds[r.urlId];if(this.groupId!==n){this.groupId=n;var t=this.tracks.filter(function(p){return!n||p.groupId===n});this.selectDefaultTrack&&!t.some(function(p){return p.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var g={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(k.Events.AUDIO_TRACKS_UPDATED,g),this.selectInitialTrack()}},i.onError=function(s,r){if(d.prototype.onError.call(this,s,r),r.fatal||!r.context)return;r.context.type===B.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},i.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 n=r[this.trackId];this.log("Now switching to audio-track index "+s);var t=r[s],g=t.id,p=t.groupId,m=p===void 0?"":p,b=t.name,_=t.type,l=t.url;if(this.trackId=s,this.trackName=b,this.selectDefaultTrack=!1,this.hls.trigger(k.Events.AUDIO_TRACK_SWITCHING,{id:g,groupId:m,name:b,type:_,url:l}),t.details&&!t.details.live)return;var f=this.switchParams(t.url,n==null?void 0:n.details);this.loadPlaylist(f)},i.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,n=this.findTrackId(r)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},i.findTrackId=function(s){for(var r=this.tracksInGroup,n=0;n<r.length;n++){var t=r[n];if((!this.selectDefaultTrack||t.default)&&(!s||s===t.name))return t.id}return-1},i.loadPlaylist=function(s){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var n=r.id,t=r.groupId,g=r.url;if(s)try{g=s.addDirectives(g)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(k.Events.AUDIO_TRACK_LOADING,{url:g,id:n,groupId:t,deliveryDirectives:s||null})}},e(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),a}(D.default);W.default=c},"./src/controller/base-playlist-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return e});var k=O("./src/polyfills/number.ts"),w=O("./src/types/level.ts"),D=O("./src/controller/level-helper.ts"),B=O("./src/utils/logger.ts"),M=O("./src/errors.ts"),e=function(){function C(c,d){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=B.logger.log.bind(B.logger,d+":"),this.warn=B.logger.warn.bind(B.logger,d+":"),this.hls=c}var y=C.prototype;return y.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},y.onError=function(d,a){a.fatal&&a.type===M.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},y.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},y.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},y.stopLoad=function(){this.canLoad=!1,this.clearTimer()},y.switchParams=function(d,a){var i=a==null?void 0:a.renditionReports;if(i)for(var o=0;o<i.length;o++){var s=i[o],r=""+s.URI;if(r===d.substr(-r.length)){var n=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var g=Math.min(a.age-a.partTarget,a.targetduration);t!==void 0&&g>a.partTarget&&(t+=1)}if(Object(k.isFiniteNumber)(n))return new w.HlsUrlParameters(n,Object(k.isFiniteNumber)(t)?t:void 0,w.HlsSkip.No)}}},y.loadPlaylist=function(d){},y.shouldLoadTrack=function(d){return this.canLoad&&d&&!!d.url&&(!d.details||d.details.live)},y.playlistLoaded=function(d,a,i){var o=this,s=a.details,r=a.stats,n=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(s.advancedDateTime=Date.now()-n,s.live||i!=null&&i.live){if(s.reloaded(i),i&&this.log("live playlist "+d+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),i&&s.fragments.length>0&&Object(D.mergeDetails)(i,s),!this.canLoad||!s.live)return;var t,g=void 0,p=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var m=this.hls.config.lowLatencyMode,b=s.lastPartSn,_=s.endSN,l=s.lastPartIndex,f=l!==-1,u=b===_,h=m?0:l;f?(g=u?_+1:b,p=u?h:l+1):g=_+1;var E=s.age,v=E+s.ageHeader,S=Math.min(v-s.partTarget,s.targetduration*1.5);if(S>0){if(i&&S>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+S+" with playlist age: "+s.age),S=0;else{var L=Math.floor(S/s.targetduration);if(g+=L,p!==void 0){var I=Math.round(S%s.targetduration/s.partTarget);p+=I}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+S+" skip sn "+L+" to part "+p)}s.tuneInGoal=S}if(t=this.getDeliveryDirectives(s,a.deliveryDirectives,g,p),m||!u){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,a.deliveryDirectives,g,p);var A=Object(D.computeReloadInterval)(s,r);g!==void 0&&s.canBlockReload&&(A-=s.partTarget||1),this.log("reload live playlist "+d+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return o.loadPlaylist(t)},A)}else this.clearTimer()},y.getDeliveryDirectives=function(d,a,i,o){var s=Object(w.getSkipValue)(d,i);return a!=null&&a.skip&&d.deltaUpdateFailed&&(i=a.msn,o=a.part,s=w.HlsSkip.No),new w.HlsUrlParameters(i,o,s)},y.retryLoadingOrFail=function(d){var a=this,i=this.hls.config,o=this.retryCount<i.levelLoadingMaxRetry;if(o){var s;if(this.retryCount++,d.details.indexOf("LoadTimeOut")>-1&&(s=d.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+d.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+d.details+'"')}}else this.warn('cannot recover from error "'+d.details+'"'),this.clearTimer(),d.fatal=!0;return o},C}()},"./src/controller/base-stream-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"State",function(){return _}),O.d(W,"default",function(){return l});var k=O("./src/polyfills/number.ts"),w=O("./src/task-loop.ts"),D=O("./src/controller/fragment-tracker.ts"),B=O("./src/utils/buffer-helper.ts"),M=O("./src/utils/logger.ts"),e=O("./src/events.ts"),C=O("./src/errors.ts"),y=O("./src/types/transmuxer.ts"),c=O("./src/utils/mp4-tools.ts"),d=O("./src/utils/discontinuities.ts"),a=O("./src/controller/fragment-finders.ts"),i=O("./src/controller/level-helper.ts"),o=O("./src/loader/fragment-loader.ts"),s=O("./src/crypt/decrypter.ts"),r=O("./src/utils/time-ranges.ts"),n=O("./src/types/loader.ts");function t(f,u){for(var h=0;h<u.length;h++){var E=u[h];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}function g(f,u,h){return u&&t(f.prototype,u),h&&t(f,h),f}function p(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}function m(f,u){f.prototype=Object.create(u.prototype),f.prototype.constructor=f,b(f,u)}function b(f,u){return b=Object.setPrototypeOf||function(E,v){return E.__proto__=v,E},b(f,u)}var _={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},l=function(f){m(u,f);function u(E,v,S){var L;return L=f.call(this)||this,L.hls=void 0,L.fragPrevious=null,L.fragCurrent=null,L.fragmentTracker=void 0,L.transmuxer=null,L._state=_.STOPPED,L.media=void 0,L.mediaBuffer=void 0,L.config=void 0,L.bitrateTest=!1,L.lastCurrentTime=0,L.nextLoadPosition=0,L.startPosition=0,L.loadedmetadata=!1,L.fragLoadError=0,L.retryDate=0,L.levels=null,L.fragmentLoader=void 0,L.levelLastLoaded=null,L.startFragRequested=!1,L.decrypter=void 0,L.initPTS=[],L.onvseeking=null,L.onvended=null,L.logPrefix="",L.log=void 0,L.warn=void 0,L.logPrefix=S,L.log=M.logger.log.bind(M.logger,S+":"),L.warn=M.logger.warn.bind(M.logger,S+":"),L.hls=E,L.fragmentLoader=new o.default(E.config),L.fragmentTracker=v,L.config=E.config,L.decrypter=new s.default(E,E.config),E.on(e.Events.KEY_LOADED,L.onKeyLoaded,p(L)),L}var h=u.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(v){},h.stopLoad=function(){this.fragmentLoader.abort();var v=this.fragCurrent;v&&this.fragmentTracker.removeFragment(v),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},h._streamEnded=function(v,S){var L=this.fragCurrent,I=this.fragmentTracker;if(!S.live&&L&&L.sn===S.endSN&&!v.nextStart){var A=I.getState(L);return A===D.FragmentState.PARTIAL||A===D.FragmentState.OK}return!1},h.onMediaAttached=function(v,S){var L=this.media=this.mediaBuffer=S.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),L.addEventListener("seeking",this.onvseeking),L.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(I.startPosition)},h.onMediaDetaching=function(){var v=this.media;v!=null&&v.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),v&&(v.removeEventListener("seeking",this.onvseeking),v.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},h.onMediaSeeking=function(){var v=this.config,S=this.fragCurrent,L=this.media,I=this.mediaBuffer,A=this.state,P=L?L.currentTime:0,H=B.BufferHelper.bufferInfo(I||L,P,v.maxBufferHole);if(this.log("media seeking to "+(Object(k.isFiniteNumber)(P)?P.toFixed(3):P)+", state: "+A),A===_.ENDED)this.resetLoadingState();else if(S&&!H.len){var R=v.maxFragLookUpTolerance,K=S.start-R,z=S.start+S.duration+R,oe=P>z;(P<K||oe)&&(oe&&S.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),S.loader.abort()),this.resetLoadingState())}L&&(this.lastCurrentTime=P),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=P),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(v,S){if(this.state!==_.KEY_LOADING||S.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var L=this.levels[S.frag.level].details;L&&this.loadFragment(S.frag,L,S.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),f.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=_.STOPPED,this.hls.off(e.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,f.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(v,S){this.log("Loading key for "+v.sn+" of ["+S.startSN+"-"+S.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level),this.state=_.KEY_LOADING,this.fragCurrent=v,this.hls.trigger(e.Events.KEY_LOADING,{frag:v})},h.loadFragment=function(v,S,L){this._loadFragForPlayback(v,S,L)},h._loadFragForPlayback=function(v,S,L){var I=this,A=function(H){if(I.fragContextChanged(v)){I.warn("Fragment "+v.sn+(H.part?" p: "+H.part.index:"")+" of level "+v.level+" was dropped during download."),I.fragmentTracker.removeFragment(v);return}v.stats.chunkCount++,I._handleFragmentLoadProgress(H)};this._doFragLoad(v,S,L,A).then(function(P){if(!P)return;I.fragLoadError=0;var H=I.state;if(I.fragContextChanged(v)){(H===_.FRAG_LOADING||H===_.BACKTRACKING||!I.fragCurrent&&H===_.PARSING)&&(I.fragmentTracker.removeFragment(v),I.state=_.IDLE);return}if("payload"in P&&(I.log("Loaded fragment "+v.sn+" of level "+v.level),I.hls.trigger(e.Events.FRAG_LOADED,P),I.state===_.BACKTRACKING)){I.fragmentTracker.backtrack(v,P),I.resetFragmentLoading(v);return}I._handleFragmentLoadComplete(P)}).catch(function(P){I.warn(P),I.resetFragmentLoading(v)})},h.flushMainBuffer=function(v,S,L){if(L===void 0&&(L=null),!(v-S))return;var I={startOffset:v,endOffset:S,type:L};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,I)},h._loadInitSegment=function(v){var S=this;this._doFragLoad(v).then(function(L){if(!L||S.fragContextChanged(v)||!S.levels)throw new Error("init load aborted");return L}).then(function(L){var I=S.hls,A=L.payload,P=v.decryptdata;if(A&&A.byteLength>0&&P&&P.key&&P.iv&&P.method==="AES-128"){var H=self.performance.now();return S.decrypter.webCryptoDecrypt(new Uint8Array(A),P.key.buffer,P.iv.buffer).then(function(R){var K=self.performance.now();return I.trigger(e.Events.FRAG_DECRYPTED,{frag:v,payload:R,stats:{tstart:H,tdecrypt:K}}),L.payload=R,L})}return L}).then(function(L){var I=S.fragCurrent,A=S.hls,P=S.levels;if(!P)throw new Error("init load aborted, missing levels");var H=P[v.level].details;console.assert(H,"Level details are defined when init segment is loaded");var R=v.stats;S.state=_.IDLE,S.fragLoadError=0,v.data=new Uint8Array(L.payload),R.parsing.start=R.buffering.start=self.performance.now(),R.parsing.end=R.buffering.end=self.performance.now(),L.frag===I&&A.trigger(e.Events.FRAG_BUFFERED,{stats:R,frag:I,part:null,id:v.type}),S.tick()}).catch(function(L){S.warn(L),S.resetFragmentLoading(v)})},h.fragContextChanged=function(v){var S=this.fragCurrent;return!v||!S||v.level!==S.level||v.sn!==S.sn||v.urlId!==S.urlId},h.fragBufferedComplete=function(v,S){var L=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(S?" part: "+S.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+r.default.toString(B.BufferHelper.getBuffered(L))),this.state=_.IDLE,this.tick()},h._handleFragmentLoadComplete=function(v){var S=this.transmuxer;if(!S)return;var L=v.frag,I=v.part,A=v.partsLoaded,P=!A||A.length===0||A.some(function(R){return!R}),H=new y.ChunkMetadata(L.level,L.sn,L.stats.chunkCount+1,0,I?I.index:-1,!P);S.flush(H)},h._handleFragmentLoadProgress=function(v){},h._doFragLoad=function(v,S,L,I){var A=this;if(L===void 0&&(L=null),!this.levels)throw new Error("frag load aborted, missing levels");if(L=Math.max(v.start,L||0),this.config.lowLatencyMode&&S){var P=S.partList;if(P&&I){L>v.end&&S.fragmentHint&&(v=S.fragmentHint);var H=this.getNextPart(P,v,L);if(H>-1){var R=P[H];return this.log("Loading part sn: "+v.sn+" p: "+R.index+" cc: "+v.cc+" of playlist ["+S.startSN+"-"+S.endSN+"] parts [0-"+H+"-"+(P.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(L.toFixed(3))),this.nextLoadPosition=R.start+R.duration,this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:v,part:P[H],targetBufferTime:L}),this.doFragPartsLoad(v,P,H,I).catch(function(K){return A.handleFragLoadError(K)})}else if(!v.url||this.loadedEndOfParts(P,L))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(S?"of ["+S.startSN+"-"+S.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(L.toFixed(3))),Object(k.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:v,targetBufferTime:L}),this.fragmentLoader.load(v,I).catch(function(K){return A.handleFragLoadError(K)})},h.doFragPartsLoad=function(v,S,L,I){var A=this;return new Promise(function(P,H){var R=[],K=function z(oe){var $=S[oe];A.fragmentLoader.loadPart(v,$,I).then(function(fe){R[$.index]=fe;var de=fe.part;A.hls.trigger(e.Events.FRAG_LOADED,fe);var ee=S[oe+1];if(ee&&ee.fragment===v)z(oe+1);else return P({frag:v,part:de,partsLoaded:R})}).catch(H)};K(L)})},h.handleFragLoadError=function(v){var S=v.data;return S&&S.details===C.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(S.frag,S.part):this.hls.trigger(e.Events.ERROR,S),null},h._handleTransmuxerFlush=function(v){var S=this.getCurrentContext(v);if(!S||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var L=S.frag,I=S.part,A=S.level,P=self.performance.now();L.stats.parsing.end=P,I&&(I.stats.parsing.end=P),this.updateLevelTiming(L,I,A,v.partial)},h.getCurrentContext=function(v){var S=this.levels,L=v.level,I=v.sn,A=v.part;if(!S||!S[L])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+L+". The current chunk will not be buffered."),null;var P=S[L],H=A>-1?Object(i.getPartWith)(P,I,A):null,R=H?H.fragment:Object(i.getFragmentWithSN)(P,I,this.fragCurrent);return R?{frag:R,part:H,level:P}:null},h.bufferFragmentData=function(v,S,L,I){if(!v||this.state!==_.PARSING)return;var A=v.data1,P=v.data2,H=A;if(A&&P&&(H=Object(c.appendUint8Array)(A,P)),!H||!H.length)return;var R={type:v.type,frag:S,part:L,chunkMeta:I,parent:S.type,data:H};this.hls.trigger(e.Events.BUFFER_APPENDING,R),v.dropped&&v.independent&&!L&&this.flushBufferGap(S)},h.flushBufferGap=function(v){var S=this.media;if(!S)return;if(!B.BufferHelper.isBuffered(S,S.currentTime)){this.flushMainBuffer(0,v.start);return}var L=S.currentTime,I=B.BufferHelper.bufferInfo(S,L,0),A=v.duration,P=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),H=Math.max(Math.min(v.start-P,I.end-P),L+P);v.start-H>P&&this.flushMainBuffer(H,v.start)},h.getFwdBufferInfo=function(v,S){var L=this.config,I=this.getLoadPosition();if(!Object(k.isFiniteNumber)(I))return null;var A=B.BufferHelper.bufferInfo(v,I,L.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var P=this.fragmentTracker.getBufferedFrag(I,S);if(P&&A.nextStart<P.end)return B.BufferHelper.bufferInfo(v,I,Math.max(A.nextStart,L.maxBufferHole))}return A},h.getMaxBufferLength=function(v){var S=this.config,L;return v?L=Math.max(8*S.maxBufferSize/v,S.maxBufferLength):L=S.maxBufferLength,Math.min(L,S.maxMaxBufferLength)},h.reduceMaxBufferLength=function(v){var S=this.config,L=v||S.maxBufferLength;return S.maxMaxBufferLength>=L?(S.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+S.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(v,S){var L,I,A=S.fragments,P=A.length;if(!P)return null;var H=this.config,R=A[0].start,K;if(S.live){var z=H.initialLiveManifestSize;if(P<z)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+z+")"),null;!S.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(K=this.getInitialLiveFragment(S,A),this.startPosition=K?this.hls.liveSyncPosition||K.start:v)}else v<=R&&(K=A[0]);if(!K){var oe=H.lowLatencyMode?S.partEnd:S.fragmentEnd;K=this.getFragmentAtPosition(v,oe,S)}return(L=K)!==null&&L!==void 0&&L.initSegment&&!((I=K)!==null&&I!==void 0&&I.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},h.getNextPart=function(v,S,L){for(var I=-1,A=!1,P=!0,H=0,R=v.length;H<R;H++){var K=v[H];if(P=P&&!K.independent,I>-1&&L<K.start)break;var z=K.loaded;!z&&(A||K.independent||P)&&K.fragment===S&&(I=H),A=z}return I},h.loadedEndOfParts=function(v,S){var L=v[v.length-1];return L&&S>L.start&&L.loaded},h.getInitialLiveFragment=function(v,S){var L=this.fragPrevious,I=null;if(L){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+L.programDateTime),I=Object(a.findFragmentByPDT)(S,L.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var A=L.sn+1;if(A>=v.startSN&&A<=v.endSN){var P=S[A-v.startSN];L.cc===P.cc&&(I=P,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(a.findFragWithCC)(S,L.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(I=this.getFragmentAtPosition(H,this.bitrateTest?v.fragmentEnd:v.edge,v))}return I},h.getFragmentAtPosition=function(v,S,L){var I=this.config,A=this.fragPrevious,P=L.fragments,H=L.endSN,R=L.fragmentHint,K=I.maxFragLookUpTolerance,z=!!(I.lowLatencyMode&&L.partList&&R);z&&R&&!this.bitrateTest&&(P=P.concat(R),H=R.sn);var oe;if(v<S){var $=v>S-K?0:K;oe=Object(a.findFragmentByPTS)(A,P,v,$)}else oe=P[P.length-1];if(oe){var fe=oe.sn-L.startSN,de=A&&oe.level===A.level,ee=P[fe+1],ie=this.fragmentTracker.getState(oe);if(ie===D.FragmentState.BACKTRACKED){oe=null;for(var ge=fe;P[ge]&&this.fragmentTracker.getState(P[ge])===D.FragmentState.BACKTRACKED;)A?oe=P[ge--]:oe=P[--ge];oe||(oe=ee)}else A&&oe.sn===A.sn&&!z&&(de&&(oe.sn<H&&this.fragmentTracker.getState(ee)!==D.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+ee.sn),oe=ee):oe=null))}return oe},h.synchronizeToLiveEdge=function(v){var S=this.config,L=this.media;if(!L)return;var I=this.hls.liveSyncPosition,A=L.currentTime,P=v.fragments[0].start,H=v.edge,R=A>=P-S.maxFragLookUpTolerance&&A<=H;if(I!==null&&L.duration>I&&(A<I||!R)){var K=S.liveMaxLatencyDuration!==void 0?S.liveMaxLatencyDuration:S.liveMaxLatencyDurationCount*v.targetduration;(!R&&L.readyState<4||A<H-K)&&(this.loadedmetadata||(this.nextLoadPosition=I),L.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+H+", reset currentTime to : "+I.toFixed(3)),L.currentTime=I))}},h.alignPlaylists=function(v,S){var L=this.levels,I=this.levelLastLoaded,A=this.fragPrevious,P=I!==null?L[I]:null,H=v.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var R=v.fragments[0].start,K=!S,z=v.alignedSliding&&Object(k.isFiniteNumber)(R);if(K||!z&&!R){Object(d.alignStream)(A,P,v);var oe=v.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(S?S.startSN:"na")+"->"+v.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+H),oe}return R},h.waitForCdnTuneIn=function(v){var S=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*S)},h.setStartPosition=function(v,S){var L=this.startPosition;if(L<S&&(L=-1),L===-1||this.lastCurrentTime===-1){var I=v.startTimeOffset;Object(k.isFiniteNumber)(I)?(L=S+I,I<0&&(L+=v.totalduration),L=Math.min(Math.max(S,L),S+v.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+L),this.startPosition=L):v.live?L=this.hls.liveSyncPosition||S:this.startPosition=L=0,this.lastCurrentTime=L}this.nextLoadPosition=L},h.getLoadPosition=function(){var v=this.media,S=0;return this.loadedmetadata&&v?S=v.currentTime:this.nextLoadPosition&&(S=this.nextLoadPosition),S},h.handleFragLoadAborted=function(v,S){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(S?" part"+S.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},h.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=_.IDLE)},h.onFragmentOrKeyLoadError=function(v,S){if(S.fatal)return;var L=S.frag;if(!L||L.type!==v)return;var I=this.fragCurrent;console.assert(I&&L.sn===I.sn&&L.level===I.level&&L.urlId===I.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(L.level))return;var P=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+L.sn+" of "+v+" "+L.level+" failed to load, retrying in "+P+"ms"),this.retryDate=self.performance.now()+P,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else S.levelRetry?(v===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(M.logger.error(S.details+" reaches max retry, redispatch as fatal ..."),S.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},h.afterBufferFlushed=function(v,S,L){if(!v)return;var I=B.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(S,I,L),this.state===_.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},h.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var S=this.levels?this.levels[v].details:null;if(S!=null&&S.live)return this.startPosition=-1,this.setStartPosition(S,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(v,S,L,I){var A=this,P=L.details;console.assert(!!P,"level.details must be defined");var H=Object.keys(v.elementaryStreams).reduce(function(R,K){var z=v.elementaryStreams[K];if(z){var oe=z.endPTS-z.startPTS;if(oe<=0)return A.warn("Could not parse fragment "+v.sn+" "+K+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),R||!1;var $=I?0:Object(i.updateFragPTSDTS)(P,v,z.startPTS,z.endPTS,z.startDTS,z.endDTS);return A.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:P,level:L,drift:$,type:K,frag:v,start:z.startPTS,end:z.endPTS}),!0}return R},!1);H?(this.state=_.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:v,part:S})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},g(u,[{key:"state",get:function(){return this._state},set:function(v){var S=this._state;S!==v&&(this._state=v,this.log(S+"->"+v))}}]),u}(w.default)},"./src/controller/buffer-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return a});var k=O("./src/polyfills/number.ts"),w=O("./src/events.ts"),D=O("./src/utils/logger.ts"),B=O("./src/errors.ts"),M=O("./src/utils/buffer-helper.ts"),e=O("./src/utils/mediasource-helper.ts"),C=O("./src/loader/fragment.ts"),y=O("./src/controller/buffer-operation-queue.ts"),c=Object(e.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function i(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 n=r.hls,t=r.media,g=r.mediaSource;D.logger.log("[buffer-controller]: Media source opened"),t&&(r.updateMediaElementDuration(),n.trigger(w.Events.MEDIA_ATTACHED,{media:t})),g&&g.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 o=i.prototype;return o.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},o.destroy=function(){this.unregisterListeners(),this.details=null},o.registerListeners=function(){var r=this.hls;r.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(w.Events.BUFFER_RESET,this.onBufferReset,this),r.on(w.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(w.Events.BUFFER_EOS,this.onBufferEos,this),r.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(w.Events.FRAG_PARSED,this.onFragParsed,this),r.on(w.Events.FRAG_CHANGED,this.onFragChanged,this)},o.unregisterListeners=function(){var r=this.hls;r.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(w.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(w.Events.BUFFER_RESET,this.onBufferReset,this),r.off(w.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(w.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(w.Events.BUFFER_EOS,this.onBufferEos,this),r.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(w.Events.FRAG_PARSED,this.onFragParsed,this),r.off(w.Events.FRAG_CHANGED,this.onFragChanged,this)},o._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new y.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},o.onManifestParsed=function(r,n){var t=2;(n.audio&&!n.video||!n.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,D.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},o.onMediaAttaching=function(r,n){var t=this.media=n.media;if(t&&c){var g=this.mediaSource=new c;g.addEventListener("sourceopen",this._onMediaSourceOpen),g.addEventListener("sourceended",this._onMediaSourceEnded),g.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(g),this._objectUrl=t.src}},o.onMediaDetaching=function(){var r=this.media,n=this.mediaSource,t=this._objectUrl;if(n){if(D.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(g){D.logger.warn("[buffer-controller]: onMediaDetaching: "+g.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(t&&self.URL.revokeObjectURL(t),r.src===t?(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(w.Events.MEDIA_DETACHED,void 0)},o.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(n){var t=r.sourceBuffer[n];try{t&&(r.removeBufferListeners(n),r.mediaSource&&r.mediaSource.removeSourceBuffer(t),r.sourceBuffer[n]=void 0)}catch(g){D.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",g)}}),this._initSourceBuffer()},o.onBufferCodecs=function(r,n){var t=this,g=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(p){if(g){var m=t.tracks[p];if(m&&typeof m.buffer.changeType=="function"){var b=n[p],_=b.codec,l=b.levelCodec,f=b.container,u=(m.levelCodec||m.codec).replace(d,"$1"),h=(l||_).replace(d,"$1");if(u!==h){var E=f+";codecs="+(l||_);t.appendChangeType(p,E)}}}else t.pendingTracks[p]=n[p]}),g)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},o.appendChangeType=function(r,n){var t=this,g=this.operationQueue,p={execute:function(){var b=t.sourceBuffer[r];b&&(D.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+n),b.changeType(n)),g.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(b){D.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",b)}};g.append(p,r)},o.onBufferAppending=function(r,n){var t=this,g=this.hls,p=this.operationQueue,m=this.tracks,b=n.data,_=n.type,l=n.frag,f=n.part,u=n.chunkMeta,h=u.buffering[_],E=self.performance.now();h.start=E;var v=l.stats.buffering,S=f?f.stats.buffering:null;v.start===0&&(v.start=E),S&&S.start===0&&(S.start=E);var L=m.audio,I=_==="audio"&&u.id===1&&(L==null?void 0:L.container)==="audio/mpeg",A={execute:function(){if(h.executeStart=self.performance.now(),I){var H=t.sourceBuffer[_];if(H){var R=l.start-H.timestampOffset;Math.abs(R)>=.1&&(D.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+l.start+" (delta: "+R+") sn: "+l.sn+")"),H.timestampOffset=l.start)}}t.appendExecutor(b,_)},onStart:function(){},onComplete:function(){var H=self.performance.now();h.executeEnd=h.end=H,v.first===0&&(v.first=H),S&&S.first===0&&(S.first=H);var R=t.sourceBuffer,K={};for(var z in R)K[z]=M.BufferHelper.getBuffered(R[z]);t.appendError=0,t.hls.trigger(w.Events.BUFFER_APPENDED,{type:_,frag:l,part:f,chunkMeta:u,parent:l.type,timeRanges:K})},onError:function(H){D.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",H);var R={type:B.ErrorTypes.MEDIA_ERROR,parent:l.type,details:B.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=B.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,R.details=B.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>g.config.appendErrorMaxRetry&&(D.logger.error("[buffer-controller]: Failed "+g.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),R.fatal=!0)),g.trigger(w.Events.ERROR,R)}};p.append(A,_)},o.onBufferFlushing=function(r,n){var t=this,g=this.operationQueue,p=function(b){return{execute:t.removeExecutor.bind(t,b,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(w.Events.BUFFER_FLUSHED,{type:b})},onError:function(l){D.logger.warn("[buffer-controller]: Failed to remove from "+b+" SourceBuffer",l)}}};n.type?g.append(p(n.type),n.type):this.getSourceBufferTypes().forEach(function(m){g.append(p(m),m)})},o.onFragParsed=function(r,n){var t=this,g=n.frag,p=n.part,m=[],b=p?p.elementaryStreams:g.elementaryStreams;b[C.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(b[C.ElementaryStreamTypes.AUDIO]&&m.push("audio"),b[C.ElementaryStreamTypes.VIDEO]&&m.push("video"));var _=function(){var f=self.performance.now();g.stats.buffering.end=f,p&&(p.stats.buffering.end=f);var u=p?p.stats:g.stats;t.hls.trigger(w.Events.FRAG_BUFFERED,{frag:g,part:p,stats:u,id:g.type})};m.length===0&&D.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+g.type+" level: "+g.level+" sn: "+g.sn),this.blockBuffers(_,m)},o.onFragChanged=function(r,n){this.flushBackBuffer()},o.onBufferEos=function(r,n){var t=this,g=this.getSourceBufferTypes().reduce(function(p,m){var b=t.sourceBuffer[m];return(!n.type||n.type===m)&&(b&&!b.ended&&(b.ended=!0,D.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),p&&!!(!b||b.ended)},!0);g&&this.blockBuffers(function(){var p=t.mediaSource;if(!p||p.readyState!=="open")return;p.endOfStream()})},o.onLevelUpdated=function(r,n){var t=n.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},o.flushBackBuffer=function(){var r=this.hls,n=this.details,t=this.media,g=this.sourceBuffer;if(!t||n===null)return;var p=this.getSourceBufferTypes();if(!p.length)return;var m=n.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(k.isFiniteNumber)(m)||m<0)return;var b=t.currentTime,_=n.levelTargetDuration,l=Math.max(m,_),f=Math.floor(b/_)*_-l;p.forEach(function(u){var h=g[u];if(h){var E=M.BufferHelper.getBuffered(h);E.length>0&&f>E.start(0)&&(r.trigger(w.Events.BACK_BUFFER_REACHED,{bufferEnd:f}),n.live&&r.trigger(w.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:f}),r.trigger(w.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:f,type:u}))}})},o.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,n=this.hls,t=this.media,g=this.mediaSource,p=r.fragments[0].start+r.totalduration,m=t.duration,b=Object(k.isFiniteNumber)(g.duration)?g.duration:0;r.live&&n.config.liveDurationInfinity?(D.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),g.duration=Infinity,this.updateSeekableRange(r)):(p>b&&p>m||!Object(k.isFiniteNumber)(m))&&(D.logger.log("[buffer-controller]: Updating Media Source duration to "+p.toFixed(3)),g.duration=p)},o.updateSeekableRange=function(r){var n=this.mediaSource,t=r.fragments,g=t.length;if(g&&r.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var p=Math.max(0,t[0].start),m=Math.max(p,p+r.totalduration);n.setLiveSeekableRange(p,m)}},o.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,n=this.operationQueue,t=this.pendingTracks,g=Object.keys(t).length;if(g&&!r||g===2){this.createSourceBuffers(t),this.pendingTracks={};var p=this.getSourceBufferTypes();if(p.length===0){this.hls.trigger(w.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}p.forEach(function(m){n.executeNext(m)})}},o.createSourceBuffers=function(r){var n=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var g=0;for(var p in r)if(!n[p]){var m=r[p];if(!m)throw Error("source buffer exists for track "+p+", however track does not");var b=m.levelCodec||m.codec,_=m.container+";codecs="+b;D.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var l=n[p]=t.addSourceBuffer(_),f=p;this.addBufferListener(f,"updatestart",this._onSBUpdateStart),this.addBufferListener(f,"updateend",this._onSBUpdateEnd),this.addBufferListener(f,"error",this._onSBUpdateError),this.tracks[p]={buffer:l,codec:b,container:m.container,levelCodec:m.levelCodec,id:m.id},g++}catch(u){D.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(w.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:_})}}g&&this.hls.trigger(w.Events.BUFFER_CREATED,{tracks:this.tracks})},o._onSBUpdateStart=function(r){var n=this.operationQueue,t=n.current(r);t.onStart()},o._onSBUpdateEnd=function(r){var n=this.operationQueue,t=n.current(r);t.onComplete(),n.shiftAndExecuteNext(r)},o._onSBUpdateError=function(r,n){D.logger.error("[buffer-controller]: "+r+" SourceBuffer error",n),this.hls.trigger(w.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(r);t&&t.onError(n)},o.removeExecutor=function(r,n,t){var g=this.media,p=this.mediaSource,m=this.operationQueue,b=this.sourceBuffer,_=b[r];if(!g||!p||!_){D.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(r);return}var l=Object(k.isFiniteNumber)(g.duration)?g.duration:Infinity,f=Object(k.isFiniteNumber)(p.duration)?p.duration:Infinity,u=Math.max(0,n),h=Math.min(t,l,f);h>u?(D.logger.log("[buffer-controller]: Removing ["+u+","+h+"] from the "+r+" SourceBuffer"),console.assert(!_.updating,r+" sourceBuffer must not be updating"),_.remove(u,h)):m.shiftAndExecuteNext(r)},o.appendExecutor=function(r,n){var t=this.operationQueue,g=this.sourceBuffer,p=g[n];if(!p){D.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(n);return}p.ended=!1,console.assert(!p.updating,n+" sourceBuffer must not be updating"),p.appendBuffer(r)},o.blockBuffers=function(r,n){var t=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){D.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var g=this.operationQueue,p=n.map(function(m){return g.appendBlocker(m)});Promise.all(p).then(function(){r(),n.forEach(function(m){var b=t.sourceBuffer[m];(!b||!b.updating)&&g.shiftAndExecuteNext(m)})})},o.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},o.addBufferListener=function(r,n,t){var g=this.sourceBuffer[r];if(!g)return;var p=t.bind(this,r);this.listeners[r].push({event:n,listener:p}),g.addEventListener(n,p)},o.removeBufferListeners=function(r){var n=this.sourceBuffer[r];if(!n)return;this.listeners[r].forEach(function(t){n.removeEventListener(t.event,t.listener)})},i}()},"./src/controller/buffer-operation-queue.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return w});var k=O("./src/utils/logger.ts"),w=function(){function D(M){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=M}var B=D.prototype;return B.append=function(e,C){var y=this.queues[C];y.push(e),y.length===1&&this.buffers[C]&&this.executeNext(C)},B.insertAbort=function(e,C){var y=this.queues[C];y.unshift(e),this.executeNext(C)},B.appendBlocker=function(e){var C,y=new Promise(function(d){C=d}),c={execute:C,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(c,e),y},B.executeNext=function(e){var C=this.buffers,y=this.queues,c=C[e],d=y[e];if(d.length){var a=d[0];try{a.execute()}catch(i){k.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(i),(!c||!c.updating)&&(d.shift(),this.executeNext(e))}}},B.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},B.current=function(e){return this.queues[e][0]},D}()},"./src/controller/cap-level-controller.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/events.ts");function w(M,e){for(var C=0;C<e.length;C++){var y=e[C];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(M,y.key,y)}}function D(M,e,C){return e&&w(M.prototype,e),C&&w(M,C),M}var B=function(){function M(C){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=C,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=M.prototype;return e.setStreamController=function(y){this.streamController=y},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 y=this.hls;y.on(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var y=this.hls;y.off(k.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),y.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),y.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(k.Events.BUFFER_CODECS,this.onBufferCodecs,this),y.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(y,c){M.isLevelAllowed(c.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(c.droppedLevel)},e.onMediaAttaching=function(y,c){this.media=c.media instanceof HTMLVideoElement?c.media:null},e.onManifestParsed=function(y,c){var d=this.hls;this.restrictedLevels=[],this.firstLevel=c.firstLevel,d.config.capLevelToPlayerSize&&c.video&&this.startCapping()},e.onBufferCodecs=function(y,c){var d=this.hls;d.config.capLevelToPlayerSize&&c.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var y=this.hls.levels;if(y.length){var c=this.hls;c.autoLevelCapping=this.getMaxLevel(y.length-1),c.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=c.autoLevelCapping}}},e.getMaxLevel=function(y){var c=this,d=this.hls.levels;if(!d.length)return-1;var a=d.filter(function(i,o){return M.isLevelAllowed(o,c.restrictedLevels)&&o<=y});return this.clientRect=null,M.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},e.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},e.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},e.getDimensions=function(){if(this.clientRect)return this.clientRect;var y=this.media,c={width:0,height:0};if(y){var d=y.getBoundingClientRect();c.width=d.width,c.height=d.height,!c.width&&!c.height&&(c.width=d.right-d.left||y.width||0,c.height=d.bottom-d.top||y.height||0)}return this.clientRect=c,c},M.isLevelAllowed=function(y,c){return c===void 0&&(c=[]),c.indexOf(y)===-1},M.getMaxLevelByMediaSize=function(y,c,d){if(!y||!y.length)return-1;for(var a=function(n,t){return t?n.width!==t.width||n.height!==t.height:!0},i=y.length-1,o=0;o<y.length;o+=1){var s=y[o];if((s.width>=c||s.height>=d)&&a(s,y[o+1])){i=o;break}}return i},D(M,[{key:"mediaWidth",get:function(){return this.getDimensions().width*M.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*M.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var y=1;try{y=self.devicePixelRatio}catch(c){}return y}}]),M}();W.default=B},"./src/controller/cmcd-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return a});var k=O("./src/events.ts"),w=O("./src/types/cmcd.ts"),D=O("./src/utils/buffer-helper.ts"),B=O("./src/utils/logger.ts");function M(i,o){for(var s=0;s<o.length;s++){var r=o[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function e(i,o,s){return o&&M(i.prototype,o),s&&M(i,s),i}function C(i,o){var s=typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(s)return(s=s.call(i)).next.bind(s);if(Array.isArray(i)||(s=y(i))||o&&i&&typeof i.length=="number"){s&&(i=s);var r=0;return function(){return r>=i.length?{done:!0}:{done:!1,value:i[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 y(i,o){if(!i)return;if(typeof i=="string")return c(i,o);var s=Object.prototype.toString.call(i).slice(8,-1);if(s==="Object"&&i.constructor&&(s=i.constructor.name),s==="Map"||s==="Set")return Array.from(i);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return c(i,o)}function c(i,o){(o==null||o>i.length)&&(o=i.length);for(var s=0,r=new Array(o);s<o;s++)r[s]=i[s];return r}function d(){return d=Object.assign||function(i){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(i[r]=s[r])}return i},d.apply(this,arguments)}var a=function(){function i(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(g){try{r.apply(g,{ot:w.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(p){B.logger.warn("Could not generate manifest CMCD data.",p)}},this.applyFragmentData=function(g){try{var p=g.frag,m=r.hls.levels[p.level],b=r.getObjectType(p),_={d:p.duration*1e3,ot:b};(b===w.CMCDObjectType.VIDEO||b===w.CMCDObjectType.AUDIO||b==w.CMCDObjectType.MUXED)&&(_.br=m.bitrate/1e3,_.tb=r.getTopBandwidth(b),_.bl=r.getBufferLength(b)),r.apply(g,_)}catch(l){B.logger.warn("Could not generate segment CMCD data.",l)}},this.hls=s;var n=this.config=s.config,t=n.cmcd;t!=null&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||i.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var o=i.prototype;return o.registerListeners=function(){var r=this.hls;r.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(k.Events.BUFFER_CREATED,this.onBufferCreated,this)},o.unregisterListeners=function(){var r=this.hls;r.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(k.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},o.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},o.onMediaAttached=function(r,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},o.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},o.onBufferCreated=function(r,n){var t,g;this.audioBuffer=(t=n.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(g=n.tracks.video)===null||g===void 0?void 0:g.buffer},o.createData=function(){var r;return{v:w.CMCDVersion,sf:w.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}},o.apply=function(r,n){n===void 0&&(n={}),d(n,this.createData());var t=n.ot===w.CMCDObjectType.INIT||n.ot===w.CMCDObjectType.VIDEO||n.ot===w.CMCDObjectType.MUXED;if(this.starved&&t&&(n.bs=!0,n.su=!0,this.starved=!1),n.su==null&&(n.su=this.buffering),this.useHeaders){var g=i.toHeaders(n);if(!Object.keys(g).length)return;r.headers||(r.headers={}),d(r.headers,g)}else{var p=i.toQuery(n);if(!p)return;r.url=i.appendQueryToUri(r.url,p)}},o.getObjectType=function(r){var n=r.type;return n==="subtitle"?w.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?w.CMCDObjectType.INIT:n==="audio"?w.CMCDObjectType.AUDIO:n==="main"?this.hls.audioTracks.length?w.CMCDObjectType.VIDEO:w.CMCDObjectType.MUXED:void 0},o.getTopBandwidth=function(r){for(var n=0,t=r===w.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,g=C(t),p;!(p=g()).done;){var m=p.value;m.bitrate>n&&(n=m.bitrate)}return n>0?n:NaN},o.getBufferLength=function(r){var n=this.hls.media,t=r===w.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!n)return NaN;var g=D.BufferHelper.bufferInfo(t,n.currentTime,this.config.maxBufferHole);return g.len*1e3},o.createPlaylistLoader=function(){var r=this.config.pLoader,n=this.applyPlaylistData,t=r||this.config.loader;return function(){function g(m){this.loader=void 0,this.loader=new t(m)}var p=g.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(b,_,l){n(b),this.loader.load(b,_,l)},e(g,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),g}()},o.createFragmentLoader=function(){var r=this.config.fLoader,n=this.applyFragmentData,t=r||this.config.loader;return function(){function g(m){this.loader=void 0,this.loader=new t(m)}var p=g.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(b,_,l){n(b),this.loader.load(b,_,l)},e(g,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),g}()},i.uuid=function(){var r=URL.createObjectURL(new Blob),n=r.toString();return URL.revokeObjectURL(r),n.substr(n.lastIndexOf("/")+1)},i.serialize=function(r){for(var n=[],t=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},g=function(I){return Math.round(I)},p=function(I){return g(I/100)*100},m=function(I){return encodeURIComponent(I)},b={br:g,d:g,bl:p,dl:p,mtp:p,nor:m,rtp:p,tb:g},_=Object.keys(r||{}).sort(),l=C(_),f;!(f=l()).done;){var u=f.value,h=r[u];if(!t(h))continue;if(u==="v"&&h===1)continue;if(u=="pr"&&h===1)continue;var E=b[u];E&&(h=E(h));var v=typeof h,S=void 0;u==="ot"||u==="sf"||u==="st"?S=u+"="+h:v==="boolean"?S=u:v==="number"?S=u+"="+h:S=u+"="+JSON.stringify(h),n.push(S)}return n.join(",")},i.toHeaders=function(r){for(var n=Object.keys(r),t={},g=["Object","Request","Session","Status"],p=[{},{},{},{}],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},b=0,_=n;b<_.length;b++){var l=_[b],f=m[l]!=null?m[l]:1;p[f][l]=r[l]}for(var u=0;u<p.length;u++){var h=i.serialize(p[u]);h&&(t["CMCD-"+g[u]]=h)}return t},i.toQuery=function(r){return"CMCD="+encodeURIComponent(i.serialize(r))},i.appendQueryToUri=function(r,n){if(!n)return r;var t=r.includes("?")?"&":"?";return""+r+t+n},i}()},"./src/controller/eme-controller.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/events.ts"),w=O("./src/errors.ts"),D=O("./src/utils/logger.ts"),B=O("./src/utils/mediakeys-helper.ts");function M(a,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,i,o){return i&&M(a.prototype,i),o&&M(a,o),a}var C=3,y=function(i,o,s){var r={audioCapabilities:[],videoCapabilities:[]};return i.forEach(function(n){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:s.audioRobustness||""})}),o.forEach(function(n){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:s.videoRobustness||""})}),[r]},c=function(i,o,s,r){switch(i){case B.KeySystems.WIDEVINE:return y(o,s,r);default:throw new Error("Unknown key-system: "+i)}},d=function(){function a(o){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=o,this._config=o.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var i=a.prototype;return i.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},i._registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i._unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(k.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i.getLicenseServerUrl=function(s){switch(s){case B.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},i._attemptKeySystemAccess=function(s,r,n){var t=this,g=c(s,r,n,this._drmSystemOptions);D.logger.log("Requesting encrypted media key-system access");var p=this.requestMediaKeySystemAccess(s,g);this.mediaKeysPromise=p.then(function(m){return t._onMediaKeySystemAccessObtained(s,m)}),p.catch(function(m){D.logger.error('Failed to obtain key-system "'+s+'" access:',m)})},i._onMediaKeySystemAccessObtained=function(s,r){var n=this;D.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var g=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(p){return t.mediaKeys=p,D.logger.log('Media-keys created for key-system "'+s+'"'),n._onMediaKeysCreated(),p});return g.catch(function(p){D.logger.error("Failed to create media-keys:",p)}),g},i._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),s._onNewMediaKeySession(r.mediaKeysSession))})},i._onNewMediaKeySession=function(s){var r=this;D.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(n){r._onKeySessionMessage(s,n.message)},!1)},i._onKeySessionMessage=function(s,r){D.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(n){D.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),s.update(n)})},i.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(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(g){if(!r._media)return;r._attemptSetMediaKeys(g),r._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(n).catch(n)},i._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(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}D.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},i._generateRequestWithPreferredKeySession=function(s,r){var n=this,t=this._mediaKeysList[0];if(!t){D.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){D.logger.warn("Key-Session already initialized but requested again");return}var g=t.mediaKeysSession;if(!g){D.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){D.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}D.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,g.generateRequest(s,r).then(function(){D.logger.debug("Key-session generation succeeded")}).catch(function(p){D.logger.error("Error generating key-session request:",p),n.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},i._createLicenseXhr=function(s,r,n){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,s,r,n);var g=this._licenseXhrSetup;if(g)try{g.call(this.hls,t,s),g=void 0}catch(p){D.logger.error(p)}try{t.readyState||t.open("POST",s,!0),g&&g.call(this.hls,t,s)}catch(p){throw new Error("issue setting up KeySystem license XHR "+p)}return t},i._onLicenseRequestReadyStageChange=function(s,r,n,t){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,D.logger.log("License request succeeded");var g=s.response,p=this._licenseResponseCallback;if(p)try{g=p.call(this.hls,s,r)}catch(b){D.logger.error(b)}t(g)}else{if(D.logger.error("License Request XHR failed ("+r+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>C){this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=C-this._requestLicenseFailureCount+1;D.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(n,t)}break}},i._generateLicenseRequestChallenge=function(s,r){switch(s.mediaKeySystemDomain){case B.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},i._requestLicense=function(s,r){D.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){D.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(n.mediaKeySystemDomain),g=this._createLicenseXhr(t,s,r);D.logger.log("Sending license request to URL: "+t);var p=this._generateLicenseRequestChallenge(n,s);g.send(p)}catch(m){D.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},i.onMediaAttached=function(s,r){if(!this._emeEnabled)return;var n=r.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},i.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(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},i.onManifestParsed=function(s,r){if(!this._emeEnabled)return;var n=r.levels.map(function(g){return g.audioCodec}).filter(function(g){return!!g}),t=r.levels.map(function(g){return g.videoCodec}).filter(function(g){return!!g});this._attemptKeySystemAccess(B.KeySystems.WIDEVINE,n,t)},e(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();W.default=d},"./src/controller/fps-controller.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/events.ts"),w=O("./src/utils/logger.ts"),D=function(){function B(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 M=B.prototype;return M.setStreamController=function(C){this.streamController=C},M.registerListeners=function(){this.hls.on(k.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},M.unregisterListeners=function(){this.hls.off(k.Events.MEDIA_ATTACHING,this.onMediaAttaching)},M.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},M.onMediaAttaching=function(C,y){var c=this.hls.config;if(c.capLevelOnFPSDrop){var d=y.media instanceof self.HTMLVideoElement?y.media:null;this.media=d,d&&typeof d.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),c.fpsDroppedMonitoringPeriod)}},M.checkFPS=function(C,y,c){var d=performance.now();if(y){if(this.lastTime){var a=d-this.lastTime,i=c-this.lastDroppedFrames,o=y-this.lastDecodedFrames,s=1e3*i/a,r=this.hls;if(r.trigger(k.Events.FPS_DROP,{currentDropped:i,currentDecoded:o,totalDroppedFrames:c}),s>0&&i>r.config.fpsDroppedMonitoringThreshold*o){var n=r.currentLevel;w.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=n)&&(n=n-1,r.trigger(k.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:r.currentLevel}),r.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=d,this.lastDroppedFrames=c,this.lastDecodedFrames=y}},M.checkFPSInterval=function(){var C=this.media;if(C)if(this.isVideoPlaybackQualityAvailable){var y=C.getVideoPlaybackQuality();this.checkFPS(C,y.totalVideoFrames,y.droppedVideoFrames)}else this.checkFPS(C,C.webkitDecodedFrameCount,C.webkitDroppedFrameCount)},B}();W.default=D},"./src/controller/fragment-finders.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"findFragmentByPDT",function(){return D}),O.d(W,"findFragmentByPTS",function(){return B}),O.d(W,"fragmentWithinToleranceTest",function(){return M}),O.d(W,"pdtWithinToleranceTest",function(){return e}),O.d(W,"findFragWithCC",function(){return C});var k=O("./src/polyfills/number.ts"),w=O("./src/utils/binary-search.ts");function D(y,c,d){if(c===null||!Array.isArray(y)||!y.length||!Object(k.isFiniteNumber)(c))return null;var a=y[0].programDateTime;if(c<(a||0))return null;var i=y[y.length-1].endProgramDateTime;if(c>=(i||0))return null;d=d||0;for(var o=0;o<y.length;++o){var s=y[o];if(e(c,d,s))return s}return null}function B(y,c,d,a){d===void 0&&(d=0),a===void 0&&(a=0);var i=null;if(y?i=c[y.sn-c[0].sn+1]||null:d===0&&c[0].start===0&&(i=c[0]),i&&M(d,a,i)===0)return i;var o=w.default.search(c,M.bind(null,d,a));return o||i}function M(y,c,d){y===void 0&&(y=0),c===void 0&&(c=0);var a=Math.min(c,d.duration+(d.deltaPTS?d.deltaPTS:0));return d.start+d.duration-a<=y?1:d.start-a>y&&d.start?-1:0}function e(y,c,d){var a=Math.min(c,d.duration+(d.deltaPTS?d.deltaPTS:0))*1e3,i=d.endProgramDateTime||0;return i-a>y}function C(y,c){return w.default.search(y,function(d){return d.cc<c?1:d.cc>c?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"FragmentState",function(){return D}),O.d(W,"FragmentTracker",function(){return B});var k=O("./src/events.ts"),w=O("./src/types/loader.ts"),D;(function(C){C.NOT_LOADED="NOT_LOADED",C.BACKTRACKED="BACKTRACKED",C.APPENDING="APPENDING",C.PARTIAL="PARTIAL",C.OK="OK"})(D||(D={}));var B=function(){function C(c){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=c,this._registerListeners()}var y=C.prototype;return y._registerListeners=function(){var d=this.hls;d.on(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.on(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.on(k.Events.FRAG_LOADED,this.onFragLoaded,this)},y._unregisterListeners=function(){var d=this.hls;d.off(k.Events.BUFFER_APPENDED,this.onBufferAppended,this),d.off(k.Events.FRAG_BUFFERED,this.onFragBuffered,this),d.off(k.Events.FRAG_LOADED,this.onFragLoaded,this)},y.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},y.getAppendedFrag=function(d,a){if(a===w.PlaylistLevelType.MAIN){var i=this.activeFragment,o=this.activeParts;if(!i)return null;if(o)for(var s=o.length;s--;){var r=o[s],n=r?r.end:i.appendedPTS;if(r.start<=d&&n!==void 0&&d<=n)return s>9&&(this.activeParts=o.slice(s-9)),r}else if(i.start<=d&&i.appendedPTS!==void 0&&d<=i.appendedPTS)return i}return this.getBufferedFrag(d,a)},y.getBufferedFrag=function(d,a){for(var i=this.fragments,o=Object.keys(i),s=o.length;s--;){var r=i[o[s]];if((r==null?void 0:r.body.type)===a&&r.buffered){var n=r.body;if(n.start<=d&&d<=n.end)return n}}return null},y.detectEvictedFragments=function(d,a,i){var o=this;Object.keys(this.fragments).forEach(function(s){var r=o.fragments[s];if(!r)return;if(!r.buffered){r.body.type===i&&o.removeFragment(r.body);return}var n=r.range[d];if(!n)return;n.time.some(function(t){var g=!o.isTimeBuffered(t.startPTS,t.endPTS,a);return g&&o.removeFragment(r.body),g})})},y.detectPartialFragments=function(d){var a=this,i=this.timeRanges,o=d.frag,s=d.part;if(!i||o.sn==="initSegment")return;var r=e(o),n=this.fragments[r];if(!n)return;Object.keys(i).forEach(function(t){var g=o.elementaryStreams[t];if(!g)return;var p=i[t],m=s!==null||g.partial===!0;n.range[t]=a.getBufferedTimes(o,s,m,p)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},y.fragBuffered=function(d){var a=e(d),i=this.fragments[a];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},y.getBufferedTimes=function(d,a,i,o){for(var s={time:[],partial:i},r=a?a.start:d.start,n=a?a.end:d.end,t=d.minEndPTS||n,g=d.maxStartPTS||r,p=0;p<o.length;p++){var m=o.start(p)-this.bufferPadding,b=o.end(p)+this.bufferPadding;if(g>=m&&t<=b){s.time.push({startPTS:Math.max(r,o.start(p)),endPTS:Math.min(n,o.end(p))});break}else if(r<b&&n>m)s.partial=!0,s.time.push({startPTS:Math.max(r,o.start(p)),endPTS:Math.min(n,o.end(p))});else if(n<=m)break}return s},y.getPartialFragment=function(d){var a=null,i,o,s,r=0,n=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(g){var p=t[g];if(!p)return;M(p)&&(o=p.body.start-n,s=p.body.end+n,d>=o&&d<=s&&(i=Math.min(d-o,s-d),r<=i&&(a=p.body,r=i)))}),a},y.getState=function(d){var a=e(d),i=this.fragments[a];return i?i.buffered?M(i)?D.PARTIAL:D.OK:i.backtrack?D.BACKTRACKED:D.APPENDING:D.NOT_LOADED},y.backtrack=function(d,a){var i=e(d),o=this.fragments[i];if(!o||o.backtrack)return null;var s=o.backtrack=a||o.loaded;return o.loaded=null,s},y.getBacktrackData=function(d){var a=e(d),i=this.fragments[a];if(i){var o,s=i.backtrack;if(s!=null&&(o=s.payload)!==null&&o!==void 0&&o.byteLength)return s;this.removeFragment(d)}return null},y.isTimeBuffered=function(d,a,i){for(var o,s,r=0;r<i.length;r++){if(o=i.start(r)-this.bufferPadding,s=i.end(r)+this.bufferPadding,d>=o&&a<=s)return!0;if(a<=o)return!1}return!1},y.onFragLoaded=function(d,a){var i=a.frag,o=a.part;if(i.sn==="initSegment"||i.bitrateTest||o)return;var s=e(i);this.fragments[s]={body:i,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},y.onBufferAppended=function(d,a){var i=this,o=a.frag,s=a.part,r=a.timeRanges;if(o.type===w.PlaylistLevelType.MAIN)if(this.activeFragment=o,s){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(s)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(t){var g=r[t];if(i.detectEvictedFragments(t,g),!s)for(var p=0;p<g.length;p++)o.appendedPTS=Math.max(g.end(p),o.appendedPTS||0)})},y.onFragBuffered=function(d,a){this.detectPartialFragments(a)},y.hasFragment=function(d){var a=e(d);return!!this.fragments[a]},y.removeFragmentsInRange=function(d,a,i){var o=this;Object.keys(this.fragments).forEach(function(s){var r=o.fragments[s];if(!r)return;if(r.buffered){var n=r.body;n.type===i&&n.start<a&&n.end>d&&o.removeFragment(n)}})},y.removeFragment=function(d){var a=e(d);d.stats.loaded=0,d.clearElementaryStreamInfo(),delete this.fragments[a]},y.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},C}();function M(C){var y,c;return C.buffered&&(((y=C.range.video)===null||y===void 0?void 0:y.partial)||((c=C.range.audio)===null||c===void 0?void 0:c.partial))}function e(C){return C.type+"_"+C.level+"_"+C.urlId+"_"+C.sn}},"./src/controller/gap-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"STALL_MINIMUM_DURATION_MS",function(){return M}),O.d(W,"MAX_START_GAP_JUMP",function(){return e}),O.d(W,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return C}),O.d(W,"SKIP_BUFFER_RANGE_START",function(){return y}),O.d(W,"default",function(){return c});var k=O("./src/utils/buffer-helper.ts"),w=O("./src/errors.ts"),D=O("./src/events.ts"),B=O("./src/utils/logger.ts"),M=250,e=2,C=.1,y=.05,c=function(){function d(i,o,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=i,this.media=o,this.fragmentTracker=s,this.hls=r}var a=d.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(o){var s=this.config,r=this.media,n=this.stalled,t=r.currentTime,g=r.seeking,p=this.seeking&&!g,m=!this.seeking&&g;if(this.seeking=g,t!==o){if(this.moved=!0,n!==null){if(this.stallReported){var b=self.performance.now()-n;B.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(b)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||p)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!k.BufferHelper.getBuffered(r).length)return;var _=k.BufferHelper.bufferInfo(r,t,0),l=_.len>0,f=_.nextStart||0;if(!l&&!f)return;if(g){var u=_.len>e,h=!f||f-t>e&&!this.fragmentTracker.getPartialFragment(t);if(u||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,v=Math.max(f,_.start||0)-t,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,L=S==null||((E=S.details)===null||E===void 0)?void 0:E.live,I=L?S.details.targetduration*2:e;if(v>0&&v<=I){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(n===null){this.stalled=A;return}var P=A-n;!g&&P>=M&&this._reportStall(_.len);var H=k.BufferHelper.bufferInfo(r,t,s.maxBufferHole);this._tryFixBufferStall(H,P)},a._tryFixBufferStall=function(o,s){var r=this.config,n=this.fragmentTracker,t=this.media,g=t.currentTime,p=n.getPartialFragment(g);if(p){var m=this._trySkipBufferHole(p);if(m)return}o.len>r.maxBufferHole&&s>r.highBufferWatchdogPeriod*1e3&&(B.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(o){var s=this.hls,r=this.media,n=this.stallReported;n||(this.stallReported=!0,B.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+o+")"),s.trigger(D.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},a._trySkipBufferHole=function(o){for(var s=this.config,r=this.hls,n=this.media,t=n.currentTime,g=0,p=k.BufferHelper.getBuffered(n),m=0;m<p.length;m++){var b=p.start(m);if(t+s.maxBufferHole>=g&&t<b){var _=Math.max(b+y,n.currentTime+C);return B.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+_),this.moved=!0,this.stalled=null,n.currentTime=_,o&&r.trigger(D.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+_,frag:o}),_}g=p.end(m)}return 0},a._tryNudgeBuffer=function(){var o=this.config,s=this.hls,r=this.media,n=r.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<o.nudgeMaxRetry){var g=n+t*o.nudgeOffset;B.logger.warn("Nudging 'currentTime' from "+n+" to "+g),r.currentTime=g,s.trigger(D.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else B.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+o.nudgeMaxRetry+" nudges"),s.trigger(D.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},d}()},"./src/controller/id3-track-controller.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/events.ts"),w=O("./src/utils/texttrack-utils.ts"),D=O("./src/demux/id3.ts"),B=.25,M=function(){function e(y){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=y,this._registerListeners()}var C=e.prototype;return C.destroy=function(){this._unregisterListeners()},C._registerListeners=function(){var c=this.hls;c.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var c=this.hls;c.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(k.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.onMediaAttached=function(c,d){this.media=d.media},C.onMediaDetaching=function(){if(!this.id3Track)return;Object(w.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},C.getID3Track=function(c){if(!this.media)return;for(var d=0;d<c.length;d++){var a=c[d];if(a.kind==="metadata"&&a.label==="id3")return Object(w.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},C.onFragParsingMetadata=function(c,d){if(!this.media)return;var a=d.frag,i=d.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var o=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<i.length;s++){var r=D.getID3Frames(i[s].data);if(r){var n=i[s].pts,t=s<i.length-1?i[s+1].pts:a.end,g=t-n;g<=0&&(t=n+B);for(var p=0;p<r.length;p++){var m=r[p];if(!D.isTimeStampFrame(m)){var b=new o(n,t,"");b.value=m,this.id3Track.addCue(b)}}}}},C.onBufferFlushing=function(c,d){var a=d.startOffset,i=d.endOffset,o=d.type;if(!o||o==="audio"){var s=this.id3Track;s&&Object(w.removeCuesInRange)(s,a,i)}},e}();W.default=M},"./src/controller/latency-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return e});var k=O("./src/errors.ts"),w=O("./src/events.ts"),D=O("./src/utils/logger.ts");function B(C,y){for(var c=0;c<y.length;c++){var d=y[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(C,d.key,d)}}function M(C,y,c){return y&&B(C.prototype,y),c&&B(C,c),C}var e=function(){function C(c){var d=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 d.timeupdate()},this.hls=c,this.config=c.config,this.registerListeners()}var y=C.prototype;return y.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},y.registerListeners=function(){this.hls.on(w.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(w.Events.ERROR,this.onError,this)},y.unregisterListeners=function(){this.hls.off(w.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(w.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(w.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(w.Events.ERROR,this.onError)},y.onMediaAttached=function(d,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},y.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},y.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},y.onLevelUpdated=function(d,a){var i=a.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},y.onError=function(d,a){if(a.details!==k.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,D.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},y.timeupdate=function(){var d=this.media,a=this.levelDetails;if(!d||!a)return;this.currentTime=d.currentTime;var i=this.computeLatency();if(i===null)return;this._latency=i;var o=this.config,s=o.lowLatencyMode,r=o.maxLiveSyncPlaybackRate;if(!s||r===1)return;var n=this.targetLatency;if(n===null)return;var t=i-n,g=Math.min(this.maxLatency,n+a.targetduration),p=t<g;if(a.live&&p&&t>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,r)),b=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;d.playbackRate=Math.min(m,Math.max(1,b))}else d.playbackRate!==1&&d.playbackRate!==0&&(d.playbackRate=1)},y.estimateLiveEdge=function(){var d=this.levelDetails;return d===null?null:d.edge+d.age},y.computeLatency=function(){var d=this.estimateLiveEdge();return d===null?null:d-this.currentTime},M(C,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var d=this.config,a=this.levelDetails;return d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:a?d.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var d=this.levelDetails;if(d===null)return null;var a=d.holdBack,i=d.partHoldBack,o=d.targetduration,s=this.config,r=s.liveSyncDuration,n=s.liveSyncDurationCount,t=s.lowLatencyMode,g=this.hls.userConfig,p=t&&i||a;(g.liveSyncDuration||g.liveSyncDurationCount||p===0)&&(p=r!==void 0?r:n*o);var m=o,b=1;return p+Math.min(this.stallCount*b,m)}},{key:"liveSyncPosition",get:function(){var d=this.estimateLiveEdge(),a=this.targetLatency,i=this.levelDetails;if(d===null||a===null||i===null)return null;var o=i.edge,s=d-a-this.edgeStalled,r=o-i.totalduration,n=o-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(r,s),n)}},{key:"drift",get:function(){var d=this.levelDetails;return d===null?1:d.drift}},{key:"edgeStalled",get:function(){var d=this.levelDetails;if(d===null)return 0;var a=(this.config.lowLatencyMode&&d.partTarget||d.targetduration)*3;return Math.max(d.age-a,0)}},{key:"forwardBufferLength",get:function(){var d=this.media,a=this.levelDetails;if(!d||!a)return 0;var i=d.buffered.length;return i?d.buffered.end(i-1):a.edge-this.currentTime}}]),C}()},"./src/controller/level-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return s});var k=O("./src/types/level.ts"),w=O("./src/events.ts"),D=O("./src/errors.ts"),B=O("./src/utils/codecs.ts"),M=O("./src/controller/level-helper.ts"),e=O("./src/controller/base-playlist-controller.ts"),C=O("./src/types/loader.ts");function y(){return y=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var g in t)Object.prototype.hasOwnProperty.call(t,g)&&(r[g]=t[g])}return r},y.apply(this,arguments)}function c(r,n){for(var t=0;t<n.length;t++){var g=n[t];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}function d(r,n,t){return n&&c(r.prototype,n),t&&c(r,t),r}function a(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,i(r,n)}function i(r,n){return i=Object.setPrototypeOf||function(g,p){return g.__proto__=p,g},i(r,n)}var o=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(r){a(n,r);function n(g){var p;return p=r.call(this,g,"[level-controller]")||this,p._levels=[],p._firstLevel=-1,p._startLevel=void 0,p.currentLevelIndex=-1,p.manualLevelIndex=-1,p.onParsedComplete=void 0,p._registerListeners(),p}var t=n.prototype;return t._registerListeners=function(){var p=this.hls;p.on(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.on(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(w.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.on(w.Events.FRAG_LOADED,this.onFragLoaded,this),p.on(w.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var p=this.hls;p.off(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.off(w.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(w.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.off(w.Events.FRAG_LOADED,this.onFragLoaded,this),p.off(w.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},t.startLoad=function(){var p=this._levels;p.forEach(function(m){m.loadError=0}),r.prototype.startLoad.call(this)},t.onManifestLoaded=function(p,m){var b=[],_=[],l=[],f,u={},h,E=!1,v=!1,S=!1;if(m.levels.forEach(function(P){var H=P.attrs;E=E||!!(P.width&&P.height),v=v||!!P.videoCodec,S=S||!!P.audioCodec,o&&P.audioCodec&&P.audioCodec.indexOf("mp4a.40.34")!==-1&&(P.audioCodec=void 0);var R=P.bitrate+"-"+P.attrs.RESOLUTION+"-"+P.attrs.CODECS;h=u[R],h?h.url.push(P.url):(h=new k.Level(P),u[R]=h,b.push(h)),H&&(H.AUDIO&&Object(M.addGroupId)(h,"audio",H.AUDIO),H.SUBTITLES&&Object(M.addGroupId)(h,"text",H.SUBTITLES))}),(E||v)&&S&&(b=b.filter(function(P){var H=P.videoCodec,R=P.width,K=P.height;return!!H||!!(R&&K)})),b=b.filter(function(P){var H=P.audioCodec,R=P.videoCodec;return(!H||Object(B.isCodecSupportedInMp4)(H,"audio"))&&(!R||Object(B.isCodecSupportedInMp4)(R,"video"))}),m.audioTracks&&(_=m.audioTracks.filter(function(P){return!P.audioCodec||Object(B.isCodecSupportedInMp4)(P.audioCodec,"audio")}),Object(M.assignTrackIdsByGroup)(_)),m.subtitles&&(l=m.subtitles,Object(M.assignTrackIdsByGroup)(l)),b.length>0){f=b[0].bitrate,b.sort(function(P,H){return P.bitrate-H.bitrate}),this._levels=b;for(var L=0;L<b.length;L++)if(b[L].bitrate===f){this._firstLevel=L,this.log("manifest loaded, "+b.length+" level(s) found, first bitrate: "+f);break}var I=S&&!v,A={levels:b,audioTracks:_,subtitleTracks:l,firstLevel:this._firstLevel,stats:m.stats,audio:S,video:v,altAudio:!I&&_.some(function(P){return!!P.url})};this.hls.trigger(w.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(w.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:m.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(p,m){if(r.prototype.onError.call(this,p,m),m.fatal)return;var b=m.context,_=this._levels[this.currentLevelIndex];if(b&&(b.type===C.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&b.groupId===_.audioGroupIds[_.urlId]||b.type===C.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&b.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var l=!1,f=!0,u;switch(m.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(m.frag){var h=this._levels[m.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=m.frag.level)):u=m.frag.level}break;case D.ErrorDetails.LEVEL_LOAD_ERROR:case D.ErrorDetails.LEVEL_LOAD_TIMEOUT:b&&(b.deliveryDirectives&&(f=!1),u=b.level),l=!0;break;case D.ErrorDetails.REMUX_ALLOC_ERROR:u=m.level,l=!0;break}u!==void 0&&this.recoverLevel(m,u,l,f)},t.recoverLevel=function(p,m,b,_){var l=p.details,f=this._levels[m];if(f.loadError++,b){var u=this.retryLoadingOrFail(p);if(u)p.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var h=f.url.length;if(h>1&&f.loadError<h)p.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var E=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(l+": switch to "+E),p.levelRetry=!0,this.hls.nextAutoLevel=E)}}},t.redundantFailover=function(p){var m=this._levels[p],b=m.url.length;if(b>1){var _=(m.urlId+1)%b;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(l){l.urlId=_}),this.level=p}},t.onFragLoaded=function(p,m){var b=m.frag;if(b!==void 0&&b.type===C.PlaylistLevelType.MAIN){var _=this._levels[b.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},t.onLevelLoaded=function(p,m){var b,_=m.level,l=m.details,f=this._levels[_];if(!f){var u;this.warn("Invalid level index "+_),(u=m.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(l.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(f.fragmentError===0&&(f.loadError=0,this.retryCount=0),this.playlistLoaded(_,m,f.details)):(b=m.deliveryDirectives)!==null&&b!==void 0&&b.skip&&(l.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(p,m){var b=this.hls.levels[this.currentLevelIndex];if(!b)return;if(b.audioGroupIds){for(var _=-1,l=this.hls.audioTracks[m.id].groupId,f=0;f<b.audioGroupIds.length;f++)if(b.audioGroupIds[f]===l){_=f;break}_!==b.urlId&&(b.urlId=_,this.startLoad())}},t.loadPlaylist=function(p){var m=this.currentLevelIndex,b=this._levels[m];if(this.canLoad&&b&&b.url.length>0){var _=b.urlId,l=b.url[_];if(p)try{l=p.addDirectives(l)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Attempt loading level index "+m+(p?" at sn "+p.msn+" part "+p.part:"")+" with URL-id "+_+" "+l),this.clearTimer(),this.hls.trigger(w.Events.LEVEL_LOADING,{url:l,level:m,id:_,deliveryDirectives:p||null})}},t.removeLevel=function(p,m){var b=function(f,u){return u!==m},_=this._levels.filter(function(l,f){return f!==p?!0:l.url.length>1&&m!==void 0?(l.url=l.url.filter(b),l.audioGroupIds&&(l.audioGroupIds=l.audioGroupIds.filter(b)),l.textGroupIds&&(l.textGroupIds=l.textGroupIds.filter(b)),l.urlId=0,!0):!1}).map(function(l,f){var u=l.details;return u!=null&&u.fragments&&u.fragments.forEach(function(h){h.level=f}),l});this._levels=_,this.hls.trigger(w.Events.LEVELS_UPDATED,{levels:_})},d(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(p){var m,b=this._levels;if(b.length===0)return;if(this.currentLevelIndex===p&&(m=b[p])!==null&&m!==void 0&&m.details)return;if(p<0||p>=b.length){var _=p<0;if(this.hls.trigger(w.Events.ERROR,{type:D.ErrorTypes.OTHER_ERROR,details:D.ErrorDetails.LEVEL_SWITCH_ERROR,level:p,fatal:_,reason:"invalid level idx"}),_)return;p=Math.min(p,b.length-1)}this.clearTimer();var l=this.currentLevelIndex,f=b[l],u=b[p];this.log("switching to level "+p+" from "+l),this.currentLevelIndex=p;var h=y({},u,{level:p,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete h._urlId,this.hls.trigger(w.Events.LEVEL_SWITCHING,h);var E=u.details;if(!E||E.live){var v=this.switchParams(u.uri,f==null?void 0:f.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(p){this.manualLevelIndex=p,this._startLevel===void 0&&(this._startLevel=p),p!==-1&&(this.level=p)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(p){this._firstLevel=p}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var p=this.hls.config.startLevel;return p!==void 0?p:this._firstLevel}else return this._startLevel},set:function(p){this._startLevel=p}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(p){this.level=p,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=p)}}]),n}(e.default)},"./src/controller/level-helper.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"addGroupId",function(){return D}),O.d(W,"assignTrackIdsByGroup",function(){return B}),O.d(W,"updatePTS",function(){return M}),O.d(W,"updateFragPTSDTS",function(){return C}),O.d(W,"mergeDetails",function(){return y}),O.d(W,"mapPartIntersection",function(){return c}),O.d(W,"mapFragmentIntersection",function(){return d}),O.d(W,"adjustSliding",function(){return a}),O.d(W,"addSliding",function(){return i}),O.d(W,"computeReloadInterval",function(){return o}),O.d(W,"getFragmentWithSN",function(){return s}),O.d(W,"getPartWith",function(){return r});var k=O("./src/polyfills/number.ts"),w=O("./src/utils/logger.ts");function D(n,t,g){switch(t){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(g);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(g);break}}function B(n){var t={};n.forEach(function(g){var p=g.groupId||"";g.id=t[p]=t[p]||0,t[p]++})}function M(n,t,g){var p=n[t],m=n[g];e(p,m)}function e(n,t){var g=t.startPTS;if(Object(k.isFiniteNumber)(g)){var p=0,m;t.sn>n.sn?(p=g-n.start,m=n):(p=n.start-g,m=t),m.duration!==p&&(m.duration=p)}else if(t.sn>n.sn){var b=n.cc===t.cc;b&&n.minEndPTS?t.start=n.start+(n.minEndPTS-n.start):t.start=n.start+n.duration}else t.start=Math.max(n.start-t.duration,0)}function C(n,t,g,p,m,b){var _=p-g;_<=0&&(w.logger.warn("Fragment should have a positive duration",t),p=g+t.duration,b=m+t.duration);var l=g,f=p,u=t.startPTS,h=t.endPTS;if(Object(k.isFiniteNumber)(u)){var E=Math.abs(u-g);Object(k.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(E,t.deltaPTS):t.deltaPTS=E,l=Math.max(g,u),g=Math.min(g,u),m=Math.min(m,t.startDTS),f=Math.min(p,h),p=Math.max(p,h),b=Math.max(b,t.endDTS)}t.duration=p-g;var v=g-t.start;t.appendedPTS=p,t.start=t.startPTS=g,t.maxStartPTS=l,t.startDTS=m,t.endPTS=p,t.minEndPTS=f,t.endDTS=b;var S=t.sn;if(!n||S<n.startSN||S>n.endSN)return 0;var L,I=S-n.startSN,A=n.fragments;for(A[I]=t,L=I;L>0;L--)e(A[L],A[L-1]);for(L=I;L<A.length-1;L++)e(A[L],A[L+1]);return n.fragmentHint&&e(A[A.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,v}function y(n,t){for(var g=null,p=n.fragments,m=p.length-1;m>=0;m--){var b=p[m].initSegment;if(b){g=b;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var _=0,l;if(d(n,t,function(L,I){L.relurl&&(_=L.cc-I.cc),Object(k.isFiniteNumber)(L.startPTS)&&Object(k.isFiniteNumber)(L.endPTS)&&(I.start=I.startPTS=L.startPTS,I.startDTS=L.startDTS,I.appendedPTS=L.appendedPTS,I.maxStartPTS=L.maxStartPTS,I.endPTS=L.endPTS,I.endDTS=L.endDTS,I.minEndPTS=L.minEndPTS,I.duration=L.endPTS-L.startPTS,I.duration&&(l=I),t.PTSKnown=t.alignedSliding=!0),I.elementaryStreams=L.elementaryStreams,I.loader=L.loader,I.stats=L.stats,I.urlId=L.urlId,L.initSegment&&(I.initSegment=L.initSegment,g=L.initSegment)}),g){var f=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;f.forEach(function(L){var I;(!L.initSegment||L.initSegment.relurl===((I=g)===null||I===void 0?void 0:I.relurl))&&(L.initSegment=g)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(L){return!L}),t.deltaUpdateFailed)){w.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=t.skippedSegments;u--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var h=t.fragments;if(_){w.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<h.length;E++)h[E].cc+=_}t.skippedSegments&&(t.startCC=t.fragments[0].cc),c(n.partList,t.partList,function(L,I){I.elementaryStreams=L.elementaryStreams,I.stats=L.stats}),l?C(t,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):a(n,t),h.length&&(t.totalduration=t.edge-h[0].start),t.driftStartTime=n.driftStartTime,t.driftStart=n.driftStart;var v=t.advancedDateTime;if(t.advanced&&v){var S=t.edge;t.driftStart||(t.driftStartTime=v,t.driftStart=S),t.driftEndTime=v,t.driftEnd=S}else t.driftEndTime=n.driftEndTime,t.driftEnd=n.driftEnd,t.advancedDateTime=n.advancedDateTime}function c(n,t,g){if(n&&t)for(var p=0,m=0,b=n.length;m<=b;m++){var _=n[m],l=t[m+p];_&&l&&_.index===l.index&&_.fragment.sn===l.fragment.sn?g(_,l):p--}}function d(n,t,g){for(var p=t.skippedSegments,m=Math.max(n.startSN,t.startSN)-t.startSN,b=(n.fragmentHint?1:0)+(p?t.endSN:Math.min(n.endSN,t.endSN))-t.startSN,_=t.startSN-n.startSN,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,f=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,u=m;u<=b;u++){var h=f[_+u],E=l[u];p&&!E&&u<p&&(E=t.fragments[u]=h),h&&E&&g(h,E)}}function a(n,t){var g=t.startSN+t.skippedSegments-n.startSN,p=n.fragments;if(g<0||g>=p.length)return;i(t,p[g].start)}function i(n,t){if(t){for(var g=n.fragments,p=n.skippedSegments;p<g.length;p++)g[p].start+=t;n.fragmentHint&&(n.fragmentHint.start+=t)}}function o(n,t){var g=1e3*n.levelTargetDuration,p=g/2,m=n.age,b=m>0&&m<g*3,_=t.loading.end-t.loading.start,l,f=n.availabilityDelay;if(n.updated===!1)if(b){var u=333*n.misses;l=Math.max(Math.min(p,_*2),u),n.availabilityDelay=(n.availabilityDelay||0)+l}else l=p;else b?(f=Math.min(f||g/2,m),n.availabilityDelay=f,l=f+g-m):l=g-_;return Math.round(l)}function s(n,t,g){if(!n||!n.details)return null;var p=n.details,m=p.fragments[t-p.startSN];return m||(m=p.fragmentHint,m&&m.sn===t?m:t<p.startSN&&g&&g.sn===t?g:null)}function r(n,t,g){if(!n||!n.details)return null;var p=n.details.partList;if(p)for(var m=p.length;m--;){var b=p[m];if(b.index===g&&b.fragment.sn===t)return b}return null}},"./src/controller/stream-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return p});var k=O("./src/polyfills/number.ts"),w=O("./src/controller/base-stream-controller.ts"),D=O("./src/is-supported.ts"),B=O("./src/events.ts"),M=O("./src/utils/buffer-helper.ts"),e=O("./src/controller/fragment-tracker.ts"),C=O("./src/types/loader.ts"),y=O("./src/loader/fragment.ts"),c=O("./src/demux/transmuxer-interface.ts"),d=O("./src/types/transmuxer.ts"),a=O("./src/controller/gap-controller.ts"),i=O("./src/errors.ts"),o=O("./src/utils/logger.ts");function s(m,b){for(var _=0;_<b.length;_++){var l=b[_];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(m,l.key,l)}}function r(m,b,_){return b&&s(m.prototype,b),_&&s(m,_),m}function n(m,b){m.prototype=Object.create(b.prototype),m.prototype.constructor=m,t(m,b)}function t(m,b){return t=Object.setPrototypeOf||function(l,f){return l.__proto__=f,l},t(m,b)}var g=100,p=function(m){n(b,m);function b(l,f){var u;return u=m.call(this,l,f,"[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 _=b.prototype;return _._registerListeners=function(){var f=this.hls;f.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),f.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.on(B.Events.ERROR,this.onError,this),f.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var f=this.hls;f.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.off(B.Events.ERROR,this.onError,this),f.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(f){if(this.levels){var u=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(g),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=h.startLevel;E===-1&&(h.config.testBandwidth?(E=0,this.bitrateTest=!0):E=h.nextAutoLevel),this.level=h.nextLoadLevel=E,this.loadedmetadata=!1}u>0&&f===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),f=u),this.state=w.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()}else this._forceStartLoad=!0,this.state=w.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case w.State.IDLE:this.doTickIdle();break;case w.State.WAITING_LEVEL:{var f,u=this.levels,h=this.level,E=u==null||((f=u[h])===null||f===void 0)?void 0:f.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=w.State.IDLE;break}break}case w.State.FRAG_LOADING_WAITING_RETRY:{var v,S=self.performance.now(),L=this.retryDate;(!L||S>=L||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=w.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var f,u,h=this.hls,E=this.levelLastLoaded,v=this.levels,S=this.media,L=h.config,I=h.nextLoadLevel;if(E===null||!S&&(this.startFragRequested||!L.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[I])return;var A=v[I];this.level=h.nextLoadLevel=I;var P=A.details;if(!P||this.state===w.State.WAITING_LEVEL||P.live&&this.levelLastLoaded!==I){this.state=w.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:S,C.PlaylistLevelType.MAIN);if(H===null)return;var R=H.len,K=this.getMaxBufferLength(A.maxBitrate);if(R>=K)return;if(this._streamEnded(H,P)){var z={};this.altAudio&&(z.type="video"),this.hls.trigger(B.Events.BUFFER_EOS,z),this.state=w.State.ENDED;return}var oe=H.end,$=this.getNextFragment(oe,P);if(this.couldBacktrack&&!this.fragPrevious&&$&&$.sn!=="initSegment"){var fe=$.sn-P.startSN;fe>1&&($=P.fragments[fe-1],this.fragmentTracker.removeFragment($))}if($&&this.fragmentTracker.getState($)===e.FragmentState.OK&&this.nextLoadPosition>oe){var de=this.audioOnly&&!this.altAudio?y.ElementaryStreamTypes.AUDIO:y.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(S,de,C.PlaylistLevelType.MAIN),$=this.getNextFragment(this.nextLoadPosition,P)}if(!$)return;$.initSegment&&!$.initSegment.data&&!this.bitrateTest&&($=$.initSegment),((f=$.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((u=$.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey($,P):this.loadFragment($,P,oe)},_.loadFragment=function(f,u,h){var E,v=this.fragmentTracker.getState(f);if(this.fragCurrent=f,v===e.FragmentState.BACKTRACKED){var S=this.fragmentTracker.getBacktrackData(f);if(S){this._handleFragmentLoadProgress(S),this._handleFragmentLoadComplete(S);return}else v=e.FragmentState.NOT_LOADED}v===e.FragmentState.NOT_LOADED||v===e.FragmentState.PARTIAL?f.sn==="initSegment"?this._loadInitSegment(f):this.bitrateTest?(f.bitrateTest=!0,this.log("Fragment "+f.sn+" of level "+f.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(f)):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,f,u,h)):v===e.FragmentState.APPENDING?this.reduceMaxBufferLength(f.duration)&&this.fragmentTracker.removeFragment(f):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(f){var u=this.fragmentTracker.getAppendedFrag(f,C.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},_.getBufferedFrag=function(f){return this.fragmentTracker.getBufferedFrag(f,C.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(f){return f?this.getBufferedFrag(f.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var f=this.levels,u=this.media;if(u!=null&&u.readyState){var h,E=this.getAppendedFrag(u.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!u.paused&&f){var v=this.hls.nextLoadLevel,S=f[v],L=this.fragLastKbps;L&&this.fragCurrent?h=this.fragCurrent.duration*S.maxBitrate/(1e3*L)+1:h=0}else h=0;var I=this.getBufferedFrag(u.currentTime+h);if(I){var A=this.followingBufferedFrag(I);if(A){this.abortCurrentFrag();var P=A.maxStartPTS?A.maxStartPTS:A.start,H=A.duration,R=Math.max(I.end,P+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(R,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var f=this.fragCurrent;this.fragCurrent=null,f!=null&&f.loader&&f.loader.abort(),this.state===w.State.KEY_LOADING&&(this.state=w.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(f,u){m.prototype.flushMainBuffer.call(this,f,u,this.altAudio?"video":null)},_.onMediaAttached=function(f,u){m.prototype.onMediaAttached.call(this,f,u);var h=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,h,this.fragmentTracker,this.hls)},_.onMediaDetaching=function(){var f=this.media;f&&(f.removeEventListener("playing",this.onvplaying),f.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),m.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var f=this.media,u=f?f.currentTime:null;Object(k.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(B.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(f,u){var h=!1,E=!1,v;u.levels.forEach(function(S){v=S.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(h=!0),v.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=h&&E&&!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},_.onLevelLoading=function(f,u){var h=this.levels;if(!h||this.state!==w.State.IDLE)return;var E=h[u.level];(!E.details||E.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(E.details))&&(this.state=w.State.WAITING_LEVEL)},_.onLevelLoaded=function(f,u){var h,E=this.levels,v=u.level,S=u.details,L=S.totalduration;if(!E){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+S.startSN+","+S.endSN+"], cc ["+S.startCC+", "+S.endCC+"] duration:"+L);var I=this.fragCurrent;I&&(this.state===w.State.FRAG_LOADING||this.state===w.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==u.level&&I.loader&&(this.state=w.State.IDLE,I.loader.abort()));var A=E[v],P=0;if(S.live||(h=A.details)!==null&&h!==void 0&&h.live){if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed)return;P=this.alignPlaylists(S,A.details)}if(A.details=S,this.levelLastLoaded=v,this.hls.trigger(B.Events.LEVEL_UPDATED,{details:S,level:v}),this.state===w.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(S))return;this.state=w.State.IDLE}this.startFragRequested?S.live&&this.synchronizeToLiveEdge(S):this.setStartPosition(S,P),this.tick()},_._handleFragmentLoadProgress=function(f){var u,h=f.frag,E=f.part,v=f.payload,S=this.levels;if(!S){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var L=S[h.level],I=L.details;if(!I){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var A=L.videoCodec,P=I.PTSKnown||!I.live,H=(u=h.initSegment)===null||u===void 0?void 0:u.data,R=this._getAudioCodec(L),K=this.transmuxer=this.transmuxer||new c.default(this.hls,C.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),z=E?E.index:-1,oe=z!==-1,$=new d.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,v.byteLength,z,oe),fe=this.initPTS[h.cc];K.push(v,H,R,A,h,E,I.totalduration,P,$,fe)},_.onAudioTrackSwitching=function(f,u){var h=this.altAudio,E=!!u.url,v=u.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var S=this.fragCurrent;S!=null&&S.loader&&(this.log("Switching to main audio track, cancel main fragment load"),S.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var L=this.hls;h&&L.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),L.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:v})}},_.onAudioTrackSwitched=function(f,u){var h=u.id,E=!!this.hls.audioTracks[h].url;if(E){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=E,this.tick()},_.onBufferCreated=function(f,u){var h=u.tracks,E,v,S=!1;for(var L in h){var I=h[L];if(I.id==="main"){if(v=L,E=I,L==="video"){var A=h[L];A&&(this.videoBuffer=A.buffer)}}else S=!0}S&&E?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(f,u){var h=u.frag,E=u.part;if(h&&h.type!==C.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(E?" p: "+E.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===w.State.PARSED&&(this.state=w.State.IDLE);return}var v=E?E.stats:h.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,E)},_.onError=function(f,u){switch(u.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(C.PlaylistLevelType.MAIN,u);break;case i.ErrorDetails.LEVEL_LOAD_ERROR:case i.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==w.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=w.State.ERROR):!u.levelRetry&&this.state===w.State.WAITING_LEVEL&&(this.state=w.State.IDLE));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===w.State.PARSING||this.state===w.State.PARSED)){var h=!0,E=this.getFwdBufferInfo(this.media,C.PlaylistLevelType.MAIN);E&&E.len>.5&&(h=!this.reduceMaxBufferLength(E.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var f=this.media,u=this.gapController;if(!f||!u||!f.readyState)return;var h=M.BufferHelper.getBuffered(f);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=f.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=w.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(f,u){var h=u.type;if(h!==y.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(h===y.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,h,C.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(f,u){this.levels=u.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var f=this.media,u=f.currentTime,h=this.startPosition;if(h>=0&&u<h){if(f.seeking){o.logger.log("could not seek to "+h+", already seeking at "+u);return}var E=M.BufferHelper.getBuffered(f),v=E.length?E.start(0):0,S=v-h;S>0&&(S<this.config.maxBufferHole||S<this.config.maxFragLookUpTolerance)&&(o.logger.log("adjusting start position by "+S+" to match buffer start"),h+=S,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+u),f.currentTime=h}},_._getAudioCodec=function(f){var u=this.config.defaultAudioCodec||f.audioCodec;return this.audioCodecSwap&&u&&(this.log("Swapping audio codec"),u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5"),u},_._loadBitrateTestFrag=function(f){var u=this;this._doFragLoad(f).then(function(h){var E=u.hls;if(!h||E.nextLoadLevel||u.fragContextChanged(f))return;u.fragLoadError=0,u.state=w.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var v=f.stats;v.parsing.start=v.parsing.end=v.buffering.start=v.buffering.end=self.performance.now(),E.trigger(B.Events.FRAG_LOADED,h)})},_._handleTransmuxComplete=function(f){var u,h="main",E=this.hls,v=f.remuxResult,S=f.chunkMeta,L=this.getCurrentContext(S);if(!L){this.warn("The loading context changed while buffering fragment "+S.sn+" of level "+S.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(S.level);return}var I=L.frag,A=L.part,P=L.level,H=v.video,R=v.text,K=v.id3,z=v.initSegment,oe=this.altAudio?void 0:v.audio;if(this.fragContextChanged(I))return;if(this.state=w.State.PARSING,z){z.tracks&&(this._bufferInitSegment(P,z.tracks,I,S),E.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:I,id:h,tracks:z.tracks}));var $=z.initPTS,fe=z.timescale;Object(k.isFiniteNumber)($)&&(this.initPTS[I.cc]=$,E.trigger(B.Events.INIT_PTS_FOUND,{frag:I,id:h,initPTS:$,timescale:fe}))}if(H&&v.independent!==!1){if(P.details){var de=H.startPTS,ee=H.endPTS,ie=H.startDTS,ge=H.endDTS;if(A)A.elementaryStreams[H.type]={startPTS:de,endPTS:ee,startDTS:ie,endDTS:ge};else if(H.firstKeyFrame&&H.independent&&(this.couldBacktrack=!0),H.dropped&&H.independent){var Z=this.getLoadPosition()+this.config.maxBufferHole;if(Z<de){this.backtrack(I);return}I.setElementaryStreamInfo(H.type,I.start,ee,I.start,ge,!0)}I.setElementaryStreamInfo(H.type,de,ee,ie,ge),this.bufferFragmentData(H,I,A,S)}}else if(v.independent===!1){this.backtrack(I);return}if(oe){var Y=oe.startPTS,Se=oe.endPTS,Pe=oe.startDTS,ke=oe.endDTS;A&&(A.elementaryStreams[y.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:Se,startDTS:Pe,endDTS:ke}),I.setElementaryStreamInfo(y.ElementaryStreamTypes.AUDIO,Y,Se,Pe,ke),this.bufferFragmentData(oe,I,A,S)}if(K!=null&&(u=K.samples)!==null&&u!==void 0&&u.length){var Re={frag:I,id:h,samples:K.samples};E.trigger(B.Events.FRAG_PARSING_METADATA,Re)}if(R){var Me={frag:I,id:h,samples:R.samples};E.trigger(B.Events.FRAG_PARSING_USERDATA,Me)}},_._bufferInitSegment=function(f,u,h,E){var v=this;if(this.state!==w.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var S=u.audio,L=u.video,I=u.audiovideo;if(S){var A=f.audioCodec,P=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),S.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(A="mp4a.40.5")),P.indexOf("android")!==-1&&S.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),f.audioCodec&&f.audioCodec!==A&&this.log('Swapping manifest audio codec "'+f.audioCodec+'" for "'+A+'"'),S.levelCodec=A,S.id="main",this.log("Init audio buffer, container:"+S.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(f.audioCodec||"")+"/"+S.codec+"]")}L&&(L.levelCodec=f.videoCodec,L.id="main",this.log("Init video buffer, container:"+L.container+", codecs[level/parsed]=["+(f.videoCodec||"")+"/"+L.codec+"]")),I&&this.log("Init audiovideo buffer, container:"+I.container+", codecs[level/parsed]=["+(f.attrs.CODECS||"")+"/"+I.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(H){var R=u[H],K=R.initSegment;K!=null&&K.byteLength&&v.hls.trigger(B.Events.BUFFER_APPENDING,{type:H,data:K,frag:h,part:null,chunkMeta:E,parent:h.type})}),this.tick()},_.backtrack=function(f){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(f);var u=this.fragmentTracker.backtrack(f);this.fragPrevious=null,this.nextLoadPosition=f.start,u?this.resetFragmentLoading(f):this.state=w.State.BACKTRACKING},_.checkFragmentChanged=function(){var f=this.media,u=null;if(f&&f.readyState>1&&f.seeking===!1){var h=f.currentTime;if(M.BufferHelper.isBuffered(f,h)?u=this.getAppendedFrag(h):M.BufferHelper.isBuffered(f,h+.1)&&(u=this.getAppendedFrag(h+.1)),u){var E=this.fragPlaying,v=u.level;(!E||u.sn!==E.sn||E.level!==v||u.urlId!==E.urlId)&&(this.hls.trigger(B.Events.FRAG_CHANGED,{frag:u}),(!E||E.level!==v)&&this.hls.trigger(B.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=u)}}},r(b,[{key:"nextLevel",get:function(){var f=this.nextBufferedFrag;return f?f.level:-1}},{key:"currentLevel",get:function(){var f=this.media;if(f){var u=this.getAppendedFrag(f.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var f=this.media;if(f){var u=this.getAppendedFrag(f.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),b}(w.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"SubtitleStreamController",function(){return n});var k=O("./src/events.ts"),w=O("./src/utils/logger.ts"),D=O("./src/utils/buffer-helper.ts"),B=O("./src/controller/fragment-finders.ts"),M=O("./src/utils/discontinuities.ts"),e=O("./src/controller/level-helper.ts"),C=O("./src/controller/fragment-tracker.ts"),y=O("./src/controller/base-stream-controller.ts"),c=O("./src/types/loader.ts"),d=O("./src/types/level.ts");function a(t,g){for(var p=0;p<g.length;p++){var m=g[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function i(t,g,p){return g&&a(t.prototype,g),p&&a(t,p),t}function o(t,g){t.prototype=Object.create(g.prototype),t.prototype.constructor=t,s(t,g)}function s(t,g){return s=Object.setPrototypeOf||function(m,b){return m.__proto__=b,m},s(t,g)}var r=500,n=function(t){o(g,t);function g(m,b){var _;return _=t.call(this,m,b,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var p=g.prototype;return p.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},p._registerListeners=function(){var b=this.hls;b.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(k.Events.ERROR,this.onError,this),b.on(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),b.on(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),b.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),b.on(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),b.on(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var b=this.hls;b.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(k.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(k.Events.ERROR,this.onError,this),b.off(k.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),b.off(k.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),b.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),b.off(k.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),b.off(k.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.startLoad=function(){this.stopLoad(),this.state=y.State.IDLE,this.setInterval(r),this.tick()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},p.onLevelLoaded=function(b,_){this.mainDetails=_.details},p.onSubtitleFragProcessed=function(b,_){var l=_.frag,f=_.success;if(this.fragPrevious=l,this.state=y.State.IDLE,!f)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var h,E=l.start,v=0;v<u.length;v++)if(E>=u[v].start&&E<=u[v].end){h=u[v];break}var S=l.start+l.duration;h?h.end=S:(h={start:E,end:S},u.push(h)),this.fragmentTracker.fragBuffered(l)},p.onBufferFlushing=function(b,_){var l=_.startOffset,f=_.endOffset;if(l===0&&f!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,h=this.levels;if(!h.length||!h[u]||!h[u].details)return;var E=h[u].details,v=E.targetduration,S=f-v;if(S<=0)return;_.endOffsetSubtitles=Math.max(0,S),this.tracksBuffered.forEach(function(L){for(var I=0;I<L.length;){if(L[I].end<=S){L.shift();continue}else if(L[I].start<S)L[I].start=S;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(l,S,c.PlaylistLevelType.SUBTITLE)}},p.onError=function(b,_){var l,f=_.frag;if(!f||f.type!==c.PlaylistLevelType.SUBTITLE)return;(l=this.fragCurrent)!==null&&l!==void 0&&l.loader&&this.fragCurrent.loader.abort(),this.state=y.State.IDLE},p.onSubtitleTracksUpdated=function(b,_){var l=this,f=_.subtitleTracks;this.tracksBuffered=[],this.levels=f.map(function(u){return new d.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){l.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},p.onSubtitleTrackSwitch=function(b,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var l=this.levels[this.currentTrackId];l!=null&&l.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,l&&this.setInterval(r)},p.onSubtitleTrackLoaded=function(b,_){var l,f=_.details,u=_.id,h=this.currentTrackId,E=this.levels;if(!E.length)return;var v=E[h];if(u>=E.length||u!==h||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,f.live||(l=v.details)!==null&&l!==void 0&&l.live){var S=this.mainDetails;if(f.deltaUpdateFailed||!S)return;var L=S.fragments[0];if(!v.details)f.hasProgramDateTime&&S.hasProgramDateTime?Object(M.alignMediaPlaylistByPDT)(f,S):L&&Object(e.addSliding)(f,L.start);else{var I=this.alignPlaylists(f,v.details);I===0&&L&&Object(e.addSliding)(f,L.start)}}if(v.details=f,this.levelLastLoaded=u,this.tick(),f.live&&!this.fragCurrent&&this.media&&this.state===y.State.IDLE){var A=Object(B.findFragmentByPTS)(null,f.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},p._handleFragmentLoadComplete=function(b){var _=b.frag,l=b.payload,f=_.decryptdata,u=this.hls;if(this.fragContextChanged(_))return;if(l&&l.byteLength>0&&f&&f.key&&f.iv&&f.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(l),f.key.buffer,f.iv.buffer).then(function(E){var v=performance.now();u.trigger(k.Events.FRAG_DECRYPTED,{frag:_,payload:E,stats:{tstart:h,tdecrypt:v}})})}},p.doTick=function(){if(!this.media){this.state=y.State.IDLE;return}if(this.state===y.State.IDLE){var b,_=this.currentTrackId,l=this.levels;if(!l.length||!l[_]||!l[_].details)return;var f=l[_].details,u=f.targetduration,h=this.config,E=this.media,v=D.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-u,h.maxBufferHole),S=v.end,L=v.len,I=this.getMaxBufferLength()+u;if(L>I)return;console.assert(f,"Subtitle track details are defined on idle subtitle stream controller tick");var A=f.fragments,P=A.length,H=f.edge,R,K=this.fragPrevious;if(S<H){var z=h.maxFragLookUpTolerance;K&&f.hasProgramDateTime&&(R=Object(B.findFragmentByPDT)(A,K.endProgramDateTime,z)),R||(R=Object(B.findFragmentByPTS)(K,A,S,z),!R&&K&&K.start<A[0].start&&(R=A[0]))}else R=A[P-1];(b=R)!==null&&b!==void 0&&b.encrypted?(w.logger.log("Loading key for "+R.sn),this.state=y.State.KEY_LOADING,this.hls.trigger(k.Events.KEY_LOADING,{frag:R})):R&&this.fragmentTracker.getState(R)===C.FragmentState.NOT_LOADED&&this.loadFragment(R,f,S)}},p.loadFragment=function(b,_,l){this.fragCurrent=b,t.prototype.loadFragment.call(this,b,_,l)},i(g,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),g}(y.default)},"./src/controller/subtitle-track-controller.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/events.ts"),w=O("./src/utils/texttrack-utils.ts"),D=O("./src/controller/base-playlist-controller.ts"),B=O("./src/types/loader.ts");function M(a,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,i,o){return i&&M(a.prototype,i),o&&M(a,o),a}function C(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,y(a,i)}function y(a,i){return y=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},y(a,i)}var c=function(a){C(i,a);function i(s){var r;return r=a.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 o=i.prototype;return o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},o.registerListeners=function(){var r=this.hls;r.on(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(k.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(k.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var r=this.hls;r.off(k.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(k.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(k.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(k.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(k.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(k.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(k.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(k.Events.ERROR,this.onError,this)},o.onMediaAttached=function(r,n){if(this.media=n.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},o.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},o.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=d(this.media.textTracks);r.forEach(function(n){Object(w.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},o.onManifestParsed=function(r,n){this.tracks=n.subtitleTracks},o.onSubtitleTrackLoaded=function(r,n){var t=n.id,g=n.details,p=this.trackId,m=this.tracksInGroup[p];if(!m){this.warn("Invalid subtitle track id "+t);return}var b=m.details;m.details=n.details,this.log("subtitle track "+t+" loaded ["+g.startSN+"-"+g.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,n,b))},o.onLevelLoading=function(r,n){this.switchLevel(n.level)},o.onLevelSwitching=function(r,n){this.switchLevel(n.level)},o.switchLevel=function(r){var n=this.hls.levels[r];if(!(n!=null&&n.textGroupIds))return;var t=n.textGroupIds[n.urlId];if(this.groupId!==t){var g=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,p=this.tracks.filter(function(_){return!t||_.groupId===t});this.tracksInGroup=p;var m=this.findTrackId(g==null?void 0:g.name)||this.findTrackId();this.groupId=t;var b={subtitleTracks:p};this.log("Updating subtitle tracks, "+p.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(k.Events.SUBTITLE_TRACKS_UPDATED,b),m!==-1&&this.setSubtitleTrack(m,g)}},o.findTrackId=function(r){for(var n=this.tracksInGroup,t=0;t<n.length;t++){var g=n[t];if((!this.selectDefaultTrack||g.default)&&(!r||r===g.name))return g.id}return-1},o.onError=function(r,n){if(a.prototype.onError.call(this,r,n),n.fatal||!n.context)return;n.context.type===B.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},o.loadPlaylist=function(r){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var t=n.id,g=n.groupId,p=n.url;if(r)try{p=r.addDirectives(p)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(k.Events.SUBTITLE_TRACK_LOADING,{url:p,id:t,groupId:g,deliveryDirectives:r||null})}},o.toggleTrackModes=function(r){var n=this,t=this.media,g=this.subtitleDisplay,p=this.trackId;if(!t)return;var m=d(t.textTracks),b=m.filter(function(f){return f.groupId===n.groupId});if(r===-1)[].slice.call(m).forEach(function(f){f.mode="disabled"});else{var _=b[p];_&&(_.mode="disabled")}var l=b[r];l&&(l.mode=g?"showing":"hidden")},o.setSubtitleTrack=function(r,n){var t,g=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(t=g[r])!==null&&t!==void 0&&t.details)||r<-1||r>=g.length)return;this.clearTimer();var p=g[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,p){var m=p.id,b=p.groupId,_=b===void 0?"":b,l=p.name,f=p.type,u=p.url;this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:_,name:l,type:f,url:u});var h=this.switchParams(p.url,n==null?void 0:n.details);this.loadPlaylist(h)}else this.hls.trigger(k.Events.SUBTITLE_TRACK_SWITCH,{id:r})},o.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,n=d(this.media.textTracks),t=0;t<n.length;t++)if(n[t].mode==="hidden")r=t;else if(n[t].mode==="showing"){r=t;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},e(i,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,n)}}]),i}(D.default);function d(a){for(var i=[],o=0;o<a.length;o++){var s=a[o];s.kind==="subtitles"&&s.label&&i.push(a[o])}return i}W.default=c},"./src/controller/timeline-controller.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"TimelineController",function(){return d});var k=O("./src/polyfills/number.ts"),w=O("./src/events.ts"),D=O("./src/utils/cea-608-parser.ts"),B=O("./src/utils/output-filter.ts"),M=O("./src/utils/webvtt-parser.ts"),e=O("./src/utils/texttrack-utils.ts"),C=O("./src/utils/imsc1-ttml-parser.ts"),y=O("./src/types/loader.ts"),c=O("./src/utils/logger.ts"),d=function(){function s(n){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),this.captionsProperties=void 0,this.hls=n,this.config=n.config,this.Cues=n.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new B.default(this,"textTrack1"),g=new B.default(this,"textTrack2"),p=new B.default(this,"textTrack3"),m=new B.default(this,"textTrack4");this.cea608Parser1=new D.default(1,t,g),this.cea608Parser2=new D.default(3,p,m)}n.on(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.on(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.on(w.Events.FRAG_LOADING,this.onFragLoading,this),n.on(w.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(w.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.on(w.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.on(w.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(w.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.on(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=s.prototype;return r.destroy=function(){var t=this.hls;t.off(w.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(w.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(w.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(w.Events.FRAG_LOADING,this.onFragLoading,this),t.off(w.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(w.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(w.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(w.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(w.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(w.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(t,g,p,m,b){for(var _=!1,l=b.length;l--;){var f=b[l],u=i(f[0],f[1],g,p);if(u>=0&&(f[0]=Math.min(f[0],g),f[1]=Math.max(f[1],p),_=!0,u/(p-g)>.5))return}if(_||b.push([g,p]),this.config.renderTextTracksNatively){var h=this.captionsTracks[t];this.Cues.newCue(h,g,p,m)}else{var E=this.Cues.newCue(null,g,p,m);this.hls.trigger(w.Events.CUES_PARSED,{type:"captions",cues:E,track:t})}},r.onInitPtsFound=function(t,g){var p=this,m=g.frag,b=g.id,_=g.initPTS,l=g.timescale,f=this.unparsedVttFrags;b==="main"&&(this.initPTS[m.cc]=_,this.timescale[m.cc]=l),f.length&&(this.unparsedVttFrags=[],f.forEach(function(u){p.onFragLoaded(w.Events.FRAG_LOADED,u)}))},r.getExistingTrack=function(t){var g=this.media;if(g)for(var p=0;p<g.textTracks.length;p++){var m=g.textTracks[p];if(m[t])return m}return null},r.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},r.createNativeTrack=function(t){if(this.captionsTracks[t])return;var g=this.captionsProperties,p=this.captionsTracks,m=this.media,b=g[t],_=b.label,l=b.languageCode,f=this.getExistingTrack(t);if(f)p[t]=f,Object(e.clearCurrentCues)(p[t]),Object(e.sendAddTrackEvent)(p[t],m);else{var u=this.createTextTrack("captions",_,l);u&&(u[t]=!0,p[t]=u)}},r.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var g=this.captionsProperties[t];if(!g)return;var p=g.label,m={_id:t,label:p,kind:"captions",default:g.media?!!g.media.default:!1,closedCaptions:g.media};this.nonNativeCaptionsTracks[t]=m,this.hls.trigger(w.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},r.createTextTrack=function(t,g,p){var m=this.media;return m?m.addTextTrack(t,g,p):void 0},r.onMediaAttaching=function(t,g){this.media=g.media,this._cleanTracks()},r.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(g){Object(e.clearCurrentCues)(t[g]),delete t[g]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=o(),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 t=this.media;if(!t)return;var g=t.textTracks;if(g)for(var p=0;p<g.length;p++)Object(e.clearCurrentCues)(g[p])},r.onSubtitleTracksUpdated=function(t,g){var p=this;this.textTracks=[];var m=g.subtitleTracks||[],b=m.some(function(u){return u.textCodec===C.IMSC1_CODEC});if(this.config.enableWebVTT||b&&this.config.enableIMSC1){var _=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var l=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,h){var E;if(h<l.length){for(var v=null,S=0;S<l.length;S++)if(a(l[S],u)){v=l[S];break}v&&(E=v)}E?Object(e.clearCurrentCues)(E):(E=p.createTextTrack("subtitles",u.name,u.lang),E&&(E.mode="disabled")),E&&(E.groupId=u.groupId,p.textTracks.push(E))})}else if(!_&&this.tracks&&this.tracks.length){var f=this.tracks.map(function(u){return{label:u.name,kind:u.type.toLowerCase(),default:u.default,subtitleTrack:u}});this.hls.trigger(w.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:f})}}},r.onManifestLoaded=function(t,g){var p=this;this.config.enableCEA708Captions&&g.captions&&g.captions.forEach(function(m){var b=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!b)return;var _="textTrack"+b[1],l=p.captionsProperties[_];if(!l)return;l.label=m.name,m.lang&&(l.languageCode=m.lang),l.media=m})},r.onFragLoading=function(t,g){var p=this.cea608Parser1,m=this.cea608Parser2,b=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(p&&m))return;if(g.frag.type===y.PlaylistLevelType.MAIN){var l,f,u=g.frag.sn,h=(l=g==null||((f=g.part)===null||f===void 0)?void 0:f.index)!=null?l:-1;u===b+1||u===b&&h===_+1||(p.reset(),m.reset()),this.lastSn=u,this.lastPartIndex=h}},r.onFragLoaded=function(t,g){var p=g.frag,m=g.payload,b=this.initPTS,_=this.unparsedVttFrags;if(p.type===y.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(k.isFiniteNumber)(b[p.cc])){_.push(g),b.length&&this.hls.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Missing initial subtitle PTS")});return}var l=p.decryptdata;if(l==null||l.key==null||l.method!=="AES-128"){var f=this.tracks[p.level],u=this.vttCCs;u[p.cc]||(u[p.cc]={start:p.start,prevCC:this.prevCC,new:!0},this.prevCC=p.cc),f&&f.textCodec===C.IMSC1_CODEC?this._parseIMSC1(p,m):this._parseVTTs(p,m,u)}}else this.hls.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(t,g){var p=this,m=this.hls;Object(C.parseIMSC1)(g,this.initPTS[t.cc],this.timescale[t.cc],function(b){p._appendCues(b,t.level),m.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(b){c.logger.log("Failed to parse IMSC1: "+b),m.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:b})})},r._parseVTTs=function(t,g,p){var m=this,b=this.hls;Object(M.parseWebVTT)(g,this.initPTS[t.cc],this.timescale[t.cc],p,t.cc,t.start,function(_){m._appendCues(_,t.level),b.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(_){m._fallbackToIMSC1(t,g),c.logger.log("Failed to parse VTT cue: "+_),b.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:_})})},r._fallbackToIMSC1=function(t,g){var p=this,m=this.tracks[t.level];m.textCodec||Object(C.parseIMSC1)(g,this.initPTS[t.cc],this.timescale[t.cc],function(){m.textCodec=C.IMSC1_CODEC,p._parseIMSC1(t,g)},function(){m.textCodec="wvtt"})},r._appendCues=function(t,g){var p=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[g];if(m.mode==="disabled")return;t.forEach(function(l){return Object(e.addCueToTrack)(m,l)})}else{var b=this.tracks[g],_=b.default?"default":"subtitles"+g;p.trigger(w.Events.CUES_PARSED,{type:"subtitles",cues:t,track:_})}},r.onFragDecrypted=function(t,g){var p=g.frag;if(p.type===y.PlaylistLevelType.SUBTITLE){if(!Object(k.isFiniteNumber)(this.initPTS[p.cc])){this.unparsedVttFrags.push(g);return}this.onFragLoaded(w.Events.FRAG_LOADED,g)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(t,g){var p=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(p&&m))return;for(var b=0;b<g.samples.length;b++){var _=g.samples[b].bytes;if(_){var l=this.extractCea608Data(_);p.addData(g.samples[b].pts,l[0]),m.addData(g.samples[b].pts,l[1])}}},r.onBufferFlushing=function(t,g){var p=g.startOffset,m=g.endOffset,b=g.endOffsetSubtitles,_=g.type,l=this.media;if(!l||l.currentTime<m)return;if(!_||_==="video"){var f=this.captionsTracks;Object.keys(f).forEach(function(h){return Object(e.removeCuesInRange)(f[h],p,m)})}if(this.config.renderTextTracksNatively&&(p===0&&b!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(h){return Object(e.removeCuesInRange)(u[h],p,b)})}},r.extractCea608Data=function(t){for(var g=t[0]&31,p=2,m=[[],[]],b=0;b<g;b++){var _=t[p++],l=127&t[p++],f=127&t[p++],u=(4&_)!==0,h=3&_;if(l===0&&f===0)continue;u&&((h===0||h===1)&&(m[h].push(l),m[h].push(f)))}return m},s}();function a(s,r){return s&&s.label===r.name&&!(s.textTrack1||s.textTrack2)}function i(s,r,n,t){return Math.min(r,t)-Math.max(s,n)}function o(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return k});var k=function(){function w(B,M){this.subtle=void 0,this.aesIV=void 0,this.subtle=B,this.aesIV=M}var D=w.prototype;return D.decrypt=function(M,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,M)},w}()},"./src/crypt/aes-decryptor.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"removePadding",function(){return w}),O.d(W,"default",function(){return D});var k=O("./src/utils/typed-array.ts");function w(B){var M=B.byteLength,e=M&&new DataView(B.buffer).getUint8(M-1);return e?Object(k.sliceUint8)(B,0,M-e):B}var D=function(){function B(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var M=B.prototype;return M.uint8ArrayToUint32Array_=function(C){for(var y=new DataView(C),c=new Uint32Array(4),d=0;d<4;d++)c[d]=y.getUint32(d*4);return c},M.initTable=function(){var C=this.sBox,y=this.invSBox,c=this.subMix,d=c[0],a=c[1],i=c[2],o=c[3],s=this.invSubMix,r=s[0],n=s[1],t=s[2],g=s[3],p=new Uint32Array(256),m=0,b=0,_=0;for(_=0;_<256;_++)_<128?p[_]=_<<1:p[_]=_<<1^283;for(_=0;_<256;_++){var l=b^b<<1^b<<2^b<<3^b<<4;l=l>>>8^l&255^99,C[m]=l,y[l]=m;var f=p[m],u=p[f],h=p[u],E=p[l]*257^l*16843008;d[m]=E<<24|E>>>8,a[m]=E<<16|E>>>16,i[m]=E<<8|E>>>24,o[m]=E,E=h*16843009^u*65537^f*257^m*16843008,r[l]=E<<24|E>>>8,n[l]=E<<16|E>>>16,t[l]=E<<8|E>>>24,g[l]=E,m?(m=f^p[p[p[h^f]]],b^=p[p[b]]):m=b=1}},M.expandKey=function(C){for(var y=this.uint8ArrayToUint32Array_(C),c=!0,d=0;d<y.length&&c;)c=y[d]===this.key[d],d++;if(c)return;this.key=y;var a=this.keySize=y.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var i=this.ksRows=(a+6+1)*4,o,s,r=this.keySchedule=new Uint32Array(i),n=this.invKeySchedule=new Uint32Array(i),t=this.sBox,g=this.rcon,p=this.invSubMix,m=p[0],b=p[1],_=p[2],l=p[3],f,u;for(o=0;o<i;o++){if(o<a){f=r[o]=y[o];continue}u=f,o%a===0?(u=u<<8|u>>>24,u=t[u>>>24]<<24|t[u>>>16&255]<<16|t[u>>>8&255]<<8|t[u&255],u^=g[o/a|0]<<24):a>6&&o%a===4&&(u=t[u>>>24]<<24|t[u>>>16&255]<<16|t[u>>>8&255]<<8|t[u&255]),r[o]=f=(r[o-a]^u)>>>0}for(s=0;s<i;s++)o=i-s,s&3?u=r[o]:u=r[o-4],s<4||o<=4?n[s]=u:n[s]=m[t[u>>>24]]^b[t[u>>>16&255]]^_[t[u>>>8&255]]^l[t[u&255]],n[s]=n[s]>>>0},M.networkToHostOrderSwap=function(C){return C<<24|(C&65280)<<8|(C&16711680)>>8|C>>>24},M.decrypt=function(C,y,c){for(var d=this.keySize+6,a=this.invKeySchedule,i=this.invSBox,o=this.invSubMix,s=o[0],r=o[1],n=o[2],t=o[3],g=this.uint8ArrayToUint32Array_(c),p=g[0],m=g[1],b=g[2],_=g[3],l=new Int32Array(C),f=new Int32Array(l.length),u,h,E,v,S,L,I,A,P,H,R,K,z,oe,$=this.networkToHostOrderSwap;y<l.length;){for(P=$(l[y]),H=$(l[y+1]),R=$(l[y+2]),K=$(l[y+3]),S=P^a[0],L=K^a[1],I=R^a[2],A=H^a[3],z=4,oe=1;oe<d;oe++)u=s[S>>>24]^r[L>>16&255]^n[I>>8&255]^t[A&255]^a[z],h=s[L>>>24]^r[I>>16&255]^n[A>>8&255]^t[S&255]^a[z+1],E=s[I>>>24]^r[A>>16&255]^n[S>>8&255]^t[L&255]^a[z+2],v=s[A>>>24]^r[S>>16&255]^n[L>>8&255]^t[I&255]^a[z+3],S=u,L=h,I=E,A=v,z=z+4;u=i[S>>>24]<<24^i[L>>16&255]<<16^i[I>>8&255]<<8^i[A&255]^a[z],h=i[L>>>24]<<24^i[I>>16&255]<<16^i[A>>8&255]<<8^i[S&255]^a[z+1],E=i[I>>>24]<<24^i[A>>16&255]<<16^i[S>>8&255]<<8^i[L&255]^a[z+2],v=i[A>>>24]<<24^i[S>>16&255]<<16^i[L>>8&255]<<8^i[I&255]^a[z+3],f[y]=$(u^p),f[y+1]=$(v^m),f[y+2]=$(E^b),f[y+3]=$(h^_),p=P,m=H,b=R,_=K,y=y+4}return f.buffer},B}()},"./src/crypt/decrypter.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return y});var k=O("./src/crypt/aes-crypto.ts"),w=O("./src/crypt/fast-aes-key.ts"),D=O("./src/crypt/aes-decryptor.ts"),B=O("./src/utils/logger.ts"),M=O("./src/utils/mp4-tools.ts"),e=O("./src/utils/typed-array.ts"),C=16,y=function(){function c(a,i,o){var s=o===void 0?{}:o,r=s.removePKCS7Padding,n=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=a,this.config=i,this.removePKCS7Padding=n,n)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(g){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var d=c.prototype;return d.destroy=function(){this.observer=null},d.isSync=function(){return this.config.enableSoftwareAES},d.flush=function(){var i=this.currentResult;if(!i){this.reset();return}var o=new Uint8Array(i);return this.reset(),this.removePKCS7Padding?Object(D.removePadding)(o):o},d.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},d.decrypt=function(i,o,s,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(i),o,s);var n=this.flush();n&&r(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(i),o,s).then(r)},d.softwareDecrypt=function(i,o,s){var r=this.currentIV,n=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(i=Object(M.appendUint8Array)(t,i),this.remainderData=null);var g=this.getValidChunk(i);if(!g.length)return null;r&&(s=r);var p=this.softwareDecrypter;p||(p=this.softwareDecrypter=new D.default),p.expandKey(o);var m=n;return this.currentResult=p.decrypt(g.buffer,0,s),this.currentIV=Object(e.sliceUint8)(g,-16).buffer,m||null},d.webCryptoDecrypt=function(i,o,s){var r=this,n=this.subtle;return(this.key!==o||!this.fastAesKey)&&(this.key=o,this.fastAesKey=new w.default(n,o)),this.fastAesKey.expandKey().then(function(t){if(!n)return Promise.reject(new Error("web crypto not initialized"));var g=new k.default(n,s);return g.decrypt(i.buffer,t)}).catch(function(t){return r.onWebCryptoError(t,i,o,s)})},d.onWebCryptoError=function(i,o,s,r){return B.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",i),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(o,s,r)},d.getValidChunk=function(i){var o=i,s=i.length-i.length%C;return s!==i.length&&(o=Object(e.sliceUint8)(i,0,s),this.remainderData=Object(e.sliceUint8)(i,s)),o},d.logOnce=function(i){if(!this.logEnabled)return;B.logger.log("[decrypter.ts]: "+i),this.logEnabled=!1},c}()},"./src/crypt/fast-aes-key.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return k});var k=function(){function w(B,M){this.subtle=void 0,this.key=void 0,this.subtle=B,this.key=M}var D=w.prototype;return D.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},w}()},"./src/demux/aacdemuxer.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/demux/base-audio-demuxer.ts"),w=O("./src/demux/adts.ts"),D=O("./src/utils/logger.ts"),B=O("./src/demux/id3.ts");function M(y,c){y.prototype=Object.create(c.prototype),y.prototype.constructor=y,e(y,c)}function e(y,c){return e=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},e(y,c)}var C=function(y){M(c,y);function c(a,i){var o;return o=y.call(this)||this,o.observer=void 0,o.config=void 0,o.observer=a,o.config=i,o}var d=c.prototype;return d.resetInitSegment=function(i,o,s){y.prototype.resetInitSegment.call(this,i,o,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:i,duration:s,inputTimeScale:9e4,dropped:0}},c.probe=function(i){if(!i)return!1;for(var o=B.getID3Data(i,0)||[],s=o.length,r=i.length;s<r;s++)if(w.probe(i,s))return D.logger.log("ADTS sync word found !"),!0;return!1},d.canParse=function(i,o){return w.canParse(i,o)},d.appendFrame=function(i,o,s){w.initTrackConfig(i,this.observer,o,s,i.manifestCodec);var r=w.appendFrame(i,o,s,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},c}(k.default);C.minProbeByteLength=9,W.default=C},"./src/demux/adts.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"getAudioConfig",function(){return B}),O.d(W,"isHeaderPattern",function(){return M}),O.d(W,"getHeaderLength",function(){return e}),O.d(W,"getFullFrameLength",function(){return C}),O.d(W,"canGetFrameLength",function(){return y}),O.d(W,"isHeader",function(){return c}),O.d(W,"canParse",function(){return d}),O.d(W,"probe",function(){return a}),O.d(W,"initTrackConfig",function(){return i}),O.d(W,"getFrameDuration",function(){return o}),O.d(W,"parseFrameHeader",function(){return s}),O.d(W,"appendFrame",function(){return r});var k=O("./src/utils/logger.ts"),w=O("./src/errors.ts"),D=O("./src/events.ts");function B(n,t,g,p){var m,b,_,l,f=navigator.userAgent.toLowerCase(),u=p,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((t[g+2]&192)>>>6)+1;var E=(t[g+2]&60)>>>2;if(E>h.length-1){n.trigger(D.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return _=(t[g+2]&1)<<2,_|=(t[g+3]&192)>>>6,k.logger.log("manifest codec:"+p+", ADTS type:"+m+", samplingIndex:"+E),/firefox/i.test(f)?E>=6?(m=5,l=new Array(4),b=E-3):(m=2,l=new Array(2),b=E):f.indexOf("android")!==-1?(m=2,l=new Array(2),b=E):(m=5,l=new Array(4),p&&(p.indexOf("mp4a.40.29")!==-1||p.indexOf("mp4a.40.5")!==-1)||!p&&E>=6?b=E-3:((p&&p.indexOf("mp4a.40.2")!==-1&&(E>=6&&_===1||/vivaldi/i.test(f))||!p&&_===1)&&(m=2,l=new Array(2)),b=E)),l[0]=m<<3,l[0]|=(E&14)>>1,l[1]|=(E&1)<<7,l[1]|=_<<3,m===5&&(l[1]|=(b&14)>>1,l[2]=(b&1)<<7,l[2]|=2<<2,l[3]=0),{config:l,samplerate:h[E],channelCount:_,codec:"mp4a.40."+m,manifestCodec:u}}function M(n,t){return n[t]===255&&(n[t+1]&246)===240}function e(n,t){return n[t+1]&1?7:9}function C(n,t){return(n[t+3]&3)<<11|n[t+4]<<3|(n[t+5]&224)>>>5}function y(n,t){return t+5<n.length}function c(n,t){return t+1<n.length&&M(n,t)}function d(n,t){return y(n,t)&&M(n,t)&&C(n,t)<=n.length-t}function a(n,t){if(c(n,t)){var g=e(n,t);if(t+g>=n.length)return!1;var p=C(n,t);if(p<=g)return!1;var m=t+p;return m===n.length||c(n,m)}return!1}function i(n,t,g,p,m){if(!n.samplerate){var b=B(t,g,p,m);if(!b)return;n.config=b.config,n.samplerate=b.samplerate,n.channelCount=b.channelCount,n.codec=b.codec,n.manifestCodec=b.manifestCodec,k.logger.log("parsed codec:"+n.codec+", rate:"+b.samplerate+", channels:"+b.channelCount)}}function o(n){return 1024*9e4/n}function s(n,t,g,p,m){var b=e(n,t),_=C(n,t);if(_-=b,_>0){var l=g+p*m;return{headerLength:b,frameLength:_,stamp:l}}}function r(n,t,g,p,m){var b=o(n.samplerate),_=s(t,g,p,m,b);if(_){var l=_.frameLength,f=_.headerLength,u=_.stamp,h=f+l,E=Math.max(0,g+h-t.length),v;E?(v=new Uint8Array(h-f),v.set(t.subarray(g+f,t.length),0)):v=t.subarray(g+f,g+h);var S={unit:v,pts:u};return E||n.samples.push(S),{sample:S,length:h,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"initPTSFn",function(){return C});var k=O("./src/polyfills/number.ts"),w=O("./src/demux/id3.ts"),D=O("./src/demux/dummy-demuxed-track.ts"),B=O("./src/utils/mp4-tools.ts"),M=O("./src/utils/typed-array.ts"),e=function(){function y(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var c=y.prototype;return c.resetInitSegment=function(a,i,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},c.resetTimeStamp=function(){},c.resetContiguity=function(){},c.canParse=function(a,i){return!1},c.appendFrame=function(a,i,o){},c.demux=function(a,i){this.cachedData&&(a=Object(B.appendUint8Array)(this.cachedData,a),this.cachedData=null);var o=w.getID3Data(a,0),s=o?o.length:0,r,n,t=this._audioTrack,g=this._id3Track,p=o?w.getTimeStamp(o):void 0,m=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=C(p,i)),o&&o.length>0&&g.samples.push({pts:this.initPTS,dts:this.initPTS,data:o}),n=this.initPTS;s<m;){if(this.canParse(a,s)){var b=this.appendFrame(t,a,s);b?(this.frameIndex++,n=b.sample.pts,s+=b.length,r=s):s=m}else w.canParse(a,s)?(o=w.getID3Data(a,s),g.samples.push({pts:n,dts:n,data:o}),s+=o.length,r=s):s++;if(s===m&&r!==m){var _=Object(M.sliceUint8)(a,r);this.cachedData?this.cachedData=Object(B.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:t,avcTrack:Object(D.dummyTrack)(),id3Track:g,textTrack:Object(D.dummyTrack)()}},c.demuxSampleAes=function(a,i,o){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},c.flush=function(a){var i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(D.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(D.dummyTrack)()}},c.destroy=function(){},y}(),C=function(c,d){return Object(k.isFiniteNumber)(c)?c*90:d*9e4};W.default=e},"./src/demux/chunk-cache.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return k});var k=function(){function D(){this.chunks=[],this.dataLength=0}var B=D.prototype;return B.push=function(e){this.chunks.push(e),this.dataLength+=e.length},B.flush=function(){var e=this.chunks,C=this.dataLength,y;if(e.length)e.length===1?y=e[0]:y=w(e,C);else return new Uint8Array(0);return this.reset(),y},B.reset=function(){this.chunks.length=0,this.dataLength=0},D}();function w(D,B){for(var M=new Uint8Array(B),e=0,C=0;C<D.length;C++){var y=D[C];M.set(y,e),e+=y.length}return M}},"./src/demux/dummy-demuxed-track.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"dummyTrack",function(){return k});function k(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/utils/logger.ts"),w=function(){function D(M){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=M,this.bytesAvailable=M.byteLength,this.word=0,this.bitsAvailable=0}var B=D.prototype;return B.loadWord=function(){var e=this.data,C=this.bytesAvailable,y=e.byteLength-C,c=new Uint8Array(4),d=Math.min(4,C);if(d===0)throw new Error("no bytes available");c.set(e.subarray(y,y+d)),this.word=new DataView(c.buffer).getUint32(0),this.bitsAvailable=d*8,this.bytesAvailable-=d},B.skipBits=function(e){var C;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,C=e>>3,e-=C>>3,this.bytesAvailable-=C,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},B.readBits=function(e){var C=Math.min(this.bitsAvailable,e),y=this.word>>>32-C;return e>32&&k.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=C,this.bitsAvailable>0?this.word<<=C:this.bytesAvailable>0&&this.loadWord(),C=e-C,C>0&&this.bitsAvailable?y<<C|this.readBits(C):y},B.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()},B.skipUEG=function(){this.skipBits(1+this.skipLZ())},B.skipEG=function(){this.skipBits(1+this.skipLZ())},B.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},B.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},B.readBoolean=function(){return this.readBits(1)===1},B.readUByte=function(){return this.readBits(8)},B.readUShort=function(){return this.readBits(16)},B.readUInt=function(){return this.readBits(32)},B.skipScalingList=function(e){for(var C=8,y=8,c,d=0;d<e;d++)y!==0&&(c=this.readEG(),y=(C+c+256)%256),C=y===0?C:y},B.readSPS=function(){var e=0,C=0,y=0,c=0,d,a,i,o=this.readUByte.bind(this),s=this.readBits.bind(this),r=this.readUEG.bind(this),n=this.readBoolean.bind(this),t=this.skipBits.bind(this),g=this.skipEG.bind(this),p=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);o();var b=o();if(s(5),t(3),o(),p(),b===100||b===110||b===122||b===244||b===44||b===83||b===86||b===118||b===128){var _=r();if(_===3&&t(1),p(),p(),t(1),n())for(a=_!==3?8:12,i=0;i<a;i++)n()&&(i<6?m(16):m(64))}p();var l=r();if(l===0)r();else if(l===1)for(t(1),g(),g(),d=r(),i=0;i<d;i++)g();p(),t(1);var f=r(),u=r(),h=s(1);h===0&&t(1),t(1),n()&&(e=r(),C=r(),y=r(),c=r());var E=[1,1];if(n()&&n()){var v=o();switch(v){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[o()<<8|o(),o()<<8|o()];break}}}return{width:Math.ceil((f+1)*16-e*2-C*2),height:(2-h)*(u+1)*16-(h?2:4)*(y+c),pixelRatio:E}},B.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},D}();W.default=w},"./src/demux/id3.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"isHeader",function(){return k}),O.d(W,"isFooter",function(){return w}),O.d(W,"getID3Data",function(){return D}),O.d(W,"canParse",function(){return M}),O.d(W,"getTimeStamp",function(){return e}),O.d(W,"isTimeStampFrame",function(){return C}),O.d(W,"getID3Frames",function(){return c}),O.d(W,"decodeFrame",function(){return d}),O.d(W,"utf8ArrayToStr",function(){return r}),O.d(W,"testables",function(){return n});var k=function(m,b){return b+10<=m.length&&(m[b]===73&&m[b+1]===68&&m[b+2]===51&&(m[b+3]<255&&m[b+4]<255&&(m[b+6]<128&&m[b+7]<128&&m[b+8]<128&&m[b+9]<128)))},w=function(m,b){return b+10<=m.length&&(m[b]===51&&m[b+1]===68&&m[b+2]===73&&(m[b+3]<255&&m[b+4]<255&&(m[b+6]<128&&m[b+7]<128&&m[b+8]<128&&m[b+9]<128)))},D=function(m,b){for(var _=b,l=0;k(m,b);){l+=10;var f=B(m,b+6);l+=f,w(m,b+10)&&(l+=10),b+=l}return l>0?m.subarray(_,_+l):void 0},B=function(m,b){var _=0;return _=(m[b]&127)<<21,_|=(m[b+1]&127)<<14,_|=(m[b+2]&127)<<7,_|=m[b+3]&127,_},M=function(m,b){return k(m,b)&&B(m,b+6)+10<=m.length-b},e=function(m){for(var b=c(m),_=0;_<b.length;_++){var l=b[_];if(C(l))return s(l)}return},C=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},y=function(m){var b=String.fromCharCode(m[0],m[1],m[2],m[3]),_=B(m,4),l=10;return{type:b,size:_,data:m.subarray(l,l+_)}},c=function(m){for(var b=0,_=[];k(m,b);){var l=B(m,b+6);b+=10;for(var f=b+l;b+8<f;){var u=y(m.subarray(b)),h=d(u);h&&_.push(h),b+=u.size+10}w(m,b)&&(b+=10)}return _},d=function(m){return m.type==="PRIV"?a(m):m.type[0]==="W"?o(m):i(m)},a=function(m){if(m.size<2)return;var b=r(m.data,!0),_=new Uint8Array(m.data.subarray(b.length+1));return{key:m.type,info:b,data:_.buffer}},i=function(m){if(m.size<2)return;if(m.type==="TXXX"){var b=1,_=r(m.data.subarray(b),!0);b+=_.length+1;var l=r(m.data.subarray(b));return{key:m.type,info:_,data:l}}var f=r(m.data.subarray(1));return{key:m.type,data:f}},o=function(m){if(m.type==="WXXX"){if(m.size<2)return;var b=1,_=r(m.data.subarray(b),!0);b+=_.length+1;var l=r(m.data.subarray(b));return{key:m.type,info:_,data:l}}var f=r(m.data);return{key:m.type,data:f}},s=function(m){if(m.data.byteLength===8){var b=new Uint8Array(m.data),_=b[3]&1,l=(b[4]<<23)+(b[5]<<15)+(b[6]<<7)+b[7];return l/=45,_&&(l+=4772185884e-2),Math.round(l)}return},r=function(m,b){b===void 0&&(b=!1);var _=g();if(_){var l=_.decode(m);if(b){var f=l.indexOf("\0");return f!==-1?l.substring(0,f):l}return l.replace(/\0/g,"")}for(var u=m.length,h,E,v,S="",L=0;L<u;){if(h=m[L++],h===0&&b)return S;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:S+=String.fromCharCode(h);break;case 12:case 13:E=m[L++],S+=String.fromCharCode((h&31)<<6|E&63);break;case 14:E=m[L++],v=m[L++],S+=String.fromCharCode((h&15)<<12|(E&63)<<6|(v&63)<<0);break;default:}}return S},n={decodeTextFrame:i},t;function g(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/demux/base-audio-demuxer.ts"),w=O("./src/demux/id3.ts"),D=O("./src/utils/logger.ts"),B=O("./src/demux/mpegaudio.ts");function M(y,c){y.prototype=Object.create(c.prototype),y.prototype.constructor=y,e(y,c)}function e(y,c){return e=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},e(y,c)}var C=function(y){M(c,y);function c(){return y.apply(this,arguments)||this}var d=c.prototype;return d.resetInitSegment=function(i,o,s){y.prototype.resetInitSegment.call(this,i,o,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:i,duration:s,inputTimeScale:9e4,dropped:0}},c.probe=function(i){if(!i)return!1;for(var o=w.getID3Data(i,0)||[],s=o.length,r=i.length;s<r;s++)if(B.probe(i,s))return D.logger.log("MPEG Audio sync word found !"),!0;return!1},d.canParse=function(i,o){return B.canParse(i,o)},d.appendFrame=function(i,o,s){return this.initPTS===null?void 0:B.appendFrame(i,o,s,this.initPTS,this.frameIndex)},c}(k.default);C.minProbeByteLength=4,W.default=C},"./src/demux/mp4demuxer.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/utils/mp4-tools.ts"),w=O("./src/demux/dummy-demuxed-track.ts"),D=function(){function B(e,C){this.remainderData=null,this.config=void 0,this.config=C}var M=B.prototype;return M.resetTimeStamp=function(){},M.resetInitSegment=function(){},M.resetContiguity=function(){},B.probe=function(C){return Object(k.findBox)({data:C,start:0,end:Math.min(C.length,16384)},["moof"]).length>0},M.demux=function(C){var y=C,c=Object(w.dummyTrack)();if(this.config.progressive){this.remainderData&&(y=Object(k.appendUint8Array)(this.remainderData,C));var d=Object(k.segmentValidRange)(y);this.remainderData=d.remainder,c.samples=d.valid||new Uint8Array}else c.samples=y;return{audioTrack:Object(w.dummyTrack)(),avcTrack:c,id3Track:Object(w.dummyTrack)(),textTrack:Object(w.dummyTrack)()}},M.flush=function(){var C=Object(w.dummyTrack)();return C.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(w.dummyTrack)(),avcTrack:C,id3Track:Object(w.dummyTrack)(),textTrack:Object(w.dummyTrack)()}},M.demuxSampleAes=function(C,y,c){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},M.destroy=function(){},B}();D.minProbeByteLength=1024,W.default=D},"./src/demux/mpegaudio.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"appendFrame",function(){return e}),O.d(W,"parseHeader",function(){return C}),O.d(W,"isHeaderPattern",function(){return y}),O.d(W,"isHeader",function(){return c}),O.d(W,"canParse",function(){return d}),O.d(W,"probe",function(){return a});var k=null,w=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],D=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],B=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],M=[0,1,1,4];function e(i,o,s,r,n){if(s+24>o.length)return;var t=C(o,s);if(t&&s+t.frameLength<=o.length){var g=t.samplesPerFrame*9e4/t.sampleRate,p=r+n*g,m={unit:o.subarray(s,s+t.frameLength),pts:p,dts:p};return i.config=[],i.channelCount=t.channelCount,i.samplerate=t.sampleRate,i.samples.push(m),{sample:m,length:t.frameLength,missing:0}}}function C(i,o){var s=i[o+1]>>3&3,r=i[o+1]>>1&3,n=i[o+2]>>4&15,t=i[o+2]>>2&3;if(s!==1&&n!==0&&n!==15&&t!==3){var g=i[o+2]>>1&1,p=i[o+3]>>6,m=s===3?3-r:r===3?3:4,b=w[m*14+n-1]*1e3,_=s===3?0:s===2?1:2,l=D[_*3+t],f=p===3?1:2,u=B[s][r],h=M[r],E=u*8*h,v=Math.floor(u*b/l+g)*h;if(k===null){var S=navigator.userAgent||"",L=S.match(/Chrome\/(\d+)/i);k=L?parseInt(L[1]):0}var I=!!k&&k<=87;return I&&r===2&&b>=224e3&&p===0&&(i[o+3]=i[o+3]|128),{sampleRate:l,channelCount:f,frameLength:v,samplesPerFrame:E}}}function y(i,o){return i[o]===255&&(i[o+1]&224)===224&&(i[o+1]&6)!==0}function c(i,o){return o+1<i.length&&y(i,o)}function d(i,o){var s=4;return y(i,o)&&s<=i.length-o}function a(i,o){if(o+1<i.length&&y(i,o)){var s=4,r=C(i,o),n=s;r!=null&&r.frameLength&&(n=r.frameLength);var t=o+n;return t===i.length||c(i,t)}return!1}},"./src/demux/sample-aes.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/crypt/decrypter.ts"),w=O("./src/demux/tsdemuxer.ts"),D=function(){function B(e,C,y){this.keyData=void 0,this.decrypter=void 0,this.keyData=y,this.decrypter=new k.default(e,C,{removePKCS7Padding:!1})}var M=B.prototype;return M.decryptBuffer=function(C,y){this.decrypter.decrypt(C,this.keyData.key.buffer,this.keyData.iv.buffer,y)},M.decryptAacSample=function(C,y,c,d){var a=C[y].unit,i=a.subarray(16,a.length-a.length%16),o=i.buffer.slice(i.byteOffset,i.byteOffset+i.length),s=this;this.decryptBuffer(o,function(r){var n=new Uint8Array(r);a.set(n,16),d||s.decryptAacSamples(C,y+1,c)})},M.decryptAacSamples=function(C,y,c){for(;;y++){if(y>=C.length){c();return}if(C[y].unit.length<32)continue;var d=this.decrypter.isSync();if(this.decryptAacSample(C,y,c,d),!d)return}},M.getAvcEncryptedData=function(C){for(var y=Math.floor((C.length-48)/160)*16+16,c=new Int8Array(y),d=0,a=32;a<=C.length-16;a+=160,d+=16)c.set(C.subarray(a,a+16),d);return c},M.getAvcDecryptedUnit=function(C,y){for(var c=new Uint8Array(y),d=0,a=32;a<=C.length-16;a+=160,d+=16)C.set(c.subarray(d,d+16),a);return C},M.decryptAvcSample=function(C,y,c,d,a,i){var o=Object(w.discardEPB)(a.data),s=this.getAvcEncryptedData(o),r=this;this.decryptBuffer(s.buffer,function(n){a.data=r.getAvcDecryptedUnit(o,n),i||r.decryptAvcSamples(C,y,c+1,d)})},M.decryptAvcSamples=function(C,y,c,d){if(C instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;y++,c=0){if(y>=C.length){d();return}for(var a=C[y].units;!(c>=a.length);c++){var i=a[c];if(i.data.length<=48||i.type!==1&&i.type!==5)continue;var o=this.decrypter.isSync();if(this.decryptAvcSample(C,y,c,d,i,o),!o)return}}},B}();W.default=D},"./src/demux/transmuxer-interface.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return a});var k=O("./node_modules/webworkify-webpack/index.js"),w=O.n(k),D=O("./src/events.ts"),B=O("./src/demux/transmuxer.ts"),M=O("./src/utils/logger.ts"),e=O("./src/errors.ts"),C=O("./src/utils/mediasource-helper.ts"),y=O("./node_modules/eventemitter3/index.js"),c=O.n(y),d=Object(C.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function i(s,r,n,t){var g=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=n,this.onFlush=t;var p=s.config,m=function(u,h){h=h||{},h.frag=g.frag,h.id=g.id,s.trigger(u,h)};this.observer=new y.EventEmitter,this.observer.on(D.Events.FRAG_DECRYPTED,m),this.observer.on(D.Events.ERROR,m);var b={mp4:d.isTypeSupported("video/mp4"),mpeg:d.isTypeSupported("audio/mpeg"),mp3:d.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(p.enableWorker&&typeof Worker!="undefined"){M.logger.log("demuxing in webworker");var l;try{l=this.worker=k("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(f){s.trigger(D.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(f.message+" ("+f.filename+":"+f.lineno+")")})},l.postMessage({cmd:"init",typeSupported:b,vendor:_,id:r,config:JSON.stringify(p)})}catch(f){M.logger.warn("Error in worker:",f),M.logger.error("Error while initializing DemuxerWorker, fallback to inline"),l&&self.URL.revokeObjectURL(l.objectURL),this.transmuxer=new B.default(this.observer,b,p,_,r),this.worker=null}}else this.transmuxer=new B.default(this.observer,b,p,_,r)}var o=i.prototype;return o.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},o.push=function(r,n,t,g,p,m,b,_,l,f){var u=this;l.transmuxing.start=self.performance.now();var h=this.transmuxer,E=this.worker,v=m?m.start:p.start,S=p.decryptdata,L=this.frag,I=!(L&&p.cc===L.cc),A=!(L&&l.level===L.level),P=L?l.sn-L.sn:-1,H=this.part?l.part-this.part.index:1,R=!A&&(P===1||P===0&&H===1),K=self.performance.now();(A||P||p.stats.parsing.start===0)&&(p.stats.parsing.start=K),m&&(H||!R)&&(m.stats.parsing.start=K);var z=new B.TransmuxState(I,R,_,A,v);if(!R||I){M.logger.log("[transmuxer-interface, "+p.type+"]: Starting new transmux session for sn: "+l.sn+" p: "+l.part+" level: "+l.level+" id: "+l.id+`
|
|
discontinuity: `+I+`
|
|
trackSwitch: `+A+`
|
|
contiguous: `+R+`
|
|
accurateTimeOffset: `+_+`
|
|
timeOffset: `+v);var oe=new B.TransmuxConfig(t,g,n,b,f);this.configureTransmuxer(oe)}if(this.frag=p,this.part=m,E)E.postMessage({cmd:"demux",data:r,decryptdata:S,chunkMeta:l,state:z},r instanceof ArrayBuffer?[r]:[]);else if(h){var $=h.push(r,S,l,z);Object(B.isPromise)($)?$.then(function(fe){u.handleTransmuxComplete(fe)}):this.handleTransmuxComplete($)}},o.flush=function(r){var n=this;r.transmuxing.start=self.performance.now();var t=this.transmuxer,g=this.worker;if(g)g.postMessage({cmd:"flush",chunkMeta:r});else if(t){var p=t.flush(r);Object(B.isPromise)(p)?p.then(function(m){n.handleFlushResult(m,r)}):this.handleFlushResult(p,r)}},o.handleFlushResult=function(r,n){var t=this;r.forEach(function(g){t.handleTransmuxComplete(g)}),this.onFlush(n)},o.onWorkerMessage=function(r){var n=r.data,t=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,t.trigger(n.event,n.data);break}}},o.configureTransmuxer=function(r){var n=this.worker,t=this.transmuxer;n?n.postMessage({cmd:"configure",config:r}):t&&t.configure(r)},o.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},i}()},"./src/demux/transmuxer-worker.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return e});var k=O("./src/demux/transmuxer.ts"),w=O("./src/events.ts"),D=O("./src/utils/logger.ts"),B=O("./node_modules/eventemitter3/index.js"),M=O.n(B);function e(a){var i=new B.EventEmitter,o=function(r,n){a.postMessage({event:r,data:n})};i.on(w.Events.FRAG_DECRYPTED,o),i.on(w.Events.ERROR,o),a.addEventListener("message",function(s){var r=s.data;switch(r.cmd){case"init":{var n=JSON.parse(r.config);a.transmuxer=new k.default(i,r.typeSupported,n,r.vendor,r.id),Object(D.enableLogs)(n.debug),o("init",null);break}case"configure":{a.transmuxer.configure(r.config);break}case"demux":{var t=a.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(k.isPromise)(t)?t.then(function(m){C(a,m)}):C(a,t);break}case"flush":{var g=r.chunkMeta,p=a.transmuxer.flush(g);Object(k.isPromise)(p)?p.then(function(m){c(a,m,g)}):c(a,p,g);break}default:break}})}function C(a,i){if(d(i.remuxResult))return;var o=[],s=i.remuxResult,r=s.audio,n=s.video;r&&y(o,r),n&&y(o,n),a.postMessage({event:"transmuxComplete",data:i},o)}function y(a,i){i.data1&&a.push(i.data1.buffer),i.data2&&a.push(i.data2.buffer)}function c(a,i,o){i.forEach(function(s){C(a,s)}),a.postMessage({event:"flush",data:o})}function d(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return n}),O.d(W,"isPromise",function(){return p}),O.d(W,"TransmuxConfig",function(){return m}),O.d(W,"TransmuxState",function(){return b});var k=O("./src/events.ts"),w=O("./src/errors.ts"),D=O("./src/crypt/decrypter.ts"),B=O("./src/demux/aacdemuxer.ts"),M=O("./src/demux/mp4demuxer.ts"),e=O("./src/demux/tsdemuxer.ts"),C=O("./src/demux/mp3demuxer.ts"),y=O("./src/remux/mp4-remuxer.ts"),c=O("./src/remux/passthrough-remuxer.ts"),d=O("./src/demux/chunk-cache.ts"),a=O("./src/utils/mp4-tools.ts"),i=O("./src/utils/logger.ts"),o;try{o=self.performance.now.bind(self.performance)}catch(_){i.logger.debug("Unable to use Performance API on this environment"),o=self.Date.now}var s=[{demux:e.default,remux:y.default},{demux:M.default,remux:c.default},{demux:B.default,remux:y.default},{demux:C.default,remux:y.default}],r=1024;s.forEach(function(_){var l=_.demux;r=Math.max(r,l.minProbeByteLength)});var n=function(){function _(f,u,h,E,v){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 d.default,this.observer=f,this.typeSupported=u,this.config=h,this.vendor=E,this.id=v}var l=_.prototype;return l.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},l.push=function(u,h,E,v){var S=this,L=E.transmuxing;L.executeStart=o();var I=new Uint8Array(u),A=this.cache,P=this.config,H=this.currentTransmuxState,R=this.transmuxConfig;v&&(this.currentTransmuxState=v);var K=t(I,h);if(K&&K.method==="AES-128"){var z=this.getDecrypter();if(P.enableSoftwareAES){var oe=z.softwareDecrypt(I,K.key.buffer,K.iv.buffer);if(!oe)return L.executeEnd=o(),g(E);I=new Uint8Array(oe)}else return this.decryptionPromise=z.webCryptoDecrypt(I,K.key.buffer,K.iv.buffer).then(function(Le){var Ne=S.push(Le,null,E);return S.decryptionPromise=null,Ne}),this.decryptionPromise}var $=v||H,fe=$.contiguous,de=$.discontinuity,ee=$.trackSwitch,ie=$.accurateTimeOffset,ge=$.timeOffset,Z=R.audioCodec,Y=R.videoCodec,Se=R.defaultInitPts,Pe=R.duration,ke=R.initSegmentData;if((de||ee)&&this.resetInitSegment(ke,Z,Y,Pe),de&&this.resetInitialTimestamp(Se),fe||this.resetContiguity(),this.needsProbing(I,de,ee)){if(A.dataLength){var Re=A.flush();I=Object(a.appendUint8Array)(Re,I)}this.configureTransmuxer(I,R)}var Me=this.transmux(I,K,ge,ie,E),Ce=this.currentTransmuxState;return Ce.contiguous=!0,Ce.discontinuity=!1,Ce.trackSwitch=!1,L.executeEnd=o(),Me},l.flush=function(u){var h=this,E=u.transmuxing;E.executeStart=o();var v=this.decrypter,S=this.cache,L=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return h.flush(u)});var A=[],P=L.timeOffset;if(v){var H=v.flush();H&&A.push(this.push(H,null,u))}var R=S.dataLength;S.reset();var K=this.demuxer,z=this.remuxer;if(!K||!z)return R>=r&&this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=o(),[g(u)];var oe=K.flush(P);return p(oe)?oe.then(function($){return h.flushRemux(A,$,u),A}):(this.flushRemux(A,oe,u),A)},l.flushRemux=function(u,h,E){var v=h.audioTrack,S=h.avcTrack,L=h.id3Track,I=h.textTrack,A=this.currentTransmuxState,P=A.accurateTimeOffset,H=A.timeOffset;i.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var R=this.remuxer.remux(v,S,L,I,H,P,!0,this.id);u.push({remuxResult:R,chunkMeta:E}),E.transmuxing.executeEnd=o()},l.resetInitialTimestamp=function(u){var h=this.demuxer,E=this.remuxer;if(!h||!E)return;h.resetTimeStamp(u),E.resetTimeStamp(u)},l.resetContiguity=function(){var u=this.demuxer,h=this.remuxer;if(!u||!h)return;u.resetContiguity(),h.resetNextTimestamp()},l.resetInitSegment=function(u,h,E,v){var S=this.demuxer,L=this.remuxer;if(!S||!L)return;S.resetInitSegment(h,E,v),L.resetInitSegment(u,h,E)},l.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},l.transmux=function(u,h,E,v,S){var L;return h&&h.method==="SAMPLE-AES"?L=this.transmuxSampleAes(u,h,E,v,S):L=this.transmuxUnencrypted(u,E,v,S),L},l.transmuxUnencrypted=function(u,h,E,v){var S=this.demuxer.demux(u,h,!1,!this.config.progressive),L=S.audioTrack,I=S.avcTrack,A=S.id3Track,P=S.textTrack,H=this.remuxer.remux(L,I,A,P,h,E,!1,this.id);return{remuxResult:H,chunkMeta:v}},l.transmuxSampleAes=function(u,h,E,v,S){var L=this;return this.demuxer.demuxSampleAes(u,h,E).then(function(I){var A=L.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,E,v,!1,L.id);return{remuxResult:A,chunkMeta:S}})},l.configureTransmuxer=function(u,h){for(var E=this.config,v=this.observer,S=this.typeSupported,L=this.vendor,I=h.audioCodec,A=h.defaultInitPts,P=h.duration,H=h.initSegmentData,R=h.videoCodec,K,z=0,oe=s.length;z<oe;z++)if(s[z].demux.probe(u)){K=s[z];break}K||(i.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:M.default,remux:c.default});var $=this.demuxer,fe=this.remuxer,de=K.remux,ee=K.demux;(!fe||!(fe instanceof de))&&(this.remuxer=new de(v,E,S,L)),(!$||!($ instanceof ee))&&(this.demuxer=new ee(v,E,S),this.probe=ee.probe),this.resetInitSegment(H,I,R,P),this.resetInitialTimestamp(A)},l.needsProbing=function(u,h,E){return!this.demuxer||!this.remuxer||h||E},l.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new D.default(this.observer,this.config)),u},_}();function t(_,l){var f=null;return _.byteLength>0&&l!=null&&l.key!=null&&l.iv!==null&&l.method!=null&&(f=l),f}var g=function(l){return{remuxResult:{},chunkMeta:l}};function p(_){return"then"in _&&_.then instanceof Function}var m=function(l,f,u,h,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=l,this.videoCodec=f,this.initSegmentData=u,this.duration=h,this.defaultInitPts=E},b=function(l,f,u,h,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=l,this.contiguous=f,this.accurateTimeOffset=u,this.trackSwitch=h,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"discardEPB",function(){return g});var k=O("./src/demux/adts.ts"),w=O("./src/demux/mpegaudio.ts"),D=O("./src/demux/exp-golomb.ts"),B=O("./src/demux/id3.ts"),M=O("./src/demux/sample-aes.ts"),e=O("./src/events.ts"),C=O("./src/utils/mp4-tools.ts"),y=O("./src/utils/logger.ts"),c=O("./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},a=function(){function p(b,_,l){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=b,this.config=_,this.typeSupported=l}p.probe=function(_){var l=p.syncOffset(_);return l<0?!1:(l&&y.logger.warn("MPEG2-TS detected but first sync word found @ offset "+l+", junk ahead ?"),!0)},p.syncOffset=function(_){for(var l=Math.min(1e3,_.length-3*188),f=0;f<l;){if(_[f]===71&&_[f+188]===71&&_[f+2*188]===71)return f;f++}return-1},p.createTrack=function(_,l){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:d[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?l:void 0}};var m=p.prototype;return m.resetInitSegment=function(_,l,f){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=p.createTrack("video",f),this._audioTrack=p.createTrack("audio",f),this._id3Track=p.createTrack("id3",f),this._txtTrack=p.createTrack("text",f),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=_,this.videoCodec=l,this._duration=f},m.resetTimeStamp=function(){},m.resetContiguity=function(){var _=this._audioTrack,l=this._avcTrack,f=this._id3Track;_&&(_.pesData=null),l&&(l.pesData=null),f&&(f.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(_,l,f,u){f===void 0&&(f=!1),u===void 0&&(u=!1),f||(this.sampleAes=null);var h,E=this._avcTrack,v=this._audioTrack,S=this._id3Track,L=E.pid,I=E.pesData,A=v.pid,P=S.pid,H=v.pesData,R=S.pesData,K=!1,z=this.pmtParsed,oe=this._pmtId,$=_.length;if(this.remainderData&&(_=Object(C.appendUint8Array)(this.remainderData,_),$=_.length,this.remainderData=null),$<188&&!u)return this.remainderData=_,{audioTrack:v,avcTrack:E,id3Track:S,textTrack:this._txtTrack};var fe=Math.max(0,p.syncOffset(_));$-=($+fe)%188,$<_.byteLength&&!u&&(this.remainderData=new Uint8Array(_.buffer,$,_.buffer.byteLength-$));for(var de=fe;de<$;de+=188)if(_[de]===71){var ee=!!(_[de+1]&64),ie=((_[de+1]&31)<<8)+_[de+2],ge=(_[de+3]&48)>>4,Z=void 0;if(ge>1){if(Z=de+5+_[de+4],Z===de+188)continue}else Z=de+4;switch(ie){case L:ee&&(I&&(h=r(I))&&this.parseAVCPES(h,!1),I={data:[],size:0}),I&&(I.data.push(_.subarray(Z,de+188)),I.size+=de+188-Z);break;case A:ee&&(H&&(h=r(H))&&(v.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),H={data:[],size:0}),H&&(H.data.push(_.subarray(Z,de+188)),H.size+=de+188-Z);break;case P:ee&&(R&&(h=r(R))&&this.parseID3PES(h),R={data:[],size:0}),R&&(R.data.push(_.subarray(Z,de+188)),R.size+=de+188-Z);break;case 0:ee&&(Z+=_[Z]+1),oe=this._pmtId=o(_,Z);break;case oe:{ee&&(Z+=_[Z]+1);var Y=s(_,Z,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,f);L=Y.avc,L>0&&(E.pid=L),A=Y.audio,A>0&&(v.pid=A,v.isAAC=Y.isAAC),P=Y.id3,P>0&&(S.pid=P),K&&!z&&(y.logger.log("reparse from beginning"),K=!1,de=fe-188),z=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=I,v.pesData=H,S.pesData=R;var Se={audioTrack:v,avcTrack:E,id3Track:S,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(Se),Se},m.flush=function(){var _=this.remainderData;this.remainderData=null;var l;return _?l=this.demux(_,-1,!1,!0):l={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(l),this.sampleAes?this.decrypt(l,this.sampleAes):l},m.extractRemainingSamples=function(_){var l=_.audioTrack,f=_.avcTrack,u=_.id3Track,h=f.pesData,E=l.pesData,v=u.pesData,S;h&&(S=r(h))?(this.parseAVCPES(S,!0),f.pesData=null):f.pesData=h,E&&(S=r(E))?(l.isAAC?this.parseAACPES(S):this.parseMPEGPES(S),l.pesData=null):(E!=null&&E.size&&y.logger.log("last AAC PES packet truncated,might overlap between fragments"),l.pesData=E),v&&(S=r(v))?(this.parseID3PES(S),u.pesData=null):u.pesData=v},m.demuxSampleAes=function(_,l,f){var u=this.demux(_,f,!0,!this.config.progressive),h=this.sampleAes=new M.default(this.observer,this.config,l);return this.decrypt(u,h)},m.decrypt=function(_,l){return new Promise(function(f){var u=_.audioTrack,h=_.avcTrack;u.samples&&u.isAAC?l.decryptAacSamples(u.samples,0,function(){h.samples?l.decryptAvcSamples(h.samples,0,0,function(){f(_)}):f(_)}):h.samples&&l.decryptAvcSamples(h.samples,0,0,function(){f(_)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(_,l){var f=this,u=this._avcTrack,h=this.parseAVCNALu(_.data),E=!1,v=this.avcSample,S,L=!1;_.data=null,v&&h.length&&!u.audFound&&(n(v,u),v=this.avcSample=i(!1,_.pts,_.dts,"")),h.forEach(function(I){switch(I.type){case 1:{S=!0,v||(v=f.avcSample=i(!0,_.pts,_.dts,"")),E&&(v.debug+="NDR "),v.frame=!0;var A=I.data;if(L&&A.length>4){var P=new D.default(A).readSliceType();(P===2||P===4||P===7||P===9)&&(v.key=!0)}break}case 5:S=!0,v||(v=f.avcSample=i(!0,_.pts,_.dts,"")),E&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{S=!0,E&&v&&(v.debug+="SEI ");var H=new D.default(g(I.data));H.readUByte();for(var R=0,K=0,z=!1,oe=0;!z&&H.bytesAvailable>1;){R=0;do oe=H.readUByte(),R+=oe;while(oe===255);K=0;do oe=H.readUByte(),K+=oe;while(oe===255);if(R===4&&H.bytesAvailable!==0){z=!0;var $=H.readUByte();if($===181){var fe=H.readUShort();if(fe===49){var de=H.readUInt();if(de===1195456820){var ee=H.readUByte();if(ee===3){for(var ie=H.readUByte(),ge=H.readUByte(),Z=31&ie,Y=[ie,ge],Se=0;Se<Z;Se++)Y.push(H.readUByte()),Y.push(H.readUByte()),Y.push(H.readUByte());t(f._txtTrack.samples,{type:3,pts:_.pts,bytes:Y})}}}}}else if(R===5&&H.bytesAvailable!==0){if(z=!0,K>16){for(var Pe=[],ke=0;ke<16;ke++)Pe.push(H.readUByte().toString(16)),(ke===3||ke===5||ke===7||ke===9)&&Pe.push("-");for(var Re=K-16,Me=new Uint8Array(Re),Ce=0;Ce<Re;Ce++)Me[Ce]=H.readUByte();t(f._txtTrack.samples,{pts:_.pts,payloadType:R,uuid:Pe.join(""),userData:Object(B.utf8ArrayToStr)(Me),userDataBytes:Me})}}else if(K<H.bytesAvailable)for(var Le=0;Le<K;Le++)H.readUByte()}break}case 7:if(S=!0,L=!0,E&&v&&(v.debug+="SPS "),!u.sps){var Ne=new D.default(I.data),J=Ne.readSPS();u.width=J.width,u.height=J.height,u.pixelRatio=J.pixelRatio,u.sps=[I.data],u.duration=f._duration;for(var pe=I.data.subarray(1,4),Te="avc1.",xe=0;xe<3;xe++){var We=pe[xe].toString(16);We.length<2&&(We="0"+We),Te+=We}u.codec=Te}break;case 8:S=!0,E&&v&&(v.debug+="PPS "),u.pps||(u.pps=[I.data]);break;case 9:S=!1,u.audFound=!0,v&&n(v,u),v=f.avcSample=i(!1,_.pts,_.dts,E?"AUD ":"");break;case 12:S=!1;break;default:S=!1,v&&(v.debug+="unknown NAL "+I.type+" ");break}if(v&&S){var He=v.units;He.push(I)}}),l&&v&&(n(v,u),this.avcSample=null)},m.getLastNalUnit=function(){var _,l=this.avcSample,f;if(!l||l.units.length===0){var u=this._avcTrack.samples;l=u[u.length-1]}if((_=l)!==null&&_!==void 0&&_.units){var h=l.units;f=h[h.length-1]}return f},m.parseAVCNALu=function(_){var l=_.byteLength,f=this._avcTrack,u=f.naluState||0,h=u,E=[],v=0,S,L,I,A=-1,P=0;for(u===-1&&(A=0,P=_[0]&31,u=0,v=1);v<l;){if(S=_[v++],!u){u=S?0:1;continue}if(u===1){u=S?0:2;continue}if(!S)u=3;else if(S===1){if(A>=0){var H={data:_.subarray(A,v-u-1),type:P};E.push(H)}else{var R=this.getLastNalUnit();if(R&&(h&&v<=4-h&&(R.state&&(R.data=R.data.subarray(0,R.data.byteLength-h))),L=v-u-1,L>0)){var K=new Uint8Array(R.data.byteLength+L);K.set(R.data,0),K.set(_.subarray(0,L),R.data.byteLength),R.data=K,R.state=0}}v<l?(I=_[v]&31,A=v,P=I,u=0):u=-1}else u=0}if(A>=0&&u>=0){var z={data:_.subarray(A,l),type:P,state:u};E.push(z)}if(E.length===0){var oe=this.getLastNalUnit();if(oe){var $=new Uint8Array(oe.data.byteLength+_.byteLength);$.set(oe.data,0),$.set(_,oe.data.byteLength),oe.data=$}}return f.naluState=u,E},m.parseAACPES=function(_){var l=0,f=this._audioTrack,u=this.aacOverFlow,h=_.data;if(u){this.aacOverFlow=null;var E=u.sample.unit.byteLength,v=Math.min(u.missing,E),S=E-v;u.sample.unit.set(h.subarray(0,v),S),f.samples.push(u.sample),l=u.missing}var L,I;for(L=l,I=h.length;L<I-1&&!k.isHeader(h,L);L++);if(L!==l){var A,P;if(L<I-1?(A="AAC PES did not start with ADTS header,offset:"+L,P=!1):(A="no ADTS header found in AAC PES",P=!0),y.logger.warn("parsing error:"+A),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:P,reason:A}),P)return}k.initTrackConfig(f,this.observer,h,L,this.audioCodec);var H;if(_.pts!==void 0)H=_.pts;else if(u){var R=k.getFrameDuration(f.samplerate);H=u.sample.pts+R}else{y.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;L<I;)if(k.isHeader(h,L)){if(L+5<I){var z=k.appendFrame(f,h,L,H,K);if(z)if(z.missing)this.aacOverFlow=z;else{L+=z.length,K++;continue}}break}else L++},m.parseMPEGPES=function(_){var l=_.data,f=l.length,u=0,h=0,E=_.pts;if(E===void 0){y.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<f;)if(w.isHeader(l,h)){var v=w.appendFrame(this._audioTrack,l,h,E,u);if(v)h+=v.length,u++;else break}else h++},m.parseID3PES=function(_){if(_.pts===void 0){y.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},p}();a.minProbeByteLength=188;function i(p,m,b,_){return{key:p,frame:!1,pts:m,dts:b,units:[],debug:_,length:0}}function o(p,m){return(p[m+10]&31)<<8|p[m+11]}function s(p,m,b,_){var l={audio:-1,avc:-1,id3:-1,isAAC:!0},f=(p[m+1]&15)<<8|p[m+2],u=m+3+f-4,h=(p[m+10]&15)<<8|p[m+11];for(m+=12+h;m<u;){var E=(p[m+1]&31)<<8|p[m+2];switch(p[m]){case 207:if(!_){y.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:l.audio===-1&&(l.audio=E);break;case 21:l.id3===-1&&(l.id3=E);break;case 219:if(!_){y.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:l.avc===-1&&(l.avc=E);break;case 3:case 4:b?l.audio===-1&&(l.audio=E,l.isAAC=!1):y.logger.log("MPEG audio found, not supported in this browser");break;case 36:y.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((p[m+3]&15)<<8|p[m+4])+5}return l}function r(p){var m=0,b,_,l,f,u,h=p.data;if(!p||p.size===0)return null;for(;h[0].length<19&&h.length>1;){var E=new Uint8Array(h[0].length+h[1].length);E.set(h[0]),E.set(h[1],h[0].length),h[0]=E,h.splice(1,1)}b=h[0];var v=(b[0]<<16)+(b[1]<<8)+b[2];if(v===1){if(_=(b[4]<<8)+b[5],_&&_>p.size-6)return null;var S=b[7];S&192&&(f=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2,S&64?(u=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,f-u>60*9e4&&(y.logger.warn(Math.round((f-u)/9e4)+"s delta between PTS and DTS, align them"),f=u)):u=f),l=b[8];var L=l+9;if(p.size<=L)return null;p.size-=L;for(var I=new Uint8Array(p.size),A=0,P=h.length;A<P;A++){b=h[A];var H=b.byteLength;if(L)if(L>H){L-=H;continue}else b=b.subarray(L),H-=L,L=0;I.set(b,m),m+=H}return _&&(_-=l+3),{data:I,pts:f,dts:u,len:_}}return null}function n(p,m){if(p.units.length&&p.frame){if(p.pts===void 0){var b=m.samples,_=b.length;if(_){var l=b[_-1];p.pts=l.pts,p.dts=l.dts}else{m.dropped++;return}}m.samples.push(p)}p.debug.length&&y.logger.log(p.pts+"/"+p.dts+":"+p.debug)}function t(p,m){var b=p.length;if(b>0){if(m.pts>=p[b-1].pts)p.push(m);else for(var _=b-1;_>=0;_--)if(m.pts<p[_].pts){p.splice(_,0,m);break}}else p.push(m)}function g(p){for(var m=p.byteLength,b=[],_=1;_<m-2;)p[_]===0&&p[_+1]===0&&p[_+2]===3?(b.push(_+2),_+=2):_++;if(b.length===0)return p;var l=m-b.length,f=new Uint8Array(l),u=0;for(_=0;_<l;u++,_++)u===b[0]&&(u++,b.shift()),f[_]=p[u];return f}W.default=a},"./src/errors.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"ErrorTypes",function(){return k}),O.d(W,"ErrorDetails",function(){return w});var k;(function(D){D.NETWORK_ERROR="networkError",D.MEDIA_ERROR="mediaError",D.KEY_SYSTEM_ERROR="keySystemError",D.MUX_ERROR="muxError",D.OTHER_ERROR="otherError"})(k||(k={}));var w;(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"})(w||(w={}))},"./src/events.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"Events",function(){return k});var k;(function(w){w.MEDIA_ATTACHING="hlsMediaAttaching",w.MEDIA_ATTACHED="hlsMediaAttached",w.MEDIA_DETACHING="hlsMediaDetaching",w.MEDIA_DETACHED="hlsMediaDetached",w.BUFFER_RESET="hlsBufferReset",w.BUFFER_CODECS="hlsBufferCodecs",w.BUFFER_CREATED="hlsBufferCreated",w.BUFFER_APPENDING="hlsBufferAppending",w.BUFFER_APPENDED="hlsBufferAppended",w.BUFFER_EOS="hlsBufferEos",w.BUFFER_FLUSHING="hlsBufferFlushing",w.BUFFER_FLUSHED="hlsBufferFlushed",w.MANIFEST_LOADING="hlsManifestLoading",w.MANIFEST_LOADED="hlsManifestLoaded",w.MANIFEST_PARSED="hlsManifestParsed",w.LEVEL_SWITCHING="hlsLevelSwitching",w.LEVEL_SWITCHED="hlsLevelSwitched",w.LEVEL_LOADING="hlsLevelLoading",w.LEVEL_LOADED="hlsLevelLoaded",w.LEVEL_UPDATED="hlsLevelUpdated",w.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",w.LEVELS_UPDATED="hlsLevelsUpdated",w.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",w.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",w.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",w.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",w.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",w.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",w.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",w.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",w.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",w.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",w.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",w.CUES_PARSED="hlsCuesParsed",w.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",w.INIT_PTS_FOUND="hlsInitPtsFound",w.FRAG_LOADING="hlsFragLoading",w.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",w.FRAG_LOADED="hlsFragLoaded",w.FRAG_DECRYPTED="hlsFragDecrypted",w.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",w.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",w.FRAG_PARSING_METADATA="hlsFragParsingMetadata",w.FRAG_PARSED="hlsFragParsed",w.FRAG_BUFFERED="hlsFragBuffered",w.FRAG_CHANGED="hlsFragChanged",w.FPS_DROP="hlsFpsDrop",w.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",w.ERROR="hlsError",w.DESTROYING="hlsDestroying",w.KEY_LOADING="hlsKeyLoading",w.KEY_LOADED="hlsKeyLoaded",w.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",w.BACK_BUFFER_REACHED="hlsBackBufferReached"})(k||(k={}))},"./src/hls.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return p});var k=O("./node_modules/url-toolkit/src/url-toolkit.js"),w=O.n(k),D=O("./src/loader/playlist-loader.ts"),B=O("./src/loader/key-loader.ts"),M=O("./src/controller/id3-track-controller.ts"),e=O("./src/controller/latency-controller.ts"),C=O("./src/controller/level-controller.ts"),y=O("./src/controller/fragment-tracker.ts"),c=O("./src/controller/stream-controller.ts"),d=O("./src/is-supported.ts"),a=O("./src/utils/logger.ts"),i=O("./src/config.ts"),o=O("./node_modules/eventemitter3/index.js"),s=O.n(o),r=O("./src/events.ts"),n=O("./src/errors.ts");function t(m,b){for(var _=0;_<b.length;_++){var l=b[_];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(m,l.key,l)}}function g(m,b,_){return b&&t(m.prototype,b),_&&t(m,_),m}var p=function(){m.isSupported=function(){return Object(d.isSupported)()};function m(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new o.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 l=this.config=Object(i.mergeConfig)(m.DefaultConfig,_);this.userConfig=_,Object(a.enableLogs)(l.debug),this._autoLevelCapping=-1,l.progressive&&Object(i.enableStreamingMode)(l);var f=l.abrController,u=l.bufferController,h=l.capLevelController,E=l.fpsController,v=this.abrController=new f(this),S=this.bufferController=new u(this),L=this.capLevelController=new h(this),I=new E(this),A=new D.default(this),P=new B.default(this),H=new M.default(this),R=this.levelController=new C.default(this),K=new y.FragmentTracker(this),z=this.streamController=new c.default(this,K);L.setStreamController(z),I.setStreamController(z);var oe=[R,z];this.networkControllers=oe;var $=[A,P,v,S,L,I,H,K];this.audioTrackController=this.createController(l.audioTrackController,null,oe),this.createController(l.audioStreamController,K,oe),this.subtitleTrackController=this.createController(l.subtitleTrackController,null,oe),this.createController(l.subtitleStreamController,K,oe),this.createController(l.timelineController,null,$),this.emeController=this.createController(l.emeController,null,$),this.cmcdController=this.createController(l.cmcdController,null,$),this.latencyController=this.createController(e.default,null,$),this.coreComponents=$}var b=m.prototype;return b.createController=function(l,f,u){if(l){var h=f?new l(this,f):new l(this);return u&&u.push(h),h}return null},b.on=function(l,f,u){u===void 0&&(u=this),this._emitter.on(l,f,u)},b.once=function(l,f,u){u===void 0&&(u=this),this._emitter.once(l,f,u)},b.removeAllListeners=function(l){this._emitter.removeAllListeners(l)},b.off=function(l,f,u,h){u===void 0&&(u=this),this._emitter.off(l,f,u,h)},b.listeners=function(l){return this._emitter.listeners(l)},b.emit=function(l,f,u){return this._emitter.emit(l,f,u)},b.trigger=function(l,f){if(this.config.debug)return this.emit(l,l,f);try{return this.emit(l,l,f)}catch(u){a.logger.error("An internal error happened while handling event "+l+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(r.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:l,error:u})}return!1},b.listenerCount=function(l){return this._emitter.listenerCount(l)},b.destroy=function(){a.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(l){return l.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(l){return l.destroy()}),this.coreComponents.length=0},b.attachMedia=function(l){a.logger.log("attachMedia"),this._media=l,this.trigger(r.Events.MEDIA_ATTACHING,{media:l})},b.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},b.loadSource=function(l){this.stopLoad();var f=this.media,u=this.url,h=this.url=k.buildAbsoluteURL(self.location.href,l,{alwaysNormalize:!0});a.logger.log("loadSource:"+h),f&&u&&u!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(f)),this.trigger(r.Events.MANIFEST_LOADING,{url:l})},b.startLoad=function(l){l===void 0&&(l=-1),a.logger.log("startLoad("+l+")"),this.networkControllers.forEach(function(f){f.startLoad(l)})},b.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(l){l.stopLoad()})},b.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},b.recoverMediaError=function(){a.logger.log("recoverMediaError");var l=this._media;this.detachMedia(),l&&this.attachMedia(l)},b.removeLevel=function(l,f){f===void 0&&(f=0),this.levelController.removeLevel(l,f)},g(m,[{key:"levels",get:function(){var l=this.levelController.levels;return l||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(l){a.logger.log("set currentLevel:"+l),this.loadLevel=l,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(l){a.logger.log("set nextLevel:"+l),this.levelController.manualLevel=l,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(l){a.logger.log("set loadLevel:"+l),this.levelController.manualLevel=l}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(l){this.levelController.nextLoadLevel=l}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(l){a.logger.log("set firstLevel:"+l),this.levelController.firstLevel=l}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(l){a.logger.log("set startLevel:"+l),l!==-1&&(l=Math.max(l,this.minAutoLevel)),this.levelController.startLevel=l}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(l){var f=!!l;f!==this.config.capLevelToPlayerSize&&(f?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=f)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(l){this._autoLevelCapping!==l&&(a.logger.log("set autoLevelCapping:"+l),this._autoLevelCapping=l)}},{key:"bandwidthEstimate",get:function(){var l=this.abrController.bwEstimator;return l?l.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var l=this.levels,f=this.config.minAutoBitrate;if(!l)return 0;for(var u=l.length,h=0;h<u;h++)if(l[h].maxBitrate>f)return h;return 0}},{key:"maxAutoLevel",get:function(){var l=this.levels,f=this.autoLevelCapping,u;return f===-1&&l&&l.length?u=l.length-1:u=f,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(l){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,l)}},{key:"audioTracks",get:function(){var l=this.audioTrackController;return l?l.audioTracks:[]}},{key:"audioTrack",get:function(){var l=this.audioTrackController;return l?l.audioTrack:-1},set:function(l){var f=this.audioTrackController;f&&(f.audioTrack=l)}},{key:"subtitleTracks",get:function(){var l=this.subtitleTrackController;return l?l.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var l=this.subtitleTrackController;return l?l.subtitleTrack:-1},set:function(l){var f=this.subtitleTrackController;f&&(f.subtitleTrack=l)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var l=this.subtitleTrackController;return l?l.subtitleDisplay:!1},set:function(l){var f=this.subtitleTrackController;f&&(f.subtitleDisplay=l)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(l){this.config.lowLatencyMode=l}},{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 n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:i.hlsDefaultConfig},set:function(l){m.defaultConfig=l}}]),m}();p.defaultConfig=void 0},"./src/is-supported.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"isSupported",function(){return D}),O.d(W,"changeTypeSupported",function(){return B});var k=O("./src/utils/mediasource-helper.ts");function w(){return self.SourceBuffer||self.WebKitSourceBuffer}function D(){var M=Object(k.getMediaSource)();if(!M)return!1;var e=w(),C=M&&typeof M.isTypeSupported=="function"&&M.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),y=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!C&&!!y}function B(){var M,e=w();return typeof(e==null||((M=e.prototype)===null||M===void 0)?void 0:M.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return a}),O.d(W,"LoadError",function(){return o});var k=O("./src/polyfills/number.ts"),w=O("./src/errors.ts");function D(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,y(s,r)}function B(s){var r=typeof Map=="function"?new Map:void 0;return B=function(t){if(t===null||!C(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(t))return r.get(t);r.set(t,g)}function g(){return M(t,arguments,c(this).constructor)}return g.prototype=Object.create(t.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),y(g,t)},B(s)}function M(s,r,n){return e()?M=Reflect.construct:M=function(g,p,m){var b=[null];b.push.apply(b,p);var _=Function.bind.apply(g,b),l=new _;return m&&y(l,m.prototype),l},M.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 C(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function y(s,r){return y=Object.setPrototypeOf||function(t,g){return t.__proto__=g,t},y(s,r)}function c(s){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},c(s)}var d=Math.pow(2,17),a=function(){function s(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}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(t,g){var p=this,m=t.url;if(!m)return Promise.reject(new o({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var b=this.config,_=b.fLoader,l=b.loader;return new Promise(function(f,u){p.loader&&p.loader.destroy();var h=p.loader=t.loader=_?new _(b):new l(b),E=i(t),v={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:b.fragLoadingMaxRetryTimeout,highWaterMark:d};t.stats=h.stats,h.load(E,v,{onSuccess:function(L,I,A,P){p.resetLoader(t,h),f({frag:t,part:null,payload:L.data,networkDetails:P})},onError:function(L,I,A){p.resetLoader(t,h),u(new o({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:L,networkDetails:A}))},onAbort:function(L,I,A){p.resetLoader(t,h),u(new o({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:A}))},onTimeout:function(L,I,A){p.resetLoader(t,h),u(new o({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:A}))},onProgress:function(L,I,A,P){g&&g({frag:t,part:null,payload:A,networkDetails:P})}})})},r.loadPart=function(t,g,p){var m=this;this.abort();var b=this.config,_=b.fLoader,l=b.loader;return new Promise(function(f,u){m.loader&&m.loader.destroy();var h=m.loader=t.loader=_?new _(b):new l(b),E=i(t,g),v={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:b.fragLoadingMaxRetryTimeout,highWaterMark:d};g.stats=h.stats,h.load(E,v,{onSuccess:function(L,I,A,P){m.resetLoader(t,h),m.updateStatsFromPart(t,g);var H={frag:t,part:g,payload:L.data,networkDetails:P};p(H),f(H)},onError:function(L,I,A){m.resetLoader(t,h),u(new o({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:g,response:L,networkDetails:A}))},onAbort:function(L,I,A){t.stats.aborted=g.stats.aborted,m.resetLoader(t,h),u(new o({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:g,networkDetails:A}))},onTimeout:function(L,I,A){m.resetLoader(t,h),u(new o({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:g,networkDetails:A}))}})})},r.updateStatsFromPart=function(t,g){var p=t.stats,m=g.stats,b=m.total;if(p.loaded+=m.loaded,b){var _=Math.round(t.duration/g.duration),l=Math.min(Math.round(p.loaded/b),_),f=_-l,u=f*Math.round(p.loaded/l);p.total=p.loaded+u}else p.total=Math.max(p.loaded,p.total);var h=p.loading,E=m.loading;h.start?h.first+=E.first-E.start:(h.start=E.start,h.first=E.first),h.end=E.end},r.resetLoader=function(t,g){t.loader=null,this.loader===g&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),g.destroy()},s}();function i(s,r){r===void 0&&(r=null);var n=r||s,t={frag:s,part:r,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},g=n.byteRangeStartOffset,p=n.byteRangeEndOffset;return Object(k.isFiniteNumber)(g)&&Object(k.isFiniteNumber)(p)&&(t.rangeStart=g,t.rangeEnd=p),t}var o=function(s){D(r,s);function r(n){for(var t,g=arguments.length,p=new Array(g>1?g-1:0),m=1;m<g;m++)p[m-1]=arguments[m];return t=s.call.apply(s,[this].concat(p))||this,t.data=void 0,t.data=n,t}return r}(B(Error))},"./src/loader/fragment.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"ElementaryStreamTypes",function(){return a}),O.d(W,"BaseSegment",function(){return i}),O.d(W,"Fragment",function(){return o}),O.d(W,"Part",function(){return s});var k=O("./src/polyfills/number.ts"),w=O("./node_modules/url-toolkit/src/url-toolkit.js"),D=O.n(w),B=O("./src/utils/logger.ts"),M=O("./src/loader/level-key.ts"),e=O("./src/loader/load-stats.ts");function C(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,y(r,n)}function y(r,n){return y=Object.setPrototypeOf||function(g,p){return g.__proto__=p,g},y(r,n)}function c(r,n){for(var t=0;t<n.length;t++){var g=n[t];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(r,g.key,g)}}function d(r,n,t){return n&&c(r.prototype,n),t&&c(r,t),r}var a;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(a||(a={}));var i=function(){function r(t){var g;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(g={},g[a.AUDIO]=null,g[a.VIDEO]=null,g[a.AUDIOVIDEO]=null,g),this.baseurl=t}var n=r.prototype;return n.setByteRange=function(g,p){var m=g.split("@",2),b=[];m.length===1?b[0]=p?p.byteRangeEndOffset:0:b[0]=parseInt(m[1]),b[1]=parseInt(m[0])+b[0],this._byteRange=b},d(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(w.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(g){this._url=g}}]),r}(),o=function(r){C(n,r);function n(g,p){var m;return m=r.call(this,p)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new e.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=g,m}var t=n.prototype;return t.createInitializationVector=function(p){for(var m=new Uint8Array(16),b=12;b<16;b++)m[b]=p>>8*(15-b)&255;return m},t.setDecryptDataFromLevelKey=function(p,m){var b=p;return(p==null?void 0:p.method)==="AES-128"&&p.uri&&!p.iv&&(b=M.LevelKey.fromURI(p.uri),b.method=p.method,b.iv=this.createInitializationVector(m),b.keyFormat="identity"),b},t.setElementaryStreamInfo=function(p,m,b,_,l,f){f===void 0&&(f=!1);var u=this.elementaryStreams,h=u[p];if(!h){u[p]={startPTS:m,endPTS:b,startDTS:_,endDTS:l,partial:f};return}h.startPTS=Math.min(h.startPTS,m),h.endPTS=Math.max(h.endPTS,b),h.startDTS=Math.min(h.startDTS,_),h.endDTS=Math.max(h.endDTS,l)},t.clearElementaryStreamInfo=function(){var p=this.elementaryStreams;p[a.AUDIO]=null,p[a.VIDEO]=null,p[a.AUDIOVIDEO]=null},d(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var p=this.sn;typeof p!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&B.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),p=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,p)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(k.isFiniteNumber)(this.programDateTime))return null;var p=Object(k.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+p*1e3}},{key:"encrypted",get:function(){var p;return!!((p=this.decryptdata)!==null&&p!==void 0&&p.keyFormat&&this.decryptdata.uri)}}]),n}(i),s=function(r){C(n,r);function n(t,g,p,m,b){var _;_=r.call(this,p)||this,_.fragOffset=0,_.duration=0,_.gap=!1,_.independent=!1,_.relurl=void 0,_.fragment=void 0,_.index=void 0,_.stats=new e.LoadStats,_.duration=t.decimalFloatingPoint("DURATION"),_.gap=t.bool("GAP"),_.independent=t.bool("INDEPENDENT"),_.relurl=t.enumeratedString("URI"),_.fragment=g,_.index=m;var l=t.enumeratedString("BYTERANGE");return l&&_.setByteRange(l,b),b&&(_.fragOffset=b.fragOffset+b.duration),_}return d(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var g=this.elementaryStreams;return!!(g.audio||g.video||g.audiovideo)}}]),n}(i)},"./src/loader/key-loader.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return B});var k=O("./src/events.ts"),w=O("./src/errors.ts"),D=O("./src/utils/logger.ts"),B=function(){function M(C){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=C,this._registerListeners()}var e=M.prototype;return e._registerListeners=function(){this.hls.on(k.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(k.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var y in this.loaders){var c=this.loaders[y];c&&c.destroy()}this.loaders={}},e.onKeyLoading=function(y,c){var d=c.frag,a=d.type,i=this.loaders[a];if(!d.decryptdata){D.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var o=d.decryptdata.uri;if(o!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(i&&(D.logger.warn("abort previous key loader for type:"+a),i.abort()),!o){D.logger.warn("key uri is falsy");return}var r=s.loader,n=d.loader=this.loaders[a]=new r(s);this.decrypturl=o,this.decryptkey=null;var t={url:o,frag:d,responseType:"arraybuffer"},g={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(t,g,p)}else this.decryptkey&&(d.decryptdata.key=this.decryptkey,this.hls.trigger(k.Events.KEY_LOADED,{frag:d}))},e.loadsuccess=function(y,c,d){var a=d.frag;if(!a.decryptdata){D.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(y.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(k.Events.KEY_LOADED,{frag:a})},e.loaderror=function(y,c){var d=c.frag,a=d.loader;a&&a.abort(),delete this.loaders[d.type],this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:d,response:y})},e.loadtimeout=function(y,c){var d=c.frag,a=d.loader;a&&a.abort(),delete this.loaders[d.type],this.hls.trigger(k.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:d})},M}()},"./src/loader/level-details.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"LevelDetails",function(){return M});var k=O("./src/polyfills/number.ts");function w(e,C){for(var y=0;y<C.length;y++){var c=C[y];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,c.key,c)}}function D(e,C,y){return C&&w(e.prototype,C),y&&w(e,y),e}var B=10,M=function(){function e(y){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=y}var C=e.prototype;return C.reloaded=function(c){if(!c){this.advanced=!0,this.updated=!0;return}var d=this.lastPartSn-c.lastPartSn,a=this.lastPartIndex-c.lastPartIndex;this.updated=this.endSN!==c.endSN||!!a||!!d,this.advanced=this.endSN>c.endSN||d>0||d===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(c.misses*.6):this.misses=c.misses+1,this.availabilityDelay=c.availabilityDelay},D(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(k.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||B}},{key:"drift",get:function(){var c=this.driftEndTime-this.driftStartTime;if(c>0){var d=this.driftEnd-this.driftStart;return d*1e3/c}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var c;return(c=this.fragments)!==null&&c!==void 0&&c.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 c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"LevelKey",function(){return M});var k=O("./node_modules/url-toolkit/src/url-toolkit.js"),w=O.n(k);function D(e,C){for(var y=0;y<C.length;y++){var c=C[y];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,c.key,c)}}function B(e,C,y){return C&&D(e.prototype,C),y&&D(e,y),e}var M=function(){e.fromURL=function(y,c){return new e(y,c)},e.fromURI=function(y){return new e(y)};function e(C,y){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,y?this._uri=Object(k.buildAbsoluteURL)(C,y,{alwaysNormalize:!0}):this._uri=C}return B(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"LoadStats",function(){return k});var k=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return n});var k=O("./src/polyfills/number.ts"),w=O("./node_modules/url-toolkit/src/url-toolkit.js"),D=O.n(w),B=O("./src/loader/fragment.ts"),M=O("./src/loader/level-details.ts"),e=O("./src/loader/level-key.ts"),C=O("./src/utils/attr-list.ts"),y=O("./src/utils/logger.ts"),c=O("./src/utils/codecs.ts"),d=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,i=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),o=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(b){var _,l;return s.test((_=(l=w.parseURL(b))===null||l===void 0?void 0:l.path)!=null?_:"")}var n=function(){function b(){}return b.findGroup=function(l,f){for(var u=0;u<l.length;u++){var h=l[u];if(h.id===f)return h}},b.convertAVC1ToAVCOTI=function(l){var f=l.split(".");if(f.length>2){var u=f.shift()+".";return u+=parseInt(f.shift()).toString(16),u+=("000"+parseInt(f.shift()).toString(16)).substr(-4),u}return l},b.resolve=function(l,f){return w.buildAbsoluteURL(f,l,{alwaysNormalize:!0})},b.parseMasterPlaylist=function(l,f){var u=[],h={},E=!1;d.lastIndex=0;for(var v;(v=d.exec(l))!=null;)if(v[1]){var S=new C.AttrList(v[1]),L={attrs:S,bitrate:S.decimalInteger("AVERAGE-BANDWIDTH")||S.decimalInteger("BANDWIDTH"),name:S.NAME,url:b.resolve(v[2],f)},I=S.decimalResolution("RESOLUTION");I&&(L.width=I.width,L.height=I.height),t((S.CODECS||"").split(/[ ,]+/).filter(function(P){return P}),L),L.videoCodec&&L.videoCodec.indexOf("avc1")!==-1&&(L.videoCodec=b.convertAVC1ToAVCOTI(L.videoCodec)),u.push(L)}else if(v[3]){var A=new C.AttrList(v[3]);A["DATA-ID"]&&(E=!0,h[A["DATA-ID"]]=A)}return{levels:u,sessionData:E?h:null}},b.parseMasterPlaylistMedia=function(l,f,u,h){h===void 0&&(h=[]);var E,v=[],S=0;for(a.lastIndex=0;(E=a.exec(l))!==null;){var L=new C.AttrList(E[1]);if(L.TYPE===u){var I={attrs:L,bitrate:0,id:S++,groupId:L["GROUP-ID"],instreamId:L["INSTREAM-ID"],name:L.NAME||L.LANGUAGE||"",type:u,default:L.bool("DEFAULT"),autoselect:L.bool("AUTOSELECT"),forced:L.bool("FORCED"),lang:L.LANGUAGE,url:L.URI?b.resolve(L.URI,f):""};if(h.length){var A=b.findGroup(h,I.groupId)||h[0];g(I,A,"audioCodec"),g(I,A,"textCodec")}v.push(I)}}return v},b.parseLevelPlaylist=function(l,f,u,h,E){var v=new M.LevelDetails(f),S=v.fragments,L=null,I=0,A=0,P=0,H=0,R=null,K=new B.Fragment(h,f),z,oe,$,fe=-1,de=!1;for(i.lastIndex=0,v.m3u8=l;(z=i.exec(l))!==null;){de&&(de=!1,K=new B.Fragment(h,f),K.start=P,K.sn=I,K.cc=H,K.level=u,L&&(K.initSegment=L,K.rawProgramDateTime=L.rawProgramDateTime));var ee=z[1];if(ee){K.duration=parseFloat(ee);var ie=(" "+z[2]).slice(1);K.title=ie||null,K.tagList.push(ie?["INF",ee,ie]:["INF",ee])}else if(z[3])Object(k.isFiniteNumber)(K.duration)&&(K.start=P,$&&(K.levelkey=$),K.sn=I,K.level=u,K.cc=H,K.urlId=E,S.push(K),K.relurl=(" "+z[3]).slice(1),m(K,R),R=K,P+=K.duration,I++,A=0,de=!0);else if(z[4]){var ge=(" "+z[4]).slice(1);R?K.setByteRange(ge,R):K.setByteRange(ge)}else if(z[5])K.rawProgramDateTime=(" "+z[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),fe===-1&&(fe=S.length);else{if(z=z[0].match(o),!z){y.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<z.length&&!(typeof z[oe]!="undefined");oe++);var Z=(" "+z[oe]).slice(1),Y=(" "+z[oe+1]).slice(1),Se=z[oe+2]?(" "+z[oe+2]).slice(1):"";switch(Z){case"PLAYLIST-TYPE":v.type=Y.toUpperCase();break;case"MEDIA-SEQUENCE":I=v.startSN=parseInt(Y);break;case"SKIP":{var Pe=new C.AttrList(Y),ke=Pe.decimalInteger("SKIPPED-SEGMENTS");if(Object(k.isFiniteNumber)(ke)){v.skippedSegments=ke;for(var Re=ke;Re--;)S.unshift(null);I+=ke}var Me=Pe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Me&&(v.recentlyRemovedDateranges=Me.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(Y);break;case"VERSION":v.version=parseInt(Y);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(Y||Se)&&K.tagList.push(Se?[Y,Se]:[Y]);break;case"DIS":H++;case"GAP":K.tagList.push([Z]);break;case"BITRATE":K.tagList.push([Z,Y]);break;case"DISCONTINUITY-SEQ":H=parseInt(Y);break;case"KEY":{var Ce,Le=new C.AttrList(Y),Ne=Le.enumeratedString("METHOD"),J=Le.URI,pe=Le.hexadecimalInteger("IV"),Te=Le.enumeratedString("KEYFORMATVERSIONS"),xe=Le.enumeratedString("KEYID"),We=(Ce=Le.enumeratedString("KEYFORMAT"))!=null?Ce:"identity",He=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(He.indexOf(We)>-1){y.logger.warn("Keyformat "+We+" is not supported from the manifest");continue}else if(We!=="identity")continue;Ne&&($=e.LevelKey.fromURL(f,J),J&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ne)>=0&&($.method=Ne,$.keyFormat=We,xe&&($.keyID=xe),Te&&($.keyFormatVersions=Te),$.iv=pe));break}case"START":{var Oe=new C.AttrList(Y),Ue=Oe.decimalFloatingPoint("TIME-OFFSET");Object(k.isFiniteNumber)(Ue)&&(v.startTimeOffset=Ue);break}case"MAP":{var Qe=new C.AttrList(Y);K.relurl=Qe.URI,Qe.BYTERANGE&&K.setByteRange(Qe.BYTERANGE),K.level=u,K.sn="initSegment",$&&(K.levelkey=$),K.initSegment=null,L=K,de=!0;break}case"SERVER-CONTROL":{var Ze=new C.AttrList(Y);v.canBlockReload=Ze.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=Ze.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&Ze.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=Ze.optionalFloat("PART-HOLD-BACK",0),v.holdBack=Ze.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Je=new C.AttrList(Y);v.partTarget=Je.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ze=v.partList;ze||(ze=v.partList=[]);var nt=A>0?ze[ze.length-1]:void 0,it=A++,je=new B.Part(new C.AttrList(Y),K,f,it,nt);ze.push(je),K.duration+=je.duration;break}case"PRELOAD-HINT":{var Ke=new C.AttrList(Y);v.preloadHint=Ke;break}case"RENDITION-REPORT":{var ae=new C.AttrList(Y);v.renditionReports=v.renditionReports||[],v.renditionReports.push(ae);break}default:y.logger.warn("line parsed but not handled: "+z);break}}}R&&!R.relurl?(S.pop(),P-=R.duration,v.partList&&(v.fragmentHint=R)):v.partList&&(m(K,R),K.cc=H,v.fragmentHint=K);var ce=S.length,ye=S[0],Q=S[ce-1];if(P+=v.skippedSegments*v.targetduration,P>0&&ce&&Q){v.averagetargetduration=P/ce;var q=Q.sn;v.endSN=q!=="initSegment"?q:0,ye&&(v.startCC=ye.cc,ye.initSegment||v.fragments.every(function(se){return se.relurl&&r(se.relurl)})&&(y.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new B.Fragment(h,f),K.relurl=Q.relurl,K.level=u,K.sn="initSegment",ye.initSegment=K,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&(P+=v.fragmentHint.duration),v.totalduration=P,v.endCC=H,fe>0&&p(S,fe),v},b}();function t(b,_){["video","audio","text"].forEach(function(l){var f=b.filter(function(h){return Object(c.isCodecType)(h,l)});if(f.length){var u=f.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});_[l+"Codec"]=u.length>0?u[0]:f[0],b=b.filter(function(h){return f.indexOf(h)===-1})}}),_.unknownCodecs=b}function g(b,_,l){var f=_[l];f&&(b[l]=f)}function p(b,_){for(var l=b[_],f=_;f--;){var u=b[f];if(!u)return;u.programDateTime=l.programDateTime-u.duration*1e3,l=u}}function m(b,_){b.rawProgramDateTime?b.programDateTime=Date.parse(b.rawProgramDateTime):_!=null&&_.programDateTime&&(b.programDateTime=_.endProgramDateTime),Object(k.isFiniteNumber)(b.programDateTime)||(b.programDateTime=null,b.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/polyfills/number.ts"),w=O("./src/events.ts"),D=O("./src/errors.ts"),B=O("./src/utils/logger.ts"),M=O("./src/utils/mp4-tools.ts"),e=O("./src/loader/m3u8-parser.ts"),C=O("./src/types/loader.ts"),y=O("./src/utils/attr-list.ts");function c(i){var o=i.type;switch(o){case C.PlaylistContextType.AUDIO_TRACK:return C.PlaylistLevelType.AUDIO;case C.PlaylistContextType.SUBTITLE_TRACK:return C.PlaylistLevelType.SUBTITLE;default:return C.PlaylistLevelType.MAIN}}function d(i,o){var s=i.url;return(s===void 0||s.indexOf("data:")===0)&&(s=o.url),s}var a=function(){function i(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var o=i.prototype;return o.registerListeners=function(){var r=this.hls;r.on(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(w.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(w.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(w.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.unregisterListeners=function(){var r=this.hls;r.off(w.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(w.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(w.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(w.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},o.createInternalLoader=function(r){var n=this.hls.config,t=n.pLoader,g=n.loader,p=t||g,m=new p(n);return r.loader=m,this.loaders[r.type]=m,m},o.getInternalLoader=function(r){return this.loaders[r.type]},o.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},o.destroyInternalLoaders=function(){for(var r in this.loaders){var n=this.loaders[r];n&&n.destroy(),this.resetInternalLoader(r)}},o.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},o.onManifestLoading=function(r,n){var t=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:C.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},o.onLevelLoading=function(r,n){var t=n.id,g=n.level,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:null,level:g,responseType:"text",type:C.PlaylistContextType.LEVEL,url:p,deliveryDirectives:m})},o.onAudioTrackLoading=function(r,n){var t=n.id,g=n.groupId,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:g,level:null,responseType:"text",type:C.PlaylistContextType.AUDIO_TRACK,url:p,deliveryDirectives:m})},o.onSubtitleTrackLoading=function(r,n){var t=n.id,g=n.groupId,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:g,level:null,responseType:"text",type:C.PlaylistContextType.SUBTITLE_TRACK,url:p,deliveryDirectives:m})},o.load=function(r){var n,t=this.hls.config,g=this.getInternalLoader(r);if(g){var p=g.context;if(p&&p.url===r.url){B.logger.trace("[playlist-loader]: playlist request ongoing");return}B.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),g.abort()}var m,b,_,l;switch(r.type){case C.PlaylistContextType.MANIFEST:m=t.manifestLoadingMaxRetry,b=t.manifestLoadingTimeOut,_=t.manifestLoadingRetryDelay,l=t.manifestLoadingMaxRetryTimeout;break;case C.PlaylistContextType.LEVEL:case C.PlaylistContextType.AUDIO_TRACK:case C.PlaylistContextType.SUBTITLE_TRACK:m=0,b=t.levelLoadingTimeOut;break;default:m=t.levelLoadingMaxRetry,b=t.levelLoadingTimeOut,_=t.levelLoadingRetryDelay,l=t.levelLoadingMaxRetryTimeout;break}if(g=this.createInternalLoader(r),(n=r.deliveryDirectives)!==null&&n!==void 0&&n.part){var f;if(r.type===C.PlaylistContextType.LEVEL&&r.level!==null?f=this.hls.levels[r.level].details:r.type===C.PlaylistContextType.AUDIO_TRACK&&r.id!==null?f=this.hls.audioTracks[r.id].details:r.type===C.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(f=this.hls.subtitleTracks[r.id].details),f){var u=f.partTarget,h=f.targetduration;u&&h&&(b=Math.min(Math.max(u*3,h*.8)*1e3,b))}}var E={timeout:b,maxRetry:m,retryDelay:_,maxRetryDelay:l,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};g.load(r,E,v)},o.loadsuccess=function(r,n,t,g){if(g===void 0&&(g=null),t.isSidxRequest){this.handleSidxRequest(r,t),this.handlePlaylistLoaded(r,n,t,g);return}this.resetInternalLoader(t.type);var p=r.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,"no EXTM3U delimiter",g);return}n.parsing.start=performance.now(),p.indexOf("#EXTINF:")>0||p.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,n,t,g):this.handleMasterPlaylist(r,n,t,g)},o.loaderror=function(r,n,t){t===void 0&&(t=null),this.handleNetworkError(n,t,!1,r)},o.loadtimeout=function(r,n,t){t===void 0&&(t=null),this.handleNetworkError(n,t,!0)},o.handleMasterPlaylist=function(r,n,t,g){var p=this.hls,m=r.data,b=d(r,t),_=e.default.parseMasterPlaylist(m,b),l=_.levels,f=_.sessionData;if(!l.length){this.handleManifestParsingError(r,t,"no level found in manifest",g);return}var u=l.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),h=l.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),E=e.default.parseMasterPlaylistMedia(m,b,"AUDIO",u),v=e.default.parseMasterPlaylistMedia(m,b,"SUBTITLES",h),S=e.default.parseMasterPlaylistMedia(m,b,"CLOSED-CAPTIONS");if(E.length){var L=E.some(function(I){return!I.url});!L&&l[0].audioCodec&&!l[0].attrs.AUDIO&&(B.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new y.AttrList({}),bitrate:0,url:""}))}p.trigger(w.Events.MANIFEST_LOADED,{levels:l,audioTracks:E,subtitles:v,captions:S,url:b,stats:n,networkDetails:g,sessionData:f})},o.handleTrackOrLevelPlaylist=function(r,n,t,g){var p=this.hls,m=t.id,b=t.level,_=t.type,l=d(r,t),f=Object(k.isFiniteNumber)(m)?m:0,u=Object(k.isFiniteNumber)(b)?b:f,h=c(t),E=e.default.parseLevelPlaylist(r.data,l,u,h,f);if(!E.fragments.length){p.trigger(w.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:l,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(_===C.PlaylistContextType.MANIFEST){var v={attrs:new y.AttrList({}),bitrate:0,details:E,name:"",url:l};p.trigger(w.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:l,stats:n,networkDetails:g,sessionData:null})}if(n.parsing.end=performance.now(),E.needSidxRanges){var S,L=(S=E.fragments[0].initSegment)===null||S===void 0?void 0:S.url;this.load({url:L,isSidxRequest:!0,type:_,level:b,levelDetails:E,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=E,this.handlePlaylistLoaded(r,n,t,g)},o.handleSidxRequest=function(r,n){var t=Object(M.parseSegmentIndex)(new Uint8Array(r.data));if(!t)return;var g=t.references,p=n.levelDetails;g.forEach(function(m,b){var _=m.info,l=p.fragments[b];l.byteRange.length===0&&l.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),l.initSegment&&l.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},o.handleManifestParsingError=function(r,n,t,g){this.hls.trigger(w.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===C.PlaylistContextType.MANIFEST,url:r.url,reason:t,response:r,context:n,networkDetails:g})},o.handleNetworkError=function(r,n,t,g){t===void 0&&(t=!1),B.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var p=D.ErrorDetails.UNKNOWN,m=!1,b=this.getInternalLoader(r);switch(r.type){case C.PlaylistContextType.MANIFEST:p=t?D.ErrorDetails.MANIFEST_LOAD_TIMEOUT:D.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case C.PlaylistContextType.LEVEL:p=t?D.ErrorDetails.LEVEL_LOAD_TIMEOUT:D.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case C.PlaylistContextType.AUDIO_TRACK:p=t?D.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case C.PlaylistContextType.SUBTITLE_TRACK:p=t?D.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:D.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}b&&this.resetInternalLoader(r.type);var _={type:D.ErrorTypes.NETWORK_ERROR,details:p,fatal:m,url:r.url,loader:b,context:r,networkDetails:n};g&&(_.response=g),this.hls.trigger(w.Events.ERROR,_)},o.handlePlaylistLoaded=function(r,n,t,g){var p=t.type,m=t.level,b=t.id,_=t.groupId,l=t.loader,f=t.levelDetails,u=t.deliveryDirectives;if(!(f!=null&&f.targetduration)){this.handleManifestParsingError(r,t,"invalid target duration",g);return}if(!l)return;f.live&&(l.getCacheAge&&(f.ageHeader=l.getCacheAge()||0),(!l.getCacheAge||isNaN(f.ageHeader))&&(f.ageHeader=0));switch(p){case C.PlaylistContextType.MANIFEST:case C.PlaylistContextType.LEVEL:this.hls.trigger(w.Events.LEVEL_LOADED,{details:f,level:m||0,id:b||0,stats:n,networkDetails:g,deliveryDirectives:u});break;case C.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(w.Events.AUDIO_TRACK_LOADED,{details:f,id:b||0,groupId:_||"",stats:n,networkDetails:g,deliveryDirectives:u});break;case C.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(w.Events.SUBTITLE_TRACK_LOADED,{details:f,id:b||0,groupId:_||"",stats:n,networkDetails:g,deliveryDirectives:u});break}},i}();W.default=a},"./src/polyfills/number.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"isFiniteNumber",function(){return k}),O.d(W,"MAX_SAFE_INTEGER",function(){return w});var k=Number.isFinite||function(D){return typeof D=="number"&&isFinite(D)},w=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,W,O){"use strict";O.r(W);var k=function(){function w(){}return w.getSilentFrame=function(B,M){switch(B){case"mp4a.40.2":if(M===1)return new Uint8Array([0,200,0,128,35,128]);if(M===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(M===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(M===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(M===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(M===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(M===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(M===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(M===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},w}();W.default=k},"./src/remux/mp4-generator.ts":function(ne,W,O){"use strict";O.r(W);var k=Math.pow(2,32)-1,w=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 M;for(M in D.types)D.types.hasOwnProperty(M)&&(D.types[M]=[M.charCodeAt(0),M.charCodeAt(1),M.charCodeAt(2),M.charCodeAt(3)]);var e=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),C=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);D.HDLR_TYPES={video:e,audio:C};var y=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c=new Uint8Array([0,0,0,0,0,0,0,0]);D.STTS=D.STSC=D.STCO=c,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 d=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);D.FTYP=D.box(D.types.ftyp,d,i,d,a),D.DINF=D.box(D.types.dinf,D.box(D.types.dref,y))},D.box=function(M){for(var e=8,C=arguments.length,y=new Array(C>1?C-1:0),c=1;c<C;c++)y[c-1]=arguments[c];for(var d=y.length,a=d;d--;)e+=y[d].byteLength;var i=new Uint8Array(e);for(i[0]=e>>24&255,i[1]=e>>16&255,i[2]=e>>8&255,i[3]=e&255,i.set(M,4),d=0,e=8;d<a;d++)i.set(y[d],e),e+=y[d].byteLength;return i},D.hdlr=function(M){return D.box(D.types.hdlr,D.HDLR_TYPES[M])},D.mdat=function(M){return D.box(D.types.mdat,M)},D.mdhd=function(M,e){e*=M;var C=Math.floor(e/(k+1)),y=Math.floor(e%(k+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,M>>24&255,M>>16&255,M>>8&255,M&255,C>>24,C>>16&255,C>>8&255,C&255,y>>24,y>>16&255,y>>8&255,y&255,85,196,0,0]))},D.mdia=function(M){return D.box(D.types.mdia,D.mdhd(M.timescale,M.duration),D.hdlr(M.type),D.minf(M))},D.mfhd=function(M){return D.box(D.types.mfhd,new Uint8Array([0,0,0,0,M>>24,M>>16&255,M>>8&255,M&255]))},D.minf=function(M){return M.type==="audio"?D.box(D.types.minf,D.box(D.types.smhd,D.SMHD),D.DINF,D.stbl(M)):D.box(D.types.minf,D.box(D.types.vmhd,D.VMHD),D.DINF,D.stbl(M))},D.moof=function(M,e,C){return D.box(D.types.moof,D.mfhd(M),D.traf(C,e))},D.moov=function(M){for(var e=M.length,C=[];e--;)C[e]=D.trak(M[e]);return D.box.apply(null,[D.types.moov,D.mvhd(M[0].timescale,M[0].duration)].concat(C).concat(D.mvex(M)))},D.mvex=function(M){for(var e=M.length,C=[];e--;)C[e]=D.trex(M[e]);return D.box.apply(null,[D.types.mvex].concat(C))},D.mvhd=function(M,e){e*=M;var C=Math.floor(e/(k+1)),y=Math.floor(e%(k+1)),c=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,M>>24&255,M>>16&255,M>>8&255,M&255,C>>24,C>>16&255,C>>8&255,C&255,y>>24,y>>16&255,y>>8&255,y&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,c)},D.sdtp=function(M){var e=M.samples||[],C=new Uint8Array(4+e.length),y,c;for(y=0;y<e.length;y++)c=e[y].flags,C[y+4]=c.dependsOn<<4|c.isDependedOn<<2|c.hasRedundancy;return D.box(D.types.sdtp,C)},D.stbl=function(M){return D.box(D.types.stbl,D.stsd(M),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(M){var e=[],C=[],y,c,d;for(y=0;y<M.sps.length;y++)c=M.sps[y],d=c.byteLength,e.push(d>>>8&255),e.push(d&255),e=e.concat(Array.prototype.slice.call(c));for(y=0;y<M.pps.length;y++)c=M.pps[y],d=c.byteLength,C.push(d>>>8&255),C.push(d&255),C=C.concat(Array.prototype.slice.call(c));var a=D.box(D.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|M.sps.length].concat(e).concat([M.pps.length]).concat(C))),i=M.width,o=M.height,s=M.pixelRatio[0],r=M.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,i>>8&255,i&255,o>>8&255,o&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,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(M){var e=M.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(M.config).concat([6,1,2]))},D.mp4a=function(M){var e=M.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,M.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),D.box(D.types.esds,D.esds(M)))},D.mp3=function(M){var e=M.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,M.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},D.stsd=function(M){return M.type==="audio"?!M.isAAC&&M.codec==="mp3"?D.box(D.types.stsd,D.STSD,D.mp3(M)):D.box(D.types.stsd,D.STSD,D.mp4a(M)):D.box(D.types.stsd,D.STSD,D.avc1(M))},D.tkhd=function(M){var e=M.id,C=M.duration*M.timescale,y=M.width,c=M.height,d=Math.floor(C/(k+1)),a=Math.floor(C%(k+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,d>>24,d>>16&255,d>>8&255,d&255,a>>24,a>>16&255,a>>8&255,a&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,y>>8&255,y&255,0,0,c>>8&255,c&255,0,0]))},D.traf=function(M,e){var C=D.sdtp(M),y=M.id,c=Math.floor(e/(k+1)),d=Math.floor(e%(k+1));return D.box(D.types.traf,D.box(D.types.tfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255])),D.box(D.types.tfdt,new Uint8Array([1,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,d>>24,d>>16&255,d>>8&255,d&255])),D.trun(M,C.length+16+20+8+16+8+8),C)},D.trak=function(M){return M.duration=M.duration||4294967295,D.box(D.types.trak,D.tkhd(M),D.mdia(M))},D.trex=function(M){var e=M.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(M,e){var C=M.samples||[],y=C.length,c=12+16*y,d=new Uint8Array(c),a,i,o,s,r,n;for(e+=8+c,d.set([0,0,15,1,y>>>24&255,y>>>16&255,y>>>8&255,y&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),a=0;a<y;a++)i=C[a],o=i.duration,s=i.size,r=i.flags,n=i.cts,d.set([o>>>24&255,o>>>16&255,o>>>8&255,o&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,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*a);return D.box(D.types.trun,d)},D.initSegment=function(M){D.types||D.init();var e=D.moov(M),C=new Uint8Array(D.FTYP.byteLength+e.byteLength);return C.set(D.FTYP),C.set(e,D.FTYP.byteLength),C},D}();w.types=void 0,w.HDLR_TYPES=void 0,w.STTS=void 0,w.STSC=void 0,w.STCO=void 0,w.STSZ=void 0,w.VMHD=void 0,w.SMHD=void 0,w.STSD=void 0,w.FTYP=void 0,w.DINF=void 0,W.default=w},"./src/remux/mp4-remuxer.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return n}),O.d(W,"normalizePts",function(){return t});var k=O("./src/polyfills/number.ts"),w=O("./src/remux/aac-helper.ts"),D=O("./src/remux/mp4-generator.ts"),B=O("./src/events.ts"),M=O("./src/errors.ts"),e=O("./src/utils/logger.ts"),C=O("./src/types/loader.ts"),y=O("./src/utils/timescale-conversion.ts");function c(){return c=Object.assign||function(b){for(var _=1;_<arguments.length;_++){var l=arguments[_];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(b[f]=l[f])}return b},c.apply(this,arguments)}var d=10*1e3,a=1024,i=1152,o=null,s=null,r=!1,n=function(){function b(l,f,u,h){if(h===void 0&&(h=""),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=l,this.config=f,this.typeSupported=u,this.ISGenerated=!1,o===null){var E=navigator.userAgent||"",v=E.match(/Chrome\/(\d+)/i);o=v?parseInt(v[1]):0}if(s===null){var S=navigator.userAgent.match(/Safari\/(\d+)/i);s=S?parseInt(S[1]):0}r=!!o&&o<75||!!s&&s<600}var _=b.prototype;return _.destroy=function(){},_.resetTimeStamp=function(f){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=f},_.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(f){var u=!1,h=f.reduce(function(E,v){var S=v.pts-E;return S<-4294967296?(u=!0,t(E,v.pts)):S>0?E:v.pts},f[0].pts);return u&&e.logger.debug("PTS rollover detected"),h},_.remux=function(f,u,h,E,v,S,L,I){var A,P,H,R,K,z,oe=v,$=v,fe=f.pid>-1,de=u.pid>-1,ee=u.samples.length,ie=f.samples.length>0,ge=ee>1,Z=(!fe||ie)&&(!de||ge)||this.ISGenerated||L;if(Z){this.ISGenerated||(H=this.generateIS(f,u,v));var Y=this.isVideoContiguous,Se=-1;if(ge&&(Se=g(u.samples),!Y&&this.config.forceKeyFrameOnDiscontinuity))if(z=!0,Se>0){e.logger.warn("[mp4-remuxer]: Dropped "+Se+" out of "+ee+" video samples due to a missing keyframe");var Pe=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(Se),u.dropped+=Se,$+=(u.samples[0].pts-Pe)/(u.timescale||9e4)}else Se===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+ee+" video samples"),z=!1);if(this.ISGenerated){if(ie&&ge){var ke=this.getVideoStartPts(u.samples),Re=t(f.samples[0].pts,ke)-ke,Me=Re/u.inputTimeScale;oe+=Math.max(0,Me),$+=Math.max(0,-Me)}if(ie){if(f.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(f,u,v)),P=this.remuxAudio(f,oe,this.isAudioContiguous,S,de||ge||I===C.PlaylistLevelType.AUDIO?$:void 0),ge){var Ce=P?P.endPTS-P.startPTS:0;u.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(f,u,v)),A=this.remuxVideo(u,$,Y,Ce)}}else ge&&(A=this.remuxVideo(u,$,Y,0));A&&(A.firstKeyFrame=Se,A.independent=Se!==-1)}}return this.ISGenerated&&(h.samples.length&&(K=this.remuxID3(h,v)),E.samples.length&&(R=this.remuxText(E,v))),{audio:P,video:A,initSegment:H,independent:z,text:R,id3:K}},_.generateIS=function(f,u,h){var E=f.samples,v=u.samples,S=this.typeSupported,L={},I=!Object(k.isFiniteNumber)(this._initPTS),A="audio/mp4",P,H,R;if(I&&(P=H=Infinity),f.config&&E.length&&(f.timescale=f.samplerate,f.isAAC||(S.mpeg?(A="audio/mpeg",f.codec=""):S.mp3&&(f.codec="mp3")),L.audio={id:"audio",container:A,codec:f.codec,initSegment:!f.isAAC&&S.mpeg?new Uint8Array(0):D.default.initSegment([f]),metadata:{channelCount:f.channelCount}},I&&(R=f.inputTimeScale,P=H=E[0].pts-Math.round(R*h))),u.sps&&u.pps&&v.length&&(u.timescale=u.inputTimeScale,L.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:D.default.initSegment([u]),metadata:{width:u.width,height:u.height}},I)){R=u.inputTimeScale;var K=this.getVideoStartPts(v),z=Math.round(R*h);H=Math.min(H,t(v[0].dts,K)-z),P=Math.min(P,K-z)}if(Object.keys(L).length)return this.ISGenerated=!0,I&&(this._initPTS=P,this._initDTS=H),{tracks:L,initPTS:P,timescale:R}},_.remuxVideo=function(f,u,h,E){var v=f.inputTimeScale,S=f.samples,L=[],I=S.length,A=this._initPTS,P=this.nextAvcDts,H=8,R,K,z,oe=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,fe=0,de=!1;if(!h||P===null){var ee=u*v,ie=S[0].pts-t(S[0].dts,S[0].pts);P=ee-ie}for(var ge=0;ge<I;ge++){var Z=S[ge];if(Z.pts=t(Z.pts-A,P),Z.dts=t(Z.dts-A,P),Z.dts>Z.pts){var Y=9e4*.2;fe=Math.max(Math.min(fe,Z.pts-Z.dts),-1*Y)}Z.dts<S[ge>0?ge-1:ge].dts&&(de=!0)}de&&S.sort(function(_t,xt){var rt=_t.dts-xt.dts,Yt=_t.pts-xt.pts;return rt||Yt}),K=S[0].dts,z=S[S.length-1].dts;var Se=Math.round((z-K)/(I-1));if(fe<0){if(fe<Se*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(y.toMsFromMpegTsClock)(-Se,!0)+" ms");for(var Pe=fe,ke=0;ke<I;ke++)S[ke].dts=Pe=Math.max(Pe,S[ke].pts-Se),S[ke].pts=Math.max(Pe,S[ke].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(y.toMsFromMpegTsClock)(fe,!0)+" ms to overcome this issue");for(var Re=0;Re<I;Re++)S[Re].dts=S[Re].dts+fe}K=S[0].dts}if(h){var Me=K-P,Ce=Me>Se,Le=Me<-1;if(Ce||Le){Ce?e.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(Me,!0)+" ms ("+Me+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(y.toMsFromMpegTsClock)(-Me,!0)+" ms ("+Me+"dts) overlapping between fragments detected"),K=P;var Ne=S[0].pts-Me;S[0].dts=K,S[0].pts=Ne,e.logger.log("Video: First PTS/DTS adjusted: "+Object(y.toMsFromMpegTsClock)(Ne,!0)+"/"+Object(y.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(y.toMsFromMpegTsClock)(Me,!0)+" ms")}}r&&(K=Math.max(0,K));for(var J=0,pe=0,Te=0;Te<I;Te++){for(var xe=S[Te],We=xe.units,He=We.length,Oe=0,Ue=0;Ue<He;Ue++)Oe+=We[Ue].data.length;pe+=Oe,J+=He,xe.length=Oe,xe.dts=Math.max(xe.dts,K),xe.pts=Math.max(xe.pts,xe.dts,0),oe=Math.min(xe.pts,oe),$=Math.max(xe.pts,$)}z=S[I-1].dts;var Qe=pe+4*J+8,Ze;try{Ze=new Uint8Array(Qe)}catch(_t){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Qe,reason:"fail allocating video mdat "+Qe});return}var Je=new DataView(Ze.buffer);Je.setUint32(0,Qe),Ze.set(D.default.types.mdat,4);for(var ze=0;ze<I;ze++){for(var nt=S[ze],it=nt.units,je=0,Ke=0,ae=it.length;Ke<ae;Ke++){var ce=it[Ke],ye=ce.data,Q=ce.data.byteLength;Je.setUint32(H,Q),H+=4,Ze.set(ye,H),H+=Q,je+=4+Q}if(ze<I-1)R=S[ze+1].dts-nt.dts;else{var q=this.config,se=nt.dts-S[ze>0?ze-1:ze].dts;if(q.stretchShortVideoTrack&&this.nextAudioPts!==null){var me=Math.floor(q.maxBufferHole*v),De=(E?oe+E*v:this.nextAudioPts)-nt.pts;De>me?(R=De-se,R<0&&(R=se),e.logger.log("[mp4-remuxer]: It is approximately "+De/90+" ms to the next segment; using duration "+R/90+" ms for the last video frame.")):R=se}else R=se}var Be=Math.round(nt.pts-nt.dts);L.push(new p(nt.key,R,je,Be))}if(L.length&&o&&o<70){var Xe=L[0].flags;Xe.dependsOn=2,Xe.isNonSync=0}console.assert(R!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=P=z+R,this.isVideoContiguous=!0;var ut=D.default.moof(f.sequenceNumber++,K,c({},f,{samples:L})),vt="video",dt={data1:ut,data2:Ze,startPTS:oe/v,endPTS:($+R)/v,startDTS:K/v,endDTS:P/v,type:vt,hasAudio:!1,hasVideo:!0,nb:L.length,dropped:f.dropped};return f.samples=[],f.dropped=0,console.assert(Ze.length,"MDAT length must not be zero"),dt},_.remuxAudio=function(f,u,h,E,v){var S=f.inputTimeScale,L=f.samplerate?f.samplerate:S,I=S/L,A=f.isAAC?a:i,P=A*I,H=this._initPTS,R=!f.isAAC&&this.typeSupported.mpeg,K=[],z=f.samples,oe=R?0:8,$=this.nextAudioPts||-1,fe=u*S;if(this.isAudioContiguous=h=h||z.length&&$>0&&(E&&Math.abs(fe-$)<9e3||Math.abs(t(z[0].pts-H,fe)-$)<20*P),z.forEach(function(ye){ye.pts=t(ye.pts-H,fe)}),!h||$<0){if(z=z.filter(function(ye){return ye.pts>=0}),!z.length)return;v===0?$=0:E?$=Math.max(0,fe):$=z[0].pts}if(f.isAAC)for(var de=v!==void 0,ee=this.config.maxAudioFramesDrift,ie=0,ge=$;ie<z.length;ie++){var Z=z[ie],Y=Z.pts,Se=Y-ge,Pe=Math.abs(1e3*Se/S);if(Se<=-ee*P&&de)ie===0&&(e.logger.warn("Audio frame @ "+(Y/S).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Se/S)+" ms."),this.nextAudioPts=$=ge=Y);else if(Se>=ee*P&&Pe<d&&de){var ke=Math.round(Se/P);ge=Y-ke*P,ge<0&&(ke--,ge+=P),ie===0&&(this.nextAudioPts=$=ge),e.logger.warn("[mp4-remuxer]: Injecting "+ke+" audio frame @ "+(ge/S).toFixed(3)+"s due to "+Math.round(1e3*Se/S)+" ms gap.");for(var Re=0;Re<ke;Re++){var Me=Math.max(ge,0),Ce=w.default.getSilentFrame(f.manifestCodec||f.codec,f.channelCount);Ce||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ce=Z.unit.subarray()),z.splice(ie,0,{unit:Ce,pts:Me}),ge+=P,ie++}}Z.pts=ge,ge+=P}for(var Le=null,Ne=null,J,pe=0,Te=z.length;Te--;)pe+=z[Te].unit.byteLength;for(var xe=0,We=z.length;xe<We;xe++){var He=z[xe],Oe=He.unit,Ue=He.pts;if(Ne!==null){var Qe=K[xe-1];Qe.duration=Math.round((Ue-Ne)/I)}else if(h&&f.isAAC&&(Ue=$),Le=Ue,pe>0){pe+=oe;try{J=new Uint8Array(pe)}catch(ye){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:M.ErrorTypes.MUX_ERROR,details:M.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:pe,reason:"fail allocating audio mdat "+pe});return}if(!R){var Ze=new DataView(J.buffer);Ze.setUint32(0,pe),J.set(D.default.types.mdat,4)}}else return;J.set(Oe,oe);var Je=Oe.byteLength;oe+=Je,K.push(new p(!0,A,Je,0)),Ne=Ue}var ze=K.length;if(!ze)return;var nt=K[K.length-1];this.nextAudioPts=$=Ne+I*nt.duration;var it=R?new Uint8Array(0):D.default.moof(f.sequenceNumber++,Le/I,c({},f,{samples:K}));f.samples=[];var je=Le/S,Ke=$/S,ae="audio",ce={data1:it,data2:J,startPTS:je,endPTS:Ke,startDTS:je,endDTS:Ke,type:ae,hasAudio:!0,hasVideo:!1,nb:ze};return this.isAudioContiguous=!0,console.assert(J.length,"MDAT length must not be zero"),ce},_.remuxEmptyAudio=function(f,u,h,E){var v=f.inputTimeScale,S=f.samplerate?f.samplerate:v,L=v/S,I=this.nextAudioPts,A=(I!==null?I:E.startDTS*v)+this._initDTS,P=E.endDTS*v+this._initDTS,H=L*a,R=Math.ceil((P-A)/H),K=w.default.getSilentFrame(f.manifestCodec||f.codec,f.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!K){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=[],oe=0;oe<R;oe++){var $=A+oe*H;z.push({unit:K,pts:$,dts:$})}return f.samples=z,this.remuxAudio(f,u,h,!1)},_.remuxID3=function(f,u){var h=f.samples.length;if(!h)return;for(var E=f.inputTimeScale,v=this._initPTS,S=this._initDTS,L=0;L<h;L++){var I=f.samples[L];I.pts=t(I.pts-v,u*E)/E,I.dts=t(I.dts-S,u*E)/E}var A=f.samples;return f.samples=[],{samples:A}},_.remuxText=function(f,u){var h=f.samples.length;if(!h)return;for(var E=f.inputTimeScale,v=this._initPTS,S=0;S<h;S++){var L=f.samples[S];L.pts=t(L.pts-v,u*E)/E}f.samples.sort(function(A,P){return A.pts-P.pts});var I=f.samples;return f.samples=[],{samples:I}},b}();function t(b,_){var l;if(_===null)return b;for(_<b?l=-8589934592:l=8589934592;Math.abs(b-_)>4294967296;)b+=l;return b}function g(b){for(var _=0;_<b.length;_++)if(b[_].key)return _;return-1}var p=function(_,l,f,u){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=l,this.size=f,this.cts=u,this.flags=new m(_)},m=function(_){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=_?2:1,this.isNonSync=_?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/polyfills/number.ts"),w=O("./src/utils/mp4-tools.ts"),D=O("./src/loader/fragment.ts"),B=O("./src/utils/logger.ts"),M=function(){function y(){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 c=y.prototype;return c.destroy=function(){},c.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},c.resetNextTimestamp=function(){this.lastEndDTS=null},c.resetInitSegment=function(a,i,o){this.audioCodec=i,this.videoCodec=o,this.generateInitSegment(a),this.emitInitSegment=!0},c.generateInitSegment=function(a){var i=this.audioCodec,o=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(w.parseInitSegment)(a);i||(i=C(s.audio,D.ElementaryStreamTypes.AUDIO)),o||(o=C(s.video,D.ElementaryStreamTypes.VIDEO));var r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:i+","+o,initSegment:a,id:"main"}:s.audio?r.audio={container:"audio/mp4",codec:i,initSegment:a,id:"audio"}:s.video?r.video={container:"video/mp4",codec:o,initSegment:a,id:"main"}:B.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},c.remux=function(a,i,o,s,r){var n=this.initPTS,t=this.lastEndDTS,g={audio:void 0,video:void 0,text:s,id3:o,initSegment:void 0};Object(k.isFiniteNumber)(t)||(t=this.lastEndDTS=r||0);var p=i.samples;if(!p||!p.length)return g;var m={initPTS:void 0,timescale:1},b=this.initData;if((!b||!b.length)&&(this.generateInitSegment(p),b=this.initData),!b||!b.length)return B.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),g;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(k.isFiniteNumber)(n)||(this.initPTS=m.initPTS=n=e(b,p,t));var _=Object(w.getDuration)(p,b),l=t,f=_+l;Object(w.offsetStartDTS)(b,p,n),_>0?this.lastEndDTS=f:(B.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!b.audio,h=!!b.video,E="";u&&(E+="audio"),h&&(E+="video");var v={data1:p,startPTS:l,startDTS:l,endPTS:f,endDTS:f,type:E,hasAudio:u,hasVideo:h,nb:1,dropped:0};return g.audio=v.type==="audio"?v:void 0,g.video=v.type!=="audio"?v:void 0,g.text=s,g.id3=o,g.initSegment=m,g},y}(),e=function(c,d,a){return Object(w.getStartDTS)(c,d)-a};function C(y,c){var d=y==null?void 0:y.codec;return d&&d.length>4?d:d==="hvc1"?"hvc1.1.c.L120.90":d==="av01"?"av01.0.04M.08":d==="avc1"||c===D.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}W.default=M},"./src/task-loop.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return k});var k=function(){function w(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var D=w.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(M){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,M),!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(){},w}()},"./src/types/cmcd.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"CMCDVersion",function(){return k}),O.d(W,"CMCDObjectType",function(){return w}),O.d(W,"CMCDStreamingFormat",function(){return D}),O.d(W,"CMCDStreamType",function(){return B});var k=1,w;(function(M){M.MANIFEST="m",M.AUDIO="a",M.VIDEO="v",M.MUXED="av",M.INIT="i",M.CAPTION="c",M.TIMED_TEXT="tt",M.KEY="k",M.OTHER="o"})(w||(w={}));var D;(function(M){M.DASH="d",M.HLS="h",M.SMOOTH="s",M.OTHER="o"})(D||(D={}));var B;(function(M){M.VOD="v",M.LIVE="l"})(B||(B={}))},"./src/types/level.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"HlsSkip",function(){return D}),O.d(W,"getSkipValue",function(){return B}),O.d(W,"HlsUrlParameters",function(){return M}),O.d(W,"Level",function(){return e});function k(C,y){for(var c=0;c<y.length;c++){var d=y[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(C,d.key,d)}}function w(C,y,c){return y&&k(C.prototype,y),c&&k(C,c),C}var D;(function(C){C.No="",C.Yes="YES",C.v2="v2"})(D||(D={}));function B(C,y){var c=C.canSkipUntil,d=C.canSkipDateRanges,a=C.endSN,i=y!==void 0?y-a:0;return c&&i<c?d?D.v2:D.Yes:D.No}var M=function(){function C(c,d,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=c,this.part=d,this.skip=a}var y=C.prototype;return y.addDirectives=function(d){var a=new self.URL(d);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},C}(),e=function(){function C(y){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=[y.url],this.attrs=y.attrs,this.bitrate=y.bitrate,y.details&&(this.details=y.details),this.id=y.id||0,this.name=y.name,this.width=y.width||0,this.height=y.height||0,this.audioCodec=y.audioCodec,this.videoCodec=y.videoCodec,this.unknownCodecs=y.unknownCodecs,this.codecSet=[y.videoCodec,y.audioCodec].filter(function(c){return c}).join(",").replace(/\.[^.,]+/g,"")}return w(C,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(c){var d=c%this.url.length;this._urlId!==d&&(this.details=void 0,this._urlId=d)}}]),C}()},"./src/types/loader.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"PlaylistContextType",function(){return k}),O.d(W,"PlaylistLevelType",function(){return w});var k;(function(D){D.MANIFEST="manifest",D.LEVEL="level",D.AUDIO_TRACK="audioTrack",D.SUBTITLE_TRACK="subtitleTrack"})(k||(k={}));var w;(function(D){D.MAIN="main",D.AUDIO="audio",D.SUBTITLE="subtitle"})(w||(w={}))},"./src/types/transmuxer.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"ChunkMetadata",function(){return k});var k=function(B,M,e,C,y,c){C===void 0&&(C=0),y===void 0&&(y=-1),c===void 0&&(c=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=w(),this.buffering={audio:w(),video:w(),audiovideo:w()},this.level=B,this.sn=M,this.id=e,this.size=C,this.part=y,this.partial=c};function w(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"AttrList",function(){return D});var k=/^(\d+)x(\d+)$/,w=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,D=function(){function B(e){typeof e=="string"&&(e=B.parseAttrList(e));for(var C in e)e.hasOwnProperty(C)&&(this[C]=e[C])}var M=B.prototype;return M.decimalInteger=function(C){var y=parseInt(this[C],10);return y>Number.MAX_SAFE_INTEGER?Infinity:y},M.hexadecimalInteger=function(C){if(this[C]){var y=(this[C]||"0x").slice(2);y=(y.length&1?"0":"")+y;for(var c=new Uint8Array(y.length/2),d=0;d<y.length/2;d++)c[d]=parseInt(y.slice(d*2,d*2+2),16);return c}else return null},M.hexadecimalIntegerAsNumber=function(C){var y=parseInt(this[C],16);return y>Number.MAX_SAFE_INTEGER?Infinity:y},M.decimalFloatingPoint=function(C){return parseFloat(this[C])},M.optionalFloat=function(C,y){var c=this[C];return c?parseFloat(c):y},M.enumeratedString=function(C){return this[C]},M.bool=function(C){return this[C]==="YES"},M.decimalResolution=function(C){var y=k.exec(this[C]);return y===null?void 0:{width:parseInt(y[1],10),height:parseInt(y[2],10)}},B.parseAttrList=function(C){var y,c={},d='"';for(w.lastIndex=0;(y=w.exec(C))!==null;){var a=y[2];a.indexOf(d)===0&&a.lastIndexOf(d)===a.length-1&&(a=a.slice(1,-1)),c[y[1]]=a}return c},B}()},"./src/utils/binary-search.ts":function(ne,W,O){"use strict";O.r(W);var k={search:function(D,B){for(var M=0,e=D.length-1,C=null,y=null;M<=e;){C=(M+e)/2|0,y=D[C];var c=B(y);if(c>0)M=C+1;else if(c<0)e=C-1;else return y}return null}};W.default=k},"./src/utils/buffer-helper.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"BufferHelper",function(){return D});var k=O("./src/utils/logger.ts"),w={length:0,start:function(){return 0},end:function(){return 0}},D=function(){function B(){}return B.isBuffered=function(e,C){try{if(e){for(var y=B.getBuffered(e),c=0;c<y.length;c++)if(C>=y.start(c)&&C<=y.end(c))return!0}}catch(d){}return!1},B.bufferInfo=function(e,C,y){try{if(e){var c=B.getBuffered(e),d=[],a;for(a=0;a<c.length;a++)d.push({start:c.start(a),end:c.end(a)});return this.bufferedInfo(d,C,y)}}catch(i){}return{len:0,start:C,end:C,nextStart:void 0}},B.bufferedInfo=function(e,C,y){C=Math.max(0,C),e.sort(function(m,b){var _=m.start-b.start;return _||b.end-m.end});var c=[];if(y)for(var d=0;d<e.length;d++){var a=c.length;if(a){var i=c[a-1].end;e[d].start-i<y?e[d].end>i&&(c[a-1].end=e[d].end):c.push(e[d])}else c.push(e[d])}else c=e;for(var o=0,s,r=C,n=C,t=0;t<c.length;t++){var g=c[t].start,p=c[t].end;if(C+y>=g&&C<p)r=g,n=p,o=n-C;else if(C+y<g){s=g;break}}return{len:o,start:r||0,end:n||0,nextStart:s}},B.getBuffered=function(e){try{return e.buffered}catch(C){return k.logger.log("failed to get media.buffered",C),w}},B}()},"./src/utils/cea-608-parser.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"Row",function(){return n}),O.d(W,"CaptionScreen",function(){return t});var k=O("./src/utils/logger.ts"),w={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},D=function(f){var u=f;return w.hasOwnProperty(f)&&(u=w[f]),String.fromCharCode(u)},B=15,M=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},C={17:2,18:4,21:6,22:8,23:10,19:13,20:15},y={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},c={25:2,26:4,29:6,30:8,31:10,27:13,28:15},d=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(l){l[l.ERROR=0]="ERROR",l[l.TEXT=1]="TEXT",l[l.WARNING=2]="WARNING",l[l.INFO=2]="INFO",l[l.DEBUG=3]="DEBUG",l[l.DATA=3]="DATA"})(a||(a={}));var i=function(){function l(){this.time=null,this.verboseLevel=a.ERROR}var f=l.prototype;return f.log=function(h,E){this.verboseLevel>=h&&k.logger.log(this.time+" ["+h+"] "+E)},l}(),o=function(f){for(var u=[],h=0;h<f.length;h++)u.push(f[h].toString(16));return u},s=function(){function l(u,h,E,v,S){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=h||!1,this.italics=E||!1,this.background=v||"black",this.flash=S||!1}var f=l.prototype;return f.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},f.setStyles=function(h){for(var E=["foreground","underline","italics","background","flash"],v=0;v<E.length;v++){var S=E[v];h.hasOwnProperty(S)&&(this[S]=h[S])}},f.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},f.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},f.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},f.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},l}(),r=function(){function l(u,h,E,v,S,L){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new s(h,E,v,S,L)}var f=l.prototype;return f.reset=function(){this.uchar=" ",this.penState.reset()},f.setChar=function(h,E){this.uchar=h,this.penState.copy(E)},f.setPenState=function(h){this.penState.copy(h)},f.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},f.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},f.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},l}(),n=function(){function l(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 h=0;h<M;h++)this.chars.push(new r);this.logger=u,this.pos=0,this.currPenState=new s}var f=l.prototype;return f.equals=function(h){for(var E=!0,v=0;v<M;v++)if(!this.chars[v].equals(h.chars[v])){E=!1;break}return E},f.copy=function(h){for(var E=0;E<M;E++)this.chars[E].copy(h.chars[E])},f.isEmpty=function(){for(var h=!0,E=0;E<M;E++)if(!this.chars[E].isEmpty()){h=!1;break}return h},f.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>M&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=M)},f.moveCursor=function(h){var E=this.pos+h;if(h>1)for(var v=this.pos+1;v<E+1;v++)this.chars[v].setPenState(this.currPenState);this.setCursor(E)},f.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},f.insertChar=function(h){h>=144&&this.backSpace();var E=D(h);if(this.pos>=M){this.logger.log(a.ERROR,"Cannot insert "+h.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},f.clearFromPos=function(h){var E;for(E=h;E<M;E++)this.chars[E].reset()},f.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},f.clearToEndOfRow=function(){this.clearFromPos(this.pos)},f.getTextString=function(){for(var h=[],E=!0,v=0;v<M;v++){var S=this.chars[v].uchar;S!==" "&&(E=!1),h.push(S)}return E?"":h.join("")},f.setPenStyles=function(h){this.currPenState.setStyles(h);var E=this.chars[this.pos];E.setPenState(this.currPenState)},l}(),t=function(){function l(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 h=0;h<B;h++)this.rows.push(new n(u));this.logger=u,this.currRow=B-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var f=l.prototype;return f.reset=function(){for(var h=0;h<B;h++)this.rows[h].clear();this.currRow=B-1},f.equals=function(h){for(var E=!0,v=0;v<B;v++)if(!this.rows[v].equals(h.rows[v])){E=!1;break}return E},f.copy=function(h){for(var E=0;E<B;E++)this.rows[E].copy(h.rows[E])},f.isEmpty=function(){for(var h=!0,E=0;E<B;E++)if(!this.rows[E].isEmpty()){h=!1;break}return h},f.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},f.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},f.insertChar=function(h){var E=this.rows[this.currRow];E.insertChar(h)},f.setPen=function(h){var E=this.rows[this.currRow];E.setPenStyles(h)},f.moveCursor=function(h){var E=this.rows[this.currRow];E.moveCursor(h)},f.setCursor=function(h){this.logger.log(a.INFO,"setCursor: "+h);var E=this.rows[this.currRow];E.setCursor(h)},f.setPAC=function(h){this.logger.log(a.INFO,"pacData = "+JSON.stringify(h));var E=h.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var v=0;v<B;v++)this.rows[v].clear();var S=this.currRow+1-this.nrRollUpRows,L=this.lastOutputScreen;if(L){var I=L.rows[S].cueStartTime,A=this.logger.time;if(I&&A!==null&&I<A)for(var P=0;P<this.nrRollUpRows;P++)this.rows[E-this.nrRollUpRows+P+1].copy(L.rows[S+P])}}this.currRow=E;var H=this.rows[this.currRow];if(h.indent!==null){var R=h.indent,K=Math.max(R-1,0);H.setCursor(h.indent),h.color=H.chars[K].penState.foreground}var z={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(z)},f.setBkgData=function(h){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},f.setRollUpRows=function(h){this.nrRollUpRows=h},f.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(h,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(a.INFO,"Rolling up")},f.getDisplayText=function(h){h=h||!1;for(var E=[],v="",S=-1,L=0;L<B;L++){var I=this.rows[L].getTextString();I&&(S=L+1,h?E.push("Row "+S+": '"+I+"'"):E.push(I.trim()))}return E.length>0&&(h?v="["+E.join(" | ")+"]":v=E.join(`
|
|
`)),v},f.getTextAndFormat=function(){return this.rows},l}(),g=function(){function l(u,h,E){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=h,this.mode=null,this.verbose=0,this.displayedMemory=new t(E),this.nonDisplayedMemory=new t(E),this.lastOutputScreen=new t(E),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var f=l.prototype;return f.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},f.getHandler=function(){return this.outputFilter},f.setHandler=function(h){this.outputFilter=h},f.setPAC=function(h){this.writeScreen.setPAC(h)},f.setBkgData=function(h){this.writeScreen.setBkgData(h)},f.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(a.INFO,"MODE="+h),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=h},f.insertChars=function(h){for(var E=0;E<h.length;E++)this.writeScreen.insertChar(h[E]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,v+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},f.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},f.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},f.ccAOF=function(){},f.ccAON=function(){},f.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},f.ccRU=function(h){this.logger.log(a.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},f.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},f.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},f.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},f.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},f.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},f.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},f.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},f.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},f.ccTO=function(h){this.logger.log(a.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},f.ccMIDROW=function(h){var E={flash:!1};if(E.underline=h%2===1,E.italics=h>=46,E.italics)E.foreground="white";else{var v=Math.floor(h/2)-16,S=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=S[v]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},f.outputDataUpdate=function(h){h===void 0&&(h=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},f.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},l}(),p=function(){function l(u,h,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new i;this.channels=[null,new g(u,h,v),new g(u+1,E,v)],this.cmdHistory=_(),this.logger=v}var f=l.prototype;return f.getHandler=function(h){return this.channels[h].getHandler()},f.setHandler=function(h,E){this.channels[h].setHandler(E)},f.addData=function(h,E){var v,S,L,I=!1;this.logger.time=h;for(var A=0;A<E.length;A+=2){if(S=E[A]&127,L=E[A+1]&127,S===0&&L===0)continue;if(this.logger.log(a.DATA,"["+o([E[A],E[A+1]])+"] -> ("+o([S,L])+")"),v=this.parseCmd(S,L),v||(v=this.parseMidrow(S,L)),v||(v=this.parsePAC(S,L)),v||(v=this.parseBackgroundAttributes(S,L)),!v&&(I=this.parseChars(S,L),I)){var P=this.currentChannel;if(P&&P>0){var H=this.channels[P];H.insertChars(I)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!I&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+o([S,L])+" orig: "+o([E[A],E[A+1]]))}},f.parseCmd=function(h,E){var v=this.cmdHistory,S=(h===20||h===28||h===21||h===29)&&E>=32&&E<=47,L=(h===23||h===31)&&E>=33&&E<=35;if(!(S||L))return!1;if(b(h,E,v))return m(null,null,v),this.logger.log(a.DEBUG,"Repeated command ("+o([h,E])+") is dropped"),!0;var I=h===20||h===21||h===23?1:2,A=this.channels[I];return h===20||h===21||h===28||h===29?E===32?A.ccRCL():E===33?A.ccBS():E===34?A.ccAOF():E===35?A.ccAON():E===36?A.ccDER():E===37?A.ccRU(2):E===38?A.ccRU(3):E===39?A.ccRU(4):E===40?A.ccFON():E===41?A.ccRDC():E===42?A.ccTR():E===43?A.ccRTD():E===44?A.ccEDM():E===45?A.ccCR():E===46?A.ccENM():E===47&&A.ccEOC():A.ccTO(E-32),m(h,E,v),this.currentChannel=I,!0},f.parseMidrow=function(h,E){var v=0;if((h===17||h===25)&&E>=32&&E<=47){if(h===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var S=this.channels[v];return S?(S.ccMIDROW(E),this.logger.log(a.DEBUG,"MIDROW ("+o([h,E])+")"),!0):!1}return!1},f.parsePAC=function(h,E){var v,S=this.cmdHistory,L=(h>=17&&h<=23||h>=25&&h<=31)&&E>=64&&E<=127,I=(h===16||h===24)&&E>=64&&E<=95;if(!(L||I))return!1;if(b(h,E,S))return m(null,null,S),!0;var A=h<=23?1:2;E>=64&&E<=95?v=A===1?e[h]:y[h]:v=A===1?C[h]:c[h];var P=this.channels[A];return P?(P.setPAC(this.interpretPAC(v,E)),m(h,E,S),this.currentChannel=A,!0):!1},f.interpretPAC=function(h,E){var v,S={color:null,italics:!1,indent:null,underline:!1,row:h};return E>95?v=E-96:v=E-64,S.underline=(v&1)===1,v<=13?S.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(S.italics=!0,S.color="white"):S.indent=Math.floor((v-16)/2)*4,S},f.parseChars=function(h,E){var v,S=null,L=null;if(h>=25?(v=2,L=h-8):(v=1,L=h),L>=17&&L<=19){var I;L===17?I=E+80:L===18?I=E+112:I=E+144,this.logger.log(a.INFO,"Special char '"+D(I)+"' in channel "+v),S=[I]}else h>=32&&h<=127&&(S=E===0?[h]:[h,E]);if(S){var A=o(S);this.logger.log(a.DEBUG,"Char codes = "+A.join(",")),m(h,E,this.cmdHistory)}return S},f.parseBackgroundAttributes=function(h,E){var v=(h===16||h===24)&&E>=32&&E<=47,S=(h===23||h===31)&&E>=45&&E<=47;if(!(v||S))return!1;var L,I={};h===16||h===24?(L=Math.floor((E-32)/2),I.background=d[L],E%2===1&&(I.background=I.background+"_semi")):E===45?I.background="transparent":(I.foreground="black",E===47&&(I.underline=!0));var A=h<=23?1:2,P=this.channels[A];return P.setBkgData(I),m(h,E,this.cmdHistory),!0},f.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var E=this.channels[h];E&&E.reset()}this.cmdHistory=_()},f.cueSplitAtTime=function(h){for(var E=0;E<this.channels.length;E++){var v=this.channels[E];v&&v.cueSplitAtTime(h)}},l}();function m(l,f,u){u.a=l,u.b=f}function b(l,f,u){return u.a===l&&u.b===f}function _(){return{a:null,b:null}}W.default=p},"./src/utils/codecs.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"isCodecType",function(){return w}),O.d(W,"isCodecSupportedInMp4",function(){return D});var k={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function w(B,M){var e=k[M];return!!e&&e[B.slice(0,4)]===!0}function D(B,M){return MediaSource.isTypeSupported((M||"video")+'/mp4;codecs="'+B+'"')}},"./src/utils/cues.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/utils/vttparser.ts"),w=O("./src/utils/webvtt-parser.ts"),D=O("./src/utils/texttrack-utils.ts"),B=/\s/,M={newCue:function(C,y,c,d){for(var a=[],i,o,s,r,n,t=self.VTTCue||self.TextTrackCue,g=0;g<d.rows.length;g++)if(i=d.rows[g],s=!0,r=0,n="",!i.isEmpty()){for(var p=0;p<i.chars.length;p++)B.test(i.chars[p].uchar)&&s?r++:(n+=i.chars[p].uchar,s=!1);i.cueStartTime=y,y===c&&(c+=1e-4),r>=16?r--:r++;var m=Object(k.fixLineBreaks)(n.trim()),b=Object(w.generateCueId)(y,c,m);(!C||!C.cues||!C.cues.getCueById(b))&&(o=new t(y,c,m),o.id=b,o.line=g+1,o.align="left",o.position=10+Math.min(80,Math.floor(r*8/32)*10),a.push(o))}return C&&a.length&&(a.sort(function(_,l){return _.line==="auto"||l.line==="auto"?0:_.line>8&&l.line>8?l.line-_.line:_.line-l.line}),a.forEach(function(_){return Object(D.addCueToTrack)(C,_)})),a}};W.default=M},"./src/utils/discontinuities.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"findFirstFragWithCC",function(){return B}),O.d(W,"shouldAlignOnDiscontinuities",function(){return M}),O.d(W,"findDiscontinuousReferenceFrag",function(){return e}),O.d(W,"adjustSlidingStart",function(){return y}),O.d(W,"alignStream",function(){return c}),O.d(W,"alignPDT",function(){return a}),O.d(W,"alignFragmentByPDTDelta",function(){return i}),O.d(W,"alignMediaPlaylistByPDT",function(){return o});var k=O("./src/polyfills/number.ts"),w=O("./src/utils/logger.ts"),D=O("./src/controller/level-helper.ts");function B(s,r){for(var n=null,t=0,g=s.length;t<g;t++){var p=s[t];if(p&&p.cc===r){n=p;break}}return n}function M(s,r,n){return!!(r.details&&(n.endCC>n.startCC||s&&s.cc<n.startCC))}function e(s,r){var n=s.fragments,t=r.fragments;if(!t.length||!n.length){w.logger.log("No fragments to align");return}var g=B(n,t[0].cc);if(!g||g&&!g.startPTS){w.logger.log("No frag in previous level to align on");return}return g}function C(s,r){if(s){var n=s.start+r;s.start=s.startPTS=n,s.endPTS=n+s.duration}}function y(s,r){for(var n=r.fragments,t=0,g=n.length;t<g;t++)C(n[t],s);r.fragmentHint&&C(r.fragmentHint,s),r.alignedSliding=!0}function c(s,r,n){if(!r)return;d(s,n,r),!n.alignedSliding&&r.details&&a(n,r.details),!n.alignedSliding&&r.details&&!n.skippedSegments&&Object(D.adjustSliding)(r.details,n)}function d(s,r,n){if(M(s,n,r)){var t=e(n.details,r);t&&Object(k.isFiniteNumber)(t.start)&&(w.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),y(t.start,r))}}function a(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,t=s.fragments[0].programDateTime,g=(t-n)/1e3+r.fragments[0].start;g&&Object(k.isFiniteNumber)(g)&&(w.logger.log("Adjusting PTS using programDateTime delta "+(t-n)+"ms, sliding:"+g.toFixed(3)+" "+s.url+" "),y(g,s))}function i(s,r){var n=s.programDateTime;if(!n)return;var t=(n-r)/1e3;s.start=s.startPTS=t,s.endPTS=t+s.duration}function o(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,t=r.fragments[0].start,g=n-t*1e3;s.fragments.forEach(function(p){i(p,g)}),s.fragmentHint&&i(s.fragmentHint,g),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/utils/ewma.ts"),w=function(){function D(M,e,C){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=C,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new k.default(M),this.fast_=new k.default(e)}var B=D.prototype;return B.update=function(e,C){var y=this.slow_,c=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new k.default(e,y.getEstimate(),y.getTotalWeight())),this.fast_.halfLife!==C&&(this.fast_=new k.default(C,c.getEstimate(),c.getTotalWeight()))},B.sample=function(e,C){e=Math.max(e,this.minDelayMs_);var y=8*C,c=e/1e3,d=y/c;this.fast_.sample(c,d),this.slow_.sample(c,d)},B.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},B.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},B.destroy=function(){},D}();W.default=w},"./src/utils/ewma.ts":function(ne,W,O){"use strict";O.r(W);var k=function(){function w(B,M,e){M===void 0&&(M=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=B,this.alpha_=B?Math.exp(Math.log(.5)/B):0,this.estimate_=M,this.totalWeight_=e}var D=w.prototype;return D.sample=function(M,e){var C=Math.pow(this.alpha_,M);this.estimate_=e*(1-C)+C*this.estimate_,this.totalWeight_+=M},D.getTotalWeight=function(){return this.totalWeight_},D.getEstimate=function(){if(this.alpha_){var M=1-Math.pow(this.alpha_,this.totalWeight_);if(M)return this.estimate_/M}return this.estimate_},w}();W.default=k},"./src/utils/fetch-loader.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"fetchSupported",function(){return i});var k=O("./src/polyfills/number.ts"),w=O("./src/loader/load-stats.ts"),D=O("./src/demux/chunk-cache.ts");function B(t,g){t.prototype=Object.create(g.prototype),t.prototype.constructor=t,c(t,g)}function M(t){var g=typeof Map=="function"?new Map:void 0;return M=function(m){if(m===null||!y(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof g!="undefined"){if(g.has(m))return g.get(m);g.set(m,b)}function b(){return e(m,arguments,d(this).constructor)}return b.prototype=Object.create(m.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),c(b,m)},M(t)}function e(t,g,p){return C()?e=Reflect.construct:e=function(b,_,l){var f=[null];f.push.apply(f,_);var u=Function.bind.apply(b,f),h=new u;return l&&c(h,l.prototype),h},e.apply(null,arguments)}function C(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function y(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function c(t,g){return c=Object.setPrototypeOf||function(m,b){return m.__proto__=b,m},c(t,g)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},d(t)}function a(){return a=Object.assign||function(t){for(var g=1;g<arguments.length;g++){var p=arguments[g];for(var m in p)Object.prototype.hasOwnProperty.call(p,m)&&(t[m]=p[m])}return t},a.apply(this,arguments)}function i(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var o=function(){function t(p){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=p.fetchSetup||r,this.controller=new self.AbortController,this.stats=new w.LoadStats}var g=t.prototype;return g.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},g.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},g.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},g.load=function(m,b,_){var l=this,f=this.stats;if(f.loading.start)throw new Error("Loader can only be used once.");f.loading.start=self.performance.now();var u=s(m,this.controller.signal),h=_.onProgress,E=m.responseType==="arraybuffer",v=E?"byteLength":"length";this.context=m,this.config=b,this.callbacks=_,this.request=this.fetchSetup(m,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){l.abortInternal(),_.onTimeout(f,m,l.response)},b.timeout),self.fetch(this.request).then(function(S){if(l.response=l.loader=S,!S.ok){var L=S.status,I=S.statusText;throw new n(I||"fetch, bad network response",L,S)}return f.loading.first=Math.max(self.performance.now(),f.loading.start),f.total=parseInt(S.headers.get("Content-Length")||"0"),h&&Object(k.isFiniteNumber)(b.highWaterMark)?l.loadProgressively(S,f,m,b.highWaterMark,h):E?S.arrayBuffer():S.text()}).then(function(S){var L=l.response;self.clearTimeout(l.requestTimeout),f.loading.end=Math.max(self.performance.now(),f.loading.first),f.loaded=f.total=S[v];var I={url:L.url,data:S};h&&!Object(k.isFiniteNumber)(b.highWaterMark)&&h(f,m,S,L),_.onSuccess(I,f,m,L)}).catch(function(S){if(self.clearTimeout(l.requestTimeout),f.aborted)return;var L=S.code||0;_.onError({code:L,text:S.message},m,S.details)})},g.getCacheAge=function(){var m=null;if(this.response){var b=this.response.headers.get("age");m=b?parseFloat(b):null}return m},g.loadProgressively=function(m,b,_,l,f){l===void 0&&(l=0);var u=new D.default,h=m.body.getReader(),E=function v(){return h.read().then(function(S){if(S.done)return u.dataLength&&f(b,_,u.flush(),m),Promise.resolve(new ArrayBuffer(0));var L=S.value,I=L.length;return b.loaded+=I,I<l||u.dataLength?(u.push(L),u.dataLength>=l&&f(b,_,u.flush(),m)):f(b,_,L,m),v()}).catch(function(){return Promise.reject()})};return E()},t}();function s(t,g){var p={method:"GET",mode:"cors",credentials:"same-origin",signal:g,headers:new self.Headers(a({},t.headers))};return t.rangeEnd&&p.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),p}function r(t,g){return new self.Request(t.url,g)}var n=function(t){B(g,t);function g(p,m,b){var _;return _=t.call(this,p)||this,_.code=void 0,_.details=void 0,_.code=m,_.details=b,_}return g}(M(Error));W.default=o},"./src/utils/imsc1-ttml-parser.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"IMSC1_CODEC",function(){return y}),O.d(W,"parseIMSC1",function(){return i});var k=O("./src/utils/mp4-tools.ts"),w=O("./src/utils/vttparser.ts"),D=O("./src/utils/vttcue.ts"),B=O("./src/demux/id3.ts"),M=O("./src/utils/timescale-conversion.ts"),e=O("./src/utils/webvtt-parser.ts");function C(){return C=Object.assign||function(l){for(var f=1;f<arguments.length;f++){var u=arguments[f];for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(l[h]=u[h])}return l},C.apply(this,arguments)}var y="stpp.ttml.im1t",c=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function i(l,f,u,h,E){var v=Object(k.findBox)(new Uint8Array(l),["mdat"]);if(v.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var S=v[0],L=Object(B.utf8ArrayToStr)(new Uint8Array(l,S.start,S.end-S.start)),I=Object(M.toTimescaleFromScale)(f,1,u);try{h(o(L,I))}catch(A){E(A)}}function o(l,f){var u=new DOMParser,h=u.parseFromString(l,"text/xml"),E=h.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},S=Object.keys(v).reduce(function(H,R){return H[R]=E.getAttribute("ttp:"+R)||v[R],H},{}),L=E.getAttribute("xml:space")!=="preserve",I=r(s(E,"styling","style")),A=r(s(E,"layout","region")),P=s(E,"body","[begin]");return[].map.call(P,function(H){var R=n(H,L);if(!R||!H.hasAttribute("begin"))return null;var K=m(H.getAttribute("begin"),S),z=m(H.getAttribute("dur"),S),oe=m(H.getAttribute("end"),S);if(K===null)throw p(H);if(oe===null){if(z===null)throw p(H);oe=K+z}var $=new D.default(K-f,oe-f,R);$.id=Object(e.generateCueId)($.startTime,$.endTime,$.text);var fe=A[H.getAttribute("region")],de=I[H.getAttribute("style")];$.position=10,$.size=80;var ee=t(fe,de),ie=ee.textAlign;if(ie){var ge=a[ie];ge&&($.lineAlign=ge),$.align=ie}return C($,ee),$}).filter(function(H){return H!==null})}function s(l,f,u){var h=l.getElementsByTagName(f)[0];return h?[].slice.call(h.querySelectorAll(u)):[]}function r(l){return l.reduce(function(f,u){var h=u.getAttribute("xml:id");return h&&(f[h]=u),f},{})}function n(l,f){return[].slice.call(l.childNodes).reduce(function(u,h,E){var v;return h.nodeName==="br"&&E?u+`
|
|
`:(v=h.childNodes)!==null&&v!==void 0&&v.length?n(h,f):f?u+h.textContent.trim().replace(/\s+/g," "):u+h.textContent},"")}function t(l,f){var u="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(E,v){var S=g(f,u,v)||g(l,u,v);return S&&(E[v]=S),E},{})}function g(l,f,u){return l.hasAttributeNS(f,u)?l.getAttributeNS(f,u):null}function p(l){return new Error("Could not parse ttml timestamp "+l)}function m(l,f){if(!l)return null;var u=Object(w.parseTimeStamp)(l);return u===null&&(c.test(l)?u=b(l,f):d.test(l)&&(u=_(l,f))),u}function b(l,f){var u=c.exec(l),h=(u[4]|0)+(u[5]|0)/f.subFrameRate;return(u[1]|0)*3600+(u[2]|0)*60+(u[3]|0)+h/f.frameRate}function _(l,f){var u=d.exec(l),h=Number(u[1]),E=u[2];switch(E){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/f.frameRate;case"t":return h/f.tickRate}return h}},"./src/utils/logger.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"enableLogs",function(){return e}),O.d(W,"logger",function(){return C});var k=function(){},w={trace:k,debug:k,log:k,warn:k,info:k,error:k},D=w;function B(y){var c=self.console[y];return c?c.bind(self.console,"["+y+"] >"):k}function M(y){for(var c=arguments.length,d=new Array(c>1?c-1:0),a=1;a<c;a++)d[a-1]=arguments[a];d.forEach(function(i){D[i]=y[i]?y[i].bind(y):B(i)})}function e(y){if(self.console&&y===!0||typeof y=="object"){M(y,"debug","log","info","warn","error");try{D.log()}catch(c){D=w}}else D=w}var C=D},"./src/utils/mediakeys-helper.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"KeySystems",function(){return k}),O.d(W,"requestMediaKeySystemAccess",function(){return w});var k;(function(D){D.WIDEVINE="com.widevine.alpha",D.PLAYREADY="com.microsoft.playready"})(k||(k={}));var w=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"getMediaSource",function(){return k});function k(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"bin2str",function(){return M}),O.d(W,"readUint16",function(){return e}),O.d(W,"readUint32",function(){return C}),O.d(W,"writeUint32",function(){return y}),O.d(W,"findBox",function(){return c}),O.d(W,"parseSegmentIndex",function(){return d}),O.d(W,"parseInitSegment",function(){return a}),O.d(W,"getStartDTS",function(){return i}),O.d(W,"getDuration",function(){return o}),O.d(W,"computeRawDurationFromSamples",function(){return s}),O.d(W,"offsetStartDTS",function(){return r}),O.d(W,"segmentValidRange",function(){return n}),O.d(W,"appendUint8Array",function(){return t});var k=O("./src/utils/typed-array.ts"),w=O("./src/loader/fragment.ts"),D=Math.pow(2,32)-1,B=[].push;function M(g){return String.fromCharCode.apply(null,g)}function e(g,p){"data"in g&&(p+=g.start,g=g.data);var m=g[p]<<8|g[p+1];return m<0?65536+m:m}function C(g,p){"data"in g&&(p+=g.start,g=g.data);var m=g[p]<<24|g[p+1]<<16|g[p+2]<<8|g[p+3];return m<0?4294967296+m:m}function y(g,p,m){"data"in g&&(p+=g.start,g=g.data),g[p]=m>>24,g[p+1]=m>>16&255,g[p+2]=m>>8&255,g[p+3]=m&255}function c(g,p){var m=[];if(!p.length)return m;var b,_,l;"data"in g?(b=g.data,_=g.start,l=g.end):(b=g,_=0,l=b.byteLength);for(var f=_;f<l;){var u=C(b,f),h=M(b.subarray(f+4,f+8)),E=u>1?f+u:l;if(h===p[0])if(p.length===1)m.push({data:b,start:f+8,end:E});else{var v=c({data:b,start:f+8,end:E},p.slice(1));v.length&&B.apply(m,v)}f=E}return m}function d(g){var p=c(g,["moov"]),m=p[0],b=m?m.end:null,_=c(g,["sidx"]);if(!_||!_[0])return null;var l=[],f=_[0],u=f.data[0],h=u===0?8:16,E=C(f,h);h+=4;var v=0,S=0;u===0?h+=8:h+=16,h+=2;var L=f.end+S,I=e(f,h);h+=2;for(var A=0;A<I;A++){var P=h,H=C(f,P);P+=4;var R=H&2147483647,K=(H&2147483648)>>>31;if(K===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var z=C(f,P);P+=4,l.push({referenceSize:R,subsegmentDuration:z,info:{duration:z/E,start:L,end:L+R-1}}),L+=R,P+=4,h=P}return{earliestPresentationTime:v,timescale:E,version:u,referencesCount:I,references:l,moovEndOffset:b}}function a(g){for(var p=[],m=c(g,["moov","trak"]),b=0;b<m.length;b++){var _=m[b],l=c(_,["tkhd"])[0];if(l){var f=l.data[l.start],u=f===0?12:20,h=C(l,u),E=c(_,["mdia","mdhd"])[0];if(E){f=E.data[E.start],u=f===0?12:20;var v=C(E,u),S=c(_,["mdia","hdlr"])[0];if(S){var L=M(S.data.subarray(S.start+8,S.start+12)),I={soun:w.ElementaryStreamTypes.AUDIO,vide:w.ElementaryStreamTypes.VIDEO}[L];if(I){var A=c(_,["mdia","minf","stbl","stsd"])[0],P=void 0;A&&(P=M(A.data.subarray(A.start+12,A.start+16))),p[h]={timescale:v,type:I},p[I]={timescale:v,id:h,codec:P}}}}}}var H=c(g,["moov","mvex","trex"]);return H.forEach(function(R){var K=C(R,4),z=p[K];z&&(z.default={duration:C(R,12),flags:C(R,20)})}),p}function i(g,p){return c(p,["moof","traf"]).reduce(function(m,b){var _=c(b,["tfdt"])[0],l=_.data[_.start],f=c(b,["tfhd"]).reduce(function(u,h){var E=C(h,4),v=g[E];if(v){var S=C(_,4);l===1&&(S*=Math.pow(2,32),S+=C(_,8));var L=v.timescale||9e4,I=S/L;if(isFinite(I)&&(u===null||I<u))return I}return u},null);return f!==null&&isFinite(f)&&(m===null||f<m)?f:m},null)||0}function o(g,p){for(var m=0,b=0,_=0,l=c(g,["moof","traf"]),f=0;f<l.length;f++){var u=l[f],h=c(u,["tfhd"])[0],E=C(h,4),v=p[E];if(!v)continue;var S=v.default,L=C(h,0)|(S==null?void 0:S.flags),I=S==null?void 0:S.duration;L&8&&(L&2?I=C(h,12):I=C(h,8));for(var A=v.timescale||9e4,P=c(u,["trun"]),H=0;H<P.length;H++){if(I){var R=C(P[H],4);m=I*R}else m=s(P[H]);v.type===w.ElementaryStreamTypes.VIDEO?b+=m/A:v.type===w.ElementaryStreamTypes.AUDIO&&(_+=m/A)}}if(b===0&&_===0){var K=d(g);if(K!=null&&K.references)return K.references.reduce(function(z,oe){return z+oe.info.duration||0},0)}return b||_}function s(g){var p=C(g,0),m=8;p&1&&(m+=4),p&4&&(m+=4);for(var b=0,_=C(g,4),l=0;l<_;l++){if(p&256){var f=C(g,m);b+=f,m+=4}p&512&&(m+=4),p&1024&&(m+=4),p&2048&&(m+=4)}return b}function r(g,p,m){c(p,["moof","traf"]).forEach(function(b){c(b,["tfhd"]).forEach(function(_){var l=C(_,4),f=g[l];if(!f)return;var u=f.timescale||9e4;c(b,["tfdt"]).forEach(function(h){var E=h.data[h.start],v=C(h,4);if(E===0)y(h,4,v-m*u);else{v*=Math.pow(2,32),v+=C(h,8),v-=m*u,v=Math.max(v,0);var S=Math.floor(v/(D+1)),L=Math.floor(v%(D+1));y(h,4,S),y(h,8,L)}})})})}function n(g){var p={valid:null,remainder:null},m=c(g,["moof"]);if(m){if(m.length<2)return p.remainder=g,p}else return p;var b=m[m.length-1];return p.valid=Object(k.sliceUint8)(g,0,b.start-8),p.remainder=Object(k.sliceUint8)(g,b.start-8),p}function t(g,p){var m=new Uint8Array(g.length+p.length);return m.set(g),m.set(p,g.length),m}},"./src/utils/output-filter.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"default",function(){return k});var k=function(){function w(B,M){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=B,this.trackName=M}var D=w.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(M,e,C){(this.startTime===null||this.startTime>M)&&(this.startTime=M),this.endTime=e,this.screen=C,this.timelineController.createCaptionsTrack(this.trackName)},D.reset=function(){this.cueRanges=[]},w}()},"./src/utils/texttrack-utils.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"sendAddTrackEvent",function(){return w}),O.d(W,"addCueToTrack",function(){return D}),O.d(W,"clearCurrentCues",function(){return B}),O.d(W,"removeCuesInRange",function(){return M}),O.d(W,"getCuesInRange",function(){return C});var k=O("./src/utils/logger.ts");function w(y,c){var d;try{d=new Event("addtrack")}catch(a){d=document.createEvent("Event"),d.initEvent("addtrack",!1,!1)}d.track=y,c.dispatchEvent(d)}function D(y,c){var d=y.mode;if(d==="disabled"&&(y.mode="hidden"),y.cues&&!y.cues.getCueById(c.id))try{if(y.addCue(c),!y.cues.getCueById(c.id))throw new Error("addCue is failed for: "+c)}catch(i){k.logger.debug("[texttrack-utils]: "+i);var a=new self.TextTrackCue(c.startTime,c.endTime,c.text);a.id=c.id,y.addCue(a)}d==="disabled"&&(y.mode=d)}function B(y){var c=y.mode;if(c==="disabled"&&(y.mode="hidden"),y.cues)for(var d=y.cues.length;d--;)y.removeCue(y.cues[d]);c==="disabled"&&(y.mode=c)}function M(y,c,d){var a=y.mode;if(a==="disabled"&&(y.mode="hidden"),y.cues&&y.cues.length>0)for(var i=C(y.cues,c,d),o=0;o<i.length;o++)y.removeCue(i[o]);a==="disabled"&&(y.mode=a)}function e(y,c){if(c<y[0].startTime)return 0;var d=y.length-1;if(c>y[d].endTime)return-1;for(var a=0,i=d;a<=i;){var o=Math.floor((i+a)/2);if(c<y[o].startTime)i=o-1;else if(c>y[o].startTime&&a<d)a=o+1;else return o}return y[a].startTime-c<c-y[i].startTime?a:i}function C(y,c,d){var a=[],i=e(y,c);if(i>-1)for(var o=i,s=y.length;o<s;o++){var r=y[o];if(r.startTime>=c&&r.endTime<=d)a.push(r);else if(r.startTime>d)return a}return a}},"./src/utils/time-ranges.ts":function(ne,W,O){"use strict";O.r(W);var k={toString:function(D){for(var B="",M=D.length,e=0;e<M;e++)B+="["+D.start(e).toFixed(3)+","+D.end(e).toFixed(3)+"]";return B}};W.default=k},"./src/utils/timescale-conversion.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"toTimescaleFromBase",function(){return w}),O.d(W,"toTimescaleFromScale",function(){return D}),O.d(W,"toMsFromMpegTsClock",function(){return B}),O.d(W,"toMpegTsClockFromTimescale",function(){return M});var k=9e4;function w(e,C,y,c){y===void 0&&(y=1),c===void 0&&(c=!1);var d=e*C*y;return c?Math.round(d):d}function D(e,C,y,c){return y===void 0&&(y=1),c===void 0&&(c=!1),w(e,C,1/y,c)}function B(e,C){return C===void 0&&(C=!1),w(e,1e3,1/k,C)}function M(e,C){return C===void 0&&(C=1),w(e,k,1/C)}},"./src/utils/typed-array.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"sliceUint8",function(){return k});function k(w,D,B){return Uint8Array.prototype.slice?w.slice(D,B):new Uint8Array(Array.prototype.slice.call(w,D,B))}},"./src/utils/vttcue.ts":function(ne,W,O){"use strict";O.r(W),W.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var k=["","lr","rl"],w=["start","middle","end","left","right"];function D(y,c){if(typeof c!="string")return!1;if(!Array.isArray(y))return!1;var d=c.toLowerCase();return~y.indexOf(d)?d:!1}function B(y){return D(k,y)}function M(y){return D(w,y)}function e(y){for(var c=arguments.length,d=new Array(c>1?c-1:0),a=1;a<c;a++)d[a-1]=arguments[a];for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var s in o)y[s]=o[s]}return y}function C(y,c,d){var a=this,i={enumerable:!0};a.hasBeenReset=!1;var o="",s=!1,r=y,n=c,t=d,g=null,p="",m=!0,b="auto",_="start",l=50,f="middle",u=50,h="middle";Object.defineProperty(a,"id",e({},i,{get:function(){return o},set:function(v){o=""+v}})),Object.defineProperty(a,"pauseOnExit",e({},i,{get:function(){return s},set:function(v){s=!!v}})),Object.defineProperty(a,"startTime",e({},i,{get:function(){return r},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");r=v,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",e({},i,{get:function(){return n},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");n=v,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",e({},i,{get:function(){return t},set:function(v){t=""+v,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",e({},i,{get:function(){return g},set:function(v){g=v,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",e({},i,{get:function(){return p},set:function(v){var S=B(v);if(S===!1)throw new SyntaxError("An invalid or illegal string was specified.");p=S,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",e({},i,{get:function(){return m},set:function(v){m=!!v,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",e({},i,{get:function(){return b},set:function(v){if(typeof v!="number"&&v!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");b=v,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",e({},i,{get:function(){return _},set:function(v){var S=M(v);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");_=S,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",e({},i,{get:function(){return l},set:function(v){if(v<0||v>100)throw new Error("Position must be between 0 and 100.");l=v,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",e({},i,{get:function(){return f},set:function(v){var S=M(v);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");f=S,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",e({},i,{get:function(){return u},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");u=v,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",e({},i,{get:function(){return h},set:function(v){var S=M(v);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");h=S,this.hasBeenReset=!0}})),a.displayState=void 0}return C.prototype.getCueAsHTML=function(){var y=self.WebVTT;return y.convertCueToDOMTree(self,this.text)},C}()},"./src/utils/vttparser.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"parseTimeStamp",function(){return D}),O.d(W,"fixLineBreaks",function(){return c}),O.d(W,"VTTParser",function(){return d});var k=O("./src/utils/vttcue.ts"),w=function(){function a(){}var i=a.prototype;return i.decode=function(s,r){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},a}();function D(a){function i(s,r,n,t){return(s|0)*3600+(r|0)*60+(n|0)+parseFloat(t||0)}var o=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?i(o[2],o[3],0,o[4]):i(o[1],o[2],o[3],o[4]):null}var B=function(){function a(){this.values=Object.create(null)}var i=a.prototype;return i.set=function(s,r){!this.get(s)&&r!==""&&(this.values[s]=r)},i.get=function(s,r,n){return n?this.has(s)?this.values[s]:r[n]:this.has(s)?this.values[s]:r},i.has=function(s){return s in this.values},i.alt=function(s,r,n){for(var t=0;t<n.length;++t)if(r===n[t]){this.set(s,r);break}},i.integer=function(s,r){/^-?\d+$/.test(r)&&this.set(s,parseInt(r,10))},i.percent=function(s,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var n=parseFloat(r);if(n>=0&&n<=100)return this.set(s,n),!0}return!1},a}();function M(a,i,o,s){var r=s?a.split(s):[a];for(var n in r){if(typeof r[n]!="string")continue;var t=r[n].split(o);if(t.length!==2)continue;var g=t[0],p=t[1];i(g,p)}}var e=new k.default(0,0,""),C=e.align==="middle"?"middle":"center";function y(a,i,o){var s=a;function r(){var g=D(a);if(g===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),g}function n(g,p){var m=new B;M(g,function(l,f){var u;switch(l){case"region":for(var h=o.length-1;h>=0;h--)if(o[h].id===f){m.set(l,o[h].region);break}break;case"vertical":m.alt(l,f,["rl","lr"]);break;case"line":u=f.split(","),m.integer(l,u[0]),m.percent(l,u[0])&&m.set("snapToLines",!1),m.alt(l,u[0],["auto"]),u.length===2&&m.alt("lineAlign",u[1],["start",C,"end"]);break;case"position":u=f.split(","),m.percent(l,u[0]),u.length===2&&m.alt("positionAlign",u[1],["start",C,"end","line-left","line-right","auto"]);break;case"size":m.percent(l,f);break;case"align":m.alt(l,f,["start",C,"end","left","right"]);break}},/:/,/\s/),p.region=m.get("region",null),p.vertical=m.get("vertical","");var b=m.get("line","auto");b==="auto"&&e.line===-1&&(b=-1),p.line=b,p.lineAlign=m.get("lineAlign","start"),p.snapToLines=m.get("snapToLines",!0),p.size=m.get("size",100),p.align=m.get("align",C);var _=m.get("position","auto");_==="auto"&&e.position===50&&(_=p.align==="start"||p.align==="left"?0:p.align==="end"||p.align==="right"?100:50),p.position=_}function t(){a=a.replace(/^\s+/,"")}if(t(),i.startTime=r(),t(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.substr(3),t(),i.endTime=r(),t(),n(a,i)}function c(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}var d=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new w,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var i=a.prototype;return i.parse=function(s){var r=this;s&&(r.buffer+=r.decoder.decode(s,{stream:!0}));function n(){var _=r.buffer,l=0;for(_=c(_);l<_.length&&_[l]!=="\r"&&_[l]!==`
|
|
`;)++l;var f=_.substr(0,l);return _[l]==="\r"&&++l,_[l]===`
|
|
`&&++l,r.buffer=_.substr(l),f}function t(_){M(_,function(l,f){},/:/)}try{var g="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;g=n();var p=g.match(/^()?WEBVTT([ \t].*)?$/);if(!p||!p[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var m=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;m?m=!1:g=n();switch(r.state){case"HEADER":/:/.test(g)?t(g):g||(r.state="ID");continue;case"NOTE":g||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(g)){r.state="NOTE";break}if(!g)continue;if(r.cue=new k.default(0,0,""),r.state="CUE",g.indexOf("-->")===-1){r.cue.id=g;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{y(g,r.cue,r.regionList)}catch(_){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var b=g.indexOf("-->")!==-1;if(!g||b&&(m=!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+=g}continue;case"BADCUE":g||(r.state="ID")}}}catch(_){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},i.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},a}()},"./src/utils/webvtt-parser.ts":function(ne,W,O){"use strict";O.r(W),O.d(W,"generateCueId",function(){return d}),O.d(W,"parseWebVTT",function(){return i});var k=O("./src/polyfills/number.ts"),w=O("./src/utils/vttparser.ts"),D=O("./src/demux/id3.ts"),B=O("./src/utils/timescale-conversion.ts"),M=O("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,C=function(s,r,n){return n===void 0&&(n=0),s.substr(n,r.length)===r},y=function(s){var r=parseInt(s.substr(-3)),n=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),g=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(k.isFiniteNumber)(r)||!Object(k.isFiniteNumber)(n)||!Object(k.isFiniteNumber)(t)||!Object(k.isFiniteNumber)(g))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return r+=1e3*n,r+=60*1e3*t,r+=60*60*1e3*g,r},c=function(s){for(var r=5381,n=s.length;n;)r=r*33^s.charCodeAt(--n);return(r>>>0).toString()};function d(o,s,r){return c(o.toString())+c(s.toString())+c(r)}var a=function(s,r,n){var t=s[r],g=s[t.prevCC];if(!g||!g.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(p=g)!==null&&p!==void 0&&p.new;){var p;s.ccOffset+=t.start-g.start,t.new=!1,t=g,g=s[t.prevCC]}s.presentationOffset=n};function i(o,s,r,n,t,g,p,m){var b=new w.VTTParser,_=Object(D.utf8ArrayToStr)(new Uint8Array(o)).trim().replace(e,`
|
|
`).split(`
|
|
`),l=[],f=Object(B.toMpegTsClockFromTimescale)(s,r),u="00:00.000",h=0,E=0,v,S=!0,L=!1;b.oncue=function(I){var A=n[t],P=n.ccOffset,H=(h-f)/9e4;if(A!=null&&A.new&&(E!==void 0?P=n.ccOffset=A.start:a(n,t,H)),H&&(P=H-n.presentationOffset),L){var R=I.endTime-I.startTime,K=Object(M.normalizePts)((I.startTime+P-E)*9e4,g*9e4)/9e4;I.startTime=K,I.endTime=K+R}var z=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(z)),I.id||(I.id=d(I.startTime,I.endTime,z)),I.endTime>0&&l.push(I)},b.onparsingerror=function(I){v=I},b.onflush=function(){if(v){m(v);return}p(l)},_.forEach(function(I){if(S)if(C(I,"X-TIMESTAMP-MAP=")){S=!1,L=!0,I.substr(16).split(",").forEach(function(A){C(A,"LOCAL:")?u=A.substr(6):C(A,"MPEGTS:")&&(h=parseInt(A.substr(7)))});try{E=y(u)/1e3}catch(A){L=!1,v=A}return}else I===""&&(S=!1);b.parse(I+`
|
|
`)}),b.flush()}},"./src/utils/xhr-loader.ts":function(ne,W,O){"use strict";O.r(W);var k=O("./src/utils/logger.ts"),w=O("./src/loader/load-stats.ts"),D=/^age:\s*[\d.]+\s*$/m,B=function(){function M(C){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=C?C.xhrSetup:null,this.stats=new w.LoadStats,this.retryDelay=0}var e=M.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var y=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),y&&(y.onreadystatechange=null,y.onprogress=null,y.readyState!==4&&(this.stats.aborted=!0,y.abort()))},e.abort=function(){var y;this.abortInternal(),(y=this.callbacks)!==null&&y!==void 0&&y.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(y,c,d){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=y,this.config=c,this.callbacks=d,this.retryDelay=c.retryDelay,this.loadInternal()},e.loadInternal=function(){var y=this.config,c=this.context;if(!y)return;var d=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var i=this.xhrSetup;try{if(i)try{i(d,c.url)}catch(r){d.open("GET",c.url,!0),i(d,c.url)}d.readyState||d.open("GET",c.url,!0);var o=this.context.headers;if(o)for(var s in o)d.setRequestHeader(s,o[s])}catch(r){this.callbacks.onError({code:d.status,text:r.message},c,d);return}c.rangeEnd&&d.setRequestHeader("Range","bytes="+c.rangeStart+"-"+(c.rangeEnd-1)),d.onreadystatechange=this.readystatechange.bind(this),d.onprogress=this.loadprogress.bind(this),d.responseType=c.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),y.timeout),d.send()},e.readystatechange=function(){var y=this.context,c=this.loader,d=this.stats;if(!y||!c)return;var a=c.readyState,i=this.config;if(d.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),d.loading.first===0&&(d.loading.first=Math.max(self.performance.now(),d.loading.start)),a===4){c.onreadystatechange=null,c.onprogress=null;var o=c.status;if(o>=200&&o<300){d.loading.end=Math.max(self.performance.now(),d.loading.first);var s,r;if(y.responseType==="arraybuffer"?(s=c.response,r=s.byteLength):(s=c.responseText,r=s.length),d.loaded=d.total=r,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(d,y,s,c),!this.callbacks)return;var t={url:c.responseURL,data:s};this.callbacks.onSuccess(t,d,y,c)}else d.retry>=i.maxRetry||o>=400&&o<499?(k.logger.error(o+" while loading "+y.url),this.callbacks.onError({code:o,text:c.statusText},y,c)):(k.logger.warn(o+" while loading "+y.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,i.maxRetryDelay),d.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout)},e.loadtimeout=function(){k.logger.warn("timeout while loading "+this.context.url);var y=this.callbacks;y&&(this.abortInternal(),y.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(y){var c=this.stats;c.loaded=y.loaded,y.lengthComputable&&(c.total=y.total)},e.getCacheAge=function(){var y=null;if(this.loader&&D.test(this.loader.getAllResponseHeaders())){var c=this.loader.getResponseHeader("age");y=c?parseFloat(c):null}return y},M}();W.default=B}}).default})},vHTk:function(qe,ve,U){qe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},xTzM:function(qe,ve){qe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAqRJREFUWEfNmE1o02AYx/9JzJaltHatZRVR5hSRXHYYbCpMmTIRexAsDD0L8+Rphx10DIQddvDowbugCB68iWOKDqeb7tKD+MGKA8vo3Nzch7ZLlsibJjPrkjRvE8hySUiej9/7/PO+b54wmqZx2IMH4wqWv3kIS19HIcTOgVUP1uRX2XmUVl+DxX10vHpX097FwBmMQC3kP4JtSFElYPiKefnLGJrSd+sFdAb70PMQm8o1KiirMR8D5FXv7pzwE5wyjuSJQbQ9KDiDvWwrgIu2eI8ckOXWWhGtvZ3OYONHlYBS0YeJtT52BnueVMAYMTVAvyZnu8N85mS/67kGMAygGQHNa/PcEC+6gCUqFUueBaQRgD9AP3IaD3kR+HQbWHqje9UG63wE7GumSVG/rbIMTF+nAKs/Fb2nd7An9MH9eEz3eaxY11O39dmYEUHNEgBTWY9gp575GT+97/srFrDl0QGo6h1Ai9JH8lFQNQXwJ3cG2Aab7T+CaPNcoEBUwY4Bje3/PSYvGRUjYGIkPDAmDjRdNsBUYBuMfI9968tBbJGoBhqksXgV4Iy3aPKi5R37nB1CJDUcZC6qWEIHIJ6puEx0W8EyEoR0Tt+7nPYwqkyGsdd4wn4gesMGjNwicrKN4cmZ7Af4RFXFCBiRk+PDkzN+oSLnDil1sIwERsjVo1ggPmIKSNyyATPl3PwbnpyHh6qWC3PIRE55Izw501lgZtBmryRylkvhyjn7wmETJ7NzvRienL/m9O5q9xcskXNjPhw5VRlQSsDvgh1YRsLaQnhybpWBP+sOzchU+1toWlfNnaB6ZaddN6zdEfE14ynymH0zMtNzGivfJ8CH1FpGjnc7d0lkhi7m76H8o5e2EL7sGW4E51eG3f/2+Mrgz3nPgv0D9Cc+LoUg84gAAAAASUVORK5CYII="}}]);
|