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

403 lines
1.1 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[197,5,7,8,14],{"+ua5":function(qe,ve,N){},"+vTd":function(qe,ve,N){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,N){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,N){"use strict";N.d(ve,"f",function(){return O}),N.d(ve,"g",function(){return M}),N.d(ve,"h",function(){return w}),N.d(ve,"e",function(){return j}),N.d(ve,"b",function(){return U}),N.d(ve,"c",function(){return e}),N.d(ve,"d",function(){return C}),N.d(ve,"a",function(){return g});class ie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(h){setTimeout(()=>{throw h.stack?new Error(h.message+`
`+h.stack):h},0)}}emit(h){this.listeners.forEach(u=>{u(h)})}onUnexpectedError(h){this.unexpectedErrorHandler(h),this.emit(h)}onUnexpectedExternalError(h){this.unexpectedErrorHandler(h)}}const W=new ie;function O(h){j(h)||W.onUnexpectedError(h);return}function M(h){j(h)||W.onUnexpectedExternalError(h);return}function w(h){if(h instanceof Error){let{name:u,message:a}=h;const i=h.stacktrace||h.stack;return{$isError:!0,name:u,message:a,stack:i}}return h}const L="Canceled";function j(h){return h instanceof Error&&h.name===L&&h.message===L}function U(){const h=new Error(L);return h.name=h.message,h}function e(h){return h?new Error(`Illegal argument: ${h}`):new Error("Illegal argument")}function C(h){return h?new Error(`Illegal state: ${h}`):new Error("Illegal state")}class g extends Error{constructor(h){super("NotSupported");h&&(this.message=h)}}},"1vnw":function(qe,ve,N){qe.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(qe,ve,N){"use strict";N.d(ve,"a",function(){return W});class ie{constructor(O){this.element=O,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class W{constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let O=this._first;for(;O!==ie.Undefined;){const M=O.next;O.prev=ie.Undefined,O.next=ie.Undefined,O=M}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(O){return this._insert(O,!1)}push(O){return this._insert(O,!0)}_insert(O,M){const w=new ie(O);if(this._first===ie.Undefined)this._first=w,this._last=w;else if(M){const j=this._last;this._last=w,w.prev=j,j.next=w}else{const j=this._first;this._first=w,w.next=j,j.prev=w}this._size+=1;let L=!1;return()=>{L||(L=!0,this._remove(w))}}shift(){if(this._first===ie.Undefined)return;{const O=this._first.element;return this._remove(this._first),O}}pop(){if(this._last===ie.Undefined)return;{const O=this._last.element;return this._remove(this._last),O}}_remove(O){if(O.prev!==ie.Undefined&&O.next!==ie.Undefined){const M=O.prev;M.next=O.next,O.next.prev=M}else O.prev===ie.Undefined&&O.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):O.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):O.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let O=this._first;for(;O!==ie.Undefined;)yield O.element,O=O.next}}},"3/fG":function(qe,ve,N){"use strict";N.d(ve,"a",function(){return W});function ie(O,M){let w;return M.length===0?w=O:w=O.replace(/\{(\d+)\}/g,function(L,j){const U=j[0];return typeof M[U]!="undefined"?M[U]:L}),w}function W(O,M,...w){return ie(M,w)}},"5VLF":function(qe,ve,N){"use strict";var ie,W;function O(M,w,L){var j=function(U,e){return M.js_beautify(U,e)};return j.js=M.js_beautify,j.css=w.css_beautify,j.html=L.html_beautify,j.js_beautify=M.js_beautify,j.css_beautify=w.css_beautify,j.html_beautify=L.html_beautify,j}!(ie=[N("6UM0"),N("TXwP"),N("psGv")],W=function(M,w,L){return O(M,w,L)}.apply(ve,ie),W!==void 0&&(qe.exports=W))},"5Y4S":function(qe,ve,N){"use strict";N.d(ve,"a",function(){return O});var ie=N("MNsG");const W=ie.b.performance&&typeof ie.b.performance.now=="function";class O{constructor(M){this._highResolution=W&&M,this._startTime=this._now(),this._stopTime=-1}static create(M=!0){return new O(M)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ie.b.performance.now():Date.now()}}},"6+eU":function(qe,ve,N){"use strict";N.d(ve,"a",function(){return m});var ie=N("wx14"),W=N("rePB"),O=N("VTBJ"),M=N("1OyB"),w=N("vuIU"),L=N("Ji7U"),j=N("LK+K"),U=N("q1tI"),e=N.n(U),C=N("TSYQ"),g=N.n(C),h=function(_){var o,f="".concat(_.rootPrefixCls,"-item"),l=g()(f,"".concat(f,"-").concat(_.page),(o={},Object(W.a)(o,"".concat(f,"-active"),_.active),Object(W.a)(o,_.className,!!_.className),Object(W.a)(o,"".concat(f,"-disabled"),!_.page),o)),d=function(){_.onClick(_.page)},E=function(S){_.onKeyPress(S,_.onClick,_.page)};return e.a.createElement("li",{title:_.showTitle?_.page:null,className:l,onClick:d,onKeyPress:E,tabIndex:"0"},_.itemRender(_.page,"page",e.a.createElement("a",{rel:"nofollow"},_.page)))},u=h,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(L.a)(o,b);var _=Object(j.a)(o);function o(){var f;Object(M.a)(this,o);for(var l=arguments.length,d=new Array(l),E=0;E<l;E++)d[E]=arguments[E];return f=_.call.apply(_,[this].concat(d)),f.state={goInputText:""},f.buildOptionText=function(y){return"".concat(y," ").concat(f.props.locale.items_per_page)},f.changeSize=function(y){f.props.changeSize(Number(y))},f.handleChange=function(y){f.setState({goInputText:y.target.value})},f.handleBlur=function(y){var S=f.props,D=S.goButton,I=S.quickGo,A=S.rootPrefixCls,P=f.state.goInputText;if(D||P==="")return;if(y.relatedTarget&&(y.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||y.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;f.setState({goInputText:""}),I(f.getValidValue())},f.go=function(y){var S=f.state.goInputText;if(S==="")return;(y.keyCode===a.ENTER||y.type==="click")&&(f.setState({goInputText:""}),f.props.quickGo(f.getValidValue()))},f}return Object(w.a)(o,[{key:"getValidValue",value:function(){var l=this.state,d=l.goInputText,E=l.current;return!d||isNaN(d)?E:Number(d)}},{key:"getPageSizeOptions",value:function(){var l=this.props,d=l.pageSize,E=l.pageSizeOptions;return E.some(function(y){return y.toString()===d.toString()})?E:E.concat([d.toString()]).sort(function(y,S){var D=isNaN(Number(y))?0:Number(y),I=isNaN(Number(S))?0:Number(S);return D-I})}},{key:"render",value:function(){var l=this,d=this.props,E=d.pageSize,y=d.locale,S=d.rootPrefixCls,D=d.changeSize,I=d.quickGo,A=d.goButton,P=d.selectComponentClass,H=d.buildOptionText,R=d.selectPrefixCls,K=d.disabled,V=this.state.goInputText,oe="".concat(S,"-options"),Q=P,pe=null,ce=null,ee=null;if(!D&&!I)return null;var ne=this.getPageSizeOptions();if(D&&Q){var me=ne.map(function(Z,Y){return e.a.createElement(Q.Option,{key:Y,value:Z.toString()},(H||l.buildOptionText)(Z))});pe=e.a.createElement(Q,{disabled:K,prefixCls:R,showSearch:!1,className:"".concat(oe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||ne[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Y){return Y.parentNode}},me)}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")},y.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),ce=e.a.createElement("div",{className:"".concat(oe,"-quick-jumper")},y.jump_to,e.a.createElement("input",{disabled:K,type:"text",value:V,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),y.page,ee)),e.a.createElement("li",{className:"".concat(oe)},pe,ce)}}]),o}(e.a.Component);i.defaultProps={pageSizeOptions:["10","20","50","100"]};var c=i,s=N("N2Kk");function r(){}function n(b){return typeof b=="number"&&isFinite(b)&&Math.floor(b)===b}function t(b,_,o){return o}function v(b,_,o){var f=typeof b=="undefined"?_.pageSize:b;return Math.floor((o.total-1)/f)+1}var p=function(b){Object(L.a)(o,b);var _=Object(j.a)(o);function o(f){var l;Object(M.a)(this,o),l=_.call(this,f),l.getJumpPrevPage=function(){return Math.max(1,l.state.current-(l.props.showLessItems?3:5))},l.getJumpNextPage=function(){return Math.min(v(void 0,l.state,l.props),l.state.current+(l.props.showLessItems?3:5))},l.getItemIcon=function(D,I){var A=l.props.prefixCls,P=D||e.a.createElement("button",{type:"button","aria-label":I,className:"".concat(A,"-item-link")});return typeof D=="function"&&(P=e.a.createElement(D,Object(O.a)({},l.props))),P},l.savePaginationNode=function(D){l.paginationNode=D},l.isValid=function(D){return n(D)&&D!==l.state.current},l.shouldDisplayQuickJumper=function(){var D=l.props,I=D.showQuickJumper,A=D.pageSize,P=D.total;return P<=A?!1:I},l.handleKeyDown=function(D){(D.keyCode===a.ARROW_UP||D.keyCode===a.ARROW_DOWN)&&D.preventDefault()},l.handleKeyUp=function(D){var I=l.getValidValue(D),A=l.state.currentInputValue;I!==A&&l.setState({currentInputValue:I}),D.keyCode===a.ENTER?l.handleChange(I):D.keyCode===a.ARROW_UP?l.handleChange(I-1):D.keyCode===a.ARROW_DOWN&&l.handleChange(I+1)},l.changePageSize=function(D){var I=l.state.current,A=v(D,l.state,l.props);I=I>A?A:I,A===0&&(I=l.state.current),typeof D=="number"&&("pageSize"in l.props||l.setState({pageSize:D}),"current"in l.props||l.setState({current:I,currentInputValue:I})),l.props.onShowSizeChange(I,D),"onChange"in l.props&&l.props.onChange&&l.props.onChange(I,D)},l.handleChange=function(D){var I=l.props.disabled,A=D;if(l.isValid(A)&&!I){var P=v(void 0,l.state,l.props);A>P?A=P:A<1&&(A=1),"current"in l.props||l.setState({current:A,currentInputValue:A});var H=l.state.pageSize;return l.props.onChange(A,H),A}return l.state.current},l.prev=function(){l.hasPrev()&&l.handleChange(l.state.current-1)},l.next=function(){l.hasNext()&&l.handleChange(l.state.current+1)},l.jumpPrev=function(){l.handleChange(l.getJumpPrevPage())},l.jumpNext=function(){l.handleChange(l.getJumpNextPage())},l.hasPrev=function(){return l.state.current>1},l.hasNext=function(){return l.state.current<v(void 0,l.state,l.props)},l.runIfEnter=function(D,I){if(D.key==="Enter"||D.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)}},l.runIfEnterPrev=function(D){l.runIfEnter(D,l.prev)},l.runIfEnterNext=function(D){l.runIfEnter(D,l.next)},l.runIfEnterJumpPrev=function(D){l.runIfEnter(D,l.jumpPrev)},l.runIfEnterJumpNext=function(D){l.runIfEnter(D,l.jumpNext)},l.handleGoTO=function(D){(D.keyCode===a.ENTER||D.type==="click")&&l.handleChange(l.state.currentInputValue)};var d=f.onChange!==r,E="current"in f;E&&!d&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var y=f.defaultCurrent;"current"in f&&(y=f.current);var S=f.defaultPageSize;return"pageSize"in f&&(S=f.pageSize),y=Math.min(y,v(S,void 0,f)),l.state={current:y,currentInputValue:y,pageSize:S},l}return Object(w.a)(o,[{key:"componentDidUpdate",value:function(l,d){var E=this.props.prefixCls;if(d.current!==this.state.current&&this.paginationNode){var y=this.paginationNode.querySelector(".".concat(E,"-item-").concat(d.current));y&&document.activeElement===y&&y.blur()}}},{key:"getValidValue",value:function(l){var d=l.target.value,E=v(void 0,this.state,this.props),y=this.state.currentInputValue,S;return d===""?S=d:isNaN(Number(d))?S=y:d>=E?S=E:S=Number(d),S}},{key:"getShowSizeChanger",value:function(){var l=this.props,d=l.showSizeChanger,E=l.total,y=l.totalBoundaryShowSizeChanger;return typeof d!="undefined"?d:E>y}},{key:"renderPrev",value:function(l){var d=this.props,E=d.prevIcon,y=d.itemRender,S=y(l,"prev",this.getItemIcon(E,"prev page")),D=!this.hasPrev();return Object(U.isValidElement)(S)?Object(U.cloneElement)(S,{disabled:D}):S}},{key:"renderNext",value:function(l){var d=this.props,E=d.nextIcon,y=d.itemRender,S=y(l,"next",this.getItemIcon(E,"next page")),D=!this.hasNext();return Object(U.isValidElement)(S)?Object(U.cloneElement)(S,{disabled:D}):S}},{key:"render",value:function(){var l=this,d=this.props,E=d.prefixCls,y=d.className,S=d.style,D=d.disabled,I=d.hideOnSinglePage,A=d.total,P=d.locale,H=d.showQuickJumper,R=d.showLessItems,K=d.showTitle,V=d.showTotal,oe=d.simple,Q=d.itemRender,pe=d.showPrevNextJumpers,ce=d.jumpPrevIcon,ee=d.jumpNextIcon,ne=d.selectComponentClass,me=d.selectPrefixCls,Z=d.pageSizeOptions,Y=this.state,Se=Y.current,Me=Y.pageSize,ke=Y.currentInputValue;if(I===!0&&A<=Me)return null;var Re=v(void 0,this.state,this.props),Pe=[],Ce=null,De=null,Ne=null,J=null,fe=null,Te=H&&H.goButton,Ee=R?1:2,je=Se-1>0?Se-1:0,He=Se+1<Re?Se+1:Re,Oe=Object.keys(this.props).reduce(function($,q){return(q.substr(0,5)==="data-"||q.substr(0,5)==="aria-"||q==="role")&&($[q]=l.props[q]),$},{});if(oe)return Te&&(typeof Te=="boolean"?fe=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},P.jump_to_confirm):fe=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Te),fe=e.a.createElement("li",{title:K?"".concat(P.jump_to).concat(Se,"/").concat(Re):null,className:"".concat(E,"-simple-pager")},fe)),e.a.createElement("ul",Object(ie.a)({className:g()(E,"".concat(E,"-simple"),Object(W.a)({},"".concat(E,"-disabled"),D),y),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:g()("".concat(E,"-prev"),Object(W.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(je)),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:D,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:g()("".concat(E,"-next"),Object(W.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(He)),fe);if(Re<=3+Ee*2){var Ue={locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:K,itemRender:Q};Re||Pe.push(e.a.createElement(u,Object(ie.a)({},Ue,{key:"noPager",page:Re,className:"".concat(E,"-disabled")})));for(var Ze=1;Ze<=Re;Ze+=1){var $e=Se===Ze;Pe.push(e.a.createElement(u,Object(ie.a)({},Ue,{key:Ze,page:Ze,active:$e})))}}else{var Je=R?P.prev_3:P.prev_5,ze=R?P.next_3:P.next_5;pe&&(Ce=e.a.createElement("li",{title:K?Je:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(E,"-jump-prev"),Object(W.a)({},"".concat(E,"-jump-prev-custom-icon"),!!ce))},Q(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(ce,"prev page"))),De=e.a.createElement("li",{title:K?ze:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(E,"-jump-next"),Object(W.a)({},"".concat(E,"-jump-next-custom-icon"),!!ee))},Q(this.getJumpNextPage(),"jump-next",this.getItemIcon(ee,"next page")))),J=e.a.createElement(u,{locale:P,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Re,page:Re,active:!1,showTitle:K,itemRender:Q}),Ne=e.a.createElement(u,{locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:K,itemRender:Q});var nt=Math.max(1,Se-Ee),it=Math.min(Se+Ee,Re);Se-1<=Ee&&(it=1+Ee*2),Re-Se<=Ee&&(nt=Re-Ee*2);for(var Fe=nt;Fe<=it;Fe+=1){var Ke=Se===Fe;Pe.push(e.a.createElement(u,{locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Fe,page:Fe,active:Ke,showTitle:K,itemRender:Q}))}Se-1>=Ee*2&&Se!==1+2&&(Pe[0]=Object(U.cloneElement)(Pe[0],{className:"".concat(E,"-item-after-jump-prev")}),Pe.unshift(Ce)),Re-Se>=Ee*2&&Se!==Re-2&&(Pe[Pe.length-1]=Object(U.cloneElement)(Pe[Pe.length-1],{className:"".concat(E,"-item-before-jump-next")}),Pe.push(De)),nt!==1&&Pe.unshift(Ne),it!==Re&&Pe.push(J)}var ae=null;V&&(ae=e.a.createElement("li",{className:"".concat(E,"-total-text")},V(A,[A===0?0:(Se-1)*Me+1,Se*Me>A?A:Se*Me])));var de=!this.hasPrev()||!Re,ye=!this.hasNext()||!Re;return e.a.createElement("ul",Object(ie.a)({className:g()(E,y,Object(W.a)({},"".concat(E,"-disabled"),D)),style:S,unselectable:"unselectable",ref:this.savePaginationNode},Oe),ae,e.a.createElement("li",{title:K?P.prev_page:null,onClick:this.prev,tabIndex:de?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(E,"-prev"),Object(W.a)({},"".concat(E,"-disabled"),de)),"aria-disabled":de},this.renderPrev(je)),Pe,e.a.createElement("li",{title:K?P.next_page:null,onClick:this.next,tabIndex:ye?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(E,"-next"),Object(W.a)({},"".concat(E,"-disabled"),ye)),"aria-disabled":ye},this.renderNext(He)),e.a.createElement(c,{disabled:D,locale:P,rootPrefixCls:E,selectComponentClass:ne,selectPrefixCls:me,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Se,pageSize:Me,pageSizeOptions:Z,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Te}))}}],[{key:"getDerivedStateFromProps",value:function(l,d){var E={};if("current"in l&&(E.current=l.current,l.current!==d.current&&(E.currentInputValue=E.current)),"pageSize"in l&&l.pageSize!==d.pageSize){var y=d.current,S=v(l.pageSize,d,l);y=y>S?S:y,"current"in l||(E.current=y,E.currentInputValue=y),E.pageSize=l.pageSize}return E}}]),o}(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,N){var ie,W;(function(){var O;(function(){"use strict";var w=[function(e,C,g){var h=g(1).Beautifier,u=g(5).Options;function a(i,c){var s=new h(i,c);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new u}},function(e,C,g){var h=g(2).Output,u=g(3).Token,a=g(4),i=g(5).Options,c=g(7).Tokenizer,s=g(7).line_starters,r=g(7).positionable_operators,n=g(7).TOKEN;function t(R,K){return K.indexOf(R)!==-1}function v(R){return R.replace(/^\s+/g,"")}function p(R){for(var K={},V=0;V<R.length;V++)K[R[V].replace(/-/g,"_")]=R[V];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"],o=["before-newline","after-newline","preserve-newline"],f=p(o),l=[f.before_newline,f.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(R,K){if(K.multiline_frame||K.mode===d.ForInitializer||K.mode===d.Conditional)return;R.remove_indent(K.start_line_index)}function y(R){R=R.replace(a.allLineBreaks,`
`);for(var K=[],V=R.indexOf(`
`);V!==-1;)K.push(R.substring(0,V)),R=R.substring(V+1),V=R.indexOf(`
`);return R.length&&K.push(R),K}function S(R){return R===d.ArrayLiteral}function D(R){return t(R,[d.Expression,d.ForInitializer,d.Conditional])}function I(R,K){for(var V=0;V<R.length;V++){var oe=R[V].trim();if(oe.charAt(0)!==K)return!1}return!0}function A(R,K){for(var V=0,oe=R.length,Q;V<oe;V++)if(Q=R[V],Q&&Q.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 V=0;R&&(V=R.indentation_level,!this._output.just_added_newline()&&R.line_indent_level>V&&(V=R.line_indent_level));var oe={mode:K,parent:R,last_token:R?R.last_token:new u(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:V,alignment:0,line_indent_level:R?R.line_indent_level:V,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 h(this._options,K),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var V=new c(R,this._options);return this._tokens=V.tokenize(),R},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,K=this._reset(this._source_text),V=this._options.eol;this._options.eol==="auto"&&(V=`
`,K&&a.lineBreak.test(K||"")&&(V=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(V),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 V=R.newlines,oe=this._options.keep_array_indentation&&S(this._flags.mode);if(R.comments_before)for(var Q=R.comments_before.next();Q;)this.handle_whitespace_and_comments(Q,K),this.handle_token(Q,K),Q=R.comments_before.next();if(oe)for(var pe=0;pe<V;pe+=1)this.print_newline(pe>0,K);else if(this._options.max_preserve_newlines&&V>this._options.max_preserve_newlines&&(V=this._options.max_preserve_newlines),this._options.preserve_newlines&&V>1){this.print_newline(!1,K);for(var ce=1;ce<V;ce+=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 V=this._options.preserve_newlines&&R.newlines||K,oe=t(this._flags.last_token.text,r)||t(R.text,r);if(oe){var Q=t(this._flags.last_token.text,r)&&t(this._options.operator_position,l)||t(R.text,r);V=V&&Q}if(V)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 V=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&m(V,"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===d.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===d.ObjectLiteral&&this._flags.mode===d.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===d.ObjectLiteral&&this._flags.mode===d.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===d.ForInitializer||this._previous_flags.mode===d.Conditional),K=K||this._flags.last_token.type===n.WORD&&this._flags.mode===d.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===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||b(this._flags.last_token,["get","set"])),K?(this.set_mode(d.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=d.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=d.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=d.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,K=d.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 V=this._tokens.peek(-3);if(this._options.space_after_named_function&&V){var oe=this._tokens.peek(-4);b(V,["async","function"])||V.text==="*"&&b(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(V.text==="{"||V.text===","||V.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===d.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===d.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===d.Conditional&&(this._previous_flags.mode=d.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(),V=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):V&&(t(V.text,[":",","])&&t(K.type,[n.STRING,n.WORD,n.RESERVED])||t(K.text,["get","set","..."])&&t(V.type,[n.WORD,n.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(V.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.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(d.ObjectLiteral):this.set_mode(d.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==="}",Q=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var pe=0,ce=null;this._flags.inline_frame=!0;do if(pe+=1,ce=this._tokens.peek(pe-1),ce.newlines){this._flags.inline_frame=!1;break}while(ce.type!==n.EOF&&!(ce.type===n.END_BLOCK&&ce.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&&(Q||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===d.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!==d.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===d.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&&!D(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===d.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&&(D(this._flags.mode)||S(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var V="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?V="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?V="NEWLINE":(V="SPACE",this._output.space_before_token=!0):V="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===d.BlockStatement?V="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&D(this._flags.mode)?V="SPACE":this._flags.last_token.type===n.STRING?V="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===d.ObjectLiteral&&t(this._last_last_text,["{",","]))?V="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?V="SPACE":V="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,V="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"?V="SPACE":V="NEWLINE"),b(R,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===d.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 V==="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():V==="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===d.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?(D(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===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.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])),V=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,l)&&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 Q=!0,pe=!0,ce=!1;if(R.text===":"?this._flags.ternary_depth===0?Q=!1:(this._flags.ternary_depth-=1,ce=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!V&&!K&&this._options.preserve_newlines&&t(R.text,r)){var ee=R.text===":",ne=ee&&ce,me=ee&&!ce;switch(this._options.operator_position){case f.before_newline:this._output.space_before_token=!me,this.print_token(R),(!ee||ne)&&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||ne?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:me||this.allow_wrap_or_preserved_newline(R),Q=!(this._output.just_added_newline()||me),this._output.space_before_token=Q,this.print_token(R),this._output.space_before_token=!0;return}}if(K){this.allow_wrap_or_preserved_newline(R),Q=!1;var Z=this._tokens.peek();pe=Z&&t(Z.type,[n.WORD,n.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),Q=this._flags.last_token.type===n.START_BLOCK,pe=!1;else if(t(R.text,["--","++","!","~"])||V){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),Q=!1,pe=!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===";"&&D(this._flags.mode)&&(Q=!0),this._flags.last_token.type===n.RESERVED?Q=!0:this._flags.last_token.type===n.END_EXPR?Q=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===n.OPERATOR&&(Q=t(R.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(R.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(pe=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Q,this.print_token(R),this._output.space_before_token=pe},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 V=y(R.text),oe,Q=!1,pe=!1,ce=R.whitespace_before,ee=ce.length;if(this.print_newline(!1,K),this.print_token_line_indentation(R),this._output.add_token(V[0]),this.print_newline(!1,K),V.length>1){for(V=V.slice(1),Q=I(V,"*"),pe=A(V,ce),Q&&(this._flags.alignment=1),oe=0;oe<V.length;oe++)Q?(this.print_token_line_indentation(R),this._output.add_token(v(V[oe]))):pe&&V[oe]?(this.print_token_line_indentation(R),this._output.add_token(V[oe].substring(ee))):(this._output.current_line.set_indent(-1),this._output.add_token(V[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===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R)},e.exports.Beautifier=P},function(e){function C(u){this.__parent=u,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 u=new C(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},C.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},C.prototype.has_match=function(u){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(u))return!0;return!1},C.prototype.set_indent=function(u,a){this.is_empty()&&(this.__indent_count=u||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 u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__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(u){this.__items.push(u);var a=u.lastIndexOf(`
`);a!==-1?this.__character_count=u.length-a:this.__character_count+=u.length},C.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},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 u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,a){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),a=a||"",u.indent_level>0&&(a=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}g.prototype.get_indent_size=function(u,a){var i=this.__base_string_length;return a=a||0,u<0&&(i=0),i+=u*this.__indent_size,i+=a,i},g.prototype.get_indent_string=function(u,a){var i=this.__base_string;return a=a||0,u<0&&(u=0,i=""),a+=u*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,a=0,i="";this.__indent_size&&u>=this.__indent_size&&(a=Math.floor(u/this.__indent_size),u-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),u&&(i+=new Array(u+1).join(" ")),this.__cache.push(i)};function h(u,a){this.__indent_cache=new g(u,a),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.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()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(u,a){return this.__indent_cache.get_indent_string(u,a)},h.prototype.get_indent_size=function(u,a){return this.__indent_cache.get_indent_size(u,a)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(u){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 u!==`
`&&(i=i.replace(/[\n]/g,u)),i},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(u,a){return u=u||0,a=a||0,this.next_line.set_indent(u,a),this.__lines.length>1?(this.current_line.set_indent(u,a),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(u){for(var a=0;a<u.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.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(" "))},h.prototype.remove_indent=function(u){for(var a=this.__lines.length;u<a;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&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},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(u,a){for(var i=this.__lines.length-2;i>=0;){var c=this.__lines[i];if(c.is_empty())break;if(c.item(0).indexOf(u)!==0&&c.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=h},function(e){function C(g,h,u,a){this.type=g,this.text=h,this.comments_before=null,this.newlines=u||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 g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\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}|["+g+u+"])",c="(?:\\\\u[0-9a-fA-F]{4}|["+h+u+a+"])*";C.identifier=new RegExp(i+c,"g"),C.identifierStart=new RegExp(i),C.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+h+u+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,g){var h=g(6).Options,u=["before-newline","after-newline","preserve-newline"];function a(i){h.call(this,i,"js");var c=this.raw_options.brace_style||null;c==="expand-strict"?this.raw_options.brace_style="expand":c==="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",u),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new h,e.exports.Options=a},function(e){function C(u,a){this.raw_options=g(u,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(u,a){var i=this.raw_options[u],c=a||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(c=i.concat()):typeof i=="string"&&(c=i.split(/[^a-zA-Z0-9_\/\-]+/)),c},C.prototype._get_boolean=function(u,a){var i=this.raw_options[u],c=i===void 0?!!a:!!i;return c},C.prototype._get_characters=function(u,a){var i=this.raw_options[u],c=a||"";return typeof i=="string"&&(c=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),c},C.prototype._get_number=function(u,a){var i=this.raw_options[u];a=parseInt(a,10),isNaN(a)&&(a=0);var c=parseInt(i,10);return isNaN(c)&&(c=a),c},C.prototype._get_selection=function(u,a,i){var c=this._get_selection_list(u,a,i);if(c.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[u]+"'");return c[0]},C.prototype._get_selection_list=function(u,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 c=this._get_array(u,i);if(!this._is_valid_selection(c,a))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[u]+"'");return c},C.prototype._is_valid_selection=function(u,a){return u.length&&a.length&&!u.some(function(i){return a.indexOf(i)===-1})};function g(u,a){var i={};u=h(u);var c;for(c in u)c!==a&&(i[c]=u[c]);if(a&&u[a])for(c in u[a])i[c]=u[a][c];return i}function h(u){var a={},i;for(i in u){var c=i.replace(/-/g,"_");a[c]=u[i]}return a}e.exports.Options=C,e.exports.normalizeOpts=h,e.exports.mergeOpts=g},function(e,C,g){var h=g(8).InputScanner,u=g(9).Tokenizer,a=g(9).TOKEN,i=g(13).Directives,c=g(4),s=g(12).Pattern,r=g(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},v=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(" "),o=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";o=o.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),o="\\?\\.(?!\\d) "+o,o=o.replace(/ /g,"|");var f=new RegExp(o),l="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=l.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+d.join("|")+")$"),y,S=function(I,A){u.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(c.identifier).matching(c.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(c.lineBreak),shebang:P.starting_with(/#!/).until_after(c.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 u,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(){y=!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(c.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(c.newline);)A+=this._input.next();return y=!0,this._create_token(t.COMMENT,A)}}else if(y&&I==="-"&&(A=this.__patterns.html_comment_end.read(),A))return y=!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=v.get_directives(P);H&&H.ignore==="start"&&(P+=v.readIgnored(this._input)),P=P.replace(c.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=D(A)),this._input.peek()===I&&(A+=this._input.next()),A=A.replace(c.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(c.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(c.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,V=0;H;){var oe=!!H[1],Q=H[2],pe=!!H[H.length-1]||Q.slice(0,8)==="![CDATA[";if(!pe&&(Q===R||K&&Q.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--V:++V),P+=H[0],V<=0)break;H=this.__patterns.xml.read_match()}return H||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(c.allLineBreaks,`
`),this._create_token(t.STRING,P)}}return null};function D(I){for(var A="",P=0,H=new h(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(),V="";this._input.hasNext();){if(V=this._input.next(),V===I||!A&&c.newline.test(V)){this._input.back();break}else V==="\\"&&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(),V+=this._input.next()):P&&(P==="${"&&V==="$"&&this._input.peek()==="{"&&(V+=this._input.next()),P===V&&(I==="`"?V+=this._read_string_recursive("}",A,"`"):V+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(V+=this._input.next())));V+=R.read(),K+=V}return K},e.exports.Tokenizer=S,e.exports.TOKEN=t,e.exports.positionable_operators=_.slice(),e.exports.line_starters=l.slice()},function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function g(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},g.prototype.peek=function(h){var u=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(u=this.__input.charAt(h)),u},g.prototype.__match=function(h,u){h.lastIndex=u;var a=h.exec(this.__input);return a&&!(C&&h.sticky)&&(a.index!==u&&(a=null)),a},g.prototype.test=function(h,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(h,u):!1},g.prototype.testChar=function(h,u){var a=this.peek(u);return h.lastIndex=0,a!==null&&h.test(a)},g.prototype.match=function(h){var u=this.__match(h,this.__position);return u?this.__position+=u[0].length:u=null,u},g.prototype.read=function(h,u,a){var i="",c;return h&&(c=this.match(h),c&&(i+=c[0])),u&&(c||!h)&&(i+=this.readUntil(u,a)),i},g.prototype.readUntil=function(h,u){var a="",i=this.__position;h.lastIndex=this.__position;var c=h.exec(this.__input);return c?(i=c.index,u&&(i+=c[0].length)):i=this.__input_length,a=this.__input.substring(this.__position,i),this.__position=i,a},g.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},g.prototype.get_regexp=function(h,u){var a=null,i="g";return u&&C&&(i="y"),typeof h=="string"&&h!==""?a=new RegExp(h,i):h&&(a=new RegExp(h.source,i)),a},g.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(h){var u=this.__position,a=this.readUntilAfter(h);return this.__position=u,a},g.prototype.lookBack=function(h){var u=this.__position-1;return u>=h.length&&this.__input.substring(u-h.length,u).toLowerCase()===h},e.exports.InputScanner=g},function(e,C,g){var h=g(8).InputScanner,u=g(3).Token,a=g(10).TokenStream,i=g(11).WhitespacePattern,c={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(r,n){this._input=new h(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 u(c.START,""),t=null,v=[],p=new a;n.type!==c.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)?(v.push(t),t=r):t&&this._is_closing(r,t)&&(r.opened=t,t.closed=r,t=v.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(c.RAW,t):this._create_token(c.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 u(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=c},function(e){function C(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}C.prototype.restart=function(){this.__position=0},C.prototype.isEmpty=function(){return this.__tokens_length===0},C.prototype.hasNext=function(){return this.__position<this.__tokens_length},C.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},C.prototype.peek=function(g){var h=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(h=this.__tokens[g]),h},C.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},e.exports.TokenStream=C},function(e,C,g){var h=g(12).Pattern;function u(a,i){h.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=""}u.prototype=new h,u.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+"]")},u.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},u.prototype.matching=function(a,i){var c=this._create();return c.__set_whitespace_patterns(a,i),c._update(),c},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(a,i){a.lastIndex=0;for(var c=0,s=[],r=a.exec(i);r;)s.push(i.substring(c,r.index)),c=r.index+r[0].length,r=a.exec(i);return c<i.length?s.push(i.substring(c,i.length)):s.push(""),s},e.exports.WhitespacePattern=u},function(e){function C(g,h){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,h&&(this._starting_pattern=this._input.get_regexp(h._starting_pattern,!0),this._match_pattern=this._input.get_regexp(h._match_pattern,!0),this._until_pattern=this._input.get_regexp(h._until_pattern),this._until_after=h._until_after)}C.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},C.prototype.read_match=function(){return this._input.match(this._match_pattern)},C.prototype.until_after=function(g){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(g),h._update(),h},C.prototype.until=function(g){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(g),h._update(),h},C.prototype.starting_with=function(g){var h=this._create();return h._starting_pattern=this._input.get_regexp(g,!0),h._update(),h},C.prototype.matching=function(g){var h=this._create();return h._match_pattern=this._input.get_regexp(g,!0),h._update(),h},C.prototype._create=function(){return new C(this._input,this)},C.prototype._update=function(){},e.exports.Pattern=C},function(e){function C(g,h){g=typeof g=="string"?g:g.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+h,"g")}C.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)h[u[1]]=u[2],u=this.__directive_pattern.exec(g);return h},C.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},function(e,C,g){var h=g(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(i,c){h.call(this,i,c),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),c&&(this.__template_pattern=this._input.get_regexp(c.__template_pattern),this._excluded=Object.assign(this._excluded,c._excluded),this._disabled=Object.assign(this._disabled,c._disabled));var s=new h(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 h,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(i){var c=this._create();return c._disabled[i]=!0,c._update(),c},a.prototype.read_options=function(i){var c=this._create();for(var s in u)c._disabled[s]=i.templating.indexOf(s)===-1;return c._update(),c},a.prototype.exclude=function(i){var c=this._create();return c._excluded[i]=!0,c._update(),c},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 c=this._read_template();c;)this._match_pattern?c+=this._input.read(this._match_pattern):c+=this._input.readUntil(this.__template_pattern),i+=c,c=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="",c=this._input.peek();if(c==="<"){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 c==="{"&&(!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}],L={};function j(e){var C=L[e];if(C!==void 0)return C.exports;var g=L[e]={exports:{}};return w[e](g,g.exports,j),g.exports}var U=j(0);O=U})();var M=O;!(ie=[],W=function(){return{js_beautify:M}}.apply(ve,ie),W!==void 0&&(qe.exports=W))})()},"746U":function(qe,ve,N){"use strict";N.d(ve,"f",function(){return ie}),N.d(ve,"l",function(){return W}),N.d(ve,"k",function(){return O}),N.d(ve,"j",function(){return M}),N.d(ve,"g",function(){return w}),N.d(ve,"m",function(){return L}),N.d(ve,"h",function(){return j}),N.d(ve,"n",function(){return U}),N.d(ve,"c",function(){return e}),N.d(ve,"a",function(){return C}),N.d(ve,"i",function(){return g}),N.d(ve,"o",function(){return h}),N.d(ve,"e",function(){return i}),N.d(ve,"d",function(){return c}),N.d(ve,"p",function(){return s}),N.d(ve,"b",function(){return r});function ie(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 M(n){return typeof n=="number"&&!isNaN(n)}function w(n){return n===!0||n===!1}function L(n){return typeof n=="undefined"}function j(n){return!U(n)}function U(n){return L(n)||n===null}function e(n,t){if(!n)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function C(n){if(U(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function g(n){return typeof n=="function"}function h(n,t){const v=Math.min(n.length,t.length);for(let p=0;p<v;p++)u(n[p],t[p])}function u(n,t){if(W(t)){if(typeof n!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(g(t)){try{if(n instanceof t)return}catch(v){}if(!U(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=[],v=Object.getPrototypeOf(n);for(;Object.prototype!==v;)t=t.concat(Object.getOwnPropertyNames(v)),v=Object.getPrototypeOf(v);return t}function i(n){const t=[];for(const v of a(n))typeof n[v]=="function"&&t.push(v);return t}function c(n,t){const v=m=>function(){const b=Array.prototype.slice.call(arguments,0);return t(m,b)};let p={};for(const m of n)p[m]=v(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,N){"use strict";N.d(ve,"e",function(){return j}),N.d(ve,"c",function(){return e}),N.d(ve,"d",function(){return C}),N.d(ve,"a",function(){return h}),N.d(ve,"f",function(){return u}),N.d(ve,"b",function(){return a});var ie=N("KQm4"),W=N("VTBJ"),O=N("Ff2n"),M=N("Zm9Q"),w=N("Kwbf"),L=N("OZM5");function j(i,c){return i!=null?i:c}function U(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],c=new Map;function s(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(t){var v=t.key,p=t.children;Object(w.a)(v!=null,"Tree node must have a certain key: [".concat(n).concat(v,"]"));var m=String(v);Object(w.a)(!c.has(m)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(m)),c.set(m,!0),s(p,"".concat(n).concat(m," > "))})}s(i)}function e(i){function c(s){var r=Object(M.a)(s);return r.map(function(n){if(!Object(L.i)(n))return Object(w.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var t=n.key,v=n.props,p=v.children,m=Object(O.a)(v,["children"]),b=Object(W.a)({key:t},m),_=c(p);return _.length&&(b.children=_),b}).filter(function(n){return n})}return c(i)}function C(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=new Set(c===!0?[]:c),r=[];function n(t){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(p,m){var b=Object(L.h)(v?v.pos:"0",m),_=j(p.key,b),o=Object(W.a)(Object(W.a)({},p),{},{parent:v,pos:b,children:null,data:p,isStart:[].concat(Object(ie.a)(v?v.isStart:[]),[m===0]),isEnd:[].concat(Object(ie.a)(v?v.isEnd:[]),[m===t.length-1])});return r.push(o),c===!0||s.has(_)?o.children=n(p.children||[],o):o.children=[],o})}return n(i),r}function g(i,c,s){var r;s?typeof s=="string"?r=function(v){return v[s]}:typeof s=="function"&&(r=function(v){return s(v)}):r=function(v,p){return j(v.key,p)};function n(t,v,p){var m=t?t.children:i,b=t?Object(L.h)(p.pos,v):"0";if(t){var _=r(t,b),o={node:t,index:v,pos:b,key:_,parentPos:p.node?p.pos:null,level:p.level+1};c(o)}m&&m.forEach(function(f,l){n(f,l,{node:t,pos:b,level:p?p.level+1:-1})})}n(null)}function h(i){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=c.initWrapper,r=c.processEntity,n=c.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,v={},p={},m={posEntities:v,keyEntities:p};return s&&(m=s(m)||m),g(i,function(b){var _=b.node,o=b.index,f=b.pos,l=b.key,d=b.parentPos,E=b.level,y={node:_,index:o,key:l,pos:f,level:E},S=j(l,f);v[f]=y,p[S]=y,y.parent=v[d],y.parent&&(y.parent.children=y.parent.children||[],y.parent.children.push(y)),r&&r(y,m)},t),n&&n(m),m}function u(i,c){var s=c.expandedKeys,r=c.selectedKeys,n=c.loadedKeys,t=c.loadingKeys,v=c.checkedKeys,p=c.halfCheckedKeys,m=c.dragOverNodeKey,b=c.dropPosition,_=c.keyEntities,o=_[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:v.indexOf(i)!==-1,halfChecked:p.indexOf(i)!==-1,pos:String(o?o.pos:""),dragOver:m===i&&b===0,dragOverGapTop:m===i&&b===-1,dragOverGapBottom:m===i&&b===1};return f}function a(i){var c=i.data,s=i.expanded,r=i.selected,n=i.checked,t=i.loaded,v=i.loading,p=i.halfChecked,m=i.dragOver,b=i.dragOverGapTop,_=i.dragOverGapBottom,o=i.pos,f=i.active,l=Object(W.a)(Object(W.a)({},c),{},{expanded:s,selected:r,checked:n,loaded:t,loading:v,halfChecked:p,dragOver:m,dragOverGapTop:b,dragOverGapBottom:_,pos:o,active:f});return"props"in l||Object.defineProperty(l,"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}}),l}},"8HAY":function(qe,ve,N){"use strict";N.d(ve,"a",function(){return w}),N.d(ve,"b",function(){return L}),N.d(ve,"d",function(){return j}),N.d(ve,"e",function(){return U}),N.d(ve,"c",function(){return e});var ie=N("MI8n"),W=N("pmY6"),O=N("3/fG"),M=function(C,g,h,u){function a(i){return i instanceof h?i:new h(function(c){c(i)})}return new(h||(h=Promise))(function(i,c){function s(t){try{n(u.next(t))}catch(v){c(v)}}function r(t){try{n(u.throw(t))}catch(v){c(v)}}function n(t){t.done?i(t.value):a(t.value).then(s,r)}n((u=u.apply(C,g||[])).next())})};class w extends W.a{constructor(C,g="",h="",u=!0,a){super();this._onDidChange=this._register(new ie.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=C,this._label=g,this._cssClass=h,this._enabled=u,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,g){return M(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(C))})}}class L extends W.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ie.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ie.b),this.onDidRun=this._onDidRun.event}run(C,g){return M(this,void 0,void 0,function*(){if(!C.enabled)return;this._onBeforeRun.fire({action:C});let h;try{yield this.runAction(C,g)}catch(u){h=u}this._onDidRun.fire({action:C,error:h})})}runAction(C,g){return M(this,void 0,void 0,function*(){yield C.run(g)})}}class j extends w{constructor(C){super(j.ID,C,C?"separator text":"separator");this.checked=!1,this.enabled=!1}}j.ID="vs.actions.separator";class U{constructor(C,g,h,u){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=C,this.label=g,this.class=u,this._actions=h}get actions(){return this._actions}dispose(){}run(){return M(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,N){qe.exports={button:"button___1wy9m"}},"9Bee":function(qe,ve,N){"use strict";var ie=N("DYRE"),W=N("zeV3"),O=N("+L6B"),M=N("2/Rp"),w=N("k1fw"),L=N("9og8"),j=N("tJVT"),U=N("WmNS"),e=N.n(U),C=N("q1tI"),g=N.n(C),h=N("vg9a"),u=N("DlQD"),a=N.n(u),i=N("rUJ1");function c(F,T){var x=F.match(/^(\s+)(?:```)/);if(x===null)return T;var k=x[1];return T.split(`
`).map(function(G){var B=G.match(/^\s+/);if(B===null)return G;var _e=Object(j.a)(B,1),Ge=_e[0];return Ge.length>=k.length?G.slice(k.length):G}).join(`
`)}var s=[],r=["<ul>"],n=new a.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){s.length=0,r=["<ul>"]}var p={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(F,T,x,k){if(T>=F.length||F[T].level<=x)return T;var G=F[T];k.push("<li><a href='#"+G.anchor+"'>"+G.text+"</a>"),T++;var B=[];return T=m(F,T,G.level,B),B.length>0&&(k.push("<ul>"),B.forEach(function(_e){k.push(_e)}),k.push("</ul>")),k.push("</li>"),T=m(F,T,x,k),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 k=x[0],G=c(k,x[3]||""),B=x[2]?x[2].trim():x[2];if(["latex","katex","math"].indexOf(B)>=0){var _e=l(),Ge=G;G=_e,d[_e]={type:"block",expression:Ge}}return{type:"code",raw:k,lang:B,text:G}}}},o=/(?:\${2})([^\n`]+?)(?:\${2})/gi,f=0,l=function(){return"__special_katext_id_".concat(f++,"__")},d={};function E(){return d}function y(){f=0,d={}}function S(F){return F=F.replace(o,function(T,x){var k=l();return d[k]={type:"inline",expression:x},k}),F}var D=n.listitem;n.listitem=function(F){return D(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 k=(T||"").match(/\S*/)[0];return k?["latex","katex","math"].indexOf(k)>=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 k=this.options.headerPrefix+x.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:k,level:T,text:F}),"<h"+T+' id="'+k+'">'+F+"</h"+T+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:_,renderer:n});var P=a.a,H=N("SJMd"),R=N("ulZh"),K=N.n(R),V=N("m3rI"),oe=N("Oy/b"),Q=N("p5ED"),pe=N("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 ce=function(F,T){return(ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,k){x.__proto__=k}||function(x,k){for(var G in k)Object.prototype.hasOwnProperty.call(k,G)&&(x[G]=k[G])})(F,T)};function ee(F,T){function x(){this.constructor=F}ce(F,T),F.prototype=T===null?Object.create(T):(x.prototype=T.prototype,new x)}function ne(F,T,x,k){return new(x||(x=Promise))(function(G,B){function _e(st){try{tt(k.next(st))}catch(Ve){B(Ve)}}function Ge(st){try{tt(k.throw(st))}catch(Ve){B(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((k=k.apply(F,T||[])).next())})}function me(F,T){var x,k,G,B,_e={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return B={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function Ge(tt){return function(st){return function(Ve){if(x)throw new TypeError("Generator is already executing.");for(;_e;)try{if(x=1,k&&(G=2&Ve[0]?k.return:Ve[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,Ve[1])).done)return G;switch(k=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++,k=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],k=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 k=Array(F),G=0;for(T=0;T<x;T++)for(var B=arguments[T],_e=0,Ge=B.length;_e<Ge;_e++,G++)k[G]=B[_e];return k}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 k=0,G=x;k<G.length;k++){var B=G[k],_e=B[0],Ge=B[1];T.setAttribute(_e,Ge)}},F.createRect=function(T,x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","rect");return G.setAttribute("width",T.toString()),G.setAttribute("height",x.toString()),k&&F.setAttributes(G,k),G},F.createLine=function(T,x,k,G,B){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",k.toString()),_e.setAttribute("y2",G.toString()),B&&F.setAttributes(_e,B),_e},F.createPolygon=function(T,x){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",T),x&&F.setAttributes(k,x),k},F.createCircle=function(T,x){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(T/2).toString()),k.setAttribute("cy",(T/2).toString()),k.setAttribute("r",T.toString()),x&&F.setAttributes(k,x),k},F.createEllipse=function(T,x,k){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()),k&&F.setAttributes(G,k),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,k,G,B,_e,Ge){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(tt,[["id",T],["orient",x],["markerWidth",k.toString()],["markerHeight",G.toString()],["refX",B.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 k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=T,x&&F.setAttributes(k,x),k},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 k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=T,k.y=x,k},F.createPath=function(T,x){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",T),x&&F.setAttributes(k,x),k},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}(),Me=function(){function F(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return F.prototype.rasterize=function(T,x,k){var G=this;return new Promise(function(B){var _e=k!==void 0?k: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);B(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 Pe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Pe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Pe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new 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}(),Pe=function(F,T){this.selector=F,this.style=T},Ce=function(F,T){this.localName=F,this.style=T},De=function(){function F(T,x,k,G,B){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=T,this.displayMode=x,this.markerItems=k,this.uiStyleSettings=G,this.styles=B,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 k=document.createElement("div");k.className=this.toolbarBlockStyleClass.name,k.style.whiteSpace="nowrap",this.uiContainer.appendChild(k),this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(k,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(B){var _e=document.createElement("div");_e.className=""+x.toolbarButtonStyleClass.name,_e.setAttribute("data-type-name",B.typeName),_e.innerHTML=B.icon,_e.addEventListener("click",function(){x.markerToolbarButtonClicked(_e,B)}),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,k){var G=this,B=document.createElement("div");switch(B.className=""+this.toolbarButtonStyleClass.name,B.innerHTML=x,B.setAttribute("data-action",k),B.addEventListener("click",function(){G.actionToolbarButtonClicked(B,k)}),k){case"select":B.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":B.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":B.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":B.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":B.style.fill=this.uiStyleSettings.closeButtonColor}T.appendChild(B),this.buttons.push(B)},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 Pe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Pe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},F.prototype.markerToolbarButtonClicked=function(T,x){this.setActiveButton(T),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("marker",x)}),this.markerButtonOverflowBlock.style.display="none"},F.prototype.actionToolbarButtonClicked=function(T,x){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("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(k){return k.getAttribute("data-type-name")===T});x&&this.setActiveButton(x)},F.prototype.setCurrentMarker=function(T){var x=this;this.currentMarker=T,this.buttons.filter(function(k){return/delete|notes/.test(k.getAttribute("data-action"))}).forEach(function(k){x.currentMarker===void 0?(k.style.fillOpacity="0.4",k.style.pointerEvents="none"):(k.style.fillOpacity="1",k.style.pointerEvents="all")})},F}(),Ne=function(){function F(T,x,k,G){this.panels=[],this.panelButtons=[],this.markerjsContainer=T,this.displayMode=x,this.uiStyleSettings=k,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 Pe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Pe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},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,k,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+" "+((k=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(B){var _e;B.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=B.icon,Ge.title=B.title,Ge.addEventListener("click",function(){G.panelButtonClick(B)}),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,k=-1;if(T!==this.activePanel){k=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(B,_e){var Ge,tt;B.className=x.toolboxButtonStyleClass.name+" "+(_e===k?""+((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},fe=function(F){function T(x,k,G,B){var _e=F.call(this,x,B||'<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=k,_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,k=document.createElement("div");return k.style.overflow="hidden",k.style.whiteSpace="nowrap",this.colors.forEach(function(G){var B=x.getColorBox(G);k.appendChild(B),x.colorBoxes.push(B)}),k},T.prototype.getColorBox=function(x){var k=this,G=this.uiStyleSettings.toolbarHeight/4,B=this.uiStyleSettings.toolbarHeight-G,_e=document.createElement("div");_e.style.display="inline-block",_e.style.boxSizing="content-box",_e.style.width=B-2+"px",_e.style.height=B-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=(B+2)/2+"px",_e.style.borderColor=x===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",_e.addEventListener("click",function(){k.setCurrentColor(x,_e)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=B-2+"px",Ge.style.height=B-2+"px",Ge.style.backgroundColor=x,Ge.style.borderRadius=B/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,k){var G=this;this.currentColor=x,this.colorBoxes.forEach(function(B){B.style.borderColor=B===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(x)},T}(J),Te=function(){function F(T,x,k){this._state="new",this._isSelected=!1,this._container=T,this._overlayContainer=x,this.globalSettings=k,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}(),Ee=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}(),je=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,k,G){var B=F.call(this,x,k,G)||this;return B.left=0,B.top=0,B.width=0,B.height=0,B.defaultSize={x:50,y:20},B.offsetX=0,B.offsetY=0,B.rotationAngle=0,B.CB_DISTANCE=10,B._suppressMarkerCreateEvent=!1,B.container.transform.baseVal.appendItem(Y.createTransform()),B.setupControlBox(),B}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 k=Y.createTransform();this._visual.transform.baseVal.appendItem(k)},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,k){F.prototype.pointerDown.call(this,x,k),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(k),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k)){this.activeGrip=this.rotatorGrip;var B=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=B.x-this.width/2,this.top=B.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 k=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",k==="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 k=this.unrotatePoint(x);this.state==="creating"?this.resize(x):this.state==="move"?(this.left=this.manipulationStartLeft+(k.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(k.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(k):this.state==="rotate"&&this.rotate(x)},T.prototype.resize=function(x){var k=this.manipulationStartLeft,G=this.manipulationStartWidth,B=this.manipulationStartTop,_e=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:k=this.manipulationStartLeft+x.x-this.manipulationStartX,G=this.manipulationStartWidth+this.manipulationStartLeft-k;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:B=this.manipulationStartTop+x.y-this.manipulationStartY,_e=this.manipulationStartHeight+this.manipulationStartTop-B;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=k,this.width=G):(this.left=k+G,this.width=-G),_e>=0?(this.top=B,this.height=_e):(this.top=B+_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 k=Math.sign(x.x-this.centerX);this.rotationAngle=180*Math.atan((x.y-this.centerY)/(x.x-this.centerX))/Math.PI+90*k,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 k=this.container.getCTM(),G=Y.createPoint(x.x,x.y);return{x:(G=G.matrixTransform(k)).x,y:G.y}},T.prototype.unrotatePoint=function(x){if(this.rotationAngle===0)return x;var k=this.container.getCTM();k=k.inverse();var G=Y.createPoint(x.x,x.y);return{x:(G=G.matrixTransform(k)).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 Ee,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 je;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,k=-x/2,G=k,B=(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,k,G),this.positionGrip(this.controlGrips.topCenter.visual,B,G),this.positionGrip(this.controlGrips.topRight.visual,tt,G),this.positionGrip(this.controlGrips.centerLeft.visual,k,_e),this.positionGrip(this.controlGrips.centerRight.visual,tt,_e),this.positionGrip(this.controlGrips.bottomLeft.visual,k,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,B,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,B,G-3*this.CB_DISTANCE)},T.prototype.positionGrip=function(x,k,G){var B=x.transform.baseVal.getItem(0);B.setTranslate(k,G),x.transform.baseVal.replaceItem(B,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 k=x;this.left=k.left,this.top=k.top,this.width=k.width,this.height=k.height,this.rotationAngle=k.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,k.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(He.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,k.containerTransformMatrix))},T.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k);var G=this.rotatePoint({x:this.left,y:this.top}),B=this.unrotatePoint({x:G.x*x,y:G.y*k});this.left=B.x,this.top=B.y,this.width=this.width*x,this.height=this.height*k,this.adjustControlBox()},T}(Te),Ue=function(F){function T(x,k,G){var B=F.call(this,x,k,G)||this;return B.fillColor="transparent",B.strokeColor="transparent",B.strokeWidth=0,B.strokeDasharray="",B.opacity=1,B.setStrokeColor=B.setStrokeColor.bind(B),B.setFillColor=B.setFillColor.bind(B),B.setStrokeWidth=B.setStrokeWidth.bind(B),B.setStrokeDasharray=B.setStrokeDasharray.bind(B),B.createVisual=B.createVisual.bind(B),B}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,k){F.prototype.pointerDown.call(this,x,k),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 k=x;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},T.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.setSize()},T.title="Rectangle marker",T}(Oe),Ze=function(F){function T(x,k,G,B){var _e=F.call(this,x,B||'<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=k,_e.currentWidth=G,_e.setCurrentWidth=_e.setCurrentWidth.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.widths.forEach(function(G){var B=document.createElement("div");B.style.display="flex",B.style.flexGrow="2",B.style.alignItems="center",B.style.justifyContent="space-between",B.style.padding="5px",B.style.borderWidth="2px",B.style.borderStyle="solid",B.style.borderColor=G===x.currentWidth?x.uiStyleSettings.toolboxAccentColor:"transparent",B.addEventListener("click",function(){x.setCurrentWidth(G,B)}),k.appendChild(B);var _e=document.createElement("div");_e.innerText=G.toString(),_e.style.marginRight="5px",B.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),B.appendChild(Ge),x.widthBoxes.push(B)}),k},T.prototype.setCurrentWidth=function(x,k){var G=this;this.currentWidth=x,this.widthBoxes.forEach(function(B){B.style.borderColor=B===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},T}(J),$e=function(F){function T(x,k,G,B){var _e=F.call(this,x,B||'<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=k,_e.currentStyle=G,_e.setCurrentStyle=_e.setCurrentStyle.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.styles.forEach(function(G){var B=document.createElement("div");B.style.display="flex",B.style.alignItems="center",B.style.justifyContent="space-between",B.style.padding="5px",B.style.borderWidth="2px",B.style.borderStyle="solid",B.style.overflow="hidden",B.style.maxWidth=100/x.styles.length-5+"%",B.style.borderColor=G===x.currentStyle?x.uiStyleSettings.toolboxAccentColor:"transparent",B.addEventListener("click",function(){x.setCurrentStyle(G,B)}),k.appendChild(B);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,B.appendChild(_e),x.styleBoxes.push(B)}),k},T.prototype.setCurrentStyle=function(x,k){var G=this;this.currentStyle=x,this.styleBoxes.forEach(function(B){B.style.borderColor=B===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},T}(J),Je=function(F){function T(x,k,G){var B=F.call(this,x,k,G)||this;return B.strokeColor=G.defaultColor,B.strokeWidth=G.defaultStrokeWidth,B.strokeDasharray=G.defaultStrokeDasharray,B.strokePanel=new fe("Line color",G.defaultColorSet,G.defaultColor),B.strokePanel.onColorChanged=B.setStrokeColor,B.strokeWidthPanel=new Ze("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),B.strokeWidthPanel.onWidthChanged=B.setStrokeWidth,B.strokeStylePanel=new $e("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),B.strokeStylePanel.onStyleChanged=B.setStrokeDasharray,B}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,k,G){var B=F.call(this,x,k,G)||this;return B.x1=0,B.y1=0,B.x2=0,B.y2=0,B.defaultLength=50,B.manipulationStartX=0,B.manipulationStartY=0,B.manipulationStartX1=0,B.manipulationStartY1=0,B.manipulationStartX2=0,B.manipulationStartY2=0,B.setupControlBox(),B}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,k){F.prototype.pointerDown.call(this,x,k),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(k)?this.activeGrip=this.grip1:this.grip2.ownsTarget(k)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},T.prototype.pointerUp=function(x){var k=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",k==="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 je;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,k,G){var B=x.transform.baseVal.getItem(0);B.setTranslate(k,G),x.transform.baseVal.replaceItem(B,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 k=x;this.x1=k.x1,this.y1=k.y1,this.x2=k.x2,this.y2=k.y2},T.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.x1=this.x1*x,this.y1=this.y1*k,this.x2=this.x2*x,this.y2=this.y2*k,this.adjustVisual(),this.adjustControlBox()},T}(Te),it=function(F){function T(x,k,G){var B=F.call(this,x,k,G)||this;return B.strokeColor="transparent",B.strokeWidth=0,B.strokeDasharray="",B.setStrokeColor=B.setStrokeColor.bind(B),B.setStrokeWidth=B.setStrokeWidth.bind(B),B.setStrokeDasharray=B.setStrokeDasharray.bind(B),B.strokeColor=G.defaultColor,B.strokeWidth=G.defaultStrokeWidth,B.strokeDasharray=G.defaultStrokeDasharray,B.strokePanel=new fe("Line color",G.defaultColorSet,G.defaultColor),B.strokePanel.onColorChanged=B.setStrokeColor,B.strokeWidthPanel=new Ze("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),B.strokeWidthPanel.onWidthChanged=B.setStrokeWidth,B.strokeStylePanel=new $e("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),B.strokeStylePanel.onStyleChanged=B.setStrokeDasharray,B}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,k){F.prototype.pointerDown.call(this,x,k),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 k=x;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.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),Fe=function(F){function T(x,k,G,B){var _e=F.call(this,x,B||'<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=k,_e.currentFont=G,_e.setCurrentFont=_e.setCurrentFont.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.flexGrow="2",this.fonts.forEach(function(G){var B=document.createElement("div");B.style.display="inline-block",B.style.alignItems="center",B.style.justifyContent="space-between",B.style.padding="5px",B.style.borderWidth="2px",B.style.borderStyle="solid",B.style.overflow="hidden",B.style.maxWidth=100/x.fonts.length-5+"%",B.style.borderColor=G===x.currentFont?x.uiStyleSettings.toolboxAccentColor:"transparent",B.addEventListener("click",function(){x.setCurrentFont(G,B)}),k.appendChild(B);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),B.appendChild(_e),x.fontBoxes.push(B)}),k},T.prototype.setCurrentFont=function(x,k){var G=this;this.currentFont=x,this.fontBoxes.forEach(function(B){B.style.borderColor=B===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},T}(J),Ke=function(F){function T(x,k,G){var B=F.call(this,x,k,G)||this;return B.color="transparent",B.padding=5,B.DEFAULT_TEXT="your text here",B.text=B.DEFAULT_TEXT,B.isMoved=!1,B.color=G.defaultColor,B.fontFamily=G.defaultFontFamily,B.defaultSize={x:100,y:30},B.setColor=B.setColor.bind(B),B.setFont=B.setFont.bind(B),B.renderText=B.renderText.bind(B),B.sizeText=B.sizeText.bind(B),B.textEditDivClicked=B.textEditDivClicked.bind(B),B.showTextEditor=B.showTextEditor.bind(B),B.setSize=B.setSize.bind(B),B.positionTextEditor=B.positionTextEditor.bind(B),B.colorPanel=new fe("Color",G.defaultColorSet,G.defaultColor),B.colorPanel.onColorChanged=B.setColor,B.fontFamilyPanel=new Fe("Font",G.defaultFontFamilies,G.defaultFontFamily),B.fontFamilyPanel.onFontChanged=B.setFont,B}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 k=!1;return this.textElement.childNodes.forEach(function(G){G===x&&(k=!0)}),k},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,k){F.prototype.pointerDown.call(this,x,k),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(k){x.textElement.appendChild(Y.createTSpan(k.trim()===""?" ":k.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},T.prototype.getTextScale=function(){var x=this.textElement.getBBox(),k=1;if(x.width>0&&x.height>0){var G=(1*this.width-this.width*this.padding*2/100)/x.width,B=(1*this.height-this.height*this.padding*2/100)/x.height;k=Math.min(G,B)}return k},T.prototype.getTextPosition=function(x){var k=this.textElement.getBBox(),G=0,B=0;return k.width>0&&k.height>0&&(G=(this.width-k.width*x)/2,B=this.height/2-k.height*x/2),{x:G,y:B}},T.prototype.sizeText=function(){var x=this.textElement.getBBox(),k=this.getTextScale(),G=this.getTextPosition(k);G.y-=x.y*k,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+G.x+"px, "+G.y+"px) scale("+k+", "+k+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(G.x,G.y),this.textElement.transform.baseVal.getItem(1).setScale(k,k))},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 k=this.state;k==="creating"&&(this._suppressMarkerCreateEvent=!0),F.prototype.pointerUp.call(this,x),this.setSize(),(k==="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(k){k.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var k=Number.parseFloat(x.textEditor.style.fontSize);x.textEditor.clientWidth>=Number.parseInt(x.textEditor.style.maxWidth)&&k>.9;)k-=.1,x.textEditor.style.fontSize=Math.max(k,.9)+"em"}),this.textEditor.addEventListener("keyup",function(k){k.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(k){if(k.clipboardData){var G=k.clipboardData.getData("text"),B=window.getSelection();if(!B.rangeCount)return!1;B.deleteFromDocument(),B.getRangeAt(0).insertNode(document.createTextNode(G)),k.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(),k=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),G=this.textElement.getBBox(),B={x:G.width*x,y:G.height*x};k.x-=B.x/2,k.y-=B.y/2,this.textEditor.style.top=k.y+"px",this.textEditor.style.left=k.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-k.x+"px",this.textEditor.style.fontSize=Math.max(16*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,k){F.prototype.dblClick.call(this,x,k),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 k=x;this.color=k.color,this.fontFamily=k.fontFamily,this.padding=k.padding,this.text=k.text,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},T.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),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,k,G){var B=F.call(this,x,k,G)||this;return B.color="transparent",B.lineWidth=3,B.drawing=!1,B.pixelRatio=1,B.color=G.defaultColor,B.lineWidth=G.defaultStrokeWidth,B.pixelRatio=G.freehandPixelRatio,B.setColor=B.setColor.bind(B),B.addCanvas=B.addCanvas.bind(B),B.finishCreation=B.finishCreation.bind(B),B.setLineWidth=B.setLineWidth.bind(B),B.colorPanel=new fe("Color",G.defaultColorSet,G.defaultColor),B.colorPanel.onColorChanged=B.setColor,B.lineWidthPanel=new Ze("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),B.lineWidthPanel.onWidthChanged=B.setLineWidth,B}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,k){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(x.x,x.y),this.drawing=!0):F.prototype.pointerDown.call(this,x,k)},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),k=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],G=k[0],B=k[1],_e=k[2],Ge=k[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<B&&(B=st),Ve<G&&(G=Ve),st>Ge&&(Ge=st),Ve>_e&&(_e=Ve));if(tt){this.left=G/this.pixelRatio,this.top=B/this.pixelRatio,this.width=(_e-G)/this.pixelRatio,this.height=(Ge-B)/this.pixelRatio;var yt=document.createElement("canvas");yt.width=_e-G,yt.height=Ge-B,yt.getContext("2d").putImageData(this.canvasContext.getImageData(G,B,_e-G,Ge-B),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,k){F.prototype.scale.call(this,x,k),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),de=function(F){function T(x,k,G){var B=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 B.typeBoxes=[],B.currentType=k,B.setCurrentType=B.setCurrentType.bind(B),B}return ee(T,F),T.prototype.getUi=function(){var x=this,k=document.createElement("div");k.style.display="flex",k.style.overflow="hidden",k.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===B.currentType?B.uiStyleSettings.toolboxAccentColor:"transparent",st.addEventListener("click",function(){x.setCurrentType(tt,st)}),k.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="`+(B.uiStyleSettings!==void 0?B.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 "+(B.uiStyleSettings!==void 0?B.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="`+(B.uiStyleSettings!==void 0?B.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Qt.style.marginRight="5px",st.appendChild(Qt)}B.typeBoxes.push(st)},B=this,_e=0;_e<4;_e++)G(_e);return k},T.prototype.setCurrentType=function(x,k){var G=this;this.currentType=x,this.typeBoxes.forEach(function(B){B.style.borderColor=B===k?G.uiStyleSettings!==void 0?G.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},T}(J),ye=function(F){function T(x,k,G){var B=F.call(this,x,k,G)||this;return B.arrowType="end",B.arrowBaseHeight=10,B.arrowBaseWidth=10,B.getArrowPoints=B.getArrowPoints.bind(B),B.setArrowType=B.setArrowType.bind(B),B.arrowTypePanel=new de("Arrow type","end"),B.arrowTypePanel.onArrowTypeChanged=B.setArrowType,B}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,k){var G=this.arrowBaseWidth+2*this.strokeWidth,B=this.arrowBaseHeight+2*this.strokeWidth;return x-G/2+","+(k+B/2)+" "+x+","+(k-B/2)+" "+(x+G/2)+","+(k+B/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,k){F.prototype.pointerDown.call(this,x,k),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),k=this.arrow1.transform.baseVal.getItem(0);k.setRotate(x,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(k,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 k=x;this.arrowType=k.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),$=function(F){function T(x,k,G){var B=F.call(this,x,k,G)||this;return B.fillColor=G.defaultFillColor,B.strokeWidth=0,B.fillPanel=new fe("Color",G.defaultColorSet,G.defaultFillColor),B.fillPanel.onColorChanged=B.setFillColor,B}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,k,G,B){var _e=F.call(this,x,B||'<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=k,_e.currentOpacity=G,_e.setCurrentOpacity=_e.setCurrentOpacity.bind(_e),_e}return ee(T,F),T.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",k.style.justifyContent="space-between",this.opacities.forEach(function(G){var B=document.createElement("div");B.style.display="flex",B.style.alignItems="center",B.style.justifyContent="center",B.style.padding="5px",B.style.borderWidth="2px",B.style.borderStyle="solid",B.style.borderColor=G===x.currentOpacity?x.uiStyleSettings.toolboxAccentColor:"transparent",B.addEventListener("click",function(){x.setCurrentOpacity(G,B)}),k.appendChild(B);var _e=document.createElement("div");_e.innerText=100*G+"%",B.appendChild(_e),x.opacityBoxes.push(B)}),k},T.prototype.setCurrentOpacity=function(x,k){var G=this;this.currentOpacity=x,this.opacityBoxes.forEach(function(B){B.style.borderColor=B===k?G.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},T}(J),se=function(F){function T(x,k,G){var B=F.call(this,x,k,G)||this;return B.setOpacity=B.setOpacity.bind(B),B.fillColor=G.defaultHighlightColor,B.strokeWidth=0,B.opacity=G.defaultHighlightOpacity,B.fillPanel=new fe("Color",G.defaultColorSet,B.fillColor),B.fillPanel.onColorChanged=B.setFillColor,B.opacityPanel=new q("Opacity",G.defaultOpacitySteps,B.opacity),B.opacityPanel.onOpacityChanged=B.setOpacity,B}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}($),ge='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Le=function(F){function T(x,k,G){var B=F.call(this,x,k,G)||this;return B.bgColor="transparent",B.tipPosition={x:0,y:0},B.tipBase1Position={x:0,y:0},B.tipBase2Position={x:0,y:0},B.tipMoving=!1,B.color=G.defaultStrokeColor,B.bgColor=G.defaultFillColor,B.fontFamily=G.defaultFontFamily,B.defaultSize={x:100,y:30},B.setBgColor=B.setBgColor.bind(B),B.getTipPoints=B.getTipPoints.bind(B),B.positionTip=B.positionTip.bind(B),B.setTipPoints=B.setTipPoints.bind(B),B.colorPanel=new fe("Text color",G.defaultColorSet,B.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>'),B.colorPanel.onColorChanged=B.setColor,B.bgColorPanel=new fe("Fill color",G.defaultColorSet,B.bgColor,ge),B.bgColorPanel.onColorChanged=B.setBgColor,B.fontFamilyPanel=new Fe("Font",G.defaultFontFamilies,G.defaultFontFamily),B.fontFamilyPanel.onFontChanged=B.setFont,B.tipGrip=new je,B.tipGrip.visual.transform.baseVal.appendItem(Y.createTransform()),B.controlBox.appendChild(B.tipGrip.visual),B}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,k){this.state==="new"&&F.prototype.pointerDown.call(this,x,k),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(k)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):F.prototype.pointerDown.call(this,x,k)},T.prototype.pointerUp=function(x){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,F.prototype.pointerUp.call(this,x);else{var k=this.state==="creating";F.prototype.pointerUp.call(this,x),this.setTipPoints(k),this.positionTip()}},T.prototype.manipulate=function(x){if(this.tipMoving){var k=this.unrotatePoint(x);this.tipPosition={x:k.x-this.manipulationStartLeft,y:k.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 k=Math.min(this.height/2,15),G=this.height/5;x&&(this.tipPosition={x:k+G/2,y:this.height+20});var B=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?B<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(G=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:0},this.tipBase2Position={x:k+G,y:0}):(this.tipBase1Position={x:0,y:k},this.tipBase2Position={x:0,y:k+G}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?B<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(G=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-G,y:0},this.tipBase2Position={x:this.width-k,y:0}):(this.tipBase1Position={x:this.width,y:k},this.tipBase2Position={x:this.width,y:k+G}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?B<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(G=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-G,y:this.height},this.tipBase2Position={x:this.width-k,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-k-G},this.tipBase2Position={x:this.width,y:this.height-k}):B<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(G=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:this.height},this.tipBase2Position={x:k+G,y:this.height}):(this.tipBase1Position={x:0,y:this.height-k},this.tipBase2Position={x:0,y:this.height-k-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 k=x;this.bgColor=k.bgColor,this.tipPosition=k.tipPosition,F.prototype.restoreState.call(this,x),this.createTip(),this.setTipPoints()},T.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.tipPosition={x:this.tipPosition.x*x,y:this.tipPosition.y*k},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,k,G){var B=F.call(this,x,k,G)||this;return B.fillColor="transparent",B.strokeColor="transparent",B.strokeWidth=0,B.strokeDasharray="",B.opacity=1,B.strokeColor=G.defaultColor,B.strokeWidth=G.defaultStrokeWidth,B.strokeDasharray=G.defaultStrokeDasharray,B.fillColor=G.defaultFillColor,B.setStrokeColor=B.setStrokeColor.bind(B),B.setFillColor=B.setFillColor.bind(B),B.setStrokeWidth=B.setStrokeWidth.bind(B),B.setStrokeDasharray=B.setStrokeDasharray.bind(B),B.setOpacity=B.setOpacity.bind(B),B.createVisual=B.createVisual.bind(B),B.strokePanel=new fe("Line color",Z(G.defaultColorSet,["transparent"]),G.defaultColor),B.strokePanel.onColorChanged=B.setStrokeColor,B.fillPanel=new fe("Fill color",Z(G.defaultColorSet,["transparent"]),B.fillColor,ge),B.fillPanel.onColorChanged=B.setFillColor,B.strokeWidthPanel=new Ze("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),B.strokeWidthPanel.onWidthChanged=B.setStrokeWidth,B.strokeStylePanel=new $e("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),B.strokeStylePanel.onStyleChanged=B.setStrokeDasharray,B.opacityPanel=new q("Opacity",G.defaultOpacitySteps,B.opacity),B.opacityPanel.onOpacityChanged=B.setOpacity,B}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,k){F.prototype.pointerDown.call(this,x,k),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 k=x;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},T.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),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,k,G){return F.call(this,x,k,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,k){F.prototype.pointerDown.call(this,x,k),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),k=this.tip1.transform.baseVal.getItem(0);k.setRotate(x,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(k,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,k,G){var B=F.call(this,x,k,G)||this;return B.strokePanel.colors=G.defaultColorSet,B.fillColor="transparent",B}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,k,G){var B=F.call(this,x,k,G)||this;return B.strokeColor="transparent",B.strokeWidth=0,B.strokeDasharray="",B.curveX=0,B.curveY=0,B.manipulationStartCurveX=0,B.manipulationStartCurveY=0,B.setStrokeColor=B.setStrokeColor.bind(B),B.setStrokeWidth=B.setStrokeWidth.bind(B),B.setStrokeDasharray=B.setStrokeDasharray.bind(B),B.positionGrips=B.positionGrips.bind(B),B.addControlGrips=B.addControlGrips.bind(B),B.adjustVisual=B.adjustVisual.bind(B),B.setupControlBox=B.setupControlBox.bind(B),B.resize=B.resize.bind(B),B.strokeColor=G.defaultColor,B.strokeWidth=G.defaultStrokeWidth,B.strokeDasharray=G.defaultStrokeDasharray,B.strokePanel=new fe("Line color",G.defaultColorSet,G.defaultColor),B.strokePanel.onColorChanged=B.setStrokeColor,B.strokeWidthPanel=new Ze("Line width",G.defaultStrokeWidths,G.defaultStrokeWidth),B.strokeWidthPanel.onWidthChanged=B.setStrokeWidth,B.strokeStylePanel=new $e("Line style",G.defaultStrokeDasharrays,G.defaultStrokeDasharray),B.strokeStylePanel.onStyleChanged=B.setStrokeDasharray,B}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,k){F.prototype.pointerDown.call(this,x,k),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(k)&&(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,k){this.curveX=this.curveX*x,this.curveY=this.curveY*k,F.prototype.scale.call(this,x,k)},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 k=x;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.curveX=k.curveX,this.curveY=k.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,k,G){var B=F.call(this,x,!1)||this;return B.dataUrl=k,B.state=G,B}return ee(T,F),T}(_t),rt=function(F){function T(x,k,G){G===void 0&&(G=!1);var B=F.call(this,x,G)||this;return B.marker=k,B}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 k=this[T].indexOf(x);k>-1&&this[T].splice(k,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,Le,Xe,$,it,dt]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Je,ae,ye,Ke,Be,se,Le]},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(k){if(typeof k=="string"){var G=x.ALL_MARKER_TYPES.find(function(B){return B.typeName===k});G!==void 0&&x._availableMarkerTypes.push(G)}else x._availableMarkerTypes.push(k)})},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 ne(this,void 0,void 0,function(){var T;return me(this,function(x){switch(x.label){case 0:return this.setCurrentMarker(),(T=new Me).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 k=!1;T||this.eventListeners.beforeclose.forEach(function(G){var B=new _t(x,!0);G(B),B.defaultPrevented&&(k=!0)}),k||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(G){return G(new _t(x))}),this.detachEvents(),this._isOpen=!1)}},F.prototype.addMarkersToToolbar=function(){for(var T,x=[],k=0;k<arguments.length;k++)x[k]=arguments[k];(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,k=x<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/T;this.resize(x,k)},F.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},F.prototype.resize=function(T,x){this._isResizing=!0;var k=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(k,G),this._isResizing=!1},F.prototype.scaleMarkers=function(T,x){var k,G=this;this._currentMarker&&this._currentMarker instanceof Ke?this._currentMarker.scale(T,x):(k=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(B){B!==G._currentMarker&&B.scale(T,x)}),k!==void 0&&this.setCurrentMarker(k)},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=[],k=0;k<arguments.length;k++)x[k]=arguments[k];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 De(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 B=new rt(T,T._currentMarker,!0);G(B),B.defaultPrevented&&(x=!0)}),!x){var k=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(G){return G(new rt(T,k))})}}},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 k=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,B=this.markers.length-1;B>=0;B--)k(B);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(),k=this.undoRedoManager.getLastUndoStep();if(!k||k.width===x.width&&k.height===x.height){var G=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(x),G<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(B){return B(new _t(T))})}else this.undoRedoManager.replaceLastUndoStep(x),this.eventListeners.statechange.forEach(function(B){return B(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(k){return k(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(k){return k(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 ne(this,void 0,void 0,function(){var T,x,k=this;return me(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(B){return B(new xt(k,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(k){return x.markers.push(k.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(k){var G=x._availableMarkerTypes.find(function(_e){return _e.typeName===k.typeName});if(G!==void 0){var B=x.addNewMarker(G);B.restoreState(k),x.markers.push(B)}}),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(k){return k(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,k=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(k,k._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(k){return k(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(k){return k(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(k){return k(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(k){return k(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(k){return k.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(k){return k.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 k=this.markerImage.getBoundingClientRect();return{x:(T-k.left)/this.zoomLevel,y:(x-k.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,k){x.__proto__=k}||function(x,k){for(var G in k)Object.prototype.hasOwnProperty.call(k,G)&&(x[G]=k[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,k){return new(x||(x=Promise))(function(G,B){function _e(st){try{tt(k.next(st))}catch(Ve){B(Ve)}}function Ge(st){try{tt(k.throw(st))}catch(Ve){B(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((k=k.apply(F,T||[])).next())})}function en(F,T){var x,k,G,B,_e={label:0,sent:function(){if(1&G[0])throw G[1];return G[1]},trys:[],ops:[]};return B={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(B[Symbol.iterator]=function(){return this}),B;function Ge(tt){return function(st){return function(Ve){if(x)throw new TypeError("Generator is already executing.");for(;_e;)try{if(x=1,k&&(G=2&Ve[0]?k.return:Ve[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,Ve[1])).done)return G;switch(k=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++,k=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],k=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 k=0,G=x;k<G.length;k++){var B=G[k],_e=B[0],Ge=B[1];T.setAttribute(_e,Ge)}},F.createRect=function(T,x,k){var G=document.createElementNS("http://www.w3.org/2000/svg","rect");return G.setAttribute("width",T.toString()),G.setAttribute("height",x.toString()),k&&F.setAttributes(G,k),G},F.createLine=function(T,x,k,G,B){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",k.toString()),_e.setAttribute("y2",G.toString()),B&&F.setAttributes(_e,B),_e},F.createPolygon=function(T,x){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",T),x&&F.setAttributes(k,x),k},F.createCircle=function(T,x){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(T/2).toString()),k.setAttribute("cy",(T/2).toString()),k.setAttribute("r",T.toString()),x&&F.setAttributes(k,x),k},F.createEllipse=function(T,x,k){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()),k&&F.setAttributes(G,k),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,k,G,B,_e,Ge){var tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(tt,[["id",T],["orient",x],["markerWidth",k.toString()],["markerHeight",G.toString()],["refX",B.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 k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=T,x&&F.setAttributes(k,x),k},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 k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=T,k.y=x,k},F.createPath=function(T,x){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",T),x&&F.setAttributes(k,x),k},F.createElement=function(T,x){var k=document.createElementNS("http://www.w3.org/2000/svg",T);return x&&F.setAttributes(k,x),k},F.getHollowRectanglePath=function(T,x,k,G,B,_e,Ge,tt){return"M"+T+","+x+"V"+(x+G)+"H"+(T+k)+"V"+x+"H"+B+"V"+_e+"H"+(B+Ge)+"V"+(_e+tt)+"H"+B+"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(k){return x.appendChild(k.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(k){return x.appendChild(k)}),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 k=new bn(T,x),G=k.ratio>=1?20:k.getHorizontalLength(20),B=k.ratio<1?20:k.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-B)/2,G,B,(24-G)/2+2,(24-B)/2+2,G-4,B-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,k,G){var B=F.call(this,x,k)||this;return B.isDropdownOpen=!1,B.onClick=B.dropdownButtonClicked,B.dropdownButtons=G,B}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(k){k.className=x.className,k.colorsClassName=x.colorsClassName,x.dropdownBlock.appendChild(k.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(k){return ct.setAttributes(k,[["cx",T.toString()],["cy",x.toString()]])})},F}(),Mn=function(){function F(T,x,k,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=k,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(k){return T.gridContainer.appendChild(k)}),this.verticalGridLines.forEach(function(k){return T.gridContainer.appendChild(k)}),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 k=x.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(B,_e){var Ge=x.y+k*(_e+1);ct.setAttributes(B,[["x1",""+x.x],["y1",""+Ge],["x2",""+(x.x+x.width)],["y2",""+Ge]])});var G=x.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(B,_e){var Ge=x.x+G*(_e+1);ct.setAttributes(B,[["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 k=this.container.getBoundingClientRect();return{x:T-k.left+this.margin,y:x-k.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,k=T.y-this.previousPoint.y;this.zoomFactor!==1&&(x=-x/this.zoomFactor,k=-k/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+k),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),k=T.x-this.previousPoint.x,G=T.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:x.x+k<this.margin&&(k=this.margin-x.x),x.x+=k,x.width=this.cropRect.x+this.cropRect.width-x.x;break;case this.bottomRightGrip:case this.topRightGrip:x.width+k>this.canvasWidth*this.zoomFactor&&(k=this.canvasWidth*this.zoomFactor-x.width),x.width+=k}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(k),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,k=this.aspectRatio.getHorizontalLength(this.cropRect.height),G=this.aspectRatio.getVerticalLength(this.cropRect.width);k/this.canvasWidth<G/this.canvasHeight?this.cropRect.width=k: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,k,G,B,_e){var Ge=k/T,tt=G/x;return{x:(B.x-_e)*Ge+_e,y:(B.y-_e)*tt+_e,width:B.width*Ge,height:B.height*tt}},F.prototype.scaleCanvas=function(T,x){var k=this.getRescaledRect(this.canvasWidth,this.canvasHeight,T,x,this.cropRect,this.margin);this.canvasWidth=T,this.canvasHeight=x,this.onCropChange&&this.onCropChange(k),this.setCropRectangle(k)},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,k=1;k<=this.width/5+10;k++){var G=k%5==0?this.height/3:this.height/6;x+="h4v"+-G+"h1v"+G}x+="v1H0Z",this.scaleShape=ct.createPath(x);var B=ct.createTransform();this.scaleShape.transform.baseVal.appendItem(B),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="&deg;",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,k,G,B,_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/k.width,jt=tt.height/k.height,Ve.width*=yt,Ve.height*=jt);var Qt=Ve.getContext("2d");Qt.translate(Ve.width/2,Ve.height/2),Qt.rotate(B*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=k.width*yt,Dn.height=k.height*jt,Dn.getContext("2d").putImageData(Qt.getImageData((k.x-G)*yt,(k.y-G)*jt,k.width*yt,k.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,k=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,k)}},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 k=[];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)},k.push(Qt)}),this.aspectRatioButton=new wn(Wt.getIcon(0,0),"Aspect ratio",k),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,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 B=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(B.isActive=this.zoomToCropEnabled,B.onClick=function(){T.zoomToCropEnabled=!T.zoomToCropEnabled,B.isActive=T.zoomToCropEnabled},x.addButton(B),!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 k=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");k.onClick=this.rotateLeftButtonClicked,x.addButton(k);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 B=new Cn;B.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(B),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},B.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 k=this.cropImage.getBoundingClientRect();return{x:T-k.left,y:x-k.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 k=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/k.width,this.imageHeight/k.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=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(k){switch(k.label){case 0:return[4,this.render()];case 1:return T=k.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=N("8hTe"),Vn=N.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,k=F.edit,G=k===void 0?!1:k,B=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(j.a)(ui,2),Yn=qn[0],Gn=qn[1],ni=Object(C.useState)("office"),ht=Object(j.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(L.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(pe.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(V.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(L.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(pe.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(V.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,"("+V.a.API_SERVER+"/api/attachments/").replace(Vt,'"'+V.a.API_SERVER+"/api/attachments/").replace(gn,'"'+V.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(ri){}var Ft=P(Kn),On=E();if(Kn.match(/\[TOC\]/)&&(Ft=Ft.replace("<p>[TOC]</p>",b()),v()),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"),y(),_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),y(),v()}},[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 g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:En,style:Object(w.a)({},jt),className:"".concat(B||""," markdown-body ").concat(Vn.a.mdBody),onMouseOver:Bi,dangerouslySetInnerHTML:{__html:Zt}}),g.a.createElement("div",{ref:pn,className:Vn.a.button},g.a.createElement(W.a,null,g.a.createElement(M.a,{onClick:function(){return kt()}},"\u88C1\u526A"),g.a.createElement(M.a,{onClick:function(){return dn()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:jn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(Q.a,{close:!0,data:Yn,type:Yn!=null&&Yn.length?ft:"",style:Object(w.a)({},Dn),onClose:function(){return Gn("")}}))}},BU3w:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return L});var ie=N("MNnm"),W="rc-util-key";function O(j){if(j.attachTo)return j.attachTo;var U=document.querySelector("head");return U||document.body}function M(j){var U,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ie.a)())return null;var C=document.createElement("style");if((U=e.csp)===null||U===void 0?void 0:U.nonce){var g;C.nonce=(g=e.csp)===null||g===void 0?void 0:g.nonce}C.innerHTML=j;var h=O(e),u=h.firstChild;return e.prepend&&h.prepend?h.prepend(C):e.prepend&&u?h.insertBefore(C,u):h.appendChild(C),C}var w=new Map;function L(j,U){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=O(e);if(!w.has(C)){var g=M("",e),h=g.parentNode;w.set(C,h),h.removeChild(g)}var u=Array.from(w.get(C).children).find(function(r){return r.tagName==="STYLE"&&r[W]===U});if(u){var a,i;if(((a=e.csp)===null||a===void 0?void 0:a.nonce)&&u.nonce!==((i=e.csp)===null||i===void 0?void 0:i.nonce)){var c;u.nonce=(c=e.csp)===null||c===void 0?void 0:c.nonce}return u.innerHTML!==j&&(u.innerHTML=j),u}var s=M(j,e);return s[W]=U,s}},BdwD:function(qe,ve,N){"use strict";var ie=N("+L6B"),W=N("2/Rp"),O=N("0Owb"),M=N("k1fw"),w=N("q1tI"),L=N.n(w),j=N("FOrL"),U=N.n(j),e=function(g){var h=g.buttonProps,u=h===void 0?{}:h,a=g.styles,i=a===void 0?{}:a,c=g.customText,s=g.ButtonText,r=g.ButtonClick,n=g.Buttonclass,t=g.ButtonTwo;return L.a.createElement("section",{className:"tc animated fadeIn",style:Object(M.a)(Object(M.a)({},{color:"#999",margin:"200px auto"}),i)},L.a.createElement("img",{src:U.a}),L.a.createElement("p",{className:"mt20 font14"},c||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&L.a.createElement(W.a,Object(O.a)({className:n,onClick:r},u),s),t&&t)};ve.a=e},"C/vA":function(qe,ve,N){"use strict";N.d(ve,"a",function(){return ie});function ie(W){const O=this;let M=!1,w;return function(){return M||(M=!0,w=W.apply(O,arguments)),w}}},"Cg/j":function(qe,ve,N){"use strict";N.d(ve,"b",function(){return ie}),N.d(ve,"a",function(){return W}),N.d(ve,"c",function(){return M}),N.d(ve,"d",function(){return w});var ie;(function(L){L.serviceIds=new Map,L.DI_TARGET="$di$target",L.DI_DEPENDENCIES="$di$dependencies";function j(U){return U[L.DI_DEPENDENCIES]||[]}L.getServiceDependencies=j})(ie||(ie={}));const W=M("instantiationService");function O(L,j,U,e){j[ie.DI_TARGET]===j?j[ie.DI_DEPENDENCIES].push({id:L,index:U,optional:e}):(j[ie.DI_DEPENDENCIES]=[{id:L,index:U,optional:e}],j[ie.DI_TARGET]=j)}function M(L){if(ie.serviceIds.has(L))return ie.serviceIds.get(L);const j=function(U,e,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");O(j,U,C,!1)};return j.toString=()=>L,ie.serviceIds.set(L,j),j}function w(L){return function(j,U,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");O(L,j,e,!0)}}},DlQD:function(qe,ve,N){(function(ie,W){qe.exports=W()})(this,function(){"use strict";function ie(ae,de){for(var ye=0;ye<de.length;ye++){var $=de[ye];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(ae,$.key,$)}}function W(ae,de,ye){return de&&ie(ae.prototype,de),ye&&ie(ae,ye),ae}function O(ae,de){if(!ae)return;if(typeof ae=="string")return M(ae,de);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 M(ae,de)}function M(ae,de){(de==null||de>ae.length)&&(de=ae.length);for(var ye=0,$=new Array(de);ye<de;ye++)$[ye]=ae[ye];return $}function w(ae,de){var ye;if(typeof Symbol=="undefined"||ae[Symbol.iterator]==null){if(Array.isArray(ae)||(ye=O(ae))||de&&ae&&typeof ae.length=="number"){ye&&(ae=ye);var $=0;return function(){return $>=ae.length?{done:!0}:{done:!1,value:ae[$++]}}}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 L(ae,de){return de={exports:{}},ae(de,de.exports),de.exports}var j=L(function(ae){function de(){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($){ae.exports.defaults=$}ae.exports={defaults:de(),getDefaults:de,changeDefaults:ye}}),U=j.defaults,e=j.getDefaults,C=j.changeDefaults,g=/[&<>"']/,h=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},c=function(de){return i[de]};function s(ae,de){if(de){if(g.test(ae))return ae.replace(h,c)}else if(u.test(ae))return ae.replace(a,c);return ae}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(ae){return ae.replace(r,function(de,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 v(ae,de){ae=ae.source||ae,de=de||"";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,de)}};return ye}var p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(ae,de,ye){if(ae){var $;try{$=decodeURIComponent(n(ye)).replace(p,"").toLowerCase()}catch(q){return null}if($.indexOf("javascript:")===0||$.indexOf("vbscript:")===0||$.indexOf("data:")===0)return null}de&&!m.test(ye)&&(ye=d(de,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(q){return null}return ye}var _={},o=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(ae,de){_[" "+ae]||(o.test(ae)?_[" "+ae]=ae+"/":_[" "+ae]=D(ae,"/",!0)),ae=_[" "+ae];var ye=ae.indexOf(":")===-1;return de.substring(0,2)==="//"?ye?de:ae.replace(f,"$1")+de:de.charAt(0)==="/"?ye?de:ae.replace(l,"$1")+de:ae+de}var E={exec:function(){}};function y(ae){for(var de=1,ye,$;de<arguments.length;de++){ye=arguments[de];for($ in ye)Object.prototype.hasOwnProperty.call(ye,$)&&(ae[$]=ye[$])}return ae}function S(ae,de){var ye=ae.replace(/\|/g,function(se,ge,Le){for(var Be=!1,Xe=ge;--Xe>=0&&Le[Xe]==="\\";)Be=!Be;return Be?"|":" |"}),$=ye.split(/ \|/),q=0;if($.length>de)$.splice(de);else for(;$.length<de;)$.push("");for(;q<$.length;q++)$[q]=$[q].trim().replace(/\\\|/g,"|");return $}function D(ae,de,ye){var $=ae.length;if($===0)return"";for(var q=0;q<$;){var se=ae.charAt($-q-1);if(se===de&&!ye)q++;else if(se!==de&&ye)q++;else break}return ae.substr(0,$-q)}function I(ae,de){if(ae.indexOf(de[1])===-1)return-1;for(var ye=ae.length,$=0,q=0;q<ye;q++)if(ae[q]==="\\")q++;else if(ae[q]===de[0])$++;else if(ae[q]===de[1]&&($--,$<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:v,cleanUrl:b,resolveUrl:d,noopTest:E,merge:y,splitCells:S,rtrim:D,findClosingBracket:I,checkSanitizeDeprecation:A},H=j.defaults,R=P.rtrim,K=P.splitCells,V=P.escape,oe=P.findClosingBracket;function Q(ae,de,ye){var $=de.href,q=de.title?V(de.title):null,se=ae[1].replace(/\\([\[\]])/g,"$1");return ae[0].charAt(0)!=="!"?{type:"link",raw:ye,href:$,title:q,text:se}:{type:"image",raw:ye,href:$,title:q,text:V(se)}}function pe(ae,de){var ye=ae.match(/^(\s+)(?:```)/);if(ye===null)return de;var $=ye[1];return de.split(`
`).map(function(q){var se=q.match(/^\s+/);if(se===null)return q;var ge=se[0];return ge.length>=$.length?q.slice($.length):q}).join(`
`)}var ce=function(){function ae(ye){this.options=ye||H}var de=ae.prototype;return de.space=function($){var q=this.rules.block.newline.exec($);if(q)return q[0].length>1?{type:"space",raw:q[0]}:{raw:`
`}},de.code=function($,q){var se=this.rules.block.code.exec($);if(se){var ge=q[q.length-1];if(ge&&ge.type==="paragraph")return{raw:se[0],text:se[0].trimRight()};var Le=se[0].replace(/^ {4}/gm,"");return{type:"code",raw:se[0],codeBlockStyle:"indented",text:this.options.pedantic?Le:R(Le,`
`)}}},de.fences=function($){var q=this.rules.block.fences.exec($);if(q){var se=q[0],ge=pe(se,q[3]||"");return{type:"code",raw:se,lang:q[2]?q[2].trim():q[2],text:ge}}},de.heading=function($){var q=this.rules.block.heading.exec($);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},de.nptable=function($){var q=this.rules.block.nptable.exec($);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 ge=se.align.length,Le;for(Le=0;Le<ge;Le++)/^ *-+: *$/.test(se.align[Le])?se.align[Le]="right":/^ *:-+: *$/.test(se.align[Le])?se.align[Le]="center":/^ *:-+ *$/.test(se.align[Le])?se.align[Le]="left":se.align[Le]=null;for(ge=se.cells.length,Le=0;Le<ge;Le++)se.cells[Le]=K(se.cells[Le],se.header.length);return se}}},de.hr=function($){var q=this.rules.block.hr.exec($);if(q)return{type:"hr",raw:q[0]}},de.blockquote=function($){var q=this.rules.block.blockquote.exec($);if(q){var se=q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:q[0],text:se}}},de.list=function($){var q=this.rules.block.list.exec($);if(q){for(var se=q[0],ge=q[2],Le=ge.length>1,Be=ge[ge.length-1]===")",Xe={type:"list",raw:se,ordered:Le,start:Le?+ge.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],(Le?xt.length===1||!Be&&xt[xt.length-1]===")":xt.length>1||this.options.smartLists&&xt!==ge)&&(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}},de.html=function($){var q=this.rules.block.html.exec($);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]):V(q[0]):q[0]}},de.def=function($){var q=this.rules.block.def.exec($);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]}}},de.table=function($){var q=this.rules.block.table.exec($);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 ge=se.align.length,Le;for(Le=0;Le<ge;Le++)/^ *-+: *$/.test(se.align[Le])?se.align[Le]="right":/^ *:-+: *$/.test(se.align[Le])?se.align[Le]="center":/^ *:-+ *$/.test(se.align[Le])?se.align[Le]="left":se.align[Le]=null;for(ge=se.cells.length,Le=0;Le<ge;Le++)se.cells[Le]=K(se.cells[Le].replace(/^ *\| *| *\| *$/g,""),se.header.length);return se}}},de.lheading=function($){var q=this.rules.block.lheading.exec($);if(q)return{type:"heading",raw:q[0],depth:q[2].charAt(0)==="="?1:2,text:q[1]}},de.paragraph=function($){var q=this.rules.block.paragraph.exec($);if(q)return{type:"paragraph",raw:q[0],text:q[1].charAt(q[1].length-1)===`
`?q[1].slice(0,-1):q[1]}},de.text=function($,q){var se=this.rules.block.text.exec($);if(se){var ge=q[q.length-1];return ge&&ge.type==="text"?{raw:se[0],text:se[0]}:{type:"text",raw:se[0],text:se[0]}}},de.escape=function($){var q=this.rules.inline.escape.exec($);if(q)return{type:"escape",raw:q[0],text:V(q[1])}},de.tag=function($,q,se){var ge=this.rules.inline.tag.exec($);if(ge)return!q&&/^<a /i.test(ge[0])?q=!0:q&&/^<\/a>/i.test(ge[0])&&(q=!1),!se&&/^<(pre|code|kbd|script)(\s|>)/i.test(ge[0])?se=!0:se&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ge[0])&&(se=!1),{type:this.options.sanitize?"text":"html",raw:ge[0],inLink:q,inRawBlock:se,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):V(ge[0]):ge[0]}},de.link=function($){var q=this.rules.inline.link.exec($);if(q){var se=oe(q[2],"()");if(se>-1){var ge=q[0].indexOf("!")===0?5:4,Le=ge+q[1].length+se;q[2]=q[2].substring(0,se),q[0]=q[0].substring(0,Le).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(q,{href:Be&&Be.replace(this.rules.inline._escapes,"$1"),title:Xe&&Xe.replace(this.rules.inline._escapes,"$1")},q[0]);return vt}},de.reflink=function($,q){var se;if((se=this.rules.inline.reflink.exec($))||(se=this.rules.inline.nolink.exec($))){var ge=(se[2]||se[1]).replace(/\s+/g," ");if(ge=q[ge.toLowerCase()],!ge||!ge.href){var Le=se[0].charAt(0);return{type:"text",raw:Le,text:Le}}var Be=Q(se,ge,se[0]);return Be}},de.strong=function($,q,se){se===void 0&&(se="");var ge=this.rules.inline.strong.start.exec($);if(ge&&(!ge[1]||ge[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){q=q.slice(-1*$.length);var Le=ge[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Le.lastIndex=0;for(var Be;(ge=Le.exec(q))!=null;)if(Be=this.rules.inline.strong.middle.exec(q.slice(0,ge.index+3)),Be)return{type:"strong",raw:$.slice(0,Be[0].length),text:$.slice(2,Be[0].length-2)}}},de.em=function($,q,se){se===void 0&&(se="");var ge=this.rules.inline.em.start.exec($);if(ge&&(!ge[1]||ge[1]&&(se===""||this.rules.inline.punctuation.exec(se)))){q=q.slice(-1*$.length);var Le=ge[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Le.lastIndex=0;for(var Be;(ge=Le.exec(q))!=null;)if(Be=this.rules.inline.em.middle.exec(q.slice(0,ge.index+2)),Be)return{type:"em",raw:$.slice(0,Be[0].length),text:$.slice(1,Be[0].length-1)}}},de.codespan=function($){var q=this.rules.inline.code.exec($);if(q){var se=q[2].replace(/\n/g," "),ge=/[^ ]/.test(se),Le=se.startsWith(" ")&&se.endsWith(" ");return ge&&Le&&(se=se.substring(1,se.length-1)),se=V(se,!0),{type:"codespan",raw:q[0],text:se}}},de.br=function($){var q=this.rules.inline.br.exec($);if(q)return{type:"br",raw:q[0]}},de.del=function($){var q=this.rules.inline.del.exec($);if(q)return{type:"del",raw:q[0],text:q[1]}},de.autolink=function($,q){var se=this.rules.inline.autolink.exec($);if(se){var ge,Le;return se[2]==="@"?(ge=V(this.options.mangle?q(se[1]):se[1]),Le="mailto:"+ge):(ge=V(se[1]),Le=ge),{type:"link",raw:se[0],text:ge,href:Le,tokens:[{type:"text",raw:ge,text:ge}]}}},de.url=function($,q){var se;if(se=this.rules.inline.url.exec($)){var ge,Le;if(se[2]==="@")ge=V(this.options.mangle?q(se[0]):se[0]),Le="mailto:"+ge;else{var Be;do Be=se[0],se[0]=this.rules.inline._backpedal.exec(se[0])[0];while(Be!==se[0]);ge=V(se[0]),se[1]==="www."?Le="http://"+ge:Le=ge}return{type:"link",raw:se[0],text:ge,href:Le,tokens:[{type:"text",raw:ge,text:ge}]}}},de.inlineText=function($,q,se){var ge=this.rules.inline.text.exec($);if(ge){var Le;return q?Le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ge[0]):V(ge[0]):ge[0]:Le=V(this.options.smartypants?se(ge[0]):ge[0]),{type:"text",raw:ge[0],text:Le}}},ae}(),ee=P.noopTest,ne=P.edit,me=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=ne(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=ne(Z.item,"gm").replace(/bull/g,Z.bullet).getRegex(),Z.list=ne(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=ne(Z.html,"i").replace("comment",Z._comment).replace("tag",Z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Z.paragraph=ne(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=ne(Z.blockquote).replace("paragraph",Z.paragraph).getRegex(),Z.normal=me({},Z),Z.gfm=me({},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=ne(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=ne(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=me({},Z.normal,{html:ne(`^ *(?: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:ne(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=ne(Y.punctuation).replace(/punctuation/g,Y._punctuation).getRegex(),Y._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Y._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Y.em.start=ne(Y.em.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.middle=ne(Y.em.middle).replace(/punctuation/g,Y._punctuation).replace(/overlapSkip/g,Y._overlapSkip).getRegex(),Y.em.endAst=ne(Y.em.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.em.endUnd=ne(Y.em.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.start=ne(Y.strong.start).replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.middle=ne(Y.strong.middle).replace(/punctuation/g,Y._punctuation).replace(/blockSkip/g,Y._blockSkip).getRegex(),Y.strong.endAst=ne(Y.strong.endAst,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.strong.endUnd=ne(Y.strong.endUnd,"g").replace(/punctuation/g,Y._punctuation).getRegex(),Y.blockSkip=ne(Y._blockSkip,"g").getRegex(),Y.overlapSkip=ne(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=ne(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=ne(Y.tag).replace("comment",Z._comment).replace("attribute",Y._attribute).getRegex(),Y._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Y._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Y.link=ne(Y.link).replace("label",Y._label).replace("href",Y._href).replace("title",Y._title).getRegex(),Y.reflink=ne(Y.reflink).replace("label",Y._label).getRegex(),Y.reflinkSearch=ne(Y.reflinkSearch,"g").replace("reflink",Y.reflink).replace("nolink",Y.nolink).getRegex(),Y.normal=me({},Y),Y.pedantic=me({},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:ne(/^!?\[(label)\]\((.*?)\)/).replace("label",Y._label).getRegex(),reflink:ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Y._label).getRegex()}),Y.gfm=me({},Y.normal,{escape:ne(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=ne(Y.gfm.url,"i").replace("email",Y.gfm._extended_email).getRegex(),Y.breaks=me({},Y.gfm,{br:ne(Y.br).replace("{2,}","*").getRegex(),text:ne(Y.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Se={block:Z,inline:Y},Me=j.defaults,ke=Se.block,Re=Se.inline;function Pe(ae){return ae.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Ce(ae){var de="",ye,$,q=ae.length;for(ye=0;ye<q;ye++)$=ae.charCodeAt(ye),Math.random()>.5&&($="x"+$.toString(16)),de+="&#"+$+";";return de}var De=function(){function ae(ye){this.tokens=[],this.tokens.links=Object.create(null),this.options=ye||Me,this.options.tokenizer=this.options.tokenizer||new ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var $={block:ke.normal,inline:Re.normal};this.options.pedantic?($.block=ke.pedantic,$.inline=Re.pedantic):this.options.gfm&&($.block=ke.gfm,this.options.breaks?$.inline=Re.breaks:$.inline=Re.gfm),this.tokenizer.rules=$}ae.lex=function($,q){var se=new ae(q);return se.lex($)};var de=ae.prototype;return de.lex=function($){return $=$.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens($,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function($,q,se){q===void 0&&(q=[]),se===void 0&&(se=!0),$=$.replace(/^ +$/gm,"");for(var ge,Le,Be,Xe;$;){if(ge=this.tokenizer.space($)){$=$.substring(ge.raw.length),ge.type&&q.push(ge);continue}if(ge=this.tokenizer.code($,q)){$=$.substring(ge.raw.length),ge.type?q.push(ge):(Xe=q[q.length-1],Xe.raw+=`
`+ge.raw,Xe.text+=`
`+ge.text);continue}if(ge=this.tokenizer.fences($)){$=$.substring(ge.raw.length),q.push(ge);continue}if(ge=this.tokenizer.heading($)){$=$.substring(ge.raw.length),q.push(ge);continue}if(ge=this.tokenizer.nptable($)){$=$.substring(ge.raw.length),q.push(ge);continue}if(ge=this.tokenizer.hr($)){$=$.substring(ge.raw.length),q.push(ge);continue}if(ge=this.tokenizer.blockquote($)){$=$.substring(ge.raw.length),ge.tokens=this.blockTokens(ge.text,[],se),q.push(ge);continue}if(ge=this.tokenizer.list($)){for($=$.substring(ge.raw.length),Be=ge.items.length,Le=0;Le<Be;Le++)ge.items[Le].tokens=this.blockTokens(ge.items[Le].text,[],!1);q.push(ge);continue}if(ge=this.tokenizer.html($)){$=$.substring(ge.raw.length),q.push(ge);continue}if(se&&(ge=this.tokenizer.def($))){$=$.substring(ge.raw.length),this.tokens.links[ge.tag]||(this.tokens.links[ge.tag]={href:ge.href,title:ge.title});continue}if(ge=this.tokenizer.table($)){$=$.substring(ge.raw.length),q.push(ge);continue}if(ge=this.tokenizer.lheading($)){$=$.substring(ge.raw.length),q.push(ge);continue}if(se&&(ge=this.tokenizer.paragraph($))){$=$.substring(ge.raw.length),q.push(ge);continue}if(ge=this.tokenizer.text($,q)){$=$.substring(ge.raw.length),ge.type?q.push(ge):(Xe=q[q.length-1],Xe.raw+=`
`+ge.raw,Xe.text+=`
`+ge.text);continue}if($){var ut="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(ut);break}else throw new Error(ut)}}return q},de.inline=function($){var q,se,ge,Le,Be,Xe,ut=$.length;for(q=0;q<ut;q++){Xe=$[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:[]},Le=Xe.header.length,se=0;se<Le;se++)Xe.tokens.header[se]=[],this.inlineTokens(Xe.header[se],Xe.tokens.header[se]);for(Le=Xe.cells.length,se=0;se<Le;se++)for(Be=Xe.cells[se],Xe.tokens.cells[se]=[],ge=0;ge<Be.length;ge++)Xe.tokens.cells[se][ge]=[],this.inlineTokens(Be[ge],Xe.tokens.cells[se][ge]);break}case"blockquote":{this.inline(Xe.tokens);break}case"list":{for(Le=Xe.items.length,se=0;se<Le;se++)this.inline(Xe.items[se].tokens);break}}}return $},de.inlineTokens=function($,q,se,ge,Le){q===void 0&&(q=[]),se===void 0&&(se=!1),ge===void 0&&(ge=!1),Le===void 0&&(Le="");var Be,Xe=$,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(;$;){if(Be=this.tokenizer.escape($)){$=$.substring(Be.raw.length),q.push(Be);continue}if(Be=this.tokenizer.tag($,se,ge)){$=$.substring(Be.raw.length),se=Be.inLink,ge=Be.inRawBlock,q.push(Be);continue}if(Be=this.tokenizer.link($)){$=$.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,ge)),q.push(Be);continue}if(Be=this.tokenizer.reflink($,this.tokens.links)){$=$.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,ge)),q.push(Be);continue}if(Be=this.tokenizer.strong($,Xe,Le)){$=$.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],se,ge),q.push(Be);continue}if(Be=this.tokenizer.em($,Xe,Le)){$=$.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],se,ge),q.push(Be);continue}if(Be=this.tokenizer.codespan($)){$=$.substring(Be.raw.length),q.push(Be);continue}if(Be=this.tokenizer.br($)){$=$.substring(Be.raw.length),q.push(Be);continue}if(Be=this.tokenizer.del($)){$=$.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],se,ge),q.push(Be);continue}if(Be=this.tokenizer.autolink($,Ce)){$=$.substring(Be.raw.length),q.push(Be);continue}if(!se&&(Be=this.tokenizer.url($,Ce))){$=$.substring(Be.raw.length),q.push(Be);continue}if(Be=this.tokenizer.inlineText($,ge,Pe)){$=$.substring(Be.raw.length),Le=Be.raw.slice(-1),q.push(Be);continue}if($){var dt="Infinite loop on byte: "+$.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=j.defaults,J=P.cleanUrl,fe=P.escape,Te=function(){function ae(ye){this.options=ye||Ne}var de=ae.prototype;return de.code=function($,q,se){var ge=(q||"").match(/\S*/)[0];if(this.options.highlight){var Le=this.options.highlight($,ge);Le!=null&&Le!==$&&(se=!0,$=Le)}return ge?'<pre><code class="'+this.options.langPrefix+fe(ge,!0)+'">'+(se?$:fe($,!0))+`</code></pre>
`:"<pre><code>"+(se?$:fe($,!0))+`</code></pre>
`},de.blockquote=function($){return`<blockquote>
`+$+`</blockquote>
`},de.html=function($){return $},de.heading=function($,q,se,ge){return this.options.headerIds?"<h"+q+' id="'+this.options.headerPrefix+ge.slug(se)+'">'+$+"</h"+q+`>
`:"<h"+q+">"+$+"</h"+q+`>
`},de.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},de.list=function($,q,se){var ge=q?"ol":"ul",Le=q&&se!==1?' start="'+se+'"':"";return"<"+ge+Le+`>
`+$+"</"+ge+`>
`},de.listitem=function($){return"<li>"+$+`</li>
`},de.checkbox=function($){return"<input "+($?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},de.paragraph=function($){return"<p>"+$+`</p>
`},de.table=function($,q){return q&&(q="<tbody>"+q+"</tbody>"),`<table>
<thead>
`+$+`</thead>
`+q+`</table>
`},de.tablerow=function($){return`<tr>
`+$+`</tr>
`},de.tablecell=function($,q){var se=q.header?"th":"td",ge=q.align?"<"+se+' align="'+q.align+'">':"<"+se+">";return ge+$+"</"+se+`>
`},de.strong=function($){return"<strong>"+$+"</strong>"},de.em=function($){return"<em>"+$+"</em>"},de.codespan=function($){return"<code>"+$+"</code>"},de.br=function(){return this.options.xhtml?"<br/>":"<br>"},de.del=function($){return"<del>"+$+"</del>"},de.link=function($,q,se){if($=J(this.options.sanitize,this.options.baseUrl,$),$===null)return se;var ge='<a href="'+fe($)+'"';return q&&(ge+=' title="'+q+'"'),ge+=">"+se+"</a>",ge},de.image=function($,q,se){if($=J(this.options.sanitize,this.options.baseUrl,$),$===null)return se;var ge='<img src="'+$+'" alt="'+se+'"';return q&&(ge+=' title="'+q+'"'),ge+=this.options.xhtml?"/>":">",ge},de.text=function($){return $},ae}(),Ee=function(){function ae(){}var de=ae.prototype;return de.strong=function($){return $},de.em=function($){return $},de.codespan=function($){return $},de.del=function($){return $},de.html=function($){return $},de.text=function($){return $},de.link=function($,q,se){return""+se},de.image=function($,q,se){return""+se},de.br=function(){return""},ae}(),je=function(){function ae(){this.seen={}}var de=ae.prototype;return de.slug=function($){var 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=j.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 Ee,this.slugger=new je}ae.parse=function($,q){var se=new ae(q);return se.parse($)};var de=ae.prototype;return de.parse=function($,q){q===void 0&&(q=!0);var se="",ge,Le,Be,Xe,ut,vt,dt,_t,xt,rt,Yt,It,qt,$t,bt,en,hn,ct,_n=$.length;for(ge=0;ge<_n;ge++){rt=$[ge];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,Le=0;Le<Xe;Le++)dt+=this.renderer.tablecell(this.parseInline(rt.tokens.header[Le]),{header:!0,align:rt.align[Le]});for(_t+=this.renderer.tablerow(dt),xt="",Xe=rt.cells.length,Le=0;Le<Xe;Le++){for(vt=rt.tokens.cells[Le],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="",Le=0;Le<Xe;Le++)bt=rt.items[Le],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;ge+1<_n&&$[ge+1].type==="text";)rt=$[++ge],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},de.parseInline=function($,q){q=q||this.renderer;var se="",ge,Le,Be=$.length;for(ge=0;ge<Be;ge++){Le=$[ge];switch(Le.type){case"escape":{se+=q.text(Le.text);break}case"html":{se+=q.html(Le.text);break}case"link":{se+=q.link(Le.href,Le.title,this.parseInline(Le.tokens,q));break}case"image":{se+=q.image(Le.href,Le.title,Le.text);break}case"strong":{se+=q.strong(this.parseInline(Le.tokens,q));break}case"em":{se+=q.em(this.parseInline(Le.tokens,q));break}case"codespan":{se+=q.codespan(Le.text);break}case"br":{se+=q.br();break}case"del":{se+=q.del(this.parseInline(Le.tokens,q));break}case"text":{se+=q.text(Le.text);break}default:{var Xe='Token with "'+Le.type+'" type was not found.';if(this.options.silent){console.error(Xe);return}else throw new Error(Xe)}}}return se},ae}(),Ze=P.merge,$e=P.checkSanitizeDeprecation,Je=P.escape,ze=j.getDefaults,nt=j.changeDefaults,it=j.defaults;function Fe(ae,de,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 de=="function"&&(ye=de,de=null),de=Ze({},Fe.defaults,de||{}),$e(de),ye){var $=de.highlight,q;try{q=De.lex(ae,de)}catch(Be){return ye(Be)}var se=function(Xe){var ut;if(!Xe)try{ut=Ue.parse(q,de)}catch(vt){Xe=vt}return de.highlight=$,Xe?ye(Xe):ye(null,ut)};if(!$||$.length<3)return se();if(delete de.highlight,!q.length)return se();var ge=0;Fe.walkTokens(q,function(Be){Be.type==="code"&&(ge++,setTimeout(function(){$(Be.text,Be.lang,function(Xe,ut){if(Xe)return se(Xe);ut!=null&&ut!==Be.text&&(Be.text=ut,Be.escaped=!0),ge--,ge===0&&se()})},0))}),ge===0&&se();return}try{var Le=De.lex(ae,de);return de.walkTokens&&Fe.walkTokens(Le,de.walkTokens),Ue.parse(Le,de)}catch(Be){if(Be.message+=`
Please report this to https://github.com/markedjs/marked.`,de.silent)return"<p>An error occurred:</p><pre>"+Je(Be.message+"",!0)+"</pre>";throw Be}}Fe.options=Fe.setOptions=function(ae){return Ze(Fe.defaults,ae),nt(Fe.defaults),Fe},Fe.getDefaults=ze,Fe.defaults=it,Fe.use=function(ae){var de=Ze({},ae);if(ae.renderer&&function(){var $=Fe.defaults.renderer||new Te,q=function(Le){var Be=$[Le];$[Le]=function(){for(var Xe=arguments.length,ut=new Array(Xe),vt=0;vt<Xe;vt++)ut[vt]=arguments[vt];var dt=ae.renderer[Le].apply($,ut);return dt===!1&&(dt=Be.apply($,ut)),dt}};for(var se in ae.renderer)q(se);de.renderer=$}(),ae.tokenizer&&function(){var $=Fe.defaults.tokenizer||new ce,q=function(Le){var Be=$[Le];$[Le]=function(){for(var Xe=arguments.length,ut=new Array(Xe),vt=0;vt<Xe;vt++)ut[vt]=arguments[vt];var dt=ae.tokenizer[Le].apply($,ut);return dt===!1&&(dt=Be.apply($,ut)),dt}};for(var se in ae.tokenizer)q(se);de.tokenizer=$}(),ae.walkTokens){var ye=Fe.defaults.walkTokens;de.walkTokens=function($){ae.walkTokens($),ye&&ye($)}}Fe.setOptions(de)},Fe.walkTokens=function(ae,de){for(var ye=w(ae),$;!($=ye()).done;){var q=$.value;de(q);switch(q.type){case"table":{for(var se=w(q.tokens.header),ge;!(ge=se()).done;){var Le=ge.value;Fe.walkTokens(Le,de)}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;Fe.walkTokens(_t,de)}break}case"list":{Fe.walkTokens(q.items,de);break}default:q.tokens&&Fe.walkTokens(q.tokens,de)}}},Fe.Parser=Ue,Fe.parser=Ue.parse,Fe.Renderer=Te,Fe.TextRenderer=Ee,Fe.Lexer=De,Fe.lexer=De.lex,Fe.Tokenizer=ce,Fe.Slugger=je,Fe.parse=Fe;var Ke=Fe;return Ke})},EJTS:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return p});var ie=N("qVdP"),W=N("jsC+"),O=N("lUTK"),M=N("BvKs"),w=N("sRBo"),L=N("kaz8"),j=N("oBTY"),U=N("7Kak"),e=N("9yH6"),C=N("tJVT"),g=N("q1tI"),h=N.n(g),u=N("9Bee"),a=N("+vTd"),i=N.n(a),c=N("xKgJ"),s=N("Is5a"),r=N.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"],v=function(b){var _,o=b.data,f=b.selectIds,l=b.onSelectCheckBox,d=l===void 0?function(){}:l,E=b.showCheckbox,y=E===void 0?!0:E,S=Object(g.useState)(!1),D=Object(C.a)(S,2),I=D[0],A=D[1],P=function(){if(o.item_type==="JUDGMENT")return h.a.createElement("div",{className:i.a.judgmentContent},o.choices.map(function(pe,ce){return h.a.createElement(e.a,{key:ce,disabled:!0},pe.choice_text)}));if(o.item_type==="PROGRAM"){var oe;return h.a.createElement("div",{className:i.a.programContent},h.a.createElement(u.a,{value:(oe=o.program_attr)===null||oe===void 0?void 0:oe.description}))}if(o.item_type==="COMBINATION"){var Q;return h.a.createElement("div",{className:i.a.combinationContent},o==null||((Q=o.sub_item_banks)===null||Q===void 0)?void 0:Q.map(function(pe,ce){var ee,ne="(\u9898\u76EE".concat(ce+1,"-\u5355\u9009\u9898) ");return h.a.createElement(g.Fragment,null,h.a.createElement("div",{style:{marginTop:10,marginBottom:10}},h.a.createElement(u.a,{value:ne+pe.name})),pe.choices.map(function(me,Z){return h.a.createElement("div",{key:Z,className:i.a.otherContentItem},h.a.createElement("p",null,n[Z]),h.a.createElement(u.a,{className:i.a.otehrContentHtml,value:me.choice_text}))}),h.a.createElement("div",{className:i.a.con},h.a.createElement("b",{className:"c-grey-333 font14"}," ","\u7B54\u6848\uFF1A",t==null?void 0:t[pe==null||((ee=pe.choices)===null||ee===void 0)?void 0:ee.findIndex(function(me){return me==null?void 0:me.is_answer})]," "),h.a.createElement("div",null,h.a.createElement("span",null,"\u89E3\u6790\uFF1A"),h.a.createElement(u.a,{className:i.a.parseAnswerHtml,value:pe.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return h.a.createElement("div",{className:i.a.otherContent},o.choices.map(function(pe,ce){return h.a.createElement("div",{key:ce,className:i.a.otherContentItem},h.a.createElement("p",null,n[ce]),h.a.createElement(u.a,{className:i.a.otehrContentHtml,value:pe.choice_text}))}))},H=function(){var oe;return h.a.createElement("div",null,(oe=o.standard_answer)===null||oe===void 0?void 0:oe.map(function(Q,pe){return h.a.createElement(u.a,{key:pe,className:i.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(Q.position,"\uFF09\uFF1A").concat(Q.answer_text.join("\u3001"))})}))},R=function(){var oe,Q,pe,ce={SUBJECTIVE:(oe=o.answer_texts)===null||oe===void 0?void 0:oe[0],JUDGMENT:(Q=o.choices)===null||Q===void 0||((pe=Q.find(function(Me){return Me.is_answer}))===null||pe===void 0)?void 0:pe.choice_text},ee=o.choices.map(function(Me){return Me.is_answer}).findIndex(function(Me){return Me}),ne=ee>-1?t[ee]:"",me="";o.choices.map(function(Me,ke){Me.is_answer&&(me+=t[ke])});var Z=ce[o.item_type],Y={SINGLE:h.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ne||"\u65E0")}),MULTIPLE:h.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(me||"\u65E0")}),COMPLETION:H()},Se=h.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Z||"\u65E0")});return Y[o.item_type]||Se},K=function(oe){var Q=Object(j.a)(f);oe.target.checked?Q.push(o.id):Q=Q.filter(function(pe){return pe!==o.id}),d(Q)};return h.a.createElement("div",{className:i.a.itemWrap},h.a.createElement("div",{className:i.a.list},y&&h.a.createElement(L.a,{className:"mr10",onChange:K,checked:f.includes(o.id)}),h.a.createElement("div",{className:i.a.title},h.a.createElement(u.a,{key:1,showLines:1,showTextOnly:!0,className:i.a.topicTitleContent,value:o.name})),h.a.createElement("div",{className:i.a.line},h.a.createElement("b",{className:i.a.b1}),h.a.createElement("b",{className:i.a.b2})),h.a.createElement("div",{onClick:function(){return A(!I)},className:i.a.tr},I?"\u6536\u8D77":"\u5C55\u5F00",h.a.createElement("i",{style:{transform:I?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),h.a.createElement("aside",{style:I?{display:"block"}:{display:"none"},className:i.a.itemDetail},h.a.createElement("div",{style:{marginBottom:44}},h.a.createElement(u.a,{key:2,className:i.a.topicTitleContent,value:o.name}),h.a.createElement("div",{className:"".concat(i.a.row," mt15")},P()),h.a.createElement("div",{className:i.a.row},h.a.createElement("div",{className:i.a.updateTimeRow},h.a.createElement("div",{className:i.a.updateTimeWrap},o.item_type==="PROGRAM"&&h.a.createElement("p",{className:i.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(_=o.program_attr)===null||_===void 0?void 0:_.language))))),o.item_type!=="PROGRAM"&&o.item_type!=="COMBINATION"&&h.a.createElement("div",{className:i.a.answerWrapper},h.a.createElement("img",{src:r.a,alt:"",className:i.a.decoration}),h.a.createElement("div",{className:i.a.answer},R()),h.a.createElement("div",{className:i.a.parse},h.a.createElement("div",{className:i.a.parseText},"\u89E3\u6790\uFF1A"),h.a.createElement("div",{className:i.a.parseAnswer},o.analysis?h.a.createElement(u.a,{className:i.a.parseAnswerHtml,value:o.analysis}):"\u6682\u65E0\u89E3\u6790")))))},p=function(b){var _,o,f,l,d,E,y,S,D,I,A,P,H,R,K,V,oe=b.isProblemset,Q=b.data,pe=b.user,ce=b.activeTabsKey,ee=b.onPublicReview,ne=ee===void 0?function(){}:ee,me=b.onStartExperience,Z=me===void 0?function(){}:me,Y=b.onSetPrivate,Se=Y===void 0?function(){}:Y,Me=b.onCorrection,ke=Me===void 0?function(){}:Me,Re=b.onCollect,Pe=Re===void 0?function(){}:Re,Ce=b.onSetPublic,De=Ce===void 0?function(){}:Ce,Ne=b.onDelete,J=Ne===void 0?function(){}:Ne,fe=b.onCancel,Te=fe===void 0?function(){}:fe,Ee=b.onSelect,je=Ee===void 0?function(){}:Ee,He=b.onMoveTo,Oe=He===void 0?function(){}:He,Ue=b.onSetShare,Ze=Ue===void 0?function(){}:Ue,$e=b.onCancelShare,Je=$e===void 0?function(){}:$e,ze=b.onPublish,nt=ze===void 0?function(){}:ze,it=b.onCancelPublish,Fe=it===void 0?function(){}:it,Ke=Q.item_type==="PROGRAM"?"/problems/".concat((_=Q.program_attr)===null||_===void 0?void 0:_.identifier,"/edit"):"/problemset/edit/".concat(Q.id),ae=ce==="0"&&!Q.public&&!Q.apply&&(Q.item_type==="PROGRAM"&&((o=Q.program_attr)===null||o===void 0?void 0:o.status)!==0||Q.item_type!=="PROGRAM"),de=h.a.createElement(M.a,{forceSubMenuRender:!0,className:i.a.menu},ce==="0"&&!Q.public&&h.a.createElement(M.a.Item,{key:"-1"},h.a.createElement("a",{className:i.a.actionLink,target:"_blank",href:Ke},"\u7F16\u8F91")),(ce==="0"||ce==="3")&&Q.item_type==="PROGRAM"&&((f=Q.program_attr)===null||f===void 0?void 0:f.status)!==0&&!Q.public&&((l=Q.author)===null||l===void 0?void 0:l.login)===((d=pe.userInfo)===null||d===void 0?void 0:d.login)&&h.a.createElement(M.a.Item,{key:"0"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){var se;return Fe(Q==null||((se=Q.program_attr)===null||se===void 0)?void 0:se.identifier)}},"\u64A4\u9500\u53D1\u5E03")),ce==="0"&&h.a.createElement(M.a.Item,{key:"1"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Oe(Q.id)}},"\u79FB\u52A8\u5230")),ce==="0"&&!(Q!=null&&Q.is_share)&&h.a.createElement(M.a.Item,{key:"3"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Ze(Q.id)}},"\u5171\u4EAB")),(ce==="0"&&(Q==null?void 0:Q.is_share)||ce==="3"&&((E=Q.author)===null||E===void 0?void 0:E.login)===((y=pe.userInfo)===null||y===void 0?void 0:y.login))&&h.a.createElement(M.a.Item,{key:"3"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Je(Q.id)}},"\u64A4\u9500\u5171\u4EAB")),ae&&h.a.createElement(M.a.Item,{key:"4"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return De(Q.id)}},"\u516C\u5F00")),ce==="0"&&!Q.public&&Q.apply&&(Q.item_type==="PROGRAM"&&Q.program_attr.status!==0||Q.item_type!=="PROGRAM")&&h.a.createElement(M.a.Item,{key:"5"},h.a.createElement("a",{className:i.a.reviewFlag,onClick:ne},"\u5BA1\u6838\u4E2D")),(ce==="0"||ce==="1")&&Q.public&&((S=Q.author)===null||S===void 0?void 0:S.login)===((D=pe.userInfo)===null||D===void 0?void 0:D.login)&&h.a.createElement(M.a.Item,{key:"6"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Se(Q.id)}},"\u64A4\u9500\u516C\u5F00")),ce==="2"&&h.a.createElement(M.a.Item,{key:"7"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Pe(Q.id,Q.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(ce==="0"||ce==="3")&&Q.item_type==="PROGRAM"&&((I=Q.program_attr)===null||I===void 0?void 0:I.status)===0&&!Q.public&&((A=Q.author)===null||A===void 0?void 0:A.login)===((P=pe.userInfo)===null||P===void 0?void 0:P.login)&&h.a.createElement(M.a.Item,{key:"8"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){var se;return nt(Q==null||((se=Q.program_attr)===null||se===void 0)?void 0:se.identifier)}},"\u53D1\u5E03")),(ce==="1"||ce==="3")&&!Object(c.o)()&&!Object(c.m)()&&((H=Q.author)===null||H===void 0?void 0:H.login)!==((R=pe.userInfo)===null||R===void 0?void 0:R.login)&&h.a.createElement(M.a.Item,{key:"9"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Pe(Q.id,Q.is_collected)}},Q.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),ce!=="0"&&!Object(c.o)()&&!Object(c.m)()&&h.a.createElement(M.a.Item,{key:"10"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return ke(Q.id)}},"\u7EA0\u9519")),(ce==="0"&&!Q.public||ce==="1"&&Object(c.o)()&&((K=Q.author)===null||K===void 0?void 0:K.login)!==((V=pe.userInfo)===null||V===void 0?void 0:V.login))&&h.a.createElement(M.a.Item,{key:"11"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return J(Q.id)}},"\u5220\u9664"))),ye=h.a.createElement(M.a,{forceSubMenuRender:!0,className:i.a.menu},h.a.createElement(M.a.Item,{key:"10"},h.a.createElement("a",{className:i.a.actionLink,onClick:function(){return ke(Q.id)}},"\u7EA0\u9519"))),$=ce!=="0"&&!Object(c.o)()&&!Object(c.m)();return h.a.createElement(h.a.Fragment,null,oe?h.a.createElement(h.a.Fragment,null,Q.item_type!=="SUBJECTIVE"&&Q.item_type!=="COMBINATION"&&h.a.createElement("span",{className:i.a.textBtn,style:{cursor:"pointer"},onClick:function(){return Z(Q)}},"\u4F53\u9A8C"),h.a.createElement(W.a,{overlay:de},h.a.createElement("span",{style:{cursor:"default"},onClick:function(se){return se.preventDefault()}},h.a.createElement("span",{className:i.a.textBtn},"\u66F4\u591A")))):$?h.a.createElement(W.a,{className:"ml40",overlay:ye},h.a.createElement("span",{style:{cursor:"default"},onClick:function(se){return se.preventDefault()}},h.a.createElement("span",null,"\u66F4\u591A"))):h.a.createElement("span",null))};ve.b=v},FKdj:function(qe,ve,N){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,N){qe.exports=N.p+"static/nodata.a6b3f948.png"},FWmy:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return ie});function ie(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,N){"use strict";N.d(ve,"a",function(){return ie});var ie;(function(W){function O(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}W.is=O;const M=Object.freeze([]);function w(){return M}W.empty=w;function*L(t){yield t}W.single=L;function j(t){return t||M}W.from=j;function U(t){return!t||t[Symbol.iterator]().next().done===!0}W.isEmpty=U;function e(t){return t[Symbol.iterator]().next().value}W.first=e;function C(t,v){for(const p of t)if(v(p))return!0;return!1}W.some=C;function g(t,v){for(const p of t)if(v(p))return p;return}W.find=g;function*h(t,v){for(const p of t)v(p)&&(yield p)}W.filter=h;function*u(t,v){let p=0;for(const m of t)yield v(m,p++)}W.map=u;function*a(...t){for(const v of t)for(const p of v)yield p}W.concat=a;function*i(t){for(const v of t)for(const p of v)yield p}W.concatNested=i;function c(t,v,p){let m=p;for(const b of t)m=v(m,b);return m}W.reduce=c;function*s(t,v,p=t.length){for(v<0&&(v+=t.length),p<0?p+=t.length:p>t.length&&(p=t.length);v<p;v++)yield t[v]}W.slice=s;function r(t,v=Number.POSITIVE_INFINITY){const p=[];if(v===0)return[p,t];const m=t[Symbol.iterator]();for(let b=0;b<v;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,v,p=(m,b)=>m===b){const m=t[Symbol.iterator](),b=v[Symbol.iterator]();for(;;){const _=m.next(),o=b.next();if(_.done!==o.done)return!1;if(_.done)return!0;if(!p(_.value,o.value))return!1}}W.equals=n})(ie||(ie={}))},KMxT:function(qe,ve,N){"use strict";N.r(ve);var ie=N("DjyN"),W=N("NUBc"),O=N("qVdP"),M=N("jsC+"),w=N("lUTK"),L=N("BvKs"),j=N("T2oS"),U=N("W9HT"),e=N("+L6B"),C=N("2/Rp"),g=N("k1fw"),h=N("9og8"),u=N("tJVT"),a=N("PpiC"),i=N("5NDa"),c=N("5rEg"),s=N("Znn+"),r=N("ZTPi"),n=N("WmNS"),t=N.n(n),v=N("q1tI"),p=N.n(v),m=N("9kvl"),b=N("iris"),_=N("jcZT"),o=N("BdwD"),f=N("SAoR"),l=N("FKdj"),d=N.n(l),E=N("EJTS"),y=N("LE3n"),S=N("xKgJ"),D=N("SVaM"),I=N("xTzM"),A=N.n(I),P=N("1vsH"),H=N("ErOA"),R=r.a.TabPane,K=c.a.Search,V;(function(Q){Q.Mine="0",Q.Public="1",Q.Collection="2",Q.TeachGroupShare="3"})(V||(V={}));var oe=function(pe){var ce,ee,ne,me,Z,Y,Se,Me,ke=pe.classroomList,Re=pe.problemset,Pe=pe.user,Ce=pe.globalSetting,De=pe.loading,Ne=pe.dispatch,J=pe.match,fe=pe.shixunHomeworks,Te=Object(a.a)(pe,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Ee=Object(P.I)(),je=Object(v.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:Ee.qtype,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((ce=Te.location)===null||ce===void 0||((ee=ce.query)===null||ee===void 0)?void 0:ee.id)||null,exam_id:(J==null||((ne=J.params)===null||ne===void 0)?void 0:ne.id)||null,exercise_id:(J==null||((me=J.params)===null||me===void 0)?void 0:me.categoryId)||null}),He=Object(u.a)(je,2),Oe=He[0],Ue=He[1],Ze=Object(v.useState)(0),$e=Object(u.a)(Ze,2),Je=$e[0],ze=$e[1],nt=Object(v.useState)([]),it=Object(u.a)(nt,2),Fe=it[0],Ke=it[1],ae=Object(v.useState)(V.Mine),de=Object(u.a)(ae,2),ye=de[0],$=de[1],q=Object(v.useState)(-1),se=Object(u.a)(q,2),ge=se[0],Le=se[1],Be=Object(v.useState)([]),Xe=Object(u.a)(Be,2),ut=Xe[0],vt=Xe[1],dt=Object(v.useState)([]),_t=Object(u.a)(dt,2),xt=_t[0],rt=_t[1],Yt=Object(v.useState)(!1),It=Object(u.a)(Yt,2),qt=It[0],$t=It[1],bt=Object(v.useRef)(!1),en=Object(v.useState)([]),hn=Object(u.a)(en,2),ct=hn[0],_n=hn[1],at=Object(v.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),lt=Object(u.a)(at,2),Pt=lt[0],Kt=lt[1],rn=Object(v.useState)([]),an=Object(u.a)(rn,2),Cn=an[0],bn=an[1],Wt=Object(v.useRef)(null),wn=Object(v.useState)(!1),In=Object(u.a)(wn,2),Mn=In[0],Bn=In[1],Fn=Object(v.useState)(""),Wn=Object(u.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(v.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(v.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(v.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(v.useEffect)(function(){return Ne({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Ne({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(v.useEffect)(function(){return Ne({type:"globalSetting/headerFooterToggle",payload:!1}),function(){Ne({type:"globalSetting/headerFooterToggle",payload:!0})}},[]);var li=function(){var ht=Object(h.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(h.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,Le(ft===null?-1:null),Ue(Oe),fn(Oe),ft===null)return},k=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=""),Le(ft),Ue(Oe),fn(Oe)},B=Object(v.useState)(!1),_e=Object(u.a)(B,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,Le(-1),$(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(D.a)({name:ft,copywriting:ft,position:"ItemBank"})):$t(!1),Le(-1),Ue(Oe),fn(Oe)},jt=function(){Oe.per_page=20,Ue(Oe),fn(Oe)},Qt=function(){var ht=Object(h.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:V.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(h.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:V.TeachGroupShare}}),Oe.page=1,Oe.group_id=Et||null,delete Oe.id,Ue(Object(g.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,Le(-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(h.a)(t.a.mark(function ft(Et){var kt;return t.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:if(!(Ee.type==="exercise")){Zt.next=6;break}return Zt.next=3,Object(H.a)("/api/exercises/".concat(Ee.exerciseid,"/toggle_random_question.json"),{method:"post",body:{question_id:Ee.qid,item_bank_id:Et}});case 3:return kt=Zt.sent,kt!=null&&kt.status||m.d.push(Ee.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:d.a.page},p.a.createElement("section",null,p.a.createElement("div",{className:d.a.wrap},p.a.createElement("div",{className:d.a.title},"\u8BD5\u9898\u5E93"),p.a.createElement("div",{className:d.a.headerWrapper},p.a.createElement("div",{className:d.a.tabsWrap},p.a.createElement(r.a,{activeKey:ye,onChange:st,tabBarExtraContent:p.a.createElement("div",{className:d.a.searchWrap},p.a.createElement(K,{allowClear:!0,suffix:p.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(d.a.searchIcon),onClick:function(){return yt(Oe.keyword)}}),className:d.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(g.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:d.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:k,knowledgeValue:ge,onKnowledgeChange:G,teachGroupData:(Me=Re.teachGroupData)===null||Me===void 0?void 0:Me.groups,onTeachGroupChange:pn,teachGroupValue:Oe.group_id,showTeachGroup:Ge})),p.a.createElement("div",{className:d.a.treeWrapper,style:{display:ye===V.Mine?"block":"none"}},p.a.createElement("div",{className:d.a.treeHeader},p.a.createElement(f.a,{data:xt,onClick:Qt}),p.a.createElement(C.a,{type:"link",onClick:Dn,className:d.a.exportBtn},p.a.createElement("img",{src:A.a,alt:"",className:d.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),p.a.createElement(U.a,{spinning:Mn},p.a.createElement("div",{ref:Wt,className:d.a.treeContent},p.a.createElement(y.a,{isProblemset:!1,reloadData:jt,data:Cn,onShare:function(){},onOpen:Qt})))),p.a.createElement("div",{className:d.a.contentWrap},p.a.createElement("div",{className:d.a.batchWrap},p.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},p.a.createElement("div",{className:"font14"},p.a.createElement(M.a,{overlay:p.a.createElement(L.a,{selectedKeys:[Pt]},Xn==null?void 0:Xn.map(function(ht,ft){return p.a.createElement(L.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:d.a.contentListWrap},Je!==0?p.a.createElement(U.a,{size:"large",spinning:De["problemset/getItemBanks"]},Fe.map(function(ht,ft){var Et,kt;return p.a.createElement("div",{className:d.a.li,key:ht.id},p.a.createElement("div",{className:d.a.top},p.a.createElement(E.b,{showCheckbox:!1,data:ht,selectIds:ct,onSelectCheckBox:qn})),p.a.createElement("div",{className:d.a.bottom},p.a.createElement("p",{className:"".concat(d.a.actionLeftItem," ").concat(d.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:d.a.actionLeftItem},Gn[ht.difficulty]),p.a.createElement("p",{className:d.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:d.a.actionLeftItem},"\u66F4\u65B0",p.a.createElement("span",{className:"c-grey-333"},ht==null?void 0:ht.updated_at)),p.a.createElement("p",{className:d.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:d.a.more},p.a.createElement("span",{className:d.a.btnAdd,onClick:function(){return ni(ht.id)}},"\u66FF\u6362"))))})):p.a.createElement(U.a,{size:"large",spinning:De["problemset/getItemBanks"]},p.a.createElement(o.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(Q){var pe=Q.classroomList,ce=Q.problemset,ee=Q.user,ne=Q.loading,me=Q.globalSetting,Z=Q.shixunHomeworks;return{classroomList:pe,problemset:ce,user:ee,globalSetting:me,loading:ne.effects,shixunHomeworks:Z}})(oe)},LE3n:function(qe,ve,N){"use strict";var ie=N("ozfa"),W=N("MJZm"),O=N("k1fw"),M=N("+L6B"),w=N("2/Rp"),L=N("5NDa"),j=N("5rEg"),U=N("2qtc"),e=N("kLXV"),C=N("miYZ"),g=N("tsqr"),h=N("9og8"),u=N("tJVT"),a=N("WmNS"),i=N.n(a),c=N("q1tI"),s=N.n(c),r=N("1vnw"),n=N.n(r),t=N("ErOA"),v=N("Ix/O"),p=N.n(v),m=N("xTzM"),b=N.n(m),_=N("WCUW"),o=N("LvDl"),f=N.n(o),l=function(y){var S=y.isProblemset,D=y.name,I=y.id,A=y.itemBanksCount,P=y.onOpen,H=P===void 0?function(){}:P,R=y.onShare,K=R===void 0?function(){}:R,V=y.onMove,oe=V===void 0?function(){}:V,Q=y.onDeleteOk,pe=Q===void 0?function(){}:Q,ce=Object(c.useState)(!1),ee=Object(u.a)(ce,2),ne=ee[0],me=ee[1],Z=Object(c.useState)(D),Y=Object(u.a)(Z,2),Se=Y[0],Me=Y[1],ke=Object(c.useState)(D),Re=Object(u.a)(ke,2),Pe=Re[0],Ce=Re[1],De=function(){var J=Object(h.a)(i.a.mark(function fe(Te){var Ee,je,He;return i.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(Ee=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],Pe.trim()){Ue.next=4;break}return g.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Ue.abrupt("return");case 4:if(!(Pe.charAt(0)===" ")){Ue.next=7;break}return g.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Ue.abrupt("return");case 7:je=0;case 8:if(!(je<Pe.length)){Ue.next=15;break}if(!Ee.includes(Pe.charAt(je))){Ue.next=12;break}return g.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),Ue.abrupt("return",!1);case 12:je++,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:Pe}});case 17:He=Ue.sent,He.status===0&&(me(!1),Me(Pe));case 19:case"end":return Ue.stop()}},fe)}));return function(Te){return J.apply(this,arguments)}}(),Ne=function(fe){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(h.a)(i.a.mark(function je(){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(fe),".json"),{method:"delete",body:{}});case 2:He=Ue.sent,He.status===0&&pe(fe);case 4:case"end":return Ue.stop()}},je)}));function Ee(){return Te.apply(this,arguments)}return Ee}()})};return s.a.createElement("div",{className:n.a.list},ne?s.a.createElement(j.a,{style:{maxWidth:780},value:Pe,onChange:function(fe){return Ce(fe.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},ne?s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{style:{height:16},onClick:function(){return De(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),me(!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){g.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 me(!0)},type:"link"},"\u91CD\u547D\u540D"),s.a.createElement(w.a,{onClick:function(){return Ne(I)},type:"link",danger:!0},"\u5220\u9664")))},d=function(y){var S=y.isProblemset,D=y.data,I=y.onOpen,A=I===void 0?function(){}:I,P=y.onShare,H=P===void 0?function(){}:P,R=y.reloadData,K=Object(c.useState)(),V=Object(u.a)(K,2),oe=V[0],Q=V[1];Object(c.useEffect)(function(){Q(D==null?void 0:D.map(function(Se){return{title:s.a.createElement(l,{isProblemset:S,name:Se.name,id:Se.id,itemBanksCount:Se.item_banks_count,onMove:ce,onOpen:A,onShare:H,onDeleteOk:ne}),key:Se.id,icon:s.a.createElement("img",{src:p.a,className:n.a.folderIcon}),isLeaf:!1}}))},[D]);var pe=function Se(Me,ke,Re){for(var Pe=Object(o.cloneDeep)(Me),Ce=0;Ce<Pe.length;Ce++){if(Pe[Ce].key===ke){if(Re==="up"){var De=[Pe[Ce],Pe[Ce-1]];Pe[Ce-1]=De[0],Pe[Ce]=De[1]}else{var Ne=[Pe[Ce+1],Pe[Ce]];Pe[Ce]=Ne[0],Pe[Ce+1]=Ne[1]}break}Pe[Ce].children&&(Pe[Ce].children=Se(Pe[Ce].children,ke,Re))}return Pe},ce=function(){var Se=Object(h.a)(i.a.mark(function Me(ke,Re){var Pe;return i.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:if(!(Re==="up")){De.next=6;break}return De.next=3,Object(_.I)({id:Math.abs(ke)});case 3:De.t0=De.sent,De.next=9;break;case 6:return De.next=8,Object(_.H)({id:Math.abs(ke)});case 8:De.t0=De.sent;case 9:Pe=De.t0,Pe.status===0&&Q(function(Ne){return pe(Ne,ke,Re)});case 11:case"end":return De.stop()}},Me)}));return function(ke,Re){return Se.apply(this,arguments)}}(),ee=function Se(Me,ke){return Me.filter(function(Re){return Re.key===ke?!1:(Re.children&&(Re.children=Se(Re.children,ke)),!0)})},ne=function(Me){Q(function(ke){return ee(ke,Me)}),R()},me=function Se(Me,ke,Re){return Me.map(function(Pe){return Pe.key===ke?Object(O.a)(Object(O.a)({},Pe),Re):Pe.children?Object(O.a)(Object(O.a)({},Pe),{},{children:Se(Pe.children,ke,Re)}):Pe})},Z=function(){var Se=Object(h.a)(i.a.mark(function Me(ke){var Re,Pe,Ce,De,Ne;return i.a.wrap(function(fe){for(;;)switch(fe.prev=fe.next){case 0:return Re=ke.key,fe.next=3,Object(_.B)({group_id:Math.abs(Re)});case 3:Pe=fe.sent,Ce=Pe||{},De=Ce.item_banks_group,Ne=Ce.item_banks_group_count,Ne>0?Q(function(Te){return me(Te,Re,{children:De.map(function(Ee){return{title:s.a.createElement(l,{isProblemset:S,name:Ee.name,id:Ee.id,itemBanksCount:Ee.item_banks_count,onMove:ce,onOpen:A,onShare:H,onDeleteOk:ne}),key:Ee.id,icon:s.a.createElement("img",{src:p.a,className:n.a.folderIcon}),isLeaf:!1}})})}):Q(function(Te){return me(Te,Re,{isLeaf:!0})});case 6:case"end":return fe.stop()}},Me)}));return function(ke){return Se.apply(this,arguments)}}(),Y=function(Me,ke){var Re=ke.node,Pe=ke.expanded;Q(function(Ce){return me(Ce,Re.key,{icon:Pe?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=d},LdHM:function(qe,ve,N){"use strict";N.d(ve,"b",function(){return t}),N.d(ve,"a",function(){return p});var ie=N("1OyB"),W=N("vuIU"),O=N("Ji7U"),M=N("LK+K"),w=N("q1tI"),L=N("rePB"),j=N("Ff2n"),U=N("ODXe"),e=N("4IlW"),C=N("bX4T"),g=N("YrtM"),h=N("TSYQ"),u=N.n(h),a=N("+nKL"),i=N("8OUc"),c=function(K,V){var oe=K.prefixCls,Q=K.id,pe=K.flattenOptions,ce=K.childrenAsData,ee=K.values,ne=K.searchValue,me=K.multiple,Z=K.defaultActiveFirstOption,Y=K.height,Se=K.itemHeight,Me=K.notFoundContent,ke=K.open,Re=K.menuItemSelectedIcon,Pe=K.virtual,Ce=K.onSelect,De=K.onToggleOpen,Ne=K.onActiveValue,J=K.onScroll,fe=K.onMouseEnter,Te="".concat(oe,"-item"),Ee=Object(g.a)(function(){return pe},[ke,pe],function(Ke,ae){return ae[0]&&Ke[1]!==ae[1]}),je=w.useRef(null),He=function(ae){ae.preventDefault()},Oe=function(ae){je.current&&je.current.scrollTo({index:ae})},Ue=function(ae){for(var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ye=Ee.length,$=0;$<ye;$+=1){var q=(ae+$*de+ye)%ye,se=Ee[q],ge=se.group,Le=se.data;if(!ge&&!Le.disabled)return q}return-1},Ze=w.useState(function(){return Ue(0)}),$e=Object(U.a)(Ze,2),Je=$e[0],ze=$e[1],nt=function(ae){ze(ae);var de=Ee[ae];if(!de){Ne(null,-1);return}Ne(de.data.value,ae)};w.useEffect(function(){nt(Z!==!1?Ue(0):-1)},[Ee.length,ne]),w.useEffect(function(){var Ke=setTimeout(function(){if(!me&&ke&&ee.size===1){var ae=Array.from(ee)[0],de=Ee.findIndex(function(ye){var $=ye.data;return $.value===ae});nt(de),Oe(de)}});return function(){return clearTimeout(Ke)}},[ke]);var it=function(ae){ae!==void 0&&Ce(ae,{selected:!ee.has(ae)}),me||De(!1)};if(w.useImperativeHandle(V,function(){return{onKeyDown:function(ae){var de=ae.which;switch(de){case e.a.UP:case e.a.DOWN:{var ye=0;if(de===e.a.UP?ye=-1:de===e.a.DOWN&&(ye=1),ye!==0){var $=Ue(Je+ye,ye);Oe($),nt($)}break}case e.a.ENTER:{var q=Ee[Je];q&&!q.data.disabled?it(q.data.value):it(void 0),ke&&ae.preventDefault();break}case e.a.ESC:De(!1)}},onKeyUp:function(){},scrollTo:function(ae){Oe(ae)}}}),Ee.length===0)return w.createElement("div",{role:"listbox",id:"".concat(Q,"_list"),className:"".concat(Te,"-empty"),onMouseDown:He},Me);function Fe(Ke){var ae=Ee[Ke];if(!ae)return null;var de=ae.data||{},ye=de.value,$=de.label,q=de.children,se=Object(C.a)(de,!0),ge=ce?q:$;return ae?w.createElement("div",Object.assign({"aria-label":typeof ge=="string"?ge:null},se,{key:Ke,role:"option",id:"".concat(Q,"_list_").concat(Ke),"aria-selected":ee.has(ye)}),ye):null}return w.createElement(w.Fragment,null,w.createElement("div",{role:"listbox",id:"".concat(Q,"_list"),style:{height:0,width:0,overflow:"hidden"}},Fe(Je-1),Fe(Je),Fe(Je+1)),w.createElement(a.a,{itemKey:"key",ref:je,data:Ee,height:Y,itemHeight:Se,fullHeight:!1,onMouseDown:He,onScroll:J,virtual:Pe,onMouseEnter:fe},function(Ke,ae){var de,ye=Ke.group,$=Ke.groupOption,q=Ke.data,se=q.label,ge=q.key;if(ye)return w.createElement("div",{className:u()(Te,"".concat(Te,"-group"))},se!==void 0?se:ge);var Le=q.disabled,Be=q.value,Xe=q.title,ut=q.children,vt=q.style,dt=q.className,_t=Object(j.a)(q,["disabled","value","title","children","style","className"]),xt=ee.has(Be),rt="".concat(Te,"-option"),Yt=u()(Te,rt,dt,(de={},Object(L.a)(de,"".concat(rt,"-grouped"),$),Object(L.a)(de,"".concat(rt,"-active"),Je===ae&&!Le),Object(L.a)(de,"".concat(rt,"-disabled"),Le),Object(L.a)(de,"".concat(rt,"-selected"),xt),de)),It=ce?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||Le)return;nt(ae)},onClick:function(){Le||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(c);s.displayName="OptionList";var r=s,n=function(){return null};n.isSelectOption=!0;var t=n,v=function(){return null};v.isSelectOptGroup=!0;var p=v,m=N("VTBJ"),b=N("Zm9Q");function _(R){var K=R.key,V=R.props,oe=V.children,Q=V.value,pe=Object(j.a)(V,["children","value"]);return Object(m.a)({key:K,value:Q!==void 0?Q:K,children:oe},pe)}function o(R){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(b.a)(R).map(function(V,oe){if(!w.isValidElement(V)||!V.type)return null;var Q=V.type.isSelectOptGroup,pe=V.key,ce=V.props,ee=ce.children,ne=Object(j.a)(ce,["children"]);return K||!Q?_(V):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(pe===null?oe:pe,"__"),label:pe},ne),{},{options:o(ee)})}).filter(function(V){return V})}var f=N("2Qr1"),l=N("qNPg"),d=N("U8pU"),E=N("Kwbf"),y=N("WKfj");function S(R){var K=R.mode,V=R.options,oe=R.children,Q=R.backfill,pe=R.allowClear,ce=R.placeholder,ee=R.getInputElement,ne=R.showSearch,me=R.onSearch,Z=R.defaultOpen,Y=R.autoFocus,Se=R.labelInValue,Me=R.value,ke=R.inputValue,Re=R.optionLabelProp,Pe=K==="multiple"||K==="tags",Ce=ne!==void 0?ne:Pe||K==="combobox",De=V||o(oe);if(Object(E.a)(K!=="tags"||De.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=De.some(function(Te){return Te.options?Te.options.some(function(Ee){return typeof("value"in Ee?Ee.value:Ee.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"||!Q,"`backfill` only works with `combobox` mode."),Object(E.a)(K==="combobox"||!ee,"`getInputElement` only work with `combobox` mode."),Object(E.b)(K!=="combobox"||!ee||!pe||!ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),me&&!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."),Me!=null){var J=Object(y.d)(Me);Object(E.a)(!Se||J.every(function(Te){return Object(d.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)(!Pe||Array.isArray(Me),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var fe=null;Object(b.a)(oe).some(function(Te){if(!w.isValidElement(Te)||!Te.type)return!1;var Ee=Te.type;if(Ee.isSelectOption)return!1;if(Ee.isSelectOptGroup){var je=Object(b.a)(Te.props.children).every(function(He){return!w.isValidElement(He)||!Te.type||He.type.isSelectOption?!0:(fe=He.type,!1)});return!je}return fe=Ee,!0}),fe&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(fe.displayName||fe.name||fe,"`.")),Object(E.a)(ke===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var D=S,I=Object(l.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:o,flattenOptions:f.d,getLabeledValue:f.e,filterOptions:f.b,isValueDisabled:f.g,findValueOption:f.c,warningProps:D,fillOptionsWithMissingValue:f.a}),A=function(R){Object(O.a)(V,R);var K=Object(M.a)(V);function V(){var oe;return Object(ie.a)(this,V),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)(V,[{key:"render",value:function(){return w.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),V}(w.Component);A.Option=t,A.OptGroup=p;var P=A,H=ve.c=P},MI8n:function(qe,ve,N){"use strict";N.d(ve,"c",function(){return w}),N.d(ve,"b",function(){return e}),N.d(ve,"e",function(){return C}),N.d(ve,"a",function(){return g}),N.d(ve,"d",function(){return h}),N.d(ve,"f",function(){return u});var ie=N("/cxE"),W=N("pmY6"),O=N("24hK"),M=N("5Y4S"),w;(function(a){a.None=()=>W.a.None;function i(S){return(D,I=null,A)=>{let P=!1,H;return H=S(R=>P?void 0:(H?H.dispose():P=!0,D.call(I,R)),null,A),P&&H.dispose(),H}}a.once=i;function c(S,D){return p((I,A=null,P)=>S(H=>I.call(A,D(H)),null,P))}a.map=c;function s(S,D){return p((I,A=null,P)=>S(H=>{D(H),I.call(A,H)},null,P))}a.forEach=s;function r(S,D){return p((I,A=null,P)=>S(H=>D(H)&&I.call(A,H),null,P))}a.filter=r;function n(S){return S}a.signal=n;function t(...S){return(D,I=null,A)=>Object(W.e)(...S.map(P=>P(H=>D.call(I,H),null,A)))}a.any=t;function v(S,D,I){let A=I;return c(S,P=>(A=D(A,P),A))}a.reduce=v;function p(S){let D;const I=new e({onFirstListenerAdd(){D=S(I.fire,I)},onLastListenerRemove(){D.dispose()}});return I.event}function m(S,D,I=100,A=!1,P){let H,R,K,V=0;const oe=new e({leakWarningThreshold:P,onFirstListenerAdd(){H=S(Q=>{V++,R=D(R,Q),A&&!K&&(oe.fire(R),R=void 0),clearTimeout(K),K=setTimeout(()=>{const pe=R;R=void 0,K=void 0,(!A||V>1)&&oe.fire(pe),V=0},I)})},onLastListenerRemove(){H.dispose()}});return oe.event}a.debounce=m;function b(S,D=(I,A)=>I===A){let I=!0,A;return r(S,P=>{const H=I||!D(P,A);return I=!1,A=P,H})}a.latch=b;function _(S,D){return[a.filter(S,D),a.filter(S,I=>!D(I))]}a.split=_;function o(S,D=!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&&(D?setTimeout(H):H())},onLastListenerRemove(){P&&P.dispose(),P=null}});return R.event}a.buffer=o;class f{constructor(S){this.event=S}map(S){return new f(c(this.event,S))}forEach(S){return new f(s(this.event,S))}filter(S){return new f(r(this.event,S))}reduce(S,D){return new f(v(this.event,S,D))}latch(){return new f(b(this.event))}debounce(S,D=100,I=!1,A){return new f(m(this.event,S,D,I,A))}on(S,D,I){return this.event(S,D,I)}once(S,D,I){return i(this.event)(S,D,I)}}function l(S){return new f(S)}a.chain=l;function d(S,D,I=A=>A){const A=(...K)=>R.fire(I(...K)),P=()=>S.on(D,A),H=()=>S.removeListener(D,A),R=new e({onFirstListenerAdd:P,onLastListenerRemove:H});return R.event}a.fromNodeEventEmitter=d;function E(S,D,I=A=>A){const A=(...K)=>R.fire(I(...K)),P=()=>S.addEventListener(D,A),H=()=>S.removeEventListener(D,A),R=new e({onFirstListenerAdd:P,onLastListenerRemove:H});return R.event}a.fromDOMEventEmitter=E;function y(S){return new Promise(D=>i(S)(D))}a.toPromise=y})(w||(w={}));class L{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${L._idPool++}`}start(a){this._stopWatch=new M.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}}}L._idPool=0;let j=-1;class U{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=j;if(typeof this.customThreshold=="number"&&(i=this.customThreshold),i<=0||a<i)return;this._stacks||(this._stacks=new Map);const c=new Error().stack.split(`
`).slice(3).join(`
`),s=this._stacks.get(c)||0;if(this._stacks.set(c,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let r,n=0;for(const[t,v]of this._stacks)(!r||n<v)&&(r=t,n=v);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(c)||0;this._stacks.set(c,r-1)}}}class e{constructor(a){var i;this._disposed=!1,this._options=a,this._leakageMon=j>0?new U(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((i=this._options)===null||i===void 0?void 0:i._profName)?new L(this._options._profName):void 0}get event(){return this._event||(this._event=(a,i,c)=>{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),v=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 c instanceof W.b?c.add(v):Array.isArray(c)&&c.push(v),v}),this._event}fire(a){var i,c;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(ie.f)(n)}}(c=this._perfMon)===null||c===void 0||c.stop()}}dispose(){var a,i,c,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=(c=this._options)===null||c===void 0?void 0:c.onLastListenerRemove)===null||s===void 0||s.call(c),(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 g 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 h{constructor(){this.buffers=[]}wrapEvent(a){return(i,c,s)=>a(r=>{const n=this.buffers[this.buffers.length-1];n?n.push(()=>i.call(c,r)):i.call(c,r)},void 0,s)}bufferEvents(a){const i=[];this.buffers.push(i);const c=a();return this.buffers.pop(),i.forEach(s=>s()),c}}class u{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,N){"use strict";(function(ie,W){N.d(ve,"b",function(){return c}),N.d(ve,"i",function(){return t}),N.d(ve,"f",function(){return v}),N.d(ve,"d",function(){return p}),N.d(ve,"g",function(){return m}),N.d(ve,"h",function(){return b}),N.d(ve,"c",function(){return _}),N.d(ve,"k",function(){return o}),N.d(ve,"j",function(){return f}),N.d(ve,"a",function(){return l}),N.d(ve,"e",function(){return y});var O;const M="en";let w=!1,L=!1,j=!1,U=!1,e=!1,C=!1,g=!1,h,u=M,a,i;const c=typeof self=="object"?self:typeof ie=="object"?ie:{};let s;typeof c.vscode!="undefined"&&typeof c.vscode.process!="undefined"?s=c.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,L=i.indexOf("Macintosh")>=0,g=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,j=i.indexOf("Linux")>=0,C=!0,h=navigator.language,u=h;else if(typeof s=="object"){w=s.platform==="win32",L=s.platform==="darwin",j=s.platform==="linux",U=j&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,h=M,u=M;const S=s.env.VSCODE_NLS_CONFIG;if(S)try{const D=JSON.parse(S),I=D.availableLanguages["*"];h=D.locale,u=I||M,a=D._translationsConfigFile}catch(D){}e=!0}else console.error("Unable to resolve platform.");let n=0;L?n=1:w?n=3:j&&(n=2);const t=w,v=L,p=j,m=e,b=C,_=g,o=i,f=function(){if(c.setImmediate)return c.setImmediate.bind(c);if(typeof c.postMessage=="function"&&!c.importScripts){let I=[];c.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}),c.postMessage({vscodeSetImmediateId:H},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const D=Promise.resolve();return I=>D.then(I)}(),l=L||g?2:w?1:3;let d=!0,E=!1;function y(){if(!E){E=!0;const S=new Uint8Array(2);S[0]=1,S[1]=2;const D=new Uint16Array(S.buffer);d=D[0]===(2<<8)+1}return d}}).call(this,N("IyRk"),N("Q2Ig"))},N0LK:function(qe,ve,N){"use strict";N.d(ve,"C",function(){return ie}),N.d(ve,"v",function(){return O}),N.d(ve,"s",function(){return M}),N.d(ve,"t",function(){return w}),N.d(ve,"U",function(){return L}),N.d(ve,"J",function(){return j}),N.d(ve,"O",function(){return U}),N.d(ve,"p",function(){return e}),N.d(ve,"T",function(){return C}),N.d(ve,"q",function(){return g}),N.d(ve,"N",function(){return h}),N.d(ve,"M",function(){return u}),N.d(ve,"Q",function(){return a}),N.d(ve,"u",function(){return i}),N.d(ve,"x",function(){return c}),N.d(ve,"I",function(){return s}),N.d(ve,"f",function(){return r}),N.d(ve,"h",function(){return n}),N.d(ve,"g",function(){return t}),N.d(ve,"i",function(){return v}),N.d(ve,"G",function(){return p}),N.d(ve,"H",function(){return m}),N.d(ve,"r",function(){return b}),N.d(ve,"R",function(){return _}),N.d(ve,"d",function(){return o}),N.d(ve,"e",function(){return f}),N.d(ve,"E",function(){return l}),N.d(ve,"F",function(){return d}),N.d(ve,"j",function(){return E}),N.d(ve,"z",function(){return y}),N.d(ve,"K",function(){return D}),N.d(ve,"L",function(){return I}),N.d(ve,"m",function(){return P}),N.d(ve,"k",function(){return R}),N.d(ve,"A",function(){return V}),N.d(ve,"a",function(){return oe}),N.d(ve,"n",function(){return Q}),N.d(ve,"l",function(){return pe}),N.d(ve,"D",function(){return ce}),N.d(ve,"B",function(){return ee}),N.d(ve,"b",function(){return ne}),N.d(ve,"S",function(){return me}),N.d(ve,"o",function(){return Z}),N.d(ve,"P",function(){return Y}),N.d(ve,"w",function(){return Se}),N.d(ve,"c",function(){return Me}),N.d(ve,"y",function(){return Pe});function ie(J){return!J||typeof J!="string"?!0:J.trim().length===0}const W=/{(\d+)}/g;function O(J,...fe){return fe.length===0?J:J.replace(W,function(Te,Ee){const je=parseInt(Ee,10);return isNaN(je)||je<0||je>=fe.length?Te:fe[je]})}function M(J){return J.replace(/[<>&]/g,function(fe){switch(fe){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return fe}})}function w(J){return J.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function L(J,fe=" "){const Te=j(J,fe);return U(Te,fe)}function j(J,fe){if(!J||!fe)return J;const Te=fe.length;if(Te===0||J.length===0)return J;let Ee=0;for(;J.indexOf(fe,Ee)===Ee;)Ee=Ee+Te;return J.substring(Ee)}function U(J,fe){if(!J||!fe)return J;const Te=fe.length,Ee=J.length;if(Te===0||Ee===0)return J;let je=Ee,He=-1;for(;!(He=J.lastIndexOf(fe,je-1),He===-1||He+Te!==je);){if(He===0)return"";je=He}return J.substring(0,je)}function e(J){return J.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function C(J){return J.replace(/\*/g,"")}function g(J,fe,Te={}){if(!J)throw new Error("Cannot create regex from empty string");fe||(J=w(J)),Te.wholeWord&&(/\B/.test(J.charAt(0))||(J="\\b"+J),/\B/.test(J.charAt(J.length-1))||(J=J+"\\b"));let Ee="";return Te.global&&(Ee+="g"),Te.matchCase||(Ee+="i"),Te.multiline&&(Ee+="m"),Te.unicode&&(Ee+="u"),new RegExp(J,Ee)}function h(J){if(J.source==="^"||J.source==="^$"||J.source==="$"||J.source==="^\\s*$")return!1;const fe=J.exec("");return!!(fe&&J.lastIndex===0)}function u(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 fe=0,Te=J.length;fe<Te;fe++){const Ee=J.charCodeAt(fe);if(Ee!==32&&Ee!==9)return fe}return-1}function c(J,fe=0,Te=J.length){for(let Ee=fe;Ee<Te;Ee++){const je=J.charCodeAt(Ee);if(je!==32&&je!==9)return J.substring(fe,Ee)}return J.substring(fe,Te)}function s(J,fe=J.length-1){for(let Te=fe;Te>=0;Te--){const Ee=J.charCodeAt(Te);if(Ee!==32&&Ee!==9)return Te}return-1}function r(J,fe){return J<fe?-1:J>fe?1:0}function n(J,fe,Te=0,Ee=J.length,je=0,He=fe.length){for(;Te<Ee&&je<He;Te++,je++){let Ze=J.charCodeAt(Te),$e=fe.charCodeAt(je);if(Ze<$e)return-1;if(Ze>$e)return 1}const Oe=Ee-Te,Ue=He-je;return Oe<Ue?-1:Oe>Ue?1:0}function t(J,fe){return v(J,fe,0,J.length,0,fe.length)}function v(J,fe,Te=0,Ee=J.length,je=0,He=fe.length){for(;Te<Ee&&je<He;Te++,je++){let Ze=J.charCodeAt(Te),$e=fe.charCodeAt(je);if(Ze===$e)continue;if(Ze>=128||$e>=128)return n(J.toLowerCase(),fe.toLowerCase(),Te,Ee,je,He);p(Ze)&&(Ze-=32),p($e)&&($e-=32);const Je=Ze-$e;if(Je===0)continue;return Je}const Oe=Ee-Te,Ue=He-je;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,fe){return J.length===fe.length&&v(J,fe)===0}function _(J,fe){const Te=fe.length;return fe.length>J.length?!1:v(J,fe,0,Te)===0}function o(J,fe){let Te,Ee=Math.min(J.length,fe.length);for(Te=0;Te<Ee;Te++)if(J.charCodeAt(Te)!==fe.charCodeAt(Te))return Te;return Ee}function f(J,fe){let Te,Ee=Math.min(J.length,fe.length);const je=J.length-1,He=fe.length-1;for(Te=0;Te<Ee;Te++)if(J.charCodeAt(je-Te)!==fe.charCodeAt(He-Te))return Te;return Ee}function l(J){return 55296<=J&&J<=56319}function d(J){return 56320<=J&&J<=57343}function E(J,fe){return(J-55296<<10)+(fe-56320)+65536}function y(J,fe,Te){const Ee=J.charCodeAt(Te);if(l(Ee)&&Te+1<fe){const je=J.charCodeAt(Te+1);if(d(je))return E(Ee,je)}return Ee}function S(J,fe){const Te=J.charCodeAt(fe-1);if(d(Te)&&fe>1){const Ee=J.charCodeAt(fe-2);if(l(Ee))return E(Ee,Te)}return Te}function D(J,fe){const Te=ke.getInstance(),Ee=fe,je=J.length,He=y(J,je,fe);fe+=He>=65536?2:1;let Oe=Te.getGraphemeBreakType(He);for(;fe<je;){const Ue=y(J,je,fe),Ze=Te.getGraphemeBreakType(Ue);if(Me(Oe,Ze))break;fe+=Ue>=65536?2:1,Oe=Ze}return fe-Ee}function I(J,fe){const Te=ke.getInstance(),Ee=fe,je=S(J,fe);fe-=je>=65536?2:1;let He=Te.getGraphemeBreakType(je);for(;fe>0;){const Oe=S(J,fe),Ue=Te.getGraphemeBreakType(Oe);if(Me(Ue,He))break;fe-=Oe>=65536?2:1,He=Ue}return Ee-fe}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 V(J){return K.test(J)}const oe=/[\u2028\u2029]/;function Q(J){return oe.test(J)}function pe(J){for(let fe=0,Te=J.length;fe<Te;fe++)if(ce(J.charCodeAt(fe)))return!0;return!1}function ce(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 ne=String.fromCharCode(65279);function me(J){return!!(J&&J.length>0&&J.charCodeAt(0)===65279)}function Z(J,fe=!1){return J?(fe&&(J=J.replace(/\\./g,"")),J.toLowerCase()!==J):!1}function Y(J){const fe=90-65+1;return J=J%(2*fe),J<fe?String.fromCharCode(97+J):String.fromCharCode(65+J-fe)}function Se(J){const fe=ke.getInstance();return fe.getGraphemeBreakType(J)}function Me(J,fe){return J===0?fe!==5&&fe!==7:J===2&&fe===3?!1:J===4||J===2||J===3||(fe===4||fe===2||fe===3)?!0:J===8&&(fe===8||fe===9||fe===11||fe===12)||((J===11||J===9)&&(fe===9||fe===10)||((J===12||J===10)&&fe===10||(fe===5||fe===13||(fe===7||(J===1||J===13&&fe===14)))))?!1:!(J===6&&fe===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 fe=this._data,Te=fe.length/3;let Ee=1;for(;Ee<=Te;)if(J<fe[3*Ee])Ee=2*Ee;else if(J>fe[3*Ee+1])Ee=2*Ee+1;else return fe[3*Ee+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 Pe(J,fe){if(J===0)return 0;const Te=Ce(J,fe);if(Te!==void 0)return Te;const Ee=S(fe,J);return J-=De(Ee),J}function Ce(J,fe){let Te=S(fe,J);for(J-=De(Te);Ne(Te)||Te===65039||Te===8419;){if(J===0)return;Te=S(fe,J),J-=De(Te)}if(!ee(Te))return;if(J>=0){const Ee=S(fe,J);Ee===8205&&(J-=De(Ee))}return J}function De(J){return J>=65536?2:1}function Ne(J){return 127995<=J&&J<=127999}},NvD2:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return L});var ie=N("Kwbf");function W(j,U){var e=new Set;return j.forEach(function(C){U.has(C)||e.add(C)}),e}function O(j){var U=j||{},e=U.disabled,C=U.disableCheckbox,g=U.checkable;return!!(e||C)||g===!1}function M(j,U,e,C){for(var g=new Set(j),h=new Set,u=0;u<=e;u+=1){var a=U.get(u)||new Set;a.forEach(function(r){var n=r.key,t=r.node,v=r.children,p=v===void 0?[]:v;g.has(n)&&!C(t)&&p.filter(function(m){return!C(m.node)}).forEach(function(m){g.add(m.key)})})}for(var i=new Set,c=e;c>=0;c-=1){var s=U.get(c)||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 v=!0,p=!1;(n.children||[]).filter(function(m){return!C(m.node)}).forEach(function(m){var b=m.key,_=g.has(b);v&&!_&&(v=!1),!p&&(_||h.has(b))&&(p=!0)}),v&&g.add(n.key),p&&h.add(n.key),i.add(n.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(W(h,g))}}function w(j,U,e,C,g){for(var h=new Set(j),u=new Set(U),a=0;a<=C;a+=1){var i=e.get(a)||new Set;i.forEach(function(n){var t=n.key,v=n.node,p=n.children,m=p===void 0?[]:p;!h.has(t)&&!u.has(t)&&!g(v)&&m.filter(function(b){return!g(b.node)}).forEach(function(b){h.delete(b.key)})})}u=new Set;for(var c=new Set,s=C;s>=0;s-=1){var r=e.get(s)||new Set;r.forEach(function(n){var t=n.parent,v=n.node;if(g(v)||!n.parent||c.has(n.parent.key))return;if(g(n.parent.node)){c.add(t.key);return}var p=!0,m=!1;(t.children||[]).filter(function(b){return!g(b.node)}).forEach(function(b){var _=b.key,o=h.has(_);p&&!o&&(p=!1),!m&&(o||u.has(_))&&(m=!0)}),p||h.delete(t.key),m&&u.add(t.key),c.add(t.key)})}return{checkedKeys:Array.from(h),halfCheckedKeys:Array.from(W(u,h))}}function L(j,U,e,C){var g=[],h;C?h=C:h=O;var u=new Set(j.filter(function(s){var r=!!e[s];return r||g.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(ie.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var c;return U===!0?c=M(u,a,i,h):c=w(u,U.halfCheckedKeys,a,i,h),c}},OZM5:function(qe,ve,N){"use strict";N.d(ve,"b",function(){return C}),N.d(ve,"a",function(){return g}),N.d(ve,"k",function(){return h}),N.d(ve,"h",function(){return u}),N.d(ve,"i",function(){return a}),N.d(ve,"g",function(){return i}),N.d(ve,"c",function(){return c}),N.d(ve,"d",function(){return s}),N.d(ve,"j",function(){return t}),N.d(ve,"e",function(){return v}),N.d(ve,"f",function(){return p});var ie=N("KQm4"),W=N("U8pU"),O=N("Ff2n"),M=N("q1tI"),w=N.n(M),L=N("Kwbf"),j=N("WaYH"),U=.25,e=2;function C(m,b){var _=m.slice(),o=_.indexOf(b);return o>=0&&_.splice(o,1),_}function g(m,b){var _=m.slice();return _.indexOf(b)===-1&&_.push(b),_}function h(m){return m.split("-")}function u(m,b){return"".concat(m,"-").concat(b)}function a(m){return m&&m.type&&m.type.isTreeNode}function i(m,b){var _=[m],o=b[m];function f(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];l.forEach(function(d){var E=d.key,y=d.children;_.push(E),f(y)})}return f(o.children),_}function c(m,b){var _=m.clientY,o=b.selectHandle.getBoundingClientRect(),f=o.top,l=o.bottom,d=o.height,E=Math.max(d*U,e);return _<=f+E?-1:_>=l-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||{},o=_.processProps,f=o===void 0?r:o,l=Array.isArray(m)?m:[m];return l.map(function(d){var E=d.children,y=Object(O.a)(d,["children"]),S=n(E,b);return w.a.createElement(j.a,Object.assign({},f(y)),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(L.a)(!1,"`checkedKeys` is not an array or an object"),null;return b}function v(m,b){var _=new Set;function o(f){if(_.has(f))return;var l=b[f];if(!l)return;_.add(f);var d=l.parent,E=l.node;if(E.disabled)return;d&&o(d.key)}return(m||[]).forEach(function(f){o(f)}),Object(ie.a)(_)}function p(m){var b={};return Object.keys(m).forEach(function(_){(_.startsWith("data-")||_.startsWith("aria-"))&&(b[_]=m[_])}),b}},"P/tu":function(qe,ve,N){"use strict";var ie=N("ozfa"),W=N("MJZm"),O=N("0Owb"),M=N("9og8"),w=N("tJVT"),L=N("PpiC"),j=N("WmNS"),U=N.n(j),e=N("q1tI"),C=N.n(e),g=N("WCUW"),h=N("spXi"),u=N.n(h),a=function(c){var s=c.value,r=c.onChange,n=c.defaultValue,t=c.disabled,v=Object(L.a)(c,["value","onChange","defaultValue","disabled"]),p=Object(e.useState)([]),m=Object(w.a)(p,2),b=m[0],_=m[1],o=Object(e.useState)("1"),f=Object(w.a)(o,2),l=f[0],d=f[1];Object(e.useEffect)(function(){E()},[]);var E=function(){var D=Object(M.a)(U.a.mark(function I(){var A,P;return U.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,Object(g.A)({});case 2:A=R.sent,A!=null&&A.data&&(P=[{title:C.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:u.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:y(A.data||[])}],_(P),d("2"));case 4:case"end":return R.stop()}},I)}));return function(){return D.apply(this,arguments)}}(),y=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:u.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(V){return A(V)}):[]}}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:u.a.customTree},C.a.createElement(W.a,Object(O.a)({key:l},S,{showIcon:!0,treeData:b,onSelect:r,disabled:t},v)))};ve.a=a},Q0Vu:function(qe,ve,N){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,N){"use strict";var ie=N("Q9mQ"),W=N("diRs"),O=N("q1tI"),M=N.n(O),w=N("+z73"),L=N.n(w),j=function(e){var C=e.data,g=C===void 0?[]:C,h=e.onClick,u=function(){return g.map(function(c,s){return M.a.createElement("div",{key:s,className:L.a.few},M.a.createElement("b",{title:c.name,style:{color:s===0?"#333333":"#999999"},onClick:function(){return h(c.id)}},c.name),s<g.length-1&&M.a.createElement("span",null,"/"))})},a=function(){var c=!0,s=g.slice(2,-2),r=M.a.createElement("div",{className:L.a.pWrap},s.map(function(n){return M.a.createElement("span",{title:n.name,onClick:function(){return h(n.id)},key:n.id},n.name)}));return g.map(function(n,t){var v=null;return t>1&&t<g.length-2?c&&(v=M.a.createElement(W.a,{key:t,placement:"bottom",content:r},M.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),c=!1):v=M.a.createElement("div",{key:t,className:L.a.few},M.a.createElement("b",{title:n.name,style:{color:t===0?"#333333":"#999999"},onClick:function(){return h(n.id)}},n.name),t<g.length-1&&M.a.createElement("span",null,"/")),v})};return M.a.createElement("aside",{style:{overflowX:"auto"}},(g==null?void 0:g.length)>5?a():u())};ve.a=j},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 N,ie,W,O=!1,M,w;window.PR_SHOULD_USE_CONTINUATION=!0;var L,j;(function(){var U=window,e=["break,continue,do,else,for,if,return,while"],C=[e,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[C,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],h=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],u=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],i="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",c=[g,"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"],v=[h,a,u,c,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",o="typ",f="lit",l="pun",d="pln",E="tag",y="dec",S="src",D="atn",I="atv",A="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(Ce){for(var De=0,Ne=!1,J=!1,fe=0,Te=Ce.length;fe<Te;++fe){var Ee=Ce[fe];if(Ee.ignoreCase)J=!0;else if(/[a-z]/i.test(Ee.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ne=!0,J=!1;break}}var je={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=je[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]==="^",Fe=["["];it&&Fe.push("^");for(var Ke=it?1:0,ae=ze.length;Ke<ae;++Ke){var de=ze[Ke];if(/\\[bdsw]/i.test(de))Fe.push(de);else{var ye=He(de),$;Ke+2<ae&&ze[Ke+1]==="-"?($=He(ze[Ke+2]),Ke+=2):$=ye,nt.push([ye,$]),$<65||ye>122||($<65||ye>90||nt.push([Math.max(65,ye)|32,Math.min($,90)|32]),$<97||ye>122||nt.push([Math.max(97,ye)&~32,Math.min($,122)&~32]))}}nt.sort(function(Le,Be){return Le[0]-Be[0]||Be[1]-Le[1]});for(var q=[],se=[],Ke=0;Ke<nt.length;++Ke){var ge=nt[Ke];ge[0]<=se[1]+1?se[1]=Math.max(se[1],ge[1]):q.push(se=ge)}for(var Ke=0;Ke<q.length;++Ke){var ge=q[Ke];Fe.push(Oe(ge[0])),ge[1]>ge[0]&&(ge[1]+1>ge[0]&&Fe.push("-"),Fe.push(Oe(ge[1])))}return Fe.push("]"),Fe.join("")}function Ze(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=[],Fe=0,Ke=0;Fe<nt;++Fe){var ae=ze[Fe];if(ae==="(")++Ke;else if(ae.charAt(0)==="\\"){var de=+ae.substring(1);de&&(de<=Ke?it[de]=-1:ze[Fe]=Oe(de))}}for(var Fe=1;Fe<it.length;++Fe)it[Fe]===-1&&(it[Fe]=++De);for(var Fe=0,Ke=0;Fe<nt;++Fe){var ae=ze[Fe];if(ae==="(")++Ke,it[Ke]||(ze[Fe]="(?:");else if(ae.charAt(0)==="\\"){var de=+ae.substring(1);de&&de<=Ke&&(ze[Fe]="\\"+it[de])}}for(var Fe=0;Fe<nt;++Fe)ze[Fe]==="^"&&ze[Fe+1]!=="^"&&(ze[Fe]="");if(Je.ignoreCase&&Ne)for(var Fe=0;Fe<nt;++Fe){var ae=ze[Fe],ye=ae.charAt(0);ae.length>=2&&ye==="["?ze[Fe]=Ue(ae):ye!=="\\"&&(ze[Fe]=ae.replace(/[a-zA-Z]/g,function(se){var ge=se.charCodeAt(0);return"["+String.fromCharCode(ge&~32,ge|32)+"]"}))}return ze.join("")}for(var $e=[],fe=0,Te=Ce.length;fe<Te;++fe){var Ee=Ce[fe];if(Ee.global||Ee.multiline)throw new Error(""+Ee);$e.push("(?:"+Ze(Ee)+")")}return new RegExp($e.join("|"),J?"gi":"g")}function R(Ce,De){var Ne=/(?:^|\s)nocode(?:\s|$)/,J=[],fe=0,Te=[],Ee=0;function je(He){var Oe=He.nodeType;if(Oe==1){if(Ne.test(He.className))return;for(var Ue=He.firstChild;Ue;Ue=Ue.nextSibling)je(Ue);var Ze=He.nodeName.toLowerCase();(Ze==="br"||Ze==="li")&&(J[Ee]=`
`,Te[Ee<<1]=fe++,Te[Ee++<<1|1]=He)}else if(Oe==3||Oe==4){var $e=He.nodeValue;$e.length&&(De?$e=$e.replace(/\r\n?/g,`
`):$e=$e.replace(/[ \t\r\n]+/g," "),J[Ee]=$e,Te[Ee<<1]=fe,fe+=$e.length,Te[Ee++<<1|1]=He)}}return je(Ce),{sourceCode:J.join("").replace(/\n$/,""),spans:Te}}function K(Ce,De,Ne,J,fe){if(!Ne)return;var Te={sourceNode:Ce,pre:1,langExtension:null,numberLines:null,sourceCode:Ne,spans:null,basePos:De,decorations:null};J(Te),fe.push.apply(fe,Te.decorations)}var V=/\S/;function oe(Ce){for(var De=void 0,Ne=Ce.firstChild;Ne;Ne=Ne.nextSibling){var J=Ne.nodeType;De=J===1?De?Ce:Ne:J===3&&V.test(Ne.nodeValue)?Ce:De}return De===Ce?void 0:De}function Q(Ce,De){var Ne={},J;(function(){for(var Ee=Ce.concat(De),je=[],He={},Oe=0,Ue=Ee.length;Oe<Ue;++Oe){var Ze=Ee[Oe],$e=Ze[3];if($e)for(var Je=$e.length;--Je>=0;)Ne[$e.charAt(Je)]=Ze;var ze=Ze[1],nt=""+ze;He.hasOwnProperty(nt)||(je.push(ze),He[nt]=null)}je.push(/[\0-\uffff]/),J=H(je)})();var fe=De.length,Te=function(Ee){for(var je=Ee.sourceCode,He=Ee.basePos,Oe=Ee.sourceNode,Ue=[He,d],Ze=0,$e=je.match(J)||[],Je={},ze=0,nt=$e.length;ze<nt;++ze){var it=$e[ze],Fe=Je[it],Ke=void 0,ae;if(typeof Fe=="string")ae=!1;else{var de=Ne[it.charAt(0)];if(de)Ke=it.match(de[1]),Fe=de[0];else{for(var ye=0;ye<fe;++ye)if(de=De[ye],Ke=it.match(de[1]),Ke){Fe=de[0];break}Ke||(Fe=d)}ae=Fe.length>=5&&Fe.substring(0,5)==="lang-",ae&&!(Ke&&typeof Ke[1]=="string")&&(ae=!1,Fe=S),ae||(Je[it]=Fe)}var $=Ze;if(Ze+=it.length,!ae)Ue.push(He+$,Fe);else{var q=Ke[1],se=it.indexOf(q),ge=se+q.length;Ke[2]&&(ge=it.length-Ke[2].length,se=ge-q.length);var Le=Fe.substring(5);K(Oe,He+$,it.substring(0,se),Te,Ue),K(Oe,He+$+se,q,Y(Le,q),Ue),K(Oe,He+$+ge,it.substring(ge),Te,Ue)}}Ee.decorations=Ue};return Te}function pe(Ce){var De=[],Ne=[];Ce.tripleQuotedStrings?De.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ce.multiLineStrings?De.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):De.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ce.verbatimStrings&&Ne.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var J=Ce.hashComments;J&&(Ce.cStyleComments?(J>1?De.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):De.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])):De.push([_,/^#[^\r\n]*/,null,"#"])),Ce.cStyleComments&&(Ne.push([_,/^\/\/[^\r\n]*/,null]),Ne.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var fe=Ce.regexLiterals;if(fe){var Te=fe>1?"":`
\r`,Ee=Te?".":"[\\S\\s]",je="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+Ee+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+Ee+")*(?:\\x5D|$))+/";Ne.push(["lang-regex",RegExp("^"+P+"("+je+")")])}var He=Ce.types;He&&Ne.push([o,He]);var Oe=(""+Ce.keywords).replace(/^ | $/g,"");Oe.length&&Ne.push([b,new RegExp("^(?:"+Oe.replace(/[\s,]+/g,"|")+")\\b"),null]),De.push([d,/^\s+/,null,` \r
\xA0`]);var Ue="^.[^\\s\\w.$@'\"`/\\\\]*";return Ce.regexLiterals&&(Ue+="(?!s*/)"),Ne.push([f,/^@[a-z_$][a-z_$@0-9]*/i,null],[o,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[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"],[d,/^\\[\s\S]?/,null],[l,new RegExp(Ue),null]),Q(De,Ne)}var ce=pe({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ee(Ce,De,Ne){for(var J=/(?:^|\s)nocode(?:\s|$)/,fe=/\r\n?|\n/,Te=Ce.ownerDocument,Ee=Te.createElement("li");Ce.firstChild;)Ee.appendChild(Ce.firstChild);var je=[Ee];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 Fe=ze.nodeValue,Ke=Fe.match(fe);if(Ke){var ae=Fe.substring(0,Ke.index);ze.nodeValue=ae;var de=Fe.substring(Ke.index+Ke[0].length);if(de){var ye=ze.parentNode;ye.insertBefore(Te.createTextNode(de),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 de=ae?Ke.cloneNode(!1):Ke,ye=Ke.parentNode;if(ye){var $=nt(ye,1),q=Ke.nextSibling;$.appendChild(de);for(var se=q;se;se=q)q=se.nextSibling,$.appendChild(se)}return de}for(var it=nt(ze.nextSibling,0),Fe;(Fe=it.parentNode)&&Fe.nodeType===1;)it=Fe;je.push(it)}for(var Ue=0;Ue<je.length;++Ue)He(je[Ue]);De===(De|0)&&je[0].setAttribute("value",De);var Ze=Te.createElement("ol");Ze.className="linenums";for(var $e=Math.max(0,De-1|0)||0,Ue=0,Je=je.length;Ue<Je;++Ue)Ee=je[Ue],Ee.className="L"+(Ue+$e)%10,Ee.firstChild||Ee.appendChild(Te.createTextNode("\xA0")),Ze.appendChild(Ee);Ce.appendChild(Ze)}function ne(Ce){var De=/\bMSIE\s(\d+)/.exec(navigator.userAgent);De=De&&+De[1]<=8;var Ne=/\n/g,J=Ce.sourceCode,fe=J.length,Te=0,Ee=Ce.spans,je=Ee.length,He=0,Oe=Ce.decorations,Ue=Oe.length,Ze=0;Oe[Ue]=fe;var $e,Je;for(Je=$e=0;Je<Ue;)Oe[Je]!==Oe[Je+2]?(Oe[$e++]=Oe[Je++],Oe[$e++]=Oe[Je++]):Je+=2;for(Ue=$e,Je=$e=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[$e++]=ze,Oe[$e++]=nt,Je=it}Ue=Oe.length=$e;var Fe=Ce.sourceNode,Ke="";Fe&&(Ke=Fe.style.display,Fe.style.display="none");try{for(var ae=null;He<je;){var de=Ee[He],ye=Ee[He+2]||fe,$=Oe[Ze+2]||fe,it=Math.min(ye,$),q=Ee[He+1],se;if(q.nodeType!==1&&(se=J.substring(Te,it))){De&&(se=se.replace(Ne,"\r")),q.nodeValue=se;var ge=q.ownerDocument,Le=ge.createElement("span");Le.className=Oe[Ze+1];var Be=q.parentNode;Be.replaceChild(Le,q),Le.appendChild(q),Te<ye&&(Ee[He+1]=q=ge.createTextNode(J.substring(it,ye)),Be.insertBefore(q,Le.nextSibling))}Te=it,Te>=ye&&(He+=2),Te>=$&&(Ze+=2)}}finally{Fe&&(Fe.style.display=Ke)}}var me={};function Z(Ce,De){for(var Ne=De.length;--Ne>=0;){var J=De[Ne];me.hasOwnProperty(J)?U.console&&console.warn("cannot override language handler %s",J):me[J]=Ce}}function Y(Ce,De){return Ce&&me.hasOwnProperty(Ce)||(Ce=/^\s*</.test(De)?"default-markup":"default-code"),me[Ce]}Z(ce,["default-code"]),Z(Q([],[[d,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[l,/^(?:<[%?]|[%?]>)/],["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(Q([[d,/^[\s]+/,null,` \r
`],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[D,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[l,/^[=<>\/]+/],["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(Q([],[[I,/^[\s\S]+/]]),["uq.val"]),Z(pe({keywords:h,hashComments:!0,cStyleComments:!0,types:p}),["c","cc","cpp","cxx","cyc","m"]),Z(pe({keywords:"null,true,false"}),["json"]),Z(pe({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:p}),["cs"]),Z(pe({keywords:u,cStyleComments:!0}),["java"]),Z(pe({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Z(pe({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Z(pe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Z(pe({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Z(pe({keywords:c,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Z(pe({keywords:i,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Z(Q([],[[m,/^[\s\S]+/]]),["regex"]);function Se(Ce){var De=Ce.langExtension;try{var Ne=R(Ce.sourceNode,Ce.pre),J=Ne.sourceCode;Ce.sourceCode=J,Ce.spans=Ne.spans,Ce.basePos=0,Y(De,J)(Ce),ne(Ce)}catch(fe){U.console&&console.log(fe&&fe.stack||fe)}}function Me(Ce,De,Ne){var J=Ne||!1,fe=De||null,Te=document.createElement("div");Te.innerHTML="<pre>"+Ce+"</pre>",Te=Te.firstChild,J&&ee(Te,J,!0);var Ee={langExtension:fe,numberLines:J,sourceNode:Te,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Se(Ee),Te.innerHTML}function ke(Ce,De){var Ne=De||document.body,J=Ne.ownerDocument||document;function fe(de){return Ne.getElementsByTagName(de)}for(var Te=[fe("pre"),fe("code"),fe("xmp")],Ee=[],je=0;je<Te.length;++je)for(var He=0,Oe=Te[je].length;He<Oe;++He)Ee.push(Te[je][He]);Te=null;var Ue=Date;Ue.now||(Ue={now:function(){return+new Date}});var Ze=0,$e=/\blang(?:uage)?-([\w.]+)(?!\S)/,Je=/\bprettyprint\b/,ze=/\bprettyprinted\b/,nt=/pre|xmp/i,it=/^code$/i,Fe=/^(?:pre|code|xmp)$/i,Ke={};function ae(){for(var de=U.PR_SHOULD_USE_CONTINUATION?Ue.now()+250:Infinity;Ze<Ee.length&&Ue.now()<de;Ze++){for(var ye=Ee[Ze],$=Ke,q=ye;q=q.previousSibling;){var se=q.nodeType,ge=(se===7||se===8)&&q.nodeValue;if(ge?!/^\??prettify\b/.test(ge):se!==3||/\S/.test(q.nodeValue))break;if(ge){$={},ge.replace(/\b(\w+)=([\w:.%+-]+)/g,function($t,bt,en){$[bt]=en});break}}var Le=ye.className;if(($!==Ke||Je.test(Le))&&!ze.test(Le)){for(var Be=!1,Xe=ye.parentNode;Xe;Xe=Xe.parentNode){var ut=Xe.tagName;if(Fe.test(ut)&&Xe.className&&Je.test(Xe.className)){Be=!0;break}}if(!Be){ye.className+=" prettyprinted";var vt=$.lang;if(!vt){vt=Le.match($e);var dt;!vt&&(dt=oe(ye))&&it.test(dt.tagName)&&(vt=dt.className.match($e)),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=$.linenums;(It=It==="true"||+It)||(It=Le.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)}}}Ze<Ee.length?U.setTimeout(ae,250):typeof Ce=="function"&&Ce()}ae()}var Re=U.PR={createSimpleLexer:Q,registerLangHandler:Z,sourceDecorator:pe,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:I,PR_COMMENT:_,PR_DECLARATION:y,PR_KEYWORD:b,PR_LITERAL:f,PR_NOCODE:A,PR_PLAIN:d,PR_PUNCTUATION:l,PR_SOURCE:S,PR_STRING:m,PR_TAG:E,PR_TYPE:o,prettyPrintOne:O?U.prettyPrintOne=Me:L=Me,prettyPrint:j=O?U.prettyPrint=ke:j=ke},Pe=U.define;typeof Pe=="function"&&Pe.amd&&Pe("google-code-prettify",[],function(){return Re})})()},T8No:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return j}),N.d(ve,"e",function(){return U}),N.d(ve,"c",function(){return l}),N.d(ve,"b",function(){return d}),N.d(ve,"d",function(){return E}),N.d(ve,"f",function(){return D});var ie=N("MNsG"),W=N("N0LK"),O=N("Cg/j");let M=ie.k||"";const w=new Map;w.set("false",!1),w.set("true",!0),w.set("isMac",ie.f),w.set("isLinux",ie.d),w.set("isWindows",ie.i),w.set("isWeb",ie.h),w.set("isMacNative",ie.f&&!ie.h),w.set("isEdge",M.indexOf("Edg/")>=0),w.set("isFirefox",M.indexOf("Firefox")>=0),w.set("isChrome",M.indexOf("Chrome")>=0),w.set("isSafari",M.indexOf("Safari")>=0);const L=Object.prototype.hasOwnProperty;class j{static has(A){return h.create(A)}static equals(A,P){return u.create(A,P)}static regex(A,P){return m.create(A,P)}static not(A){return s.create(A)}static and(...A){return o.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 o.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 c.create(H[0].trim(),this._deserializeValue(H[1],P))}if(A.indexOf("==")>=0){let H=A.split("==");return u.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 v.create(H[0].trim(),H[1].trim())}return/^\!\s*/.test(A)?s.create(A.substr(1).trim()):h.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),V=A[R+1]==="i"?"i":"";try{return new RegExp(K,V)}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 U(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 g.INSTANCE}}C.INSTANCE=new C;class g{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}}g.INSTANCE=new g;class h{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?g.INSTANCE:C.INSTANCE:new h(A,P)}cmp(A){return A.type!==this.type?this.type-A.type:y(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?g.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 u{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?h.create(A,H):s.create(A,H);const R=w.get(A);if(typeof R=="boolean"){const K=R?"true":"false";return P===K?g.INSTANCE:C.INSTANCE}return new u(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?g.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=c.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?L.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 c{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):h.create(A,H);const R=w.get(A);if(typeof R=="boolean"){const K=R?"true":"false";return P===K?C.INSTANCE:g.INSTANCE}return new c(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:g.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=u.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:g.INSTANCE:new s(A,P)}cmp(A){return A.type!==this.type?this.type-A.type:y(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:g.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.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=v.create(this.key,this.value,this)),this.negated}}class v{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 v(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 V=0;V<H;V++)P[V]=A[V]}P!==null&&(P[H]=K)}return P===null?A:P}class o{constructor(A,P){this.expr=A,this.negated=P,this.type=6}static create(A,P){return o._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:o.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 g.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 V=H.pop(),oe=H.length===0,Q=f.create(K.expr.map(pe=>o.create([pe,V],null)),null,oe);Q&&(H.push(Q),H.sort(e))}return H.length===1?H[0]:new o(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 V=0,oe=A.length;V<oe;V++){const Q=A[V];if(!Q)continue;if(Q.type===0){K=!0;continue}if(Q.type===1)return g.INSTANCE;if(Q.type===9){R=R.concat(Q.expr);continue}R.push(Q)}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 V=1;V<R.length;V++)R[V-1].equals(R[V])&&(R.splice(V,1),V--);if(R.length===1)return R[0];if(H){for(let V=0;V<R.length;V++)for(let oe=V+1;oe<R.length;oe++)D(R[V],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 V of I(P))for(const oe of I(H))R.push(o.create([V,oe],null));const K=A.length===0;A.unshift(f.create(R,null,K))}this.negated=A[0]}return this.negated}}class l extends h{constructor(A,P,H){super(A,null);this._defaultValue=P,typeof H=="object"?l._info.push(Object.assign(Object.assign({},H),{key:A})):H!==!0&&l._info.push({key:A,description:H,type:P!=null?typeof P:void 0})}static all(){return l._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 u.create(this.key,A)}}l._info=[];const d=Object(O.c)("contextKeyService"),E="setContext";function y(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 D(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 V=R[K],oe=V.negate();for(let Q=K+1;Q<R.length;Q++){const pe=R[Q];if(oe.equals(pe))return!0}}return!1}function I(A){return A.type===9?A.expr:[A]}},TXwP:function(qe,ve,N){var ie,W;(function(){var O;(function(){"use strict";var w=[,,function(e){function C(u){this.__parent=u,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 u=new C(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},C.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},C.prototype.has_match=function(u){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(u))return!0;return!1},C.prototype.set_indent=function(u,a){this.is_empty()&&(this.__indent_count=u||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 u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__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(u){this.__items.push(u);var a=u.lastIndexOf(`
`);a!==-1?this.__character_count=u.length-a:this.__character_count+=u.length},C.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},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 u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,a){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),a=a||"",u.indent_level>0&&(a=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}g.prototype.get_indent_size=function(u,a){var i=this.__base_string_length;return a=a||0,u<0&&(i=0),i+=u*this.__indent_size,i+=a,i},g.prototype.get_indent_string=function(u,a){var i=this.__base_string;return a=a||0,u<0&&(u=0,i=""),a+=u*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,a=0,i="";this.__indent_size&&u>=this.__indent_size&&(a=Math.floor(u/this.__indent_size),u-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),u&&(i+=new Array(u+1).join(" ")),this.__cache.push(i)};function h(u,a){this.__indent_cache=new g(u,a),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.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()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(u,a){return this.__indent_cache.get_indent_string(u,a)},h.prototype.get_indent_size=function(u,a){return this.__indent_cache.get_indent_size(u,a)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(u){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 u!==`
`&&(i=i.replace(/[\n]/g,u)),i},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(u,a){return u=u||0,a=a||0,this.next_line.set_indent(u,a),this.__lines.length>1?(this.current_line.set_indent(u,a),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(u){for(var a=0;a<u.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},h.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(" "))},h.prototype.remove_indent=function(u){for(var a=this.__lines.length;u<a;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&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},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(u,a){for(var i=this.__lines.length-2;i>=0;){var c=this.__lines[i];if(c.is_empty())break;if(c.item(0).indexOf(u)!==0&&c.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=h},,,,function(e){function C(u,a){this.raw_options=g(u,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(u,a){var i=this.raw_options[u],c=a||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(c=i.concat()):typeof i=="string"&&(c=i.split(/[^a-zA-Z0-9_\/\-]+/)),c},C.prototype._get_boolean=function(u,a){var i=this.raw_options[u],c=i===void 0?!!a:!!i;return c},C.prototype._get_characters=function(u,a){var i=this.raw_options[u],c=a||"";return typeof i=="string"&&(c=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),c},C.prototype._get_number=function(u,a){var i=this.raw_options[u];a=parseInt(a,10),isNaN(a)&&(a=0);var c=parseInt(i,10);return isNaN(c)&&(c=a),c},C.prototype._get_selection=function(u,a,i){var c=this._get_selection_list(u,a,i);if(c.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[u]+"'");return c[0]},C.prototype._get_selection_list=function(u,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 c=this._get_array(u,i);if(!this._is_valid_selection(c,a))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[u]+"'");return c},C.prototype._is_valid_selection=function(u,a){return u.length&&a.length&&!u.some(function(i){return a.indexOf(i)===-1})};function g(u,a){var i={};u=h(u);var c;for(c in u)c!==a&&(i[c]=u[c]);if(a&&u[a])for(c in u[a])i[c]=u[a][c];return i}function h(u){var a={},i;for(i in u){var c=i.replace(/-/g,"_");a[c]=u[i]}return a}e.exports.Options=C,e.exports.normalizeOpts=h,e.exports.mergeOpts=g},,function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function g(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},g.prototype.peek=function(h){var u=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(u=this.__input.charAt(h)),u},g.prototype.__match=function(h,u){h.lastIndex=u;var a=h.exec(this.__input);return a&&!(C&&h.sticky)&&(a.index!==u&&(a=null)),a},g.prototype.test=function(h,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(h,u):!1},g.prototype.testChar=function(h,u){var a=this.peek(u);return h.lastIndex=0,a!==null&&h.test(a)},g.prototype.match=function(h){var u=this.__match(h,this.__position);return u?this.__position+=u[0].length:u=null,u},g.prototype.read=function(h,u,a){var i="",c;return h&&(c=this.match(h),c&&(i+=c[0])),u&&(c||!h)&&(i+=this.readUntil(u,a)),i},g.prototype.readUntil=function(h,u){var a="",i=this.__position;h.lastIndex=this.__position;var c=h.exec(this.__input);return c?(i=c.index,u&&(i+=c[0].length)):i=this.__input_length,a=this.__input.substring(this.__position,i),this.__position=i,a},g.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},g.prototype.get_regexp=function(h,u){var a=null,i="g";return u&&C&&(i="y"),typeof h=="string"&&h!==""?a=new RegExp(h,i):h&&(a=new RegExp(h.source,i)),a},g.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(h){var u=this.__position,a=this.readUntilAfter(h);return this.__position=u,a},g.prototype.lookBack=function(h){var u=this.__position-1;return u>=h.length&&this.__input.substring(u-h.length,u).toLowerCase()===h},e.exports.InputScanner=g},,,,,function(e){function C(g,h){g=typeof g=="string"?g:g.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+h,"g")}C.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)h[u[1]]=u[2],u=this.__directive_pattern.exec(g);return h},C.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},,function(e,C,g){var h=g(16).Beautifier,u=g(17).Options;function a(i,c){var s=new h(i,c);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new u}},function(e,C,g){var h=g(17).Options,u=g(2).Output,a=g(8).InputScanner,i=g(13).Directives,c=new i(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,n=/\s/,t=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,p=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function m(b,_){this._source_text=b||"",this._options=new h(_),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()),o=0;n.test(this._input.peek());)this._ch=this._input.next(),b&&this._ch===`
`&&((o===0||o<this._options.max_preserve_newlines)&&(o++,this._output.add_new_line(!0)));return _},m.prototype.foundNestedPseudoClass=function(){for(var b=0,_=1,o=this._input.peek(_);o;){if(o==="{")return!0;if(o==="(")b+=1;else if(o===")"){if(b===0)return!1;b-=1}else if(o===";"||o==="}")return!1;_++,o=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 o=b.match(/^[\t ]*/)[0];this._output=new u(this._options,o),this._input=new a(b),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f=0,l=!1,d=!1,E=!1,y=!1,S=!1,D=!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(v),V=c.get_directives(K);V&&V.ignore==="start"&&(K+=c.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"?y=!0:oe==="import"&&(S=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!l&&f===0&&oe.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(H),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),E?(E=!1,l=this._indentLevel>=this._nestedLevel):l=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&l&&(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,y=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),l=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var Q=0;Q<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Q++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Q])){A=!0;break}(l||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&f===0?(this.print_string(":"),d||(d=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var pe=R==='"'||R==="'";this.preserveSingleSpace(pe||H),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,f===0?(d&&(this.outdent(),d=!1),y=!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 ce=!1;this._input.lookBack("with")&&(ce=!0),this.preserveSingleSpace(H||ce),this.print_string(this._ch),d&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),D=!0):(this.eatWhitespace(),f++,this.indent())}else if(this._ch===")")f&&(f--,this.outdent()),D&&this._input.peek()===";"&&this._options.selector_separator_newline&&(D=!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&&(!d||D)&&f===0&&!S&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!d&&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 ne=this._output.get_code(_);return ne},e.exports.Beautifier=m},function(e,C,g){var h=g(6).Options;function u(a){h.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 c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<c.length;s++)c[s]!=="expand"?this.brace_style="collapse":this.brace_style=c[s]}u.prototype=new h,e.exports.Options=u}],L={};function j(e){var C=L[e];if(C!==void 0)return C.exports;var g=L[e]={exports:{}};return w[e](g,g.exports,j),g.exports}var U=j(15);O=U})();var M=O;!(ie=[],W=function(){return{css_beautify:M}}.apply(ve,ie),W!==void 0&&(qe.exports=W))})()},Vhoy:function(qe,ve,N){"use strict";N.d(ve,"d",function(){return M}),N.d(ve,"e",function(){return w}),N.d(ve,"c",function(){return L}),N.d(ve,"b",function(){return j}),N.d(ve,"a",function(){return U});var ie=N("MI8n");class W{constructor(){this._icons=new Map,this._onDidRegister=new ie.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,M=O;function w(e,C){return new j(e,C)}function L(e){return e?e.replace(/\$\((.*?)\)/g,(C,g)=>` ${g} `).trim():""}class j{constructor(e,C,g){this.id=e,this.definition=C,this.description=g,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 U;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const C=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function g(a){if(a instanceof j)return["codicon","codicon-"+a.id];const i=C.exec(a.id);if(!i)return g(j.error);let[,c,s]=i;const r=["codicon","codicon-"+c];return s&&r.push("codicon-modifier-"+s.substr(1)),r}e.asClassNameArray=g;function h(a){return g(a).join(" ")}e.asClassName=h;function u(a){return"."+g(a).join(".")}e.asCSSSelector=u})(U||(U={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(j||(j={}))},WaYH:function(qe,ve,N){"use strict";var ie=N("rePB"),W=N("Ff2n"),O=N("VTBJ"),M=N("1OyB"),w=N("vuIU"),L=N("JX7q"),j=N("Ji7U"),U=N("LK+K"),e=N("q1tI"),C=N("TSYQ"),g=N.n(C),h=N("sboe"),u=N("OZM5"),a=function(b){var _=b.prefixCls,o=b.level,f=b.isStart,l=b.isEnd;if(!o)return null;for(var d="".concat(_,"-indent-unit"),E=[],y=0;y<o;y+=1){var S;E.push(e.createElement("span",{key:y,className:g()(d,(S={},Object(ie.a)(S,"".concat(d,"-start"),f[y+1]),Object(ie.a)(S,"".concat(d,"-end"),l[y+1]),Object(ie.a)(S,"".concat(d,"-end-first-level"),!y&&l[0]),S))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(_,"-indent")},E)},i=a,c=N("815F"),s="open",r="close",n="---",t=function(m){Object(j.a)(_,m);var b=Object(U.a)(_);function _(){var o;return Object(M.a)(this,_),o=b.apply(this,arguments),o.state={dragNodeHighlight:!1},o.onSelectorClick=function(f){var l=o.props.context.onNodeClick;l(f,Object(c.b)(o.props)),o.isSelectable()?o.onSelect(f):o.onCheck(f)},o.onSelectorDoubleClick=function(f){var l=o.props.context.onNodeDoubleClick;l(f,Object(c.b)(o.props))},o.onSelect=function(f){if(o.isDisabled())return;var l=o.props.context.onNodeSelect;f.preventDefault(),l(f,Object(c.b)(o.props))},o.onCheck=function(f){if(o.isDisabled())return;var l=o.props,d=l.disableCheckbox,E=l.checked,y=o.props.context.onNodeCheck;if(!o.isCheckable()||d)return;f.preventDefault();var S=!E;y(f,Object(c.b)(o.props),S)},o.onMouseEnter=function(f){var l=o.props.context.onNodeMouseEnter;l(f,Object(c.b)(o.props))},o.onMouseLeave=function(f){var l=o.props.context.onNodeMouseLeave;l(f,Object(c.b)(o.props))},o.onContextMenu=function(f){var l=o.props.context.onNodeContextMenu;l(f,Object(c.b)(o.props))},o.onDragStart=function(f){var l=o.props.context.onNodeDragStart;f.stopPropagation(),o.setState({dragNodeHighlight:!0}),l(f,Object(L.a)(o));try{f.dataTransfer.setData("text/plain","")}catch(d){}},o.onDragEnter=function(f){var l=o.props.context.onNodeDragEnter;f.preventDefault(),f.stopPropagation(),l(f,Object(L.a)(o))},o.onDragOver=function(f){var l=o.props.context.onNodeDragOver;f.preventDefault(),f.stopPropagation(),l(f,Object(L.a)(o))},o.onDragLeave=function(f){var l=o.props.context.onNodeDragLeave;f.stopPropagation(),l(f,Object(L.a)(o))},o.onDragEnd=function(f){var l=o.props.context.onNodeDragEnd;f.stopPropagation(),o.setState({dragNodeHighlight:!1}),l(f,Object(L.a)(o))},o.onDrop=function(f){var l=o.props.context.onNodeDrop;f.preventDefault(),f.stopPropagation(),o.setState({dragNodeHighlight:!1}),l(f,Object(L.a)(o))},o.onExpand=function(f){var l=o.props.context.onNodeExpand;l(f,Object(c.b)(o.props))},o.setSelectHandle=function(f){o.selectHandle=f},o.getNodeState=function(){var f=o.props.expanded;return o.isLeaf()?null:f?s:r},o.hasChildren=function(){var f=o.props.eventKey,l=o.props.context.keyEntities,d=l[f]||{},E=d.children;return!!(E||[]).length},o.isLeaf=function(){var f=o.props,l=f.isLeaf,d=f.loaded,E=o.props.context.loadData,y=o.hasChildren();return l===!1?!1:l||!E&&!y||E&&d&&!y},o.isDisabled=function(){var f=o.props.disabled,l=o.props.context.disabled;return!!(l||f)},o.isCheckable=function(){var f=o.props.checkable,l=o.props.context.checkable;return!l||f===!1?!1:l},o.syncLoadData=function(f){var l=f.expanded,d=f.loading,E=f.loaded,y=o.props.context,S=y.loadData,D=y.onNodeLoad;if(d)return;S&&l&&!o.isLeaf()&&(!o.hasChildren()&&!E&&D(Object(c.b)(o.props)))},o.renderSwitcher=function(){var f=o.props,l=f.expanded,d=f.switcherIcon,E=o.props.context,y=E.prefixCls,S=E.switcherIcon,D=d||S;if(o.isLeaf())return e.createElement("span",{className:g()("".concat(y,"-switcher"),"".concat(y,"-switcher-noop"))},typeof D=="function"?D(Object(O.a)(Object(O.a)({},o.props),{},{isLeaf:!0})):D);var I=g()("".concat(y,"-switcher"),"".concat(y,"-switcher_").concat(l?s:r));return e.createElement("span",{onClick:o.onExpand,className:I},typeof D=="function"?D(Object(O.a)(Object(O.a)({},o.props),{},{isLeaf:!1})):D)},o.renderCheckbox=function(){var f=o.props,l=f.checked,d=f.halfChecked,E=f.disableCheckbox,y=o.props.context.prefixCls,S=o.isDisabled(),D=o.isCheckable();if(!D)return null;var I=typeof D!="boolean"?D:null;return e.createElement("span",{className:g()("".concat(y,"-checkbox"),l&&"".concat(y,"-checkbox-checked"),!l&&d&&"".concat(y,"-checkbox-indeterminate"),(S||E)&&"".concat(y,"-checkbox-disabled")),onClick:o.onCheck},I)},o.renderIcon=function(){var f=o.props.loading,l=o.props.context.prefixCls;return e.createElement("span",{className:g()("".concat(l,"-iconEle"),"".concat(l,"-icon__").concat(o.getNodeState()||"docu"),f&&"".concat(l,"-icon_loading"))})},o.renderSelector=function(){var f=o.state.dragNodeHighlight,l=o.props,d=l.title,E=l.selected,y=l.icon,S=l.loading,D=l.data,I=o.props.context,A=I.prefixCls,P=I.showIcon,H=I.icon,R=I.draggable,K=I.loadData,V=I.titleRender,oe=o.isDisabled(),Q="".concat(A,"-node-content-wrapper"),pe;if(P){var ce=y||H;pe=ce?e.createElement("span",{className:g()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof ce=="function"?ce(o.props):ce):o.renderIcon()}else K&&S&&(pe=o.renderIcon());var ee;typeof d=="function"?ee=d(D):V?ee=V(D):ee=d;var ne=e.createElement("span",{className:"".concat(A,"-title")},ee);return e.createElement("span",{ref:o.setSelectHandle,title:typeof d=="string"?d:"",className:g()("".concat(Q),"".concat(Q,"-").concat(o.getNodeState()||"normal"),!oe&&(E||f)&&"".concat(A,"-node-selected"),!oe&&R&&"draggable"),draggable:!oe&&R||void 0,"aria-grabbed":!oe&&R||void 0,onMouseEnter:o.onMouseEnter,onMouseLeave:o.onMouseLeave,onContextMenu:o.onContextMenu,onClick:o.onSelectorClick,onDoubleClick:o.onSelectorDoubleClick,onDragStart:R?o.onDragStart:void 0},pe,ne)},o}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,l=this.props.context.selectable;return typeof f=="boolean"?f:l}},{key:"render",value:function(){var f,l=this.props,d=l.eventKey,E=l.className,y=l.style,S=l.dragOver,D=l.dragOverGapTop,I=l.dragOverGapBottom,A=l.isLeaf,P=l.isStart,H=l.isEnd,R=l.expanded,K=l.selected,V=l.checked,oe=l.halfChecked,Q=l.loading,pe=l.domRef,ce=l.active,ee=l.onMouseMove,ne=Object(W.a)(l,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),me=this.props.context,Z=me.prefixCls,Y=me.filterTreeNode,Se=me.draggable,Me=me.keyEntities,ke=this.isDisabled(),Re=Object(u.f)(ne),Pe=Me[d]||{},Ce=Pe.level,De=H[H.length-1];return e.createElement("div",Object.assign({ref:pe,className:g()(E,"".concat(Z,"-treenode"),(f={},Object(ie.a)(f,"".concat(Z,"-treenode-disabled"),ke),Object(ie.a)(f,"".concat(Z,"-treenode-switcher-").concat(R?"open":"close"),!A),Object(ie.a)(f,"".concat(Z,"-treenode-checkbox-checked"),V),Object(ie.a)(f,"".concat(Z,"-treenode-checkbox-indeterminate"),oe),Object(ie.a)(f,"".concat(Z,"-treenode-selected"),K),Object(ie.a)(f,"".concat(Z,"-treenode-loading"),Q),Object(ie.a)(f,"".concat(Z,"-treenode-active"),ce),Object(ie.a)(f,"".concat(Z,"-treenode-leaf-last"),De),Object(ie.a)(f,"drag-over",!ke&&S),Object(ie.a)(f,"drag-over-gap-top",!ke&&D),Object(ie.a)(f,"drag-over-gap-bottom",!ke&&I),Object(ie.a)(f,"filter-node",Y&&Y(Object(c.b)(this.props))),f)),style:y,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),v=function(b){return e.createElement(h.a.Consumer,null,function(_){return e.createElement(t,Object.assign({},b,{context:_}))})};v.displayName="TreeNode",v.defaultProps={title:n},v.isTreeNode=1;var p=ve.a=v},Y1PL:function(qe,ve,N){"use strict";N.r(ve),N.d(ve,"ResizableTextArea",function(){return oe});var ie=N("wx14"),W=N("1OyB"),O=N("vuIU"),M=N("Ji7U"),w=N("LK+K"),L=N("q1tI"),j=N("VTBJ"),U=N("rePB"),e=N("Zm9Q"),C=N("Kwbf"),g=N("c+Xe"),h=N("m+aA"),u=N("bdgK"),a=new Map;function i(ce){ce.forEach(function(ee){var ne,me=ee.target;(ne=a.get(me))===null||ne===void 0||ne.forEach(function(Z){return Z(me)})})}var c=new u.default(i),s=null,r=null;function n(ce,ee){a.has(ce)||(a.set(ce,new Set),c.observe(ce)),a.get(ce).add(ee)}function t(ce,ee){a.has(ce)&&(a.get(ce).delete(ee),a.get(ce).size||(c.unobserve(ce),a.delete(ce)))}var v=function(ce){Object(M.a)(ne,ce);var ee=Object(w.a)(ne);function ne(){return Object(W.a)(this,ne),ee.apply(this,arguments)}return Object(O.a)(ne,[{key:"render",value:function(){return this.props.children}}]),ne}(L.Component),p=L.createContext(null);function m(ce){var ee=ce.children,ne=ce.onBatchResize,me=L.useRef(0),Z=L.useRef([]),Y=L.useContext(p),Se=L.useCallback(function(Me,ke,Re){me.current+=1;var Pe=me.current;Z.current.push({size:Me,element:ke,data:Re}),Promise.resolve().then(function(){Pe===me.current&&(ne==null||ne(Z.current),Z.current=[])}),Y==null||Y(Me,ke,Re)},[ne,Y]);return L.createElement(p.Provider,{value:Se},ee)}function b(ce){var ee=ce.children,ne=ce.disabled,me=L.useRef(null),Z=L.useRef(null),Y=L.useContext(p),Se=L.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Me=L.isValidElement(ee)&&Object(g.c)(ee),ke=Me?ee.ref:null,Re=L.useMemo(function(){return Object(g.a)(ke,me)},[ke,me]),Pe=L.useRef(ce);Pe.current=ce;var Ce=L.useCallback(function(De){var Ne=Pe.current,J=Ne.onResize,fe=Ne.data,Te=De.getBoundingClientRect(),Ee=Te.width,je=Te.height,He=De.offsetWidth,Oe=De.offsetHeight,Ue=Math.floor(Ee),Ze=Math.floor(je);if(Se.current.width!==Ue||Se.current.height!==Ze||Se.current.offsetWidth!==He||Se.current.offsetHeight!==Oe){var $e={width:Ue,height:Ze,offsetWidth:He,offsetHeight:Oe};Se.current=$e;var Je=He===Math.round(Ee)?Ee:He,ze=Oe===Math.round(je)?je:Oe,nt=Object(j.a)(Object(j.a)({},$e),{},{offsetWidth:Je,offsetHeight:ze});Y==null||Y(nt,De,fe),J&&Promise.resolve().then(function(){J(nt,De)})}},[]);return L.useEffect(function(){var De=Object(h.a)(me.current)||Object(h.a)(Z.current);return De&&!ne&&n(De,Ce),function(){return t(De,Ce)}},[me.current,ne]),L.createElement(v,{ref:Z},Me?L.cloneElement(ee,{ref:Re}):ee)}var _="rc-observer-key";function o(ce){var ee=ce.children,ne=Object(e.a)(ee);return ne.map(function(me,Z){var Y=(me==null?void 0:me.key)||"".concat(_,"-").concat(Z);return L.createElement(b,Object(ie.a)({},ce,{key:Y}),me)})}o.Collection=m;var f=o,l=N("bT9E"),d=N("TSYQ"),E=N.n(d),y=`
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"],D={},I;function A(ce){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ne=ce.getAttribute("id")||ce.getAttribute("data-reactid")||ce.getAttribute("name");if(ee&&D[ne])return D[ne];var me=window.getComputedStyle(ce),Z=me.getPropertyValue("box-sizing")||me.getPropertyValue("-moz-box-sizing")||me.getPropertyValue("-webkit-box-sizing"),Y=parseFloat(me.getPropertyValue("padding-bottom"))+parseFloat(me.getPropertyValue("padding-top")),Se=parseFloat(me.getPropertyValue("border-bottom-width"))+parseFloat(me.getPropertyValue("border-top-width")),Me=S.map(function(Re){return"".concat(Re,":").concat(me.getPropertyValue(Re))}).join(";"),ke={sizingStyle:Me,paddingSize:Y,borderSize:Se,boxSizing:Z};return ee&&ne&&(D[ne]=ke),ke}function P(ce){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),document.body.appendChild(I)),ce.getAttribute("wrap")?I.setAttribute("wrap",ce.getAttribute("wrap")):I.removeAttribute("wrap");var Z=A(ce,ee),Y=Z.paddingSize,Se=Z.borderSize,Me=Z.boxSizing,ke=Z.sizingStyle;I.setAttribute("style","".concat(ke,";").concat(y)),I.value=ce.value||ce.placeholder||"";var Re=Number.MIN_SAFE_INTEGER,Pe=Number.MAX_SAFE_INTEGER,Ce=I.scrollHeight,De;if(Me==="border-box"?Ce+=Se:Me==="content-box"&&(Ce-=Y),ne!==null||me!==null){I.value=" ";var Ne=I.scrollHeight-Y;ne!==null&&(Re=Ne*ne,Me==="border-box"&&(Re=Re+Y+Se),Ce=Math.max(Re,Ce)),me!==null&&(Pe=Ne*me,Me==="border-box"&&(Pe=Pe+Y+Se),De=Ce>Pe?"":"hidden",Ce=Math.min(Pe,Ce))}return{height:Ce,minHeight:Re,maxHeight:Pe,overflowY:De,resize:"none"}}var H=N("Gytx"),R=N.n(H),K;(function(ce){ce[ce.NONE=0]="NONE",ce[ce.RESIZING=1]="RESIZING",ce[ce.RESIZED=2]="RESIZED"})(K||(K={}));var V=function(ce){Object(M.a)(ne,ce);var ee=Object(w.a)(ne);function ne(me){var Z;return Object(W.a)(this,ne),Z=ee.call(this,me),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,Me=Z.props,ke=Me.autoSize,Re=Me.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,Me=Y.maxRows,ke=P(Z.textArea,!1,Se,Me);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,Me=Se===void 0?"rc-textarea":Se,ke=Y.autoSize,Re=Y.onResize,Pe=Y.className,Ce=Y.disabled,De=Z.state,Ne=De.textareaStyles,J=De.resizeStatus,fe=Object(l.a)(Z.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Te=E()(Me,Pe,Object(U.a)({},"".concat(Me,"-disabled"),Ce));"value"in fe&&(fe.value=fe.value||"");var Ee=Object(j.a)(Object(j.a)(Object(j.a)({},Z.props.style),Ne),J===K.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return L.createElement(f,{onResize:Z.handleResize,disabled:!(ke||Re)},L.createElement("textarea",Object(ie.a)({},fe,{className:Te,style:Ee,ref:Z.saveTextArea})))},Z.state={textareaStyles:{},resizeStatus:K.NONE},Z}return Object(O.a)(ne,[{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()}}]),ne}(L.Component),oe=V,Q=function(ce){Object(M.a)(ne,ce);var ee=Object(w.a)(ne);function ne(me){var Z;Object(W.a)(this,ne),Z=ee.call(this,me),Z.resizableTextArea=void 0,Z.focus=function(){Z.resizableTextArea.textArea.focus()},Z.saveTextArea=function(Se){Z.resizableTextArea=Se},Z.handleChange=function(Se){var Me=Z.props.onChange;Z.setValue(Se.target.value,function(){Z.resizableTextArea.resizeTextarea()}),Me&&Me(Se)},Z.handleKeyDown=function(Se){var Me=Z.props,ke=Me.onPressEnter,Re=Me.onKeyDown;Se.keyCode===13&&ke&&ke(Se),Re&&Re(Se)};var Y=typeof me.value=="undefined"||me.value===null?me.defaultValue:me.value;return Z.state={value:Y},Z}return Object(O.a)(ne,[{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 L.createElement(oe,Object(ie.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}}]),ne}(L.Component),pe=ve.default=Q},ZW9T:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return H});var ie=N("k1fw"),W=N("oBTY"),O=N("miYZ"),M=N("tsqr"),w=N("rAM+"),L=N("tJVT"),j=N("PpiC"),U=N("q1tI"),e=N.n(U),C=N("bdgK"),g=N("9og8"),h=N("WmNS"),u=N.n(h),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"]},c={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=N("5VLF"),n=N.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"]}},v=function(K,V){return V.map(function(oe){return{label:oe,kind:K.languages.CompletionItemKind.Keyword,insertText:oe}})},p=function(K){return Object.keys(t.tables).map(function(V){return{label:V,kind:K.languages.CompletionItemKind.Variable,insertText:V}})},m=function(K,V){var oe=t.tables[K];return oe?oe.map(function(Q){return{label:Q,kind:V.languages.CompletionItemKind.Field,insertText:Q}}):[]};function b(R,K,V,oe,Q){var pe=K.getWordUntilPosition(V),ce={startLineNumber:V.lineNumber,endLineNumber:V.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},ee=oe.map(function(ne){return{label:ne,kind:R.languages.CompletionItemKind.Keyword,insertText:ne,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}});return Q.map(function(ne){ee.push(Object(ie.a)(Object(ie.a)({},ne),{},{range:ce}))}),ee}var _=function(R){t.languages.map(function(Q){return R.languages.registerDocumentFormattingEditProvider(Q,{provideDocumentFormattingEdits:function(ce,ee,ne){return Object(g.a)(u.a.mark(function me(){var Z;return u.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Z=n()(ce.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:ce.getFullModelRange(),text:Z}]);case 2:case"end":return Se.stop()}},me)}))()}}),Q});var K=c.quickKey.map(function(Q){return{label:Q.label,kind:R.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),V=s.quickKey.map(function(Q){return{label:Q.label,kind:R.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),oe=i.quickKey.map(function(Q){return{label:Q.label,kind:R.languages.CompletionItemKind.Method,insertText:Q.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}});R.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(pe,ce){var ee=pe.getWordUntilPosition(ce),ne={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn},me=pe.getLineContent(ce.lineNumber).substring(ee.startColumn-2,ee.endColumn);return{suggestions:[].concat(Object(W.a)(c.keywords.map(function(Z){return{label:Z,kind:R.languages.CompletionItemKind.Function,documentation:Z,insertText:Z,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})),Object(W.a)(c.quickKey.map(function(Z){return{label:Z.label,kind:R.languages.CompletionItemKind.Function,documentation:Z.content,insertText:me.startsWith("#")?Z.content.replace(/#/,""):Z.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})))}}}),R.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(pe,ce){var ee=pe.getWordUntilPosition(ce),ne={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn};return{suggestions:Object(W.a)(a.keywords.map(function(me){return{label:me,kind:R.languages.CompletionItemKind.Function,documentation:me,insertText:me,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}}))}}}),R.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(pe,ce){var ee=pe.getWordUntilPosition(ce),ne={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn},me=pe.getLineContent(ce.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:ne}})),Object(W.a)(i.quickKey.map(function(Z){return{label:Z.label,kind:R.languages.CompletionItemKind.Function,documentation:Z.content,insertText:me.startsWith("#")?Z.content.replace(/#/,""):Z.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})))}}}),R.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(pe,ce){var ee=pe.getWordUntilPosition(ce),ne={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:ee.startColumn,endColumn:ee.endColumn},me=pe.getLineContent(ce.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:ne}})),Object(W.a)(s.quickKey.map(function(Z){return{label:Z.label,kind:R.languages.CompletionItemKind.Function,documentation:Z.content,insertText:me.startsWith("#")?Z.content.replace(/#/,""):Z.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})))}}})},o="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",f=N("fjLI"),l=N("LvDl"),d=N("+ua5");function E(R){return/^\d+$/.test(R)?"".concat(R,"px"):R}function y(){}var S=!1,D={"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 V=0;V<R.length;V++){var oe=D[R[V]];if(oe)return oe}return K[0]}return D[K]||K}var A=null,P=ve.b=function(R){var K=R.width,V=K===void 0?"100%":K,oe=R.height,Q=oe===void 0?"100%":oe,pe=R.value,ce=R.language,ee=ce===void 0?"javascript":ce,ne=R.style,me=ne===void 0?{}:ne,Z=R.options,Y=Z===void 0?{}:Z,Se=R.overrideServices,Me=Se===void 0?{}:Se,ke=R.theme,Re=ke===void 0?"vs-dark":ke,Pe=R.onEditBlur,Ce=R.onSave,De=R.autoHeight,Ne=De===void 0?!1:De,J=R.forbidCopy,fe=J===void 0?!1:J,Te=R.onChange,Ee=Te===void 0?y:Te,je=R.editorDidMount,He=je===void 0?y:je,Oe=R.onFocus,Ue=Oe===void 0?y:Oe,Ze=R.filename,$e=Ze===void 0?"educoder.txt":Ze,Je=R.errorLine,ze=R.errorContent,nt=ze===void 0?"":ze,it=Object(j.a)(R,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Fe=Object(U.useRef)(),Ke=Object(U.useRef)({}),ae=Object(U.useRef)(),de=Object(U.useRef)(),ye=Object(U.useRef)(!1),$=Object(U.useRef)(),q=Object(U.useState)(!1),se=Object(L.a)(q,2),ge=se[0],Le=se[1];function Be(){var at;return Fe.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(Fe.current)),at}function Xe(){M.b.warn(decodeURIComponent(o))}var ut=function(){var lt=Ke.current.instance;if(pe!=null&&lt&&ge){var Pt=lt.getModel();Pt&&pe!==Pt.getValue()&&(S=!0,Pt.setValue(pe),lt.layout(),S=!1)}};Object(U.useEffect)(function(){de.current&&clearTimeout(de.current),de.current=setTimeout(function(){ut()},500)},[pe,ge,Ke.current]),Object(U.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,ge]);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<Q?Q:lt)}else ct(Q)};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(U.useEffect)(function(){_t()},[_t]),Object(U.useEffect)(function(){Fe.current&&!ge&&Promise.all([N.e(16),N.e(28)]).then(N.t.bind(null,"M/lh",7)).then(function(at){try{A=at,Ke.current.instance=A.editor.create(Fe.current,{value:pe,language:I(ee),theme:Re,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Me);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($e||"educoder.txt",lt.getValue())}}),lt.getDomNode().addEventListener("input",function(){ae.current.autoFormat&&lt.getAction("editor.action.formatDocument").run()})},500),Ke.current.subscription=lt.onDidChangeModelContent(function(Wt){ye.current?clearTimeout($.current):(_t(),Ee(lt.getValue(),Wt)),$.current=setTimeout(function(){ye.current=!1},500)}),window.Monaco||_(A,I(ee)),fe&&(Cn(rn,an),Fe.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,Pe&&lt.onDidBlurEditorWidget(function(){Pe(lt.getValue())}),Ue&&lt.onDidFocusEditorText(function(){Ue(lt.getValue())}),fe){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 Le(!0),function(){var Wt=Ke.current.instance;Wt.dispose();var wn=Wt.getModel();wn&&wn.dispose(),Ke.current.subscription&&Ke.current.subscription.dispose(),fe&&window.removeEventListener("paste",vt),bn.unobserve(Fe.current)}}catch(Wt){}})},[]),Object(U.useEffect)(function(){var at=Ke.current.instance;if(at&&ge)return document.addEventListener("keydown",dt,!1),function(){document.removeEventListener("keydown",dt)}},[Ce,ge]),Object(U.useEffect)(function(){var at=Ke.current.instance;if(at&&ge){var lt=I(ee);A.editor.setModelLanguage(at.getModel(),lt),console.log("language:",ee,at.getModel(),lt)}},[ee,ge]),Object(U.useEffect)(function(){var at=Ke.current.instance;at&&ge&&A.editor.setTheme(Re)},[Re,ge]),Object(U.useEffect)(function(){var at=Ke.current.instance;ae.current=Y,at&&ge&&(at.updateOptions(Object(ie.a)({},Y)),setTimeout(function(){at.getModel().updateOptions(Object(ie.a)({},Y))},200))},[JSON.stringify(Y),ge]),Object(U.useEffect)(function(){var at=Ke.current.instance;at&&ge&&at.layout()},[V,Q,ge]);var Yt=Object(U.useState)(E(V)),It=Object(L.a)(Yt,2),qt=It[0],$t=It[1],bt=Object(U.useState)(E(Q)),en=Object(L.a)(bt,2),hn=en[0],ct=en[1],_n=Object(ie.a)(Object(ie.a)({},me),{},{width:qt,height:hn});return e.a.createElement("div",{className:"my-monaco-editor",ref:Fe,style:_n})};function H(R){var K=R.width,V=K===void 0?"100%":K,oe=R.height,Q=oe===void 0?"100%":oe,pe=R.original,ce=R.modified,ee=R.language,ne=R.options,me=ne===void 0?{}:ne,Z=Object(U.useRef)(),Y=Object(U.useState)(null),Se=Object(L.a)(Y,2),Me=Se[0],ke=Se[1];function Re(Ne){var J;return Z.current&&(J=new C.default(function(fe){var Te=Object(w.a)(fe),Ee;try{for(Te.s();!(Ee=Te.n()).done;){var je=Ee.value;(je.target.offsetHeight>0||je.target.offsetWidth>0)&&Ne.layout()}}catch(He){Te.e(He)}finally{Te.f()}}),J.observe(Z.current)),J}Object(U.useEffect)(function(){Z.current&&Promise.all([N.e(16),N.e(28)]).then(N.t.bind(null,"M/lh",7)).then(function(Ne){A=Ne;var J=A.editor.createDiffEditor(Z.current,Object(ie.a)(Object(ie.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},me),{},{wordWrap:!0}));ke(J);var fe=Re(J);return function(){J.dispose();var Te=J.getModel();Te&&Te.dispose(),fe.unobserve(Z.current)}})},[]),Object(U.useEffect)(function(){Me&&Me.setModel({original:A.editor.createModel(pe,ee),modified:A.editor.createModel(ce,ee)})},[pe,ce,ee,Me]);var Pe=E(V),Ce=E(Q),De={width:Pe,height:Ce};return e.a.createElement("div",{className:"my-diff-editor",ref:Z,style:De})}},bT9E:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return W});var ie=N("VTBJ");function W(O,M){var w=Object(ie.a)({},O);return Array.isArray(M)&&M.forEach(function(L){delete w[L]}),w}},d5o6:function(qe,ve,N){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,N){"use strict";N.d(ve,"a",function(){return t.a});var ie=N("rePB"),W=N("VTBJ"),O=N("KQm4"),M=N("1OyB"),w=N("vuIU"),L=N("Ji7U"),j=N("LK+K"),U=N("q1tI"),e=N("4IlW"),C=N("Kwbf"),g=N("TSYQ"),h=N.n(g),u=N("sboe"),a=N("OZM5"),i=N("815F"),c=N("ODXe"),s=N("Ff2n"),r=N("+nKL"),n=N("8XRh"),t=N("WaYH"),v=function(pe,ce){var ee=pe.className,ne=pe.style,me=pe.motion,Z=pe.motionNodes,Y=pe.motionType,Se=pe.onMotionStart,Me=pe.onMotionEnd,ke=pe.active,Re=pe.treeNodeRequiredProps,Pe=Object(s.a)(pe,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Ce=U.useState(!0),De=Object(c.a)(Ce,2),Ne=De[0],J=De[1],fe=U.useContext(u.a),Te=fe.prefixCls,Ee=U.useRef(!1),je=function(){Ee.current||Me(),Ee.current=!0};return Object(U.useEffect)(function(){Z&&Y==="hide"&&Ne&&J(!1)},[Z]),Object(U.useEffect)(function(){return Z&&Se(),function(){Z&&je()}},[]),Z?U.createElement(n.default,Object.assign({ref:ce,visible:Ne},me,{motionAppear:Y==="show",onAppearEnd:je,onLeaveEnd:je}),function(He,Oe){var Ue=He.className,Ze=He.style;return U.createElement("div",{ref:Oe,className:h()("".concat(Te,"-treenode-motion"),Ue),style:Ze},Z.map(function($e){var Je=$e.data,ze=Je.key,nt=Object(s.a)(Je,["key"]),it=$e.isStart,Fe=$e.isEnd;delete nt.children;var Ke=Object(i.f)(ze,Re);return U.createElement(t.a,Object.assign({},nt,Ke,{active:ke,data:$e.data,key:ze,isStart:it,isEnd:Fe}))}))}):U.createElement(t.a,Object.assign({domRef:ce,className:ee,style:ne},Pe,{active:ke}))};v.displayName="MotionTreeNode";var p=U.forwardRef(v),m=p;function b(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ce=Q.length,ee=pe.length;if(Math.abs(ce-ee)!==1)return{add:!1,key:null};function ne(me,Z){var Y=new Map;me.forEach(function(Me){Y.set(Me,!0)});var Se=Z.filter(function(Me){return!Y.has(Me)});return Se.length===1?Se[0]:null}return ce<ee?{add:!0,key:ne(Q,pe)}:{add:!1,key:ne(pe,Q)}}function _(Q,pe,ce){var ee=Q.findIndex(function(Y){var Se=Y.data;return Se.key===ce}),ne=Q[ee+1],me=pe.findIndex(function(Y){var Se=Y.data;return Se.key===ce});if(ne){var Z=pe.findIndex(function(Y){var Se=Y.data;return Se.key===ne.data.key});return pe.slice(me+1,Z)}return pe.slice(me+1)}var o={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},f=function(){},l="RC_TREE_MOTION_".concat(Math.random()),d={key:l},E={key:l,level:0,index:0,pos:"0",node:d},y={parent:null,children:[],pos:E.pos,data:d,isStart:[],isEnd:[]};function S(Q,pe,ce,ee){return pe===!1||!ce?Q:Q.slice(0,Math.ceil(ce/ee)+1)}function D(Q){var pe=Q.data.key,ce=Q.pos;return Object(i.e)(pe,ce)}function I(Q){for(var pe=String(Q.data.key),ce=Q;ce.parent;)ce=ce.parent,pe="".concat(ce.data.key," > ").concat(pe);return pe}var A=function(pe,ce){var ee=pe.prefixCls,ne=pe.data,me=pe.selectable,Z=pe.checkable,Y=pe.expandedKeys,Se=pe.selectedKeys,Me=pe.checkedKeys,ke=pe.loadedKeys,Re=pe.loadingKeys,Pe=pe.halfCheckedKeys,Ce=pe.keyEntities,De=pe.disabled,Ne=pe.dragging,J=pe.dragOverNodeKey,fe=pe.dropPosition,Te=pe.motion,Ee=pe.height,je=pe.itemHeight,He=pe.virtual,Oe=pe.focusable,Ue=pe.activeItem,Ze=pe.focused,$e=pe.tabIndex,Je=pe.onKeyDown,ze=pe.onFocus,nt=pe.onBlur,it=pe.onActiveChange,Fe=pe.onListChangeStart,Ke=pe.onListChangeEnd,ae=Object(s.a)(pe,["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"]),de=U.useRef(null);U.useImperativeHandle(ce,function(){return{scrollTo:function(lt){de.current.scrollTo(lt)}}});var ye=U.useState(Y),$=Object(c.a)(ye,2),q=$[0],se=$[1],ge=U.useState(ne),Le=Object(c.a)(ge,2),Be=Le[0],Xe=Le[1],ut=U.useState(ne),vt=Object(c.a)(ut,2),dt=vt[0],_t=vt[1],xt=U.useState([]),rt=Object(c.a)(xt,2),Yt=rt[0],It=rt[1],qt=U.useState(null),$t=Object(c.a)(qt,2),bt=$t[0],en=$t[1];function hn(){Xe(ne),_t(ne),It([]),en(null),Ke()}U.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,ne,at.key),He,Ee,je),Kt=Be.slice();Kt.splice(lt+1,0,y),_t(Kt),It(Pt),en("show")}else{var rn=ne.findIndex(function(bn){var Wt=bn.data.key;return Wt===at.key}),an=S(_(ne,Be,at.key),He,Ee,je),Cn=ne.slice();Cn.splice(rn+1,0,y),_t(Cn),It(an),en("hide")}else Be!==ne&&(Xe(ne),_t(ne))},[Y,ne]),U.useEffect(function(){Ne||hn()},[Ne]);var ct=Te?dt:ne,_n={expandedKeys:Y,selectedKeys:Se,loadedKeys:ke,loadingKeys:Re,checkedKeys:Me,halfCheckedKeys:Pe,dragOverNodeKey:J,dropPosition:fe,keyEntities:Ce};return U.createElement(U.Fragment,null,Ze&&Ue&&U.createElement("span",{style:o,"aria-live":"assertive"},I(Ue)),U.createElement("div",{role:"tree"},U.createElement("input",{style:o,disabled:Oe===!1||De,tabIndex:Oe!==!1?$e:null,onKeyDown:Je,onFocus:ze,onBlur:nt,value:"",onChange:f})),U.createElement(r.a,Object.assign({},ae,{data:ct,itemKey:D,height:Ee,fullHeight:!1,virtual:He,itemHeight:je,prefixCls:"".concat(ee,"-list"),ref:de}),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 U.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===l?Yt:null,motionType:bt,onMotionStart:Fe,onMotionEnd:hn,treeNodeRequiredProps:_n,onMouseMove:function(){it(null)}}))}))},P=U.forwardRef(A);P.displayName="NodeList";var H=P,R=N("NvD2"),K=function(Q){Object(L.a)(ce,Q);var pe=Object(j.a)(ce);function ce(){var ee;return Object(M.a)(this,ce),ee=pe.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=U.createRef(),ee.onNodeDragStart=function(ne,me){var Z=ee.state,Y=Z.expandedKeys,Se=Z.keyEntities,Me=ee.props.onDragStart,ke=me.props.eventKey;ee.dragNode=me;var Re=Object(a.b)(Y,ke);ee.setState({dragging:!0,dragNodesKeys:Object(a.g)(ke,Se)}),ee.setExpandedKeys(Re),Me&&Me({event:ne,node:Object(i.b)(me.props)})},ee.onNodeDragEnter=function(ne,me){var Z=ee.state,Y=Z.expandedKeys,Se=Z.keyEntities,Me=Z.dragNodesKeys,ke=ee.props.onDragEnter,Re=me.props,Pe=Re.pos,Ce=Re.eventKey;if(!ee.dragNode||Me.indexOf(Ce)!==-1)return;var De=Object(a.c)(ne,me);if(ee.dragNode.props.eventKey===Ce&&De===0){ee.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ee.setState({dragOverNodeKey:Ce,dropPosition:De}),ee.delayedDragEnterLogic||(ee.delayedDragEnterLogic={}),Object.keys(ee.delayedDragEnterLogic).forEach(function(Ne){clearTimeout(ee.delayedDragEnterLogic[Ne])}),ee.delayedDragEnterLogic[Pe]=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:ne,node:Object(i.b)(me.props),expandedKeys:Ne})},400)},0)},ee.onNodeDragOver=function(ne,me){var Z=ee.state.dragNodesKeys,Y=ee.props.onDragOver,Se=me.props.eventKey;if(Z.indexOf(Se)!==-1)return;if(ee.dragNode&&Se===ee.state.dragOverNodeKey){var Me=Object(a.c)(ne,me);if(Me===ee.state.dropPosition)return;ee.setState({dropPosition:Me})}Y&&Y({event:ne,node:Object(i.b)(me.props)})},ee.onNodeDragLeave=function(ne,me){var Z=ee.props.onDragLeave;ee.setState({dragOverNodeKey:""}),Z&&Z({event:ne,node:Object(i.b)(me.props)})},ee.onNodeDragEnd=function(ne,me){var Z=ee.props.onDragEnd;ee.setState({dragOverNodeKey:""}),ee.cleanDragState(),Z&&Z({event:ne,node:Object(i.b)(me.props)}),ee.dragNode=null},ee.onNodeDrop=function(ne,me){var Z=ee.state,Y=Z.dragNodesKeys,Se=Y===void 0?[]:Y,Me=Z.dropPosition,ke=ee.props.onDrop,Re=me.props,Pe=Re.eventKey,Ce=Re.pos;if(ee.setState({dragOverNodeKey:""}),ee.cleanDragState(),Se.indexOf(Pe)!==-1){Object(C.a)(!1,"Can not drop to dragNode(include it's children node)");return}var De=Object(a.k)(Ce),Ne={event:ne,node:Object(i.b)(me.props),dragNode:ee.dragNode?Object(i.b)(ee.dragNode.props):null,dragNodesKeys:Se.slice(),dropPosition:Me+Number(De[De.length-1]),dropToGap:!1};Me!==0&&(Ne.dropToGap=!0),ke&&ke(Ne),ee.dragNode=null},ee.cleanDragState=function(){var ne=ee.state.dragging;ne&&ee.setState({dragging:!1})},ee.onNodeClick=function(ne,me){var Z=ee.props.onClick;Z&&Z(ne,me)},ee.onNodeDoubleClick=function(ne,me){var Z=ee.props.onDoubleClick;Z&&Z(ne,me)},ee.onNodeSelect=function(ne,me){var Z=ee.state.selectedKeys,Y=ee.state.keyEntities,Se=ee.props,Me=Se.onSelect,ke=Se.multiple,Re=me.selected,Pe=me.key,Ce=!Re;Ce?ke?Z=Object(a.a)(Z,Pe):Z=[Pe]:Z=Object(a.b)(Z,Pe);var De=Z.map(function(Ne){var J=Y[Ne];return J?J.node:null}).filter(function(Ne){return Ne});ee.setUncontrolledState({selectedKeys:Z}),Me&&Me(Z,{event:"select",selected:Ce,node:me,selectedNodes:De,nativeEvent:ne.nativeEvent})},ee.onNodeCheck=function(ne,me,Z){var Y=ee.state,Se=Y.keyEntities,Me=Y.checkedKeys,ke=Y.halfCheckedKeys,Re=ee.props,Pe=Re.checkStrictly,Ce=Re.onCheck,De=me.key,Ne,J={event:"check",node:me,checked:Z,nativeEvent:ne.nativeEvent};if(Pe){var fe=Z?Object(a.a)(Me,De):Object(a.b)(Me,De),Te=Object(a.b)(ke,De);Ne={checked:fe,halfChecked:Te},J.checkedNodes=fe.map(function(Ze){return Se[Ze]}).filter(function(Ze){return Ze}).map(function(Ze){return Ze.node}),ee.setUncontrolledState({checkedKeys:fe})}else{var Ee=Object(R.a)([].concat(Object(O.a)(Me),[De]),!0,Se),je=Ee.checkedKeys,He=Ee.halfCheckedKeys;if(!Z){var Oe=new Set(je);Oe.delete(De);var Ue=Object(R.a)(Array.from(Oe),{checked:!1,halfCheckedKeys:He},Se);je=Ue.checkedKeys,He=Ue.halfCheckedKeys}Ne=je,J.checkedNodes=[],J.checkedNodesPositions=[],J.halfCheckedKeys=He,je.forEach(function(Ze){var $e=Se[Ze];if(!$e)return;var Je=$e.node,ze=$e.pos;J.checkedNodes.push(Je),J.checkedNodesPositions.push({node:Je,pos:ze})}),ee.setUncontrolledState({checkedKeys:je},!1,{halfCheckedKeys:He})}Ce&&Ce(Ne,J)},ee.onNodeLoad=function(ne){return new Promise(function(me){ee.setState(function(Z){var Y=Z.loadedKeys,Se=Y===void 0?[]:Y,Me=Z.loadingKeys,ke=Me===void 0?[]:Me,Re=ee.props,Pe=Re.loadData,Ce=Re.onLoad,De=ne.key;if(!Pe||Se.indexOf(De)!==-1||ke.indexOf(De)!==-1)return{};var Ne=Pe(ne);return Ne.then(function(){var J=ee.state,fe=J.loadedKeys,Te=J.loadingKeys,Ee=Object(a.a)(fe,De),je=Object(a.b)(Te,De);Ce&&Ce(Ee,{event:"load",node:ne}),ee.setUncontrolledState({loadedKeys:Ee}),ee.setState({loadingKeys:je}),me()}),{loadingKeys:Object(a.a)(ke,De)}})})},ee.onNodeMouseEnter=function(ne,me){var Z=ee.props.onMouseEnter;Z&&Z({event:ne,node:me})},ee.onNodeMouseLeave=function(ne,me){var Z=ee.props.onMouseLeave;Z&&Z({event:ne,node:me})},ee.onNodeContextMenu=function(ne,me){var Z=ee.props.onRightClick;Z&&(ne.preventDefault(),Z({event:ne,node:me}))},ee.onFocus=function(){var ne=ee.props.onFocus;ee.setState({focused:!0}),ne&&ne.apply(void 0,arguments)},ee.onBlur=function(){var ne=ee.props.onBlur;ee.setState({focused:!1}),ee.onActiveChange(null),ne&&ne.apply(void 0,arguments)},ee.getTreeNodeRequiredProps=function(){var ne=ee.state,me=ne.expandedKeys,Z=ne.selectedKeys,Y=ne.loadedKeys,Se=ne.loadingKeys,Me=ne.checkedKeys,ke=ne.halfCheckedKeys,Re=ne.dragOverNodeKey,Pe=ne.dropPosition,Ce=ne.keyEntities;return{expandedKeys:me||[],selectedKeys:Z||[],loadedKeys:Y||[],loadingKeys:Se||[],checkedKeys:Me||[],halfCheckedKeys:ke||[],dragOverNodeKey:Re,dropPosition:Pe,keyEntities:Ce}},ee.setExpandedKeys=function(ne){var me=ee.state.treeData,Z=Object(i.d)(me,ne);ee.setUncontrolledState({expandedKeys:ne,flattenNodes:Z},!0)},ee.onNodeExpand=function(ne,me){var Z=ee.state.expandedKeys,Y=ee.state.listChanging,Se=ee.props,Me=Se.onExpand,ke=Se.loadData,Re=me.key,Pe=me.expanded;if(Y)return;var Ce=Z.indexOf(Re),De=!Pe;if(Object(C.a)(Pe&&Ce!==-1||!Pe&&Ce===-1,"Expand state not sync with index check"),De?Z=Object(a.a)(Z,Re):Z=Object(a.b)(Z,Re),ee.setExpandedKeys(Z),Me&&Me(Z,{node:me,expanded:De,nativeEvent:ne.nativeEvent}),De&&ke){var Ne=ee.onNodeLoad(me);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(ne){var me=ee.state.activeKey,Z=ee.props.onActiveChange;if(me===ne)return;ee.setState({activeKey:ne}),ne!==null&&ee.scrollTo({key:ne}),Z&&Z(ne)},ee.getActiveItem=function(){var ne=ee.state,me=ne.activeKey,Z=ne.flattenNodes;return me===null?null:Z.find(function(Y){var Se=Y.data.key;return Se===me})||null},ee.offsetActiveKey=function(ne){var me=ee.state,Z=me.flattenNodes,Y=me.activeKey,Se=Z.findIndex(function(Re){var Pe=Re.data.key;return Pe===Y});Se===-1&&ne<0&&(Se=Z.length),Se=(Se+ne+Z.length)%Z.length;var Me=Z[Se];if(Me){var ke=Me.data.key;ee.onActiveChange(ke)}else ee.onActiveChange(null)},ee.onKeyDown=function(ne){var me=ee.state,Z=me.activeKey,Y=me.expandedKeys,Se=me.checkedKeys,Me=ee.props,ke=Me.onKeyDown,Re=Me.checkable,Pe=Me.selectable;switch(ne.which){case e.a.UP:{ee.offsetActiveKey(-1),ne.preventDefault();break}case e.a.DOWN:{ee.offsetActiveKey(1),ne.preventDefault();break}}var Ce=ee.getActiveItem();if(Ce&&Ce.data){var De=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,De)),{},{data:Ce.data,active:!0}));switch(ne.which){case e.a.LEFT:{Ne&&Y.includes(Z)?ee.onNodeExpand({},J):Ce.parent&&ee.onActiveChange(Ce.parent.data.key),ne.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),ne.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&&Pe&&!J.disabled&&J.selectable!==!1&&ee.onNodeSelect({},J);break}}}ke&&ke(ne)},ee.setUncontrolledState=function(ne){var me=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,Me={};Object.keys(ne).forEach(function(ke){if(ke in ee.props){Se=!1;return}Y=!0,Me[ke]=ne[ke]}),Y&&(!me||Se)&&ee.setState(Object(W.a)(Object(W.a)({},Me),Z))},ee.scrollTo=function(ne){ee.listRef.current.scrollTo(ne)},ee}return Object(w.a)(ce,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ne,me=this.state,Z=me.focused,Y=me.flattenNodes,Se=me.keyEntities,Me=me.dragging,ke=me.activeKey,Re=this.props,Pe=Re.prefixCls,Ce=Re.className,De=Re.style,Ne=Re.showLine,J=Re.focusable,fe=Re.tabIndex,Te=fe===void 0?0:fe,Ee=Re.selectable,je=Re.showIcon,He=Re.icon,Oe=Re.switcherIcon,Ue=Re.draggable,Ze=Re.checkable,$e=Re.checkStrictly,Je=Re.disabled,ze=Re.motion,nt=Re.loadData,it=Re.filterTreeNode,Fe=Re.height,Ke=Re.itemHeight,ae=Re.virtual,de=Re.titleRender,ye=Re.onContextMenu,$=Object(a.f)(this.props);return U.createElement(u.a.Provider,{value:{prefixCls:Pe,selectable:Ee,showIcon:je,icon:He,switcherIcon:Oe,draggable:Ue,checkable:Ze,checkStrictly:$e,disabled:Je,keyEntities:Se,loadData:nt,filterTreeNode:it,titleRender:de,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}},U.createElement("div",{className:h()(Pe,Ce,(ne={},Object(ie.a)(ne,"".concat(Pe,"-show-line"),Ne),Object(ie.a)(ne,"".concat(Pe,"-focused"),Z),Object(ie.a)(ne,"".concat(Pe,"-active-focused"),ke!==null),ne))},U.createElement(H,Object.assign({ref:this.listRef,prefixCls:Pe,style:De,data:Y,disabled:Je,selectable:Ee,checkable:!!Ze,motion:ze,dragging:Me,height:Fe,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(),$))))}}],[{key:"getDerivedStateFromProps",value:function(ne,me){var Z=me.prevProps,Y={prevProps:ne};function Se(He){return!Z&&He in ne||Z&&Z[He]!==ne[He]}var Me;if(Se("treeData")?Me=ne.treeData:Se("children")&&(Object(C.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Me=Object(i.c)(ne.children)),Me){Y.treeData=Me;var ke=Object(i.a)(Me);Y.keyEntities=Object(W.a)(Object(ie.a)({},l,E),ke.keyEntities)}var Re=Y.keyEntities||me.keyEntities;if(Se("expandedKeys")||Z&&Se("autoExpandParent"))Y.expandedKeys=ne.autoExpandParent||!Z&&ne.defaultExpandParent?Object(a.e)(ne.expandedKeys,Re):ne.expandedKeys;else if(!Z&&ne.defaultExpandAll){var Pe=Object(W.a)({},Re);delete Pe[l],Y.expandedKeys=Object.keys(Pe).map(function(He){return Pe[He].key})}else!Z&&ne.defaultExpandedKeys&&(Y.expandedKeys=ne.autoExpandParent||ne.defaultExpandParent?Object(a.e)(ne.defaultExpandedKeys,Re):ne.defaultExpandedKeys);if(Y.expandedKeys||delete Y.expandedKeys,Me||Y.expandedKeys){var Ce=Object(i.d)(Me||me.treeData,Y.expandedKeys||me.expandedKeys);Y.flattenNodes=Ce}if(ne.selectable&&(Se("selectedKeys")?Y.selectedKeys=Object(a.d)(ne.selectedKeys,ne):!Z&&ne.defaultSelectedKeys&&(Y.selectedKeys=Object(a.d)(ne.defaultSelectedKeys,ne))),ne.checkable){var De;if(Se("checkedKeys")?De=Object(a.j)(ne.checkedKeys)||{}:!Z&&ne.defaultCheckedKeys?De=Object(a.j)(ne.defaultCheckedKeys)||{}:Me&&(De=Object(a.j)(ne.checkedKeys)||{checkedKeys:me.checkedKeys,halfCheckedKeys:me.halfCheckedKeys}),De){var Ne=De,J=Ne.checkedKeys,fe=J===void 0?[]:J,Te=Ne.halfCheckedKeys,Ee=Te===void 0?[]:Te;if(!ne.checkStrictly){var je=Object(R.a)(fe,!0,Re);fe=je.checkedKeys,Ee=je.halfCheckedKeys}Y.checkedKeys=fe,Y.halfCheckedKeys=Ee}}return Se("loadedKeys")&&(Y.loadedKeys=ne.loadedKeys),Y}}]),ce}(U.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 V=K,oe=ve.b=V},fjLI:function(qe,ve,N){"use strict";N.d(ve,"f",function(){return u}),N.d(ve,"b",function(){return a}),N.d(ve,"a",function(){return i}),N.d(ve,"d",function(){return c}),N.d(ve,"e",function(){return s}),N.d(ve,"c",function(){return r});var ie=N("8HAY"),W=N("Vhoy"),O=N("MI8n"),M=N("JYp7"),w=N("pmY6"),L=N("24hK"),j=N("nnTU"),U=N("T8No"),e=N("Cg/j"),C=N("t9D7"),g=function(n,t,v,p){var m=arguments.length,b=m<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,v):p,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,t,v,p);else for(var o=n.length-1;o>=0;o--)(_=n[o])&&(b=(m<3?_(b):m>3?_(t,v,b):_(t,v))||b);return m>3&&b&&Object.defineProperty(t,v,b),b},h=function(n,t){return function(v,p){t(v,p,n)}};function u(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"),c=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(M.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 v of n)t=this._commands.delete(v.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,v)=>n.set(v,t)),n}appendMenuItem(n,t){return this.appendMenuItems(M.a.single({id:n,item:t}))}appendMenuItems(n){const t=new Set,v=new L.a;for(const{id:p,item:m}of n){let b=this._menuItems.get(p);b||(b=new L.a,this._menuItems.set(p,b)),v.push(b.push(m)),t.add(p)}return this._onDidChangeMenu.fire(t),Object(w.i)(()=>{if(v.size>0){for(let p of v)p();this._onDidChangeMenu.fire(t),v.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 v of n)u(v)&&(t.add(v.command.id),v.alt&&t.add(v.alt.id));this._commands.forEach((v,p)=>{t.has(p)||n.push({command:v})})}};class s extends ie.e{constructor(n,t,v,p){super(`submenuitem.${n.submenu.id}`,typeof n.title=="string"?n.title:n.title.value,[],"submenu");this.item=n,this._menuService=t,this._contextKeyService=v,this._options=p}get actions(){const n=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),v=t.getActions(this._options);t.dispose();for(const[,p]of v)p.length>0&&(n.push(...p),n.push(new ie.d));return n.length&&n.pop(),n}}let r=class n{constructor(t,v,p,m,b){var _,o;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=(o=typeof t.tooltip=="string"?t.tooltip:(_=t.tooltip)===null||_===void 0?void 0:_.value)!==null&&o!==void 0?o:"",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=v?new n(v,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 v,p;let m=[];return((v=this._options)===null||v===void 0?void 0:v.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=g([h(3,U.b),h(4,j.b)],r)},ic2d:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return M});var ie=N("FWmy"),W=N("746U");class O{constructor(){this.data=new Map}add(w,L){ie.a(W.l(w)),ie.a(W.k(L)),ie.a(!this.data.has(w),"There is already an extension with this id"),this.data.set(w,L)}as(w){return this.data.get(w)||null}}const M=new O},iris:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return u});var ie=N("qVdP"),W=N("jsC+"),O=N("lUTK"),M=N("BvKs"),w=N("tJVT"),L=N("q1tI"),j=N.n(L),U=N("Q0Vu"),e=N.n(U),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"}],g=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],h=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],u=function(i){var c=i.showSelectAll,s=c===void 0?!1:c,r=i.disciplinesData,n=r===void 0?[]:r,t=i.knowledgeData,v=t===void 0?[]:t,p=i.directionValue,m=i.subDisciplineValue,b=i.typeValue,_=i.knowledgeValue,o=i.showKnowledge,f=o===void 0?!1:o,l=i.showRandomType,d=l===void 0?!1:l,E=i.difficultyValue,y=i.randomValue,S=i.selectAll,D=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,V=i.showItemType,oe=V===void 0?!0:V,Q=i.onShixunChange,pe=Q===void 0?function(){}:Q,ce=i.onDirectionChange,ee=ce===void 0?function(){}:ce,ne=i.onTypeChange,me=ne===void 0?function(){}:ne,Z=i.onDifficultyChange,Y=Z===void 0?function(){}:Z,Se=i.handlelanguagesChange,Me=Se===void 0?function(){}:Se,ke=i.onKnowledgeChange,Re=ke===void 0?function(){}:ke,Pe=i.onRandomChange,Ce=Pe===void 0?function(){}:Pe,De=i.showTeachGroup,Ne=De===void 0?!1:De,J=i.teachGroupData,fe=J===void 0?[]:J,Te=i.onTeachGroupChange,Ee=Te===void 0?function(){}:Te,je=i.teachGroupValue,He=Object(L.useState)(0),Oe=Object(w.a)(He,2),Ue=Oe[0],Ze=Oe[1],$e=Object(L.useRef)(null),Je=Object(L.useState)(0),ze=Object(w.a)(Je,2),nt=ze[0],it=ze[1],Fe=Object(L.useRef)(null);Object(L.useEffect)(function(){if(n.length!==0){var ae;($e==null||((ae=$e.current)===null||ae===void 0)?void 0:ae.clientHeight)>108?Ze(1):Ze(0)}n.length===0&&Ze(0)},[n]),Object(L.useEffect)(function(){if(console.log(v.length===0,"\u6570\u91CF"),v.length!==0){var ae,de;console.log(Fe==null||((ae=Fe.current)===null||ae===void 0)?void 0:ae.clientHeight,"\u9AD8\u5EA6"),(Fe==null||((de=Fe.current)===null||de===void 0)?void 0:de.clientHeight)>108?it(1):it(0)}v.length===0&&it(0)},[v]);var Ke=function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=arguments.length>1?arguments[1]:void 0;return j.a.createElement(M.a,{className:e.a.subMenu},de.map(function($){return j.a.createElement(M.a.Item,{key:$.id},j.a.createElement("a",{className:"".concat(e.a.subItem," ").concat(m===$.id?e.a.subActive:""),onClick:function(){return ee(ye,$.id)}},$.name))}))};return j.a.createElement("aside",{className:I?"".concat(e.a.main," ").concat(I):e.a.main},j.a.createElement("div",{className:e.a.wrap},H&&j.a.createElement("div",{className:e.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Ne&&j.a.createElement("div",{className:e.a.content},j.a.createElement("span",{className:e.a.name},"\u56E2\u961F"),j.a.createElement("div",{className:e.a.directionContentWrap},j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(je?"":e.a.active," "),onClick:function(){return Ee(null)}},"\u5168\u90E8"),fe==null?void 0:fe.map(function(ae){return j.a.createElement("li",{key:ae.group_id,className:"".concat(e.a.directionItem," ").concat(je===ae.group_id?e.a.active:""," "),onClick:function(){return Ee(ae.group_id)}},ae.name)}))),j.a.createElement("div",{className:e.a.content},j.a.createElement("span",{className:e.a.name},"\u65B9\u5411"),j.a.createElement("span",null),j.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:Ue===1?88:"auto"}},j.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 de;return j.a.createElement(j.a.Fragment,{key:ae.id},((de=ae.sub_disciplines)===null||de===void 0?void 0:de.length)>0?j.a.createElement(W.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function($){return $.parentNode},overlay:function(){return Ke(ae.sub_disciplines,ae.id)}},j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===ae.id?e.a.active:""," "),onClick:function(){return ee(ae.id)}},ae.name)):j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===ae.id?e.a.active:""," "),onClick:function(){return ee(ae.id)}},ae.name))})),j.a.createElement("div",{className:e.a.directionContentWrap,ref:$e,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},n.map(function(ae){var de;return j.a.createElement(j.a.Fragment,{key:ae.id},((de=ae.sub_disciplines)===null||de===void 0?void 0:de.length)>0?j.a.createElement(W.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function($){return $.parentNode},overlay:function(){return Ke(ae.sub_disciplines,ae.id)}},j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===ae.id?e.a.active:""," "),onClick:function(){return ee(ae.id)}},ae.name)):j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===ae.id?e.a.active:""," "),onClick:function(){return ee(ae.id)}},ae.name))})),!!Ue&&j.a.createElement("div",{className:e.a.action},Ue===1&&j.a.createElement("span",{onClick:function(){return Ze(2)}},"\u5C55\u5F00",j.a.createElement("i",{className:"iconfont icon-xiala"})),Ue===2&&j.a.createElement("span",{onClick:function(){return Ze(1)}},"\u6536\u8D77",j.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),f&&j.a.createElement("div",{className:e.a.content},j.a.createElement("span",{className:e.a.name},"\u77E5\u8BC6\u70B9"),j.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:nt===1?106:"auto"}},j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(_===-1?e.a.active:""," "),onClick:function(){return Re(-1)}},"\u5168\u90E8"),v.map(function(ae){return j.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)})),j.a.createElement("div",{ref:Fe,className:e.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},v.map(function(ae){return j.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&&j.a.createElement("div",{className:e.a.action},nt===1&&j.a.createElement("span",{onClick:function(){return it(2)}},"\u5C55\u5F00",j.a.createElement("i",{className:"iconfont icon-xiala"})),nt===2&&j.a.createElement("span",{onClick:function(){return it(1)}},"\u6536\u8D77",j.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),oe&&!H&&j.a.createElement("div",{className:e.a.content},j.a.createElement("span",{className:e.a.name},"\u9898\u578B"),j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(b?"":e.a.active," "),onClick:function(){return me(null)}},"\u5168\u90E8"),j.a.createElement("div",{className:e.a.directionContentWrap},C.map(function(ae){return j.a.createElement("li",{key:ae.name,className:"".concat(e.a.directionItem," ").concat(b===ae.value?e.a.active:""," "),onClick:function(){return me(ae.value)}},ae.name)}),K&&j.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:e.a.directionItem,onClick:function(){return pe()}},"\u5B9E\u8BAD\u9898"))),j.a.createElement("div",{className:e.a.content},j.a.createElement("span",{className:e.a.name},"\u96BE\u5EA6"),j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(E?"":e.a.active," "),onClick:function(){return Y(null)}},"\u5168\u90E8"),j.a.createElement("div",{className:e.a.directionContentWrap},g.map(function(ae){return j.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)}))),d&&j.a.createElement("div",{className:e.a.content},j.a.createElement("span",{className:e.a.name},"\u7C7B\u578B"),j.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(y?"":e.a.active," "),onClick:function(){return Ce(null)}},"\u5168\u90E8"),j.a.createElement("div",{className:e.a.directionContentWrap},h.map(function(ae){return j.a.createElement("li",{key:ae.name,className:"".concat(e.a.directionItem," ").concat(y===ae.value?e.a.active:""," "),onClick:function(){return Ce(ae.value)}},ae.name)})))))}},jcZT:function(qe,ve,N){"use strict";var ie=N("2qtc"),W=N("kLXV"),O=N("5NDa"),M=N("5rEg"),w=N("miYZ"),L=N("tsqr"),j=N("9og8"),U=N("tJVT"),e=N("WmNS"),C=N.n(e),g=N("q1tI"),h=N.n(g),u=N("d5o6"),a=N.n(u),i=N("P/tu"),c=N("WCUW"),s=N("9kvl"),r=function(t){var v=t.problemset,p=t.dispatch,m=t.onOk,b=Object(g.useState)(""),_=Object(U.a)(b,2),o=_[0],f=_[1],l=Object(g.useState)([0]),d=Object(U.a)(l,2),E=d[0],y=d[1],S=function(){p({type:"problemset/setActionTabs",payload:{}})};Object(g.useEffect)(function(){if(v.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var I,A;y([(I=v.actionTabs)===null||I===void 0||((A=I.params)===null||A===void 0)?void 0:A.group_id]),f("")}},[v.actionTabs.key]);var D=function(){var I=Object(j.a)(C.a.mark(function A(){var P,H,R;return C.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(P=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],o.trim()){V.next=4;break}return L.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),V.abrupt("return");case 4:if(!(o.charAt(0)===" ")){V.next=7;break}return L.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),V.abrupt("return");case 7:H=0;case 8:if(!(H<o.length)){V.next=15;break}if(!P.includes(o.charAt(H))){V.next=12;break}return L.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),V.abrupt("return",!1);case 12:H++,V.next=8;break;case 15:return V.next=17,Object(c.p)({parent_id:E.length>0?E[0]:0,name:o});case 17:R=V.sent,R.status===0&&(S(),m(R==null?void 0:R.id));case 19:case"end":return V.stop()}},A)}));return function(){return I.apply(this,arguments)}}();return h.a.createElement(W.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:v.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:S,onOk:D,destroyOnClose:!0},h.a.createElement("div",{className:a.a.addModal},h.a.createElement("div",{className:a.a.row},h.a.createElement("span",{className:a.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),h.a.createElement(M.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:o,onChange:function(A){return f(A.target.value)}})),h.a.createElement("div",{className:a.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},h.a.createElement("span",{className:a.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),h.a.createElement(i.a,{value:E,onChange:function(A){return y(A)}}))))};ve.a=Object(s.a)(function(n){var t=n.problemset;return{problemset:t}})(r)},k3GJ:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return $i});var ie=N("rePB"),W=N("ODXe"),O=N("Ff2n"),M=N("VTBJ"),w=N("q1tI"),L=N("TSYQ"),j=N.n(L),U=N("Zm9Q"),e=N("6cGi"),C=N("KQm4"),g=N("xEkU"),h=N.n(g),u=N("t23M");function a(re){var be=Object(w.useRef)(),Ae=Object(w.useRef)(!1);function ue(){for(var z=arguments.length,te=new Array(z),X=0;X<z;X++)te[X]=arguments[X];Ae.current||(h.a.cancel(be.current),be.current=h()(function(){re.apply(void 0,te)}))}return Object(w.useEffect)(function(){return function(){Ae.current=!0,h.a.cancel(be.current)}},[]),ue}function i(re){var be=Object(w.useRef)([]),Ae=Object(w.useState)({}),ue=Object(W.a)(Ae,2),z=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,z({})});function le(he){be.current.push(he),X()}return[te.current,le]}var c=N("4IlW");function s(re,be){var Ae,ue=re.prefixCls,z=re.id,te=re.active,X=re.rtl,le=re.tab,he=le.key,we=le.tab,xe=le.disabled,Ie=le.closeIcon,We=re.tabBarGutter,Qe=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={};Qe==="top"||Qe==="bottom"?At[X?"marginLeft":"marginRight"]=We:At.marginBottom=We;var Nt=wt&&Ye!==!1&&!xe;function Rt(mt){if(xe)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:j()(St,(Ae={},Object(ie.a)(Ae,"".concat(St,"-with-remove"),Nt),Object(ie.a)(Ae,"".concat(St,"-active"),te),Object(ie.a)(Ae,"".concat(St,"-disabled"),xe),Ae)),style:At,onClick:Rt},w.createElement("div",{role:"tab","aria-selected":te,id:z&&"".concat(z,"-tab-").concat(he),className:"".concat(St,"-btn"),"aria-controls":z&&"".concat(z,"-panel-").concat(he),"aria-disabled":xe,tabIndex:xe?null:0,onClick:function(pt){pt.stopPropagation(),Rt(pt)},onKeyDown:function(pt){[c.a.SPACE,c.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,z=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 xe;we=be.get((xe=re[le-1])===null||xe===void 0?void 0:xe.key)||n}var Ie=z.get(he)||Object(M.a)({},we);Ie.right=X-Ie.left-Ie.width,z.set(he,Ie)}return z},[re.map(function(ue){return ue.key}).join("_"),be,Ae])}var v={width:0,height:0,left:0,top:0,right:0};function p(re,be,Ae,ue,z){var te=z.tabs,X=z.tabPosition,le=z.rtl,he,we,xe;["top","bottom"].includes(X)?(he="width",we=le?"right":"left",xe=Math.abs(be.left)):(he="height",we="top",xe=-be.top);var Ie=be[he],We=Ae[he],Qe=ue[he],Ye=Ie;return We+Qe>Ie&&(Ye=Ie-Qe),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)||v;if(Tt[we]+Tt[he]>xe+Ye){gt=wt-1;break}}for(var Ot=0,Ct=et-1;Ct>=0;Ct-=1){var St=re.get(te[Ct].key)||v;if(St[we]<xe){Ot=Ct+1;break}}return[Ot,gt]},[re,xe,Ye,X,te.map(function(et){return et.key}).join("_"),le])}var m=N("wx14"),b=N("1OyB"),_=N("vuIU"),o=N("JX7q"),f=N("Ji7U"),l=N("LK+K"),d=N("I8Z2"),E=N("bT9E"),y=N("2GS6"),S=N("Gytx"),D=N.n(S),I=N("U8pU"),A=/iPhone/i,P=/iPod/i,H=/iPad/i,R=/\bAndroid(?:.+)Mobile\b/i,K=/Android/i,V=/\bAndroid(?:.+)SD4930UR\b/i,oe=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,Q=/Windows Phone/i,pe=/\bWindows(?:.+)ARM\b/i,ce=/BlackBerry/i,ee=/BB10/i,ne=/Opera Mini/i,me=/\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,z=Object(W.a)(ue,1);be=z[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(Q,be),ipod:Y(P,be),tablet:!Y(A,be)&&Y(H,be)&&!Y(Q,be),device:(Y(A,be)||Y(P,be)||Y(H,be))&&!Y(Q,be)},amazon:{phone:Y(V,be),tablet:!Y(V,be)&&Y(oe,be),device:Y(V,be)||Y(oe,be)},android:{phone:!Y(Q,be)&&Y(V,be)||!Y(Q,be)&&Y(R,be),tablet:!Y(Q,be)&&!Y(V,be)&&!Y(R,be)&&(Y(oe,be)||Y(K,be)),device:!Y(Q,be)&&(Y(V,be)||Y(oe,be)||Y(R,be)||Y(K,be))||Y(/\bokhttp\b/i,be)},windows:{phone:Y(Q,be),tablet:Y(pe,be),device:Y(Q,be)||Y(pe,be)},other:{blackberry:Y(ce,be),blackberry10:Y(ee,be),opera:Y(ne,be),firefox:Y(Z,be),chrome:Y(me,be),device:Y(ce,be)||Y(ee,be)||Y(ne,be)||Y(Z,be)||Y(me,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 Me=Object(M.a)(Object(M.a)({},Se()),{},{isMobile:Se}),ke=Me;function Re(){}function Pe(re,be,Ae){var ue=be||"";return re.key||"".concat(ue,"item_").concat(Ae)}function Ce(re){return"".concat(re,"-menu-")}function De(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(z){Ae+=1,be(z,Ae)}):be(ue,Ae)})}function Ne(re,be,Ae){if(!re||Ae.find)return;w.Children.forEach(re,function(ue){if(ue){var z=ue.type;if(!z||!(z.isSubMenu||z.isMenuItem||z.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"],fe=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 z=getComputedStyle(be),te=z.marginLeft,X=z.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)},Ee=function(){return ke.any},je=N("bdgK"),He=N("i8i4"),Oe=N.n(He),Ue=N("wgJM"),Ze=N("l4aY"),$e=N("m+aA"),Je=N("c+Xe"),ze=N("zT1h"),nt=N("QC+M");function it(re,be,Ae){return Ae?re[0]===be[0]:re[0]===be[0]&&re[1]===be[1]}function Fe(re,be,Ae){var ue=re[be]||{};return Object(M.a)(Object(M.a)({},ue),Ae)}function Ke(re,be,Ae,ue){for(var z=Ae.points,te=Object.keys(re),X=0;X<te.length;X+=1){var le=te[X];if(it(re[le].points,z,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)))},de=N("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 $(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=$(Object(de.a)(),typeof window!="undefined"?window:{}),se={};if(Object(de.a)()){var ge=document.createElement("div");se=ge.style}var Le={};function Be(re){if(Le[re])return Le[re];var be=q[re];if(be)for(var Ae=Object.keys(be),ue=Ae.length,z=0;z<ue;z+=1){var te=Ae[z];if(Object.prototype.hasOwnProperty.call(be,te)&&te in se)return Le[re]=be[te],Le[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),z=ue[0],te=ue[1];function X(le){be.current||te(le)}return Object(w.useEffect)(function(){return function(){be.current=!0}},[]),[z,X]}var at=Object(de.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 z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;be();var te=Object(Ue.a)(function(){z<=1?ue({isCanceled:function(){return te!==re.current}}):Ae(ue,z-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),z=ue[0],te=ue[1],X=Pt(),le=Object(W.a)(X,2),he=le[0],we=le[1];function xe(){te(bt)}return lt(function(){if(z!==$t&&z!==ct){var Ie=Kt.indexOf(z),We=Kt[Ie+1],Qe=be(z);Qe===rn?te(We):he(function(Ye){function et(){if(Ye.isCanceled())return;te(We)}Qe===!0?et():Promise.resolve(Qe).then(et)})}},[re,z]),w.useEffect(function(){return function(){we()}},[]),[xe,z]},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 z(X){X&&(X.removeEventListener(_t,ue),X.removeEventListener(dt,ue))}function te(X){be.current&&be.current!==X&&z(be.current),X&&X!==be.current&&(X.addEventListener(_t,ue),X.addEventListener(dt,ue),be.current=X)}return w.useEffect(function(){return function(){z(be.current)}},[]),[te,z]};function wn(re,be,Ae,ue){var z=ue.motionEnter,te=z===void 0?!0:z,X=ue.motionAppear,le=X===void 0?!0:X,he=ue.motionLeave,we=he===void 0?!0:he,xe=ue.motionDeadline,Ie=ue.motionLeaveImmediately,We=ue.onAppearPrepare,Qe=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(ie.a)(nn,bt,We),Object(ie.a)(nn,en,et),Object(ie.a)(nn,hn,Tt),nn;case"enter":return Ht={},Object(ie.a)(Ht,bt,Qe),Object(ie.a)(Ht,en,gt),Object(ie.a)(Ht,hn,Ot),Ht;case"leave":return An={},Object(ie.a)(An,bt,Ye),Object(ie.a)(An,en,wt),Object(ie.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()),xe>0&&(clearTimeout(Ln.current),Ln.current=setTimeout(function(){Nn({deadline:!0})},xe))),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(M.a)({transition:"none"},ti)),[ot,Jt,ti,mt!=null?mt:be]}var In=function(re){Object(f.a)(Ae,re);var be=Object(l.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(z){return!!(z.motionName&&be)}var ue=w.forwardRef(function(z,te){var X=z.visible,le=X===void 0?!0:X,he=z.removeOnLeave,we=he===void 0?!0:he,xe=z.forceRender,Ie=z.children,We=z.motionName,Qe=z.leavedClassName,Ye=z.eventProps,et=Ae(z),gt=Object(w.useRef)(),wt=Object(w.useRef)();function Tt(){try{return Object($e.a)(gt.current||wt.current)}catch(Ut){return null}}var Ot=wn(et,le,Tt,z),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(M.a)(Object(M.a)({},Ye),{},{visible:le});if(!Ie)pt=null;else if(St===rt||!Ae(z))Rt?pt=Ie(Object(M.a)({},Dt),mt):!we&&ln.current?pt=Ie(Object(M.a)(Object(M.a)({},Dt),{},{className:Qe}),mt):xe?pt=Ie(Object(M.a)(Object(M.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(M.a)(Object(M.a)({},Dt),{},{className:j()(xt(We,St),(Mt={},Object(ie.a)(Mt,xt(We,"".concat(St,"-").concat(ot)),ot),Object(ie.a)(Mt,We,typeof We=="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(M.a)(Object(M.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,z=be.length,te=fn(re),X=fn(be);te.forEach(function(we){for(var xe=!1,Ie=ue;Ie<z;Ie+=1){var We=X[Ie];if(We.key===we.key){ue<Ie&&(Ae=Ae.concat(X.slice(ue,Ie).map(function(Qe){return Object(M.a)(Object(M.a)({},Qe),{},{status:Wn})})),ue=Ie),Ae.push(Object(M.a)(Object(M.a)({},We),{},{status:Jn})),ue+=1,xe=!0;break}}xe||Ae.push(Object(M.a)(Object(M.a)({},we),{},{status:Vn}))}),ue<z&&(Ae=Ae.concat(X.slice(ue).map(function(we){return Object(M.a)(Object(M.a)({},we),{},{status:Wn})})));var le={};Ae.forEach(function(we){var xe=we.key;le[xe]=(le[xe]||0)+1});var he=Object.keys(le).filter(function(we){return le[we]>1});return he.forEach(function(we){Ae=Ae.filter(function(xe){var Ie=xe.key,We=xe.status;return Ie!==we||We!==Vn}),Ae.forEach(function(xe){xe.key===we&&(xe.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 z=Object(l.a)(te);function te(){var X;return Object(b.a)(this,te),X=z.apply(this,arguments),X.state={keyEntities:[]},X.removeKey=function(le){X.setState(function(he){var we=he.keyEntities;return{keyEntities:we.map(function(xe){return xe.key!==le?xe:Object(M.a)(Object(M.a)({},xe),{},{status:Xn})})}})},X}return Object(_.a)(te,[{key:"render",value:function(){var le=this,he=this.state.keyEntities,we=this.props,xe=we.component,Ie=we.children,We=we.onVisibleChanged,Qe=Object(O.a)(we,["component","children","onVisibleChanged"]),Ye=xe||w.Fragment,et={};return T.forEach(function(gt){et[gt]=Qe[gt],delete Qe[gt]}),delete Qe.keys,w.createElement(Ye,Qe,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){We==null||We(St,{key:Tt.key}),St||le.removeKey(Tt.key)}}),Ie)}))}}],[{key:"getDerivedStateFromProps",value:function(le,he){var we=le.keys,xe=he.keyEntities,Ie=fn(we),We=F(xe,Ie);return{keyEntities:We.filter(function(Qe){var Ye=xe.find(function(et){var gt=et.key;return Qe.key===gt});return!(Ye&&Ye.status===Xn&&Qe.status===Vn)})}}}]),te}(w.Component);return Ae.defaultProps={component:"div"},Ae}var k=x(vt),G=Fn;function B(re){var be=re.prefixCls,Ae=re.motion,ue=re.animation,z=re.transitionName;return Ae||(ue?{motionName:"".concat(be,"-").concat(ue)}:z?{motionName:z}:null)}function _e(re){var be=re.prefixCls,Ae=re.visible,ue=re.zIndex,z=re.mask,te=re.maskMotion,X=re.maskAnimation,le=re.maskTransitionName;if(!z)return null;var he={};return(te||le||X)&&(he=Object(M.a)({motionAppear:!0},B({motion:te,prefixCls:be,transitionName:le,animation:X}))),w.createElement(G,Object(m.a)({},he,{visible:Ae,removeOnLeave:!0}),function(we){var xe=we.className;return w.createElement("div",{style:{zIndex:ue},className:j()("".concat(be,"-mask"),xe)})})}var Ge=N("9mu1"),tt=N("o0o1"),st=N.n(tt),Ve=N("HaE+"),yt=["measure","align",null,"motion"],jt=function(re,be){var Ae=Object(w.useState)(null),ue=Object(W.a)(Ae,2),z=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 xe(Ie){we(),X.current=Object(Ue.a)(function(){he(function(We){switch(z){case"align":return"motion";case"motion":return"stable";default:}return We}),Ie==null||Ie()})}return Object(w.useEffect)(function(){he("measure")},[re]),Object(w.useEffect)(function(){switch(z){case"measure":be();break;default:}z&&(X.current=Object(Ue.a)(Object(Ve.a)(st.a.mark(function Ie(){var We,Qe;return st.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:We=yt.indexOf(z),Qe=yt[We+1],Qe&&We!==-1&&he(Qe);case 3:case"end":return et.stop()}},Ie)}))))},[z]),Object(w.useEffect)(function(){return function(){le.current=!0,we()}},[]),[z,xe]},Qt=function(re){var be=w.useState({width:0,height:0}),Ae=Object(W.a)(be,2),ue=Ae[0],z=Ae[1];function te(le){z({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,z=re.className,te=re.style,X=re.children,le=re.zIndex,he=re.stretch,we=re.destroyPopupOnHide,xe=re.forceRender,Ie=re.align,We=re.point,Qe=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(Qe())}var ot=jt(Ae,Mt),Ut=Object(W.a)(ot,2),tn=Ut[0],Bt=Ut[1],Xt=Object(w.useRef)();function sn(){return We||Qe}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(M.a)({},B(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(M.a)(Object(M.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:xe}),function(cn,Rn){var Sn=cn.className,vn=cn.style,$n=j()(ue,z,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(M.a)(Object(M.a)({},vn),Hn)},Nn))})});Dn.displayName="PopupInner";var Kn=Dn,pn=w.forwardRef(function(re,be){var Ae=re.prefixCls,ue=re.visible,z=re.zIndex,te=re.children,X=re.mobile;X=X===void 0?{}:X;var le=X.popupClassName,he=X.popupStyle,we=X.popupMotion,xe=we===void 0?{}:we,Ie=X.popupRender,We=w.useRef();w.useImperativeHandle(be,function(){return{forceAlign:function(){},getElement:function(){return We.current}}});var Qe=Object(M.a)({zIndex:z},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:We,removeOnLeave:!0},xe),function(et,gt){var wt=et.className,Tt=et.style,Ot=j()(Ae,le,wt);return w.createElement("div",{ref:gt,className:Ot,style:Object(M.a)(Object(M.a)({},Tt),Qe)},Ye)})});pn.displayName="MobilePopupInner";var jn=pn,ui=["visible","mobile"],qn=w.forwardRef(function(re,be){var Ae=re.visible,ue=re.mobile,z=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),xe=Object(W.a)(we,2),Ie=xe[0],We=xe[1],Qe=Object(M.a)(Object(M.a)({},z),{},{visible:le});Object(w.useEffect)(function(){he(Ae),Ae&&ue&&We(ae())},[Ae,ue]);var Ye=Ie?w.createElement(jn,Object(m.a)({},Qe,{mobile:ue,ref:be})):w.createElement(Kn,Object(m.a)({},Qe,{ref:be}));return w.createElement("div",null,w.createElement(_e,Qe),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)(z,Ae);var ue=Object(l.a)(z);function z(te){var X;Object(b.a)(this,z),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(Ze.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 xe=!X.state.popupVisible;(X.isClickToHide()&&!xe||xe&&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,xe=X.getRootDomNode(),Ie=X.getPopupDomNode();(!Object(Ze.a)(xe,we)||X.isContextMenuOnly())&&!Object(Ze.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($e.a)(X.triggerRef.current);if(we)return we}catch(xe){}return Oe.a.findDOMNode(Object(o.a)(X))},X.getPopupClassNameFromAlign=function(he){var we=[],xe=X.props,Ie=xe.popupPlacement,We=xe.builtinPlacements,Qe=xe.prefixCls,Ye=xe.alignPoint,et=xe.getPopupClassNameFromAlign;return Ie&&We&&we.push(Ke(We,Qe,he,Ye)),et&&we.push(et(he)),we.join(" ")},X.getComponent=function(){var he=X.props,we=he.prefixCls,xe=he.destroyPopupOnHide,Ie=he.popupClassName,We=he.onPopupAlign,Qe=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:xe,visible:pt,point:Rt&&Dt,className:Ie,align:Mt,onAlign:We,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:Qe,mobile:ln,forceRender:Gt}),typeof At=="function"?At():At)},X.attachParent=function(he){Ue.a.cancel(X.attachId);var we=X.props,xe=we.getPopupContainer,Ie=we.getDocument,We=X.getRootDomNode(),Qe;xe?(We||xe.length===0)&&(Qe=xe(We)):Qe=Ie(X.getRootDomNode()).body,Qe?Qe.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)(z,[{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?Fe(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,xe=le*1e3;if(this.clearDelayTimer(),xe){var Ie=he?{pageX:he.pageX,pageY:he.pageY}:null;this.delayTimer=window.setTimeout(function(){we.setPopupVisible(X,Ie),we.clearDelayTimer()},xe)}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,xe=le.alignPoint,Ie=le.className,We=le.autoDestroy,Qe=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,xe&&(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=j()(Qe&&Qe.props&&Qe.props.className,Ie);et&&(Ye.className=et);var gt=Object(M.a)({},Ye);Object(Je.c)(Qe)&&(gt.ref=Object(Je.a)(this.triggerRef,Qe.ref));var wt=w.cloneElement(Qe,gt),Tt;return(X||this.popupRef.current||we)&&(Tt=w.createElement(re,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!X&&We&&(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}}]),z}(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 z=Ce(Ae),te=be.getState();be.setState({defaultActiveFirst:Object(M.a)(Object(M.a)({},te.defaultActiveFirst),{},Object(ie.a)({},z,ue))})},Ft=function(re){Object(f.a)(Ae,re);var be=Object(l.a)(Ae);function Ae(ue){var z;Object(b.a)(this,Ae),z=be.call(this,ue),z.onDestroy=function(xe){z.props.onDestroy(xe)},z.onKeyDown=function(xe){var Ie=xe.keyCode,We=z.menuInstance,Qe=z.props.store,Ye=z.getVisible();if(Ie===c.a.ENTER)return z.onTitleClick(xe),gn(Qe,z.props.eventKey,!0),!0;if(Ie===c.a.RIGHT)return Ye?We.onKeyDown(xe):(z.triggerOpenChange(!0),gn(Qe,z.props.eventKey,!0)),!0;if(Ie===c.a.LEFT){var et;if(Ye)et=We.onKeyDown(xe);else return;return et||(z.triggerOpenChange(!1),et=!0),et}return Ye&&(Ie===c.a.UP||Ie===c.a.DOWN)?We.onKeyDown(xe):void 0},z.onOpenChange=function(xe){z.props.onOpenChange(xe)},z.onPopupVisibleChange=function(xe){z.triggerOpenChange(xe,xe?"mouseenter":"mouseleave")},z.onMouseEnter=function(xe){var Ie=z.props,We=Ie.eventKey,Qe=Ie.onMouseEnter,Ye=Ie.store;gn(Ye,z.props.eventKey,!1),Qe({key:We,domEvent:xe})},z.onMouseLeave=function(xe){var Ie=z.props,We=Ie.parentMenu,Qe=Ie.eventKey,Ye=Ie.onMouseLeave;We.subMenuInstance=Object(o.a)(z),Ye({key:Qe,domEvent:xe})},z.onTitleMouseEnter=function(xe){var Ie=z.props,We=Ie.eventKey,Qe=Ie.onItemHover,Ye=Ie.onTitleMouseEnter;Qe({key:We,hover:!0}),Ye({key:We,domEvent:xe})},z.onTitleMouseLeave=function(xe){var Ie=z.props,We=Ie.parentMenu,Qe=Ie.eventKey,Ye=Ie.onItemHover,et=Ie.onTitleMouseLeave;We.subMenuInstance=Object(o.a)(z),Ye({key:Qe,hover:!1}),et({key:Qe,domEvent:xe})},z.onTitleClick=function(xe){var Ie=Object(o.a)(z),We=Ie.props;if(We.onTitleClick({key:We.eventKey,domEvent:xe}),We.triggerSubMenuAction==="hover")return;z.triggerOpenChange(!z.getVisible(),"click"),gn(We.store,z.props.eventKey,!1)},z.onSubMenuClick=function(xe){typeof z.props.onClick=="function"&&z.props.onClick(z.addKeyPath(xe))},z.onSelect=function(xe){z.props.onSelect(xe)},z.onDeselect=function(xe){z.props.onDeselect(xe)},z.getPrefixCls=function(){return"".concat(z.props.rootPrefixCls,"-submenu")},z.getActiveClassName=function(){return"".concat(z.getPrefixCls(),"-active")},z.getDisabledClassName=function(){return"".concat(z.getPrefixCls(),"-disabled")},z.getSelectedClassName=function(){return"".concat(z.getPrefixCls(),"-selected")},z.getOpenClassName=function(){return"".concat(z.props.rootPrefixCls,"-submenu-open")},z.getVisible=function(){return z.state.isOpen},z.getMode=function(){return z.state.mode},z.saveMenuInstance=function(xe){z.menuInstance=xe},z.addKeyPath=function(xe){return Object(M.a)(Object(M.a)({},xe),{},{keyPath:(xe.keyPath||[]).concat(z.props.eventKey)})},z.triggerOpenChange=function(xe,Ie){var We=z.props.eventKey,Qe=function(){z.onOpenChange({key:We,item:Object(o.a)(z),trigger:Ie,open:xe})};Ie==="mouseenter"?z.mouseenterTimeout=setTimeout(function(){Qe()},0):Qe()},z.isChildrenSelected=function(){var xe={find:!1};return Ne(z.props.children,z.props.selectedKeys,xe),xe.find},z.isInlineMode=function(){return z.getMode()==="inline"},z.adjustWidth=function(){if(!z.subMenuTitle||!z.menuInstance)return;var xe=He.findDOMNode(z.menuInstance);if(xe.offsetWidth>=z.subMenuTitle.offsetWidth)return;xe.style.minWidth="".concat(z.subMenuTitle.offsetWidth,"px")},z.saveSubMenuTitle=function(xe){z.subMenuTitle=xe},z.getBaseProps=function(){var xe=Object(o.a)(z),Ie=xe.props,We=z.getMode();return{mode:We==="horizontal"?"vertical":We,visible:z.getVisible(),level:Ie.level+1,inlineIndent:Ie.inlineIndent,focusable:!1,onClick:z.onSubMenuClick,onSelect:z.onSelect,onDeselect:z.onDeselect,onDestroy:z.onDestroy,selectedKeys:Ie.selectedKeys,eventKey:"".concat(Ie.eventKey,"-menu-"),openKeys:Ie.openKeys,motion:Ie.motion,onOpenChange:z.onOpenChange,subMenuOpenDelay:Ie.subMenuOpenDelay,parentMenu:Object(o.a)(z),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:z.internalMenuId,manualRef:z.saveMenuInstance,itemIcon:Ie.itemIcon,expandIcon:Ie.expandIcon,direction:Ie.direction}},z.getMotion=function(xe,Ie){var We=Object(o.a)(z),Qe=We.haveRendered,Ye=z.props,et=Ye.motion,gt=Ye.rootPrefixCls,wt=Object(M.a)(Object(M.a)({},et),{},{leavedClassName:"".concat(gt,"-hidden"),removeOnLeave:!1,motionAppear:Qe||!Ie||xe!=="inline"});return wt};var te=ue.store,X=ue.eventKey,le=te.getState(),he=le.defaultActiveFirst;z.isRootMenu=!1;var we=!1;return he&&(we=he[X]),gn(te,X,we),z.state={mode:ue.mode,isOpen:ue.isOpen},z}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var z=this,te=this.props,X=te.mode,le=te.parentMenu,he=te.manualRef,we=te.isOpen,xe=function(){z.setState({mode:X,isOpen:we})},Ie=we!==this.state.isOpen,We=X!==this.state.mode;if((We||Ie)&&(Ue.a.cancel(this.updateStateRaf),We?this.updateStateRaf=Object(Ue.a)(xe):xe()),he&&he(this),X!=="horizontal"||!(le==null?void 0:le.isRootMenu)||!we)return;this.minWidthTimeout=setTimeout(function(){return z.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var z=this.props,te=z.onDestroy,X=z.eventKey;te&&te(X),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Ue.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(z,te){var X=this.getBaseProps();return w.createElement(Fi,Object(m.a)({},X,{id:this.internalMenuId,className:z,style:te}),this.props.children)}},{key:"renderChildren",value:function(){var z=this,te=this.getBaseProps(),X=te.mode,le=te.visible,he=te.forceSubMenuRender,we=te.direction,xe=this.getMotion(X,le);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||le||he,!this.haveOpened)return w.createElement("div",null);var Ie=j()("".concat(te.prefixCls,"-sub"),Object(ie.a)({},"".concat(te.prefixCls,"-rtl"),we==="rtl"));return this.isInlineMode()?w.createElement(G,Object(m.a)({visible:te.visible,forceRender:he},xe),function(We){var Qe=We.className,Ye=We.style,et=j()(Ie,Qe);return z.renderPopupMenu(et,Ye)}):this.renderPopupMenu(Ie)}},{key:"render",value:function(){var z,te,X,le=Object(M.a)({},this.props),he=this.getVisible(),we=this.getPrefixCls(),xe=this.isInlineMode(),Ie=this.getMode(),We=j()(we,"".concat(we,"-").concat(Ie),(z={},Object(ie.a)(z,le.className,!!le.className),Object(ie.a)(z,this.getOpenClassName(),he),Object(ie.a)(z,this.getActiveClassName(),le.active||he&&!xe),Object(ie.a)(z,this.getDisabledClassName(),le.disabled),Object(ie.a)(z,this.getSelectedClassName(),this.isChildrenSelected()),z));this.internalMenuId||(le.eventKey?this.internalMenuId="".concat(le.eventKey,"$Menu"):(mn+=1,this.internalMenuId="$__$".concat(mn,"$Menu")));var Qe={},Ye={},et={};le.disabled||(Qe={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";xe&&(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(M.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=j()((X={},Object(ie.a)(X,le.popupClassName,le.popupClassName&&!xe),Object(ie.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(M.a)(Object(M.a)({},xi),Ut):Object(M.a)(Object(M.a)({},ii),Ut);delete le.direction;var Bt=this.getBaseProps(),Xt=xe?null:this.getMotion(Bt.mode,Bt.visible);return w.createElement("li",Object(m.a)({},le,Qe,{className:We,role:"menuitem"}),w.createElement(Zt,{prefixCls:we,popupClassName:j()("".concat(we,"-popup"),Gt),getPopupContainer:Nt,builtinPlacements:tn,popupPlacement:Rt,popupVisible:xe?!1:he,popupAlign:ln,popup:xe?null:At,action:mt||xe?[]:[pt],mouseEnterDelay:Dt,mouseLeaveDelay:ot,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Mt,popupMotion:Xt},St),xe?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(d.b)(function(re,be){var Ae=re.openKeys,ue=re.activeKey,z=re.selectedKeys,te=be.eventKey,X=be.subMenuKey;return{isOpen:Ae.indexOf(te)>-1,active:ue[X]===te,selectedKeys:z}})(Ft);On.isSubMenu=!0;var on=On,ri="menuitem-overflowed",Tn=.5,di=function(re){Object(f.a)(Ae,re);var be=Object(l.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 z=ue.props.prefixCls,te=ue.childRef.current;return te?[].slice.call(te.children).filter(function(X){return X.className.split(" ").indexOf("".concat(z,"-overflowed-submenu"))<0}):[]},ue.getOverflowedSubMenuItem=function(z,te,X){var le=ue.props,he=le.overflowedIndicator,we=le.level,xe=le.mode,Ie=le.prefixCls,We=le.theme;if(we!==1||xe!=="horizontal")return null;var Qe=ue.props.children[0],Ye=Qe.props,et=Ye.children,gt=Ye.title,wt=Ye.style,Tt=Object(O.a)(Ye,["children","title","style"]),Ot=Object(M.a)({},wt),Ct="".concat(z,"-overflowed-indicator"),St="".concat(z,"-overflowed-indicator");te.length===0&&X!==!0?Ot=Object(M.a)(Object(M.a)({},Ot),{},{display:"none"}):X&&(Ot=Object(M.a)(Object(M.a)({},Ot),{},{visibility:"hidden",position:"absolute"}),Ct="".concat(Ct,"-placeholder"),St="".concat(St,"-placeholder"));var At=We?"".concat(Ie,"-").concat(We):"",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 z=ue.childRef.current;if(!z)return;var te=z.children;if(!te||te.length===0)return;var X=z.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 fe(we,!0)}),he.forEach(function(we){Te(we,"display","none")}),ue.overflowedIndicatorWidth=fe(z.children[z.children.length-1],!0),ue.originalTotalWidth=ue.menuItemSizes.reduce(function(we,xe){return we+xe},0),ue.handleResize(),Te(X,"display","none")},ue.handleResize=function(){if(ue.props.mode!=="horizontal")return;var z=ue.childRef.current;if(!z)return;var te=fe(z);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 z=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var te=this.childRef.current;if(!te)return;this.resizeObserver=new je.default(function(X){X.forEach(function(){var le=z.cancelFrameId;cancelAnimationFrame(le),z.cancelFrameId=requestAnimationFrame(z.setChildrenWidthAndResize)})}),[].slice.call(te.children).concat(te).forEach(function(X){z.resizeObserver.observe(X)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){z.resizeObserver.disconnect(),[].slice.call(te.children).concat(te).forEach(function(X){z.resizeObserver.observe(X)}),z.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(z){var te=this,X=this.state.lastVisibleIndex;return(z||[]).reduce(function(le,he,we){var xe=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&&(xe=w.cloneElement(he,{style:{display:"none"},eventKey:"".concat(he.props.eventKey,"-hidden"),className:"".concat(ri)})),we===X+1&&(te.overflowedItems=z.slice(X+1).map(function(Qe){return w.cloneElement(Qe,{key:Qe.props.eventKey,mode:"vertical-left"})}),Ie=te.getOverflowedSubMenuItem(he.props.eventKey,te.overflowedItems)));var We=[].concat(Object(C.a)(le),[Ie,xe]);return we===z.length-1&&We.push(te.getOverflowedSubMenuItem(he.props.eventKey,[],!0)),We}return[].concat(Object(C.a)(le),[xe])},[])}},{key:"render",value:function(){var z=this.props,te=z.visible,X=z.prefixCls,le=z.overflowedIndicator,he=z.mode,we=z.level,xe=z.tag,Ie=z.children,We=z.theme,Qe=Object(O.a)(z,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Ye=xe;return w.createElement(Ye,Object(m.a)({ref:this.childRef},Qe),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(M.a)(Object(M.a)({},ue.activeKey),{},Object(ie.a)({},be,Ae))})}function ai(re){return re.eventKey||"0-menu-"}function bi(re,be){var Ae=be,ue=re.children,z=re.eventKey;if(Ae){var te;if(De(ue,function(X,le){X&&X.props&&!X.props.disabled&&Ae===Pe(X,z,le)&&(te=!0)}),te)return Ae}return Ae=null,re.defaultActiveFirst&&De(ue,function(X,le){!Ae&&X&&!X.props.disabled&&(Ae=Pe(X,z,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(l.a)(Ae);function Ae(ue){var z;return Object(b.a)(this,Ae),z=be.call(this,ue),z.onKeyDown=function(te,X){var le=te.keyCode,he;if(z.getFlatInstanceArray().forEach(function(xe){xe&&xe.props.active&&xe.onKeyDown&&(he=xe.onKeyDown(te))}),he)return 1;var we=null;return(le===c.a.UP||le===c.a.DOWN)&&(we=z.step(le===c.a.UP?-1:1)),we?(te.preventDefault(),_i(z.props.store,ai(z.props),we.props.eventKey),typeof X=="function"&&X(we),1):void 0},z.onItemHover=function(te){var X=te.key,le=te.hover;_i(z.props.store,ai(z.props),le?X:null)},z.onDeselect=function(te){z.props.onDeselect(te)},z.onSelect=function(te){z.props.onSelect(te)},z.onClick=function(te){z.props.onClick(te)},z.onOpenChange=function(te){z.props.onOpenChange(te)},z.onDestroy=function(te){z.props.onDestroy(te)},z.getFlatInstanceArray=function(){return z.instanceArray},z.step=function(te){var X=z.getFlatInstanceArray(),le=z.props.store.getState().activeKey[ai(z.props)],he=X.length;if(!he)return null;te<0&&(X=X.concat().reverse());var we=-1;if(X.every(function(Qe,Ye){return Qe&&Qe.props.eventKey===le?(we=Ye,!1):!0}),!z.props.defaultActiveFirst&&we!==-1&&Ai(X.slice(we,he-1)))return;var xe=(we+1)%he,Ie=xe;do{var We=X[Ie];if(!We||We.props.disabled)Ie=(Ie+1)%he;else return We}while(Ie!==xe);return null},z.renderCommonMenuItem=function(te,X,le){var he=z.props.store.getState(),we=Object(o.a)(z),xe=we.props,Ie=Pe(te,xe.eventKey,X),We=te.props;if(!We||typeof te.type=="string")return te;var Qe=Ie===he.activeKey,Ye=Object(M.a)(Object(M.a)({mode:We.mode||xe.mode,level:xe.level,inlineIndent:xe.inlineIndent,renderMenuItem:z.renderMenuItem,rootPrefixCls:xe.prefixCls,index:X,parentMenu:xe.parentMenu,manualRef:We.disabled?void 0:Object(y.a)(te.ref,Tr.bind(Object(o.a)(z))),eventKey:Ie,active:!We.disabled&&Qe,multiple:xe.multiple,onClick:function(gt){(We.onClick||Re)(gt),z.onClick(gt)},onItemHover:z.onItemHover,motion:xe.motion,subMenuOpenDelay:xe.subMenuOpenDelay,subMenuCloseDelay:xe.subMenuCloseDelay,forceSubMenuRender:xe.forceSubMenuRender,onOpenChange:z.onOpenChange,onDeselect:z.onDeselect,onSelect:z.onSelect,builtinPlacements:xe.builtinPlacements,itemIcon:We.itemIcon||z.props.itemIcon,expandIcon:We.expandIcon||z.props.expandIcon},le),{},{direction:xe.direction});return(xe.mode==="inline"||Ee())&&(Ye.triggerSubMenuAction="click"),w.cloneElement(te,Object(M.a)(Object(M.a)({},Ye),{},{key:Ie||X}))},z.renderMenuItem=function(te,X,le){if(!te)return null;var he=z.props.store.getState(),we={openKeys:he.openKeys,selectedKeys:he.selectedKeys,triggerSubMenuAction:z.props.triggerSubMenuAction,subMenuKey:le};return z.renderCommonMenuItem(te,X,we)},ue.store.setState({activeKey:Object(M.a)(Object(M.a)({},ue.store.getState().activeKey),{},Object(ie.a)({},ue.eventKey,bi(ue,ue.activeKey)))}),z.instanceArray=[],z}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(z){return this.props.visible||z.visible||this.props.className!==z.className||!D()(this.props.style,z.style)}},{key:"componentDidUpdate",value:function(z){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 z){var he=bi(z,z.activeKey);le!==he&&_i(te.store,ai(te),le)}}},{key:"render",value:function(){var z=this,te=Object(m.a)({},this.props);this.instanceArray=[];var X=j()(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,xe=te.visible,Ie=te.level,We=te.mode,Qe=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:We,tag:"ul",level:Ie,theme:Ye,visible:xe,overflowedIndicator:Qe},le),Object(U.a)(te.children).map(function(et,gt){return z.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(d.b)()(ji),Fi=xr,Sr=N("Kwbf");function Ar(re,be,Ae){var ue=re.prefixCls,z=re.motion,te=re.defaultMotions,X=te===void 0?{}:te,le=re.openAnimation,he=re.openTransitionName,we=be.switchingModeFromInline;if(z)return z;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 xe=X[Ae];return xe||(we?null:X.other)}var Wi=function(re){Object(f.a)(Ae,re);var be=Object(l.a)(Ae);function Ae(ue){var z;Object(b.a)(this,Ae),z=be.call(this,ue),z.onSelect=function(le){var he=Object(o.a)(z),we=he.props;if(we.selectable){var xe=z.store.getState(),Ie=xe.selectedKeys,We=le.key;we.multiple?Ie=Ie.concat([We]):Ie=[We],"selectedKeys"in we||z.store.setState({selectedKeys:Ie}),we.onSelect(Object(M.a)(Object(M.a)({},le),{},{selectedKeys:Ie}))}},z.onClick=function(le){var he=z.getRealMenuMode(),we=Object(o.a)(z),xe=we.store,Ie=we.props.onOpenChange;he!=="inline"&&!("openKeys"in z.props)&&(xe.setState({openKeys:[]}),Ie([])),z.props.onClick(le)},z.onKeyDown=function(le,he){z.innerMenu.getWrappedInstance().onKeyDown(le,he)},z.onOpenChange=function(le){var he=Object(o.a)(z),we=he.props,xe=z.store.getState().openKeys.concat(),Ie=!1,We=function(Ye){var et=!1;if(Ye.open)et=xe.indexOf(Ye.key)===-1,et&&xe.push(Ye.key);else{var gt=xe.indexOf(Ye.key);et=gt!==-1,et&&xe.splice(gt,1)}Ie=Ie||et};Array.isArray(le)?le.forEach(We):We(le),Ie&&("openKeys"in z.props||z.store.setState({openKeys:xe}),we.onOpenChange(xe))},z.onDeselect=function(le){var he=Object(o.a)(z),we=he.props;if(we.selectable){var xe=z.store.getState().selectedKeys.concat(),Ie=le.key,We=xe.indexOf(Ie);We!==-1&&xe.splice(We,1),"selectedKeys"in we||z.store.setState({selectedKeys:xe}),we.onDeselect(Object(M.a)(Object(M.a)({},le),{},{selectedKeys:xe}))}},z.onMouseEnter=function(le){z.restoreModeVerticalFromInline();var he=z.props.onMouseEnter;he&&he(le)},z.onTransitionEnd=function(le){var he=le.propertyName==="width"&&le.target===le.currentTarget,we=le.target.className,xe=Object.prototype.toString.call(we)==="[object SVGAnimatedString]"?we.animVal:we,Ie=le.propertyName==="font-size"&&xe.indexOf("anticon")>=0;(he||Ie)&&z.restoreModeVerticalFromInline()},z.setInnerMenu=function(le){z.innerMenu=le},z.isRootMenu=!0;var te=ue.defaultSelectedKeys,X=ue.defaultOpenKeys;return"selectedKeys"in ue&&(te=ue.selectedKeys||[]),"openKeys"in ue&&(X=ue.openKeys||[]),z.store=Object(d.c)({selectedKeys:te,openKeys:X,activeKey:{"0-menu-":bi(ue,ue.activeKey)}}),z.state={switchingModeFromInline:!1,prevProps:ue,inlineOpenKeys:[],store:z.store},z}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(z){var te=this.props,X=te.siderCollapsed,le=te.inlineCollapsed,he=te.onOpenChange;(!z.inlineCollapsed&&le||!z.siderCollapsed&&X)&&he([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var z=this.props.collapsedWidth,te=this.store,X=this.prevOpenKeys,le=this.getInlineCollapsed()&&(z===0||z==="0"||z==="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 z=this.props.mode,te=this.state.switchingModeFromInline,X=this.getInlineCollapsed();return te&&X?"inline":X?"vertical":z}},{key:"getInlineCollapsed",value:function(){var z=this.props,te=z.inlineCollapsed,X=z.siderCollapsed;return X!==void 0?X:te}},{key:"restoreModeVerticalFromInline",value:function(){var z=this.state.switchingModeFromInline;z&&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 z=Object(M.a)({},Object(E.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),te=this.getRealMenuMode();return z.className+=" ".concat(z.prefixCls,"-root"),z.direction==="rtl"&&(z.className+=" ".concat(z.prefixCls,"-rtl")),z=Object(M.a)(Object(M.a)({},z),{},{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 z.openAnimation,delete z.openTransitionName,w.createElement(d.a,{store:this.store},w.createElement(Fi,Object(m.a)({},z,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(z,te){var X=te.prevProps,le=te.store,he=le.getState(),we={},xe={prevProps:z};return X.mode==="inline"&&z.mode!=="inline"&&(xe.switchingModeFromInline=!0),"openKeys"in z?we.openKeys=z.openKeys||[]:((z.inlineCollapsed&&!X.inlineCollapsed||z.siderCollapsed&&!X.siderCollapsed)&&(xe.switchingModeFromInline=!0,xe.inlineOpenKeys=he.openKeys,we.openKeys=[]),(!z.inlineCollapsed&&X.inlineCollapsed||!z.siderCollapsed&&X.siderCollapsed)&&(we.openKeys=te.inlineOpenKeys,xe.inlineOpenKeys=[])),Object.keys(we).length&&le.setState(we),xe}}]),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(l.a)(Ae);function Ae(){var ue;return Object(b.a)(this,Ae),ue=be.apply(this,arguments),ue.onKeyDown=function(z){var te=z.keyCode;return te===c.a.ENTER?(ue.onClick(z),!0):void 0},ue.onMouseLeave=function(z){var te=ue.props,X=te.eventKey,le=te.onItemHover,he=te.onMouseLeave;le({key:X,hover:!1}),he({key:X,domEvent:z})},ue.onMouseEnter=function(z){var te=ue.props,X=te.eventKey,le=te.onItemHover,he=te.onMouseEnter;le({key:X,hover:!0}),he({key:X,domEvent:z})},ue.onClick=function(z){var te=ue.props,X=te.eventKey,le=te.multiple,he=te.onClick,we=te.onSelect,xe=te.onDeselect,Ie=te.isSelected,We={key:X,keyPath:[X],item:Object(o.a)(ue),domEvent:z};he(We),le?Ie?xe(We):we(We):Ie||we(We)},ue.saveNode=function(z){ue.node=z},ue}return Object(_.a)(Ae,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var z=this.props;z.onDestroy&&z.onDestroy(z.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 z,te=Object(M.a)({},this.props),X=j()(this.getPrefixCls(),te.className,(z={},Object(ie.a)(z,this.getActiveClassName(),!te.disabled&&te.active),Object(ie.a)(z,this.getSelectedClassName(),te.isSelected),Object(ie.a)(z,this.getDisabledClassName(),te.disabled),z)),le=Object(M.a)(Object(M.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(M.a)(Object(M.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(M.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 xe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(xe=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,xe)}}]),Ae}(w.Component);wi.isMenuItem=!0,wi.defaultProps={onSelect:Re,onMouseEnter:Re,onMouseLeave:Re,manualRef:Re};var Cr=Object(d.b)(function(re,be){var Ae=re.activeKey,ue=re.selectedKeys,z=be.eventKey,te=be.subMenuKey;return{active:Ae[te]===z,isSelected:Array.isArray(ue)?ue.indexOf(z)!==-1:ue===z}})(wi),Or=Cr,Ci=function(re){Object(f.a)(Ae,re);var be=Object(l.a)(Ae);function Ae(){var ue;return Object(b.a)(this,Ae),ue=be.apply(this,arguments),ue.renderInnerMenuItem=function(z){var te=ue.props,X=te.renderMenuItem,le=te.index;return X(z,le,ue.props.subMenuKey)},ue}return Object(_.a)(Ae,[{key:"render",value:function(){var z=Object(m.a)({},this.props),te=z.className,X=te===void 0?"":te,le=z.rootPrefixCls,he="".concat(le,"-item-group-title"),we="".concat(le,"-item-group-list"),xe=z.title,Ie=z.children;return J.forEach(function(We){return delete z[We]}),delete z.direction,w.createElement("li",Object(m.a)({},z,{onClick:function(Qe){return Qe.stopPropagation()},className:"".concat(X," ").concat(le,"-item-group")}),w.createElement("div",{className:he,title:typeof xe=="string"?xe:void 0},xe),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,z=be.style;return w.createElement("li",{className:"".concat(Ae," ").concat(ue,"-item-divider"),style:z})};Hi.defaultProps={disabled:!0,className:"",style:{}};var pa=Hi,Rr=wr,Ir=N("eDIo");function Dr(re,be){var Ae=re.prefixCls,ue=re.editable,z=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":(z==null?void 0:z.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,z=re.tabs,te=re.locale,X=re.mobile,le=re.moreIcon,he=le===void 0?"More":le,we=re.moreTransitionName,xe=re.style,Ie=re.className,We=re.editable,Qe=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"},z.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=z.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){[c.a.DOWN,c.a.SPACE,c.a.ENTER].includes(Xt)&&(Ot(!0),Bt.preventDefault());return}switch(Xt){case c.a.UP:Dt(-1),Bt.preventDefault();break;case c.a.DOWN:Dt(1),Bt.preventDefault();break;case c.a.ESC:Ot(!1);break;case c.a.SPACE:case c.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(ie.a)({},Ye?"marginLeft":"marginRight",Qe);z.length||(ot.visibility="hidden",ot.order=1);var Ut=j()(Object(ie.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:j()("".concat(Ae,"-nav-operations"),Ie),style:xe,ref:be},tn,w.createElement(Ki,{prefixCls:Ae,locale:te,editable:We}))}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),z=ue[0],te=ue[1],X=Object(w.useState)(0),le=Object(W.a)(X,2),he=le[0],we=le[1],xe=Object(w.useState)(0),Ie=Object(W.a)(xe,2),We=Ie[0],Qe=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(!z)return;mt.preventDefault();var pt=mt.touches[0],Dt=pt.screenX,Mt=pt.screenY;te({x:Dt,y:Mt});var ot=Dt-z.x,Ut=Mt-z.y;be(ot,Ut);var tn=Date.now();we(tn),Qe(tn-he),wt({x:ot,y:Ut})}function St(){if(!z)return;if(te(null),wt(null),gt){var mt=gt.x/We,pt=gt.y/We,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({}),z=Object(W.a)(ue,2),te=z[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,z=be.extra;if(!z)return null;var te,X=z;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),z=ue.prefixCls,te=ue.tabs,X=re.className,le=re.style,he=re.id,we=re.animated,xe=re.activeKey,Ie=re.rtl,We=re.extra,Qe=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(z,"-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]:xe,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(M.a)(Object(M.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:z,key:Lt,rtl:Ie,tab:zt,closable:zt.closable,editable:Qe,active:Lt===xe,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(xe),dr=Object(w.useRef)();function cr(){h.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=h()(function(){ua(zt)}),cr},[Zn,pt,Ie]),Object(w.useEffect)(function(){sr()},[xe,Zn,Ti,pt]),Object(w.useEffect)(function(){Pi()},[Ie,gt,xe,te.map(function(zt){return zt.key}).join("_")]);var hr=!!lr.length,fi="".concat(z,"-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:j()("".concat(z,"-nav"),X),style:le,onKeyDown:function(){Di()}},w.createElement(Xi,{position:"left",extra:We,prefixCls:z}),w.createElement(u.a,{onResize:Pi},w.createElement("div",{className:j()(fi,(Ae={},Object(ie.a)(Ae,"".concat(fi,"-ping-left"),Mi),Object(ie.a)(Ae,"".concat(fi,"-ping-right"),ki),Object(ie.a)(Ae,"".concat(fi,"-ping-top"),fr),Object(ie.a)(Ae,"".concat(fi,"-ping-bottom"),pr),Ae)),ref:Ct},w.createElement(u.a,{onResize:Pi},w.createElement("div",{ref:St,className:"".concat(z,"-nav-list"),style:{transform:"translate(".concat(ot,"px, ").concat(Xt,"px)"),transition:Ii?"none":void 0}},ra,w.createElement(Ki,{ref:Nt,prefixCls:z,locale:Ye,editable:Qe,style:{visibility:hr?"hidden":null}}),w.createElement("div",{className:j()("".concat(z,"-ink-bar"),Object(ie.a)({},"".concat(z,"-ink-bar-animated"),we.inkBar)),style:la}))))),w.createElement(Pr,Object.assign({},re,{ref:At,prefixCls:z,tabs:lr,className:!hr&&nr})),w.createElement(Xi,{position:"right",extra:We,prefixCls:z}))}var Yi=w.forwardRef(Br);function jr(re){var be=re.id,Ae=re.activeKey,ue=re.animated,z=re.tabPosition,te=re.rtl,X=re.destroyInactiveTabPane,le=w.useContext(Oi),he=le.prefixCls,we=le.tabs,xe=ue.tabPane,Ie=we.findIndex(function(We){return We.key===Ae});return w.createElement("div",{className:j()("".concat(he,"-content-holder"))},w.createElement("div",{className:j()("".concat(he,"-content"),"".concat(he,"-content-").concat(z),Object(ie.a)({},"".concat(he,"-content-animated"),xe)),style:Ie&&xe?Object(ie.a)({},te?"marginRight":"marginLeft","-".concat(Ie,"00%")):null},we.map(function(We){return w.cloneElement(We.node,{key:We.key,prefixCls:he,tabKey:We.key,id:be,animated:xe,active:We.key===Ae,destroyInactiveTabPane:X})})))}function $i(re){var be=re.prefixCls,Ae=re.forceRender,ue=re.className,z=re.style,te=re.id,X=re.active,le=re.animated,he=re.destroyInactiveTabPane,we=re.tabKey,xe=re.children,Ie=w.useState(Ae),We=Object(W.a)(Ie,2),Qe=We[0],Ye=We[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(M.a)(Object(M.a)({},et),z),className:j()("".concat(be,"-tabpane"),X&&"".concat(be,"-tabpane-active"),ue)},(X||Qe||Ae)&&xe)}var Qi=0;function Fr(re){return Object(U.a)(re).map(function(be){if(w.isValidElement(be)){var Ae=be.key!==void 0?String(be.key):void 0;return Object(M.a)(Object(M.a)({key:Ae},be.props),{},{node:be})}return null}).filter(function(be){return be})}function Wr(re,be){var Ae,ue=re.id,z=re.prefixCls,te=z===void 0?"rc-tabs":z,X=re.className,le=re.children,he=re.direction,we=re.activeKey,xe=re.defaultActiveKey,Ie=re.editable,We=re.animated,Qe=re.tabPosition,Ye=Qe===void 0?"top":Qe,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;We===!1?Dt={inkBar:!1,tabPane:!1}:Dt=Object(M.a)({inkBar:!0,tabPane:!1},We!==!0?We: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:xe}),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(M.a)(Object(M.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:j()(te,"".concat(te,"-").concat(Sn),(Ae={},Object(ie.a)(Ae,"".concat(te,"-mobile"),Ut),Object(ie.a)(Ae,"".concat(te,"-editable"),Ie),Object(ie.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,N){"use strict";N.d(ve,"a",function(){return ie});var ie;(function(W){W.DARK="dark",W.LIGHT="light",W.HIGH_CONTRAST="hc"})(ie||(ie={}))},nnTU:function(qe,ve,N){"use strict";N.d(ve,"b",function(){return j}),N.d(ve,"a",function(){return U});var ie=N("MI8n"),W=N("JYp7"),O=N("pmY6"),M=N("24hK"),w=N("746U"),L=N("Cg/j");const j=Object(L.c)("commandService"),U=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.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 c=e.handler;e.handler=function(s,...r){return Object(w.o)(r,i),c(s,...r)}}const{id:g}=e;let h=this._commands.get(g);h||(h=new M.a,this._commands.set(g,h));let u=h.unshift(e),a=Object(O.i)(()=>{u();const i=this._commands.get(g);(i==null?void 0:i.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),a}registerCommandAlias(e,C){return U.registerCommand(e,(g,...h)=>g.get(j).executeCommand(C,...h))}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 g=this.getCommand(C);g&&e.set(C,g)}return e}};U.registerCommand("noop",()=>{})},p5ED:function(qe,ve,N){"use strict";var ie=N("+L6B"),W=N("2/Rp"),O=N("5Dmo"),M=N("3S7+"),w=N("k1fw"),L=N("9og8"),j=N("tJVT"),U=N("WmNS"),e=N.n(U),C=N("q1tI"),g=N.n(C),h=N("vHTk"),u=N.n(h),a=N("yEEn"),i=N("ZW9T"),c=N("1vsH"),s=N("V0Rq"),r=N("m3rI");ve.a=function(n){var t,v,p,m,b,_,o,f=n.editOffice,l=f===void 0?"view":f,d=n.data,E=n.theme,y=n.type,S=n.filename,D=n.monacoEditor,I=n.className,A=n.style,P=n.close,H=n.onClose,R=n.hasMask,K=n.disabledDownload,V=Object(C.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),oe=Object(j.a)(V,2),Q=oe[0],pe=oe[1],ce=Object(C.useState)(""),ee=Object(j.a)(ce,2),ne=ee[0],me=ee[1],Z=Object(C.useState)(),Y=Object(j.a)(Z,2),Se=Y[0],Me=Y[1],ke=window.ENV==="build"?"/react/build":"",Re=r.a.PROXY_SERVER||location.origin,Pe,Ce=1024*1024,De=10*Ce,Ne=Object(C.useRef)();(t=d)!==null&&t!==void 0&&t.startsWith("/api")&&y!=="txt"&&(d=r.a.API_SERVER+d),y==="office"&&(Pe=Object(c.T)(d).filesize,Pe>De&&(y="other")),S&&D&&(D.filename=S),Object(C.useEffect)(function(){var Ee,je,He=(Ee=document.cookie)===null||Ee===void 0||((je=Ee.replace(/\s/g,""))===null||je===void 0)?void 0:je.split(";");He==null||He.map(function(Oe){var Ue=Oe.split("=");Ue[0]==="_educoder_session"&&me(Ue[1])})},[]),Object(C.useEffect)(function(){y==="office"&&J()},[y,d]);var J=function(){var Ee=Object(L.a)(e.a.mark(function je(){var He,Oe,Ue;return e.a.wrap(function($e){for(;;)switch($e.prev=$e.next){case 0:return console.log("data:",d),He=d,d.startsWith("http")||(He=location.origin+He),Oe=new URL(He).pathname.split("/").pop(),$e.next=6,Object(s.V)({attachment_id:Oe});case 6:Ue=$e.sent,Me(Ue);case 8:case"end":return $e.stop()}},je)}));return function(){return Ee.apply(this,arguments)}}(),fe=function(){if(d.startsWith("http")||d.startsWith("blob:")){Te();return}Object(c.z)(S||"educoder",d,S)},Te=function(){Object(c.x)(S||"educoder",decodeURIComponent(d))};return g.a.createElement("div",{style:Object(w.a)({},A||{}),className:"".concat(R&&u.a.bgBlack," ").concat(y?u.a.wrp:"hide")},P&&g.a.createElement("div",{className:u.a.close,ref:Ne},!K&&g.a.createElement(M.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ne.current}},g.a.createElement("span",{onClick:Te},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(M.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ne.current}},g.a.createElement("span",{className:"",onClick:H},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(u.a[I]," ").concat(I," ").concat(u.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&g.a.createElement(i.b,D)),y==="audio"&&g.a.createElement("audio",{src:"".concat(((v=d)===null||v===void 0?void 0:v.indexOf("http://"))>-1||((p=d)===null||p===void 0?void 0:p.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(d),autoPlay:!0}),y==="video"&&g.a.createElement(g.a.Fragment,null,((m=d)===null||m===void 0?void 0:m.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),y==="office"&&Se&&g.a.createElement("iframe",{src:"".concat(ke,"/office.html?key=").concat(Se.key,"&url=").concat(Re+Se.url,"&callbackUrl=").concat(Re+Se.callbackUrl,"&fileType=").concat(Se.fileType,"&title=").concat(Se.title,"&model=").concat(l,"&officeServer=").concat(r.a.OFFICE_SERVER,"&disabledDownload=").concat(!!K)}),y==="html"&&g.a.createElement("iframe",{src:d+"&disposition=inline"}),y==="pdf"&&g.a.createElement("iframe",{src:"".concat(ke,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!K)}),y==="image"&&g.a.createElement("img",{src:"".concat(((b=d)===null||b===void 0?void 0:b.indexOf("http://"))>-1||((_=d)===null||_===void 0?void 0:_.indexOf("https://"))>-1||(o=d)!==null&&o!==void 0&&o.startsWith("/api")?"":"data:image/png;base64,").concat(d)}),y==="other"&&g.a.createElement("div",null,g.a.createElement(W.a,{type:"primary",size:"large",onClick:fe},g.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&g.a.createElement(W.a,{type:"primary",size:"large",onClick:fe},g.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(qe,ve,N){"use strict";N.d(ve,"h",function(){return C}),N.d(ve,"g",function(){return h}),N.d(ve,"f",function(){return u}),N.d(ve,"e",function(){return a}),N.d(ve,"i",function(){return i}),N.d(ve,"b",function(){return c}),N.d(ve,"a",function(){return s}),N.d(ve,"d",function(){return r}),N.d(ve,"c",function(){return n});var ie=N("C/vA"),W=N("JYp7");const O=!1;let M=null;function w(t){M=t}if(O){const t="__is_disposable_tracked__";w(new class{trackDisposable(v){const p=new Error("Potentially leaked disposable").stack;setTimeout(()=>{v[t]||console.log(p)},3e3)}setParent(v,p){if(v&&v!==s.None)try{v[t]=!0}catch(m){}}markAsDisposed(v){if(v&&v!==s.None)try{v[t]=!0}catch(p){}}markAsSingleton(v){}})}function L(t){return M==null||M.trackDisposable(t),t}function j(t){M==null||M.markAsDisposed(t)}function U(t,v){M==null||M.setParent(t,v)}function e(t,v){if(!M)return;for(const p of t)M.setParent(p,v)}function C(t){return M==null||M.markAsSingleton(t),t}class g extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function h(t){return typeof t.dispose=="function"&&t.dispose.length===0}function u(t){if(W.a.is(t)){let v=[];for(const p of t)if(p)try{p.dispose()}catch(m){v.push(m)}if(v.length===1)throw v[0];if(v.length>1)throw new g(v);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function a(...t){const v=i(()=>u(t));return e(t,v),v}function i(t){const v=L({dispose:Object(ie.a)(()=>{j(v),t()})});return v}class c{constructor(){this._toDispose=new Set,this._isDisposed=!1,L(this)}dispose(){if(this._isDisposed)return;j(this),this._isDisposed=!0,this.clear()}clear(){try{u(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return U(t,this),this._isDisposed?c.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}}c.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new c,L(this),U(this._store,this)}dispose(){j(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,L(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var v;if(this._isDisposed||t===this._value)return;(v=this._value)===null||v===void 0||v.dispose(),t&&U(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,j(this),(t=this._value)===null||t===void 0||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&U(t,null),t}}class n{constructor(t){this.object=t}dispose(){}}},psGv:function(qe,ve,N){var ie,W;(function(){var O;(function(){"use strict";var j=[,,function(g){function h(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=[]}h.prototype.clone_empty=function(){var i=new h(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},h.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},h.prototype.has_match=function(i){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(i))return!0;return!1},h.prototype.set_indent=function(i,c){this.is_empty()&&(this.__indent_count=i||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},h.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)},h.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},h.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},h.prototype.is_empty=function(){return this.__items.length===0},h.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},h.prototype.push=function(i){this.__items.push(i);var c=i.lastIndexOf(`
`);c!==-1?this.__character_count=i.length-c:this.__character_count+=i.length},h.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},h.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},h.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},h.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},h.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 u(i,c){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)),c=c||"",i.indent_level>0&&(c=new Array(i.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}u.prototype.get_indent_size=function(i,c){var s=this.__base_string_length;return c=c||0,i<0&&(s=0),s+=i*this.__indent_size,s+=c,s},u.prototype.get_indent_string=function(i,c){var s=this.__base_string;return c=c||0,i<0&&(i=0,s=""),c+=i*this.__indent_size,this.__ensure_cache(c),s+=this.__cache[c],s},u.prototype.__ensure_cache=function(i){for(;i>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var i=this.__cache.length,c=0,s="";this.__indent_size&&i>=this.__indent_size&&(c=Math.floor(i/this.__indent_size),i-=c*this.__indent_size,s=new Array(c+1).join(this.__indent_string)),i&&(s+=new Array(i+1).join(" ")),this.__cache.push(s)};function a(i,c){this.__indent_cache=new u(i,c),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 h(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,c){return this.__indent_cache.get_indent_string(i,c)},a.prototype.get_indent_size=function(i,c){return this.__indent_cache.get_indent_size(i,c)},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 c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),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,c){return i=i||0,c=c||0,this.next_line.set_indent(i,c),this.__lines.length>1?(this.current_line.set_indent(i,c),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(i){for(var c=0;c<i.newlines;c++)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 c=this.__lines.length;i<c;)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,c){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)!==c){this.__lines.splice(s+1,0,new h(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},g.exports.Output=a},function(g){function h(u,a,i,c){this.type=u,this.text=a,this.comments_before=null,this.newlines=i||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=h},,,function(g){function h(i,c){this.raw_options=u(i,c),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"])}h.prototype._get_array=function(i,c){var s=this.raw_options[i],r=c||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},h.prototype._get_boolean=function(i,c){var s=this.raw_options[i],r=s===void 0?!!c:!!s;return r},h.prototype._get_characters=function(i,c){var s=this.raw_options[i],r=c||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},h.prototype._get_number=function(i,c){var s=this.raw_options[i];c=parseInt(c,10),isNaN(c)&&(c=0);var r=parseInt(s,10);return isNaN(r)&&(r=c),r},h.prototype._get_selection=function(i,c,s){var r=this._get_selection_list(i,c,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+i+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[i]+"'");return r[0]},h.prototype._get_selection_list=function(i,c,s){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[c[0]],!this._is_valid_selection(s,c))throw new Error("Invalid Default Value!");var r=this._get_array(i,s);if(!this._is_valid_selection(r,c))throw new Error("Invalid Option Value: The option '"+i+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[i]+"'");return r},h.prototype._is_valid_selection=function(i,c){return i.length&&c.length&&!i.some(function(s){return c.indexOf(s)===-1})};function u(i,c){var s={};i=a(i);var r;for(r in i)r!==c&&(s[r]=i[r]);if(c&&i[c])for(r in i[c])s[r]=i[c][r];return s}function a(i){var c={},s;for(s in i){var r=s.replace(/-/g,"_");c[r]=i[s]}return c}g.exports.Options=h,g.exports.normalizeOpts=a,g.exports.mergeOpts=u},,function(g){var h=RegExp.prototype.hasOwnProperty("sticky");function u(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position<this.__input_length},u.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},u.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},u.prototype.__match=function(a,i){a.lastIndex=i;var c=a.exec(this.__input);return c&&!(h&&a.sticky)&&(c.index!==i&&(c=null)),c},u.prototype.test=function(a,i){return i=i||0,i+=this.__position,i>=0&&i<this.__input_length?!!this.__match(a,i):!1},u.prototype.testChar=function(a,i){var c=this.peek(i);return a.lastIndex=0,c!==null&&a.test(c)},u.prototype.match=function(a){var i=this.__match(a,this.__position);return i?this.__position+=i[0].length:i=null,i},u.prototype.read=function(a,i,c){var s="",r;return a&&(r=this.match(a),r&&(s+=r[0])),i&&(r||!a)&&(s+=this.readUntil(i,c)),s},u.prototype.readUntil=function(a,i){var c="",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,c=this.__input.substring(this.__position,s),this.__position=s,c},u.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},u.prototype.get_regexp=function(a,i){var c=null,s="g";return i&&h&&(s="y"),typeof a=="string"&&a!==""?c=new RegExp(a,s):a&&(c=new RegExp(a.source,s)),c},u.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(a){var i=this.__position,c=this.readUntilAfter(a);return this.__position=i,c},u.prototype.lookBack=function(a){var i=this.__position-1;return i>=a.length&&this.__input.substring(i-a.length,i).toLowerCase()===a},g.exports.InputScanner=u},function(g,h,u){var a=u(8).InputScanner,i=u(3).Token,c=u(10).TokenStream,s=u(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(t,v){this._input=new a(t),this._options=v||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var t,v=new i(r.START,""),p=null,m=[],b=new c;v.type!==r.EOF;){for(t=this._get_next_token(v,p);this._is_comment(t);)b.add(t),t=this._get_next_token(v,p);b.isEmpty()||(t.comments_before=b,b=new c),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=v,v.next=t,this.__tokens.add(t),v=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,v){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,v){return!1},n.prototype._create_token=function(t,v){var p=new i(t,v,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return p},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=n,g.exports.TOKEN=r},function(g){function h(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}h.prototype.restart=function(){this.__position=0},h.prototype.isEmpty=function(){return this.__tokens_length===0},h.prototype.hasNext=function(){return this.__position<this.__tokens_length},h.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},h.prototype.peek=function(u){var a=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(a=this.__tokens[u]),a},h.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},g.exports.TokenStream=h},function(g,h,u){var a=u(12).Pattern;function i(c,s){a.call(this,c,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(c,s){c+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+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 c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var s=this.__split(this._newline_regexp,c);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return c},i.prototype.matching=function(c,s){var r=this._create();return r.__set_whitespace_patterns(c,s),r._update(),r},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(c,s){c.lastIndex=0;for(var r=0,n=[],t=c.exec(s);t;)n.push(s.substring(r,t.index)),r=t.index+t[0].length,t=c.exec(s);return r<s.length?n.push(s.substring(r,s.length)):n.push(""),n},g.exports.WhitespacePattern=i},function(g){function h(u,a){this._input=u,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)}h.prototype.read=function(){var u=this._input.read(this._starting_pattern);return(!this._starting_pattern||u)&&(u+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),u},h.prototype.read_match=function(){return this._input.match(this._match_pattern)},h.prototype.until_after=function(u){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(u),a._update(),a},h.prototype.until=function(u){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(u),a._update(),a},h.prototype.starting_with=function(u){var a=this._create();return a._starting_pattern=this._input.get_regexp(u,!0),a._update(),a},h.prototype.matching=function(u){var a=this._create();return a._match_pattern=this._input.get_regexp(u,!0),a._update(),a},h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){},g.exports.Pattern=h},function(g){function h(u,a){u=typeof u=="string"?u:u.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+a,"g")}h.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(u);i;)a[i[1]]=i[2],i=this.__directive_pattern.exec(u);return a},h.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=h},function(g,h,u){var a=u(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(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}/)}}c.prototype=new a,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},c.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},c.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},c.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},c.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("|")+")")},c.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},g.exports.TemplatablePattern=c},,,,function(g,h,u){var a=u(19).Beautifier,i=u(20).Options;function c(s,r,n,t){var v=new a(s,r,n,t);return v.beautify()}g.exports=c,g.exports.defaultOptions=function(){return new i}},function(g,h,u){var a=u(20).Options,i=u(2).Output,c=u(21).Tokenizer,s=u(21).TOKEN,r=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,t=function(E,y){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,y)};t.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},t.prototype.set_space_before_token=function(E,y){this._output.space_before_token=E,this._output.non_breaking_space=y},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 y=0;E.type!==s.TEXT&&E.previous.type!==s.TEXT&&(y=E.newlines?1:0),this.preserve_newlines&&(y=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var S=0;S<y;S++)this.print_newline(S>0);return y!==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 v=function(E){for(var y=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&&(y=S.next.next.text);break}S=S.next}return y},p=function(E,y){var S=null,D=null;return y.closed?(E==="script"?S="text/javascript":E==="style"&&(S="text/css"),S=v(y)||S,S.search("text/css")>-1?D="css":S.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?D="javascript":S.search(/(text|application|dojo)\/(x-)?(html)/)>-1?D="html":S.search(/test\/null/)>-1&&(D="null"),D):null};function m(E,y){return y.indexOf(E)!==-1}function b(E,y,S){this.parent=E||null,this.tag=y?y.tag_name:"",this.indent_level=S||0,this.parser_token=y||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 y=new b(this._current_frame,E,this._printer.indent_level);this._current_frame=y},_.prototype._try_pop_frame=function(E){var y=null;return E&&(y=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),y},_.prototype._get_frame=function(E,y){for(var S=this._current_frame;S&&!(E.indexOf(S.tag)!==-1);){if(y&&y.indexOf(S.tag)!==-1){S=null;break}S=S.parent}return S},_.prototype.try_pop=function(E,y){var S=this._get_frame([E],y);return this._try_pop_frame(S)},_.prototype.indent_to_tag=function(E){var y=this._get_frame(E);y&&(this._printer.indent_level=y.indent_level)};function o(E,y,S,D){this._source_text=E||"",y=y||{},this._js_beautify=S,this._css_beautify=D,this._tag_stack=null;var I=new a(y,"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"}o.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
`,E&&r.test(E)&&(y=E.match(r)[0])),E=E.replace(n,`
`);var S=E.match(/^[\t ]*/)[0],D={text:"",type:""},I=new f,A=new t(this._options,S),P=new c(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,D),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),D=H,R=P.next();var K=A._output.get_code(y);return K},o.prototype._handle_tag_close=function(E,y,S){var D={text:y.text,type:y.type};return E.alignment_size=0,S.tag_complete=!0,E.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),S.is_unformatted?E.add_raw_token(y):(S.tag_start_char==="<"&&(E.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&S.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(y)),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(),D},o.prototype._handle_inside_tag=function(E,y,S,D){var I=S.has_wrapped_attrs,A={text:y.text,type:y.type};if(E.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),S.is_unformatted)E.add_raw_token(y);else if(S.tag_start_char==="{"&&y.type===s.TEXT)E.print_preserved_newlines(y)?(y.newlines=0,E.add_raw_token(y)):E.print_token(y);else{if(y.type===s.ATTRIBUTE?(E.set_space_before_token(!0),S.attr_count+=1):(y.type===s.EQUALS||y.type===s.VALUE&&y.previous.type===s.EQUALS)&&E.set_space_before_token(!1),y.type===s.ATTRIBUTE&&S.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(y),I=I||y.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=D.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(y),I=I||E.previous_token_wrapped(),S.has_wrapped_attrs=I}return A},o.prototype._handle_text=function(E,y,S){var D={text:y.text,type:"TK_CONTENT"};return S.custom_beautifier_name?this._print_custom_beatifier_text(E,y,S):S.is_unformatted||S.is_content_unformatted?E.add_raw_token(y):(E.traverse_whitespace(y),E.print_token(y)),D},o.prototype._print_custom_beatifier_text=function(E,y,S){var D=this;if(y.text!==""){var I=y.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(ce,ee){var ne=new o(ce,ee,D._js_beautify,D._css_beautify);return ne.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 V=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(I);if(!V){E.add_raw_token(y);return}H=K+V[1]+`
`,I=V[4],V[5]&&(R=K+V[5]),I=I.replace(/\n[ \t]*$/,""),(V[2]||V[3].indexOf(`
`)!==-1)&&(V=V[3].match(/[ \t]+$/),V&&(y.whitespace_before=V[0]))}if(I)if(A){var oe=function(){this.eol=`
`};oe.prototype=this._options.raw_options;var Q=new oe;I=A(K+I,Q)}else{var pe=y.whitespace_before;pe&&(I=I.replace(new RegExp(`
(`+pe+")?","g"),`
`)),I=K+I.replace(/\n/g,`
`+K)}H&&(I?I=H+I+`
`+R:I=H+R),E.print_newline(!1),I&&(y.text=I,y.whitespace_before="",y.newlines=0,E.add_raw_token(y),E.print_newline(!0))}},o.prototype._handle_tag_open=function(E,y,S,D){var I=this._get_tag_open_token(y);return(S.is_unformatted||S.is_content_unformatted)&&!S.is_empty_element&&y.type===s.TAG_OPEN&&y.text.indexOf("</")===0?(E.add_raw_token(y),I.start_tag_token=this._tag_stack.try_pop(I.tag_name)):(E.traverse_whitespace(y),this._set_tag_position(E,y,I,S,D),I.is_inline_element||E.set_wrap_point(),E.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(I.alignment_size=y.text.length+1),!I.tag_complete&&!I.is_unformatted&&(E.alignment_size=I.alignment_size),I};var f=function(E,y){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="",!y)this.tag_complete=!0;else{var S;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(S=y.text.match(/^<([^\s>]*)/),this.tag_check=S?S[1]:""):(S=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=S?S[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.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||y.closed&&y.closed.text==="/>";var D=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(D=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(D)))}};o.prototype._get_tag_open_token=function(E){var y=new f(this._tag_stack.get_parser_token(),E);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||m(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&m(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&m(y.tag_check,this._options.content_unformatted),y.is_inline_element=m(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},o.prototype._set_tag_position=function(E,y,S,D,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,y)))),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&&D.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&&!(D.is_inline_element||D.is_unformatted)&&!(I.type===s.TAG_CLOSE&&S.start_tag_token===D)&&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)},o.prototype._calcluate_parent_multiline=function(E,y){y.parent&&E._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var l=["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"],d=["a","audio","del","ins","map","noscript","video"];o.prototype._do_optional_end_element=function(E){var y=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(E.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&l.indexOf(E.tag_name)!==-1){var S=E.parent.parent;(!S||d.indexOf(S.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),y},g.exports.Beautifier=o},function(g,h,u){var a=u(6).Options;function i(c){a.call(this,c,"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,g.exports.Options=i},function(g,h,u){var a=u(9).Tokenizer,i=u(9).TOKEN,c=u(13).Directives,s=u(14).TemplatablePattern,r=u(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 c(/<\!--/,/-->/),v=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 o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=_.matching(o).until_after(o)}};v.prototype=new a,v.prototype._is_comment=function(p){return!1},v.prototype._is_opening=function(p){return p.type===n.TAG_OPEN},v.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]==="{")},v.prototype._reset=function(){this._current_tag_name=""},v.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)},v.prototype._read_comment_or_cdata=function(p){var m=null,b=null,_=null;if(p==="<"){var o=this._input.peek(1);o==="!"&&(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},v.prototype._read_processing=function(p){var m=null,b=null,_=null;if(p==="<"){var o=this._input.peek(1);(o==="!"||o==="?")&&(b=this.__patterns.conditional_comment.read(),b=b||this.__patterns.processing.read()),b&&(m=this._create_token(n.COMMENT,b),m.directives=_)}return m},v.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)),_},v.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))),_},v.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,"}}"))),_},v.prototype._read_attribute=function(p,m,b){var _=null,o="";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 o=this.__patterns.attribute.read(),o&&(m.type===n.EQUALS?_=this._create_token(n.VALUE,o):_=this._create_token(n.ATTRIBUTE,o));return _},v.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)},v.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 o=m.opened.text.substr(1).toLowerCase();if(o==="script"||o==="style"){var f=this._read_comment_or_cdata(p);if(f)return f.type=n.TEXT,f;_=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(_=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(n.TEXT,_):null},v.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)},g.exports.Tokenizer=v,g.exports.TOKEN=n}],U={};function e(g){var h=U[g];if(h!==void 0)return h.exports;var u=U[g]={exports:{}};return j[g](u,u.exports,e),u.exports}var C=e(18);O=C})();var M=O;if(!0)!(ie=[N,N("6UM0"),N("TXwP")],W=function(j){var U=N("6UM0"),e=N("TXwP");return{html_beautify:function(C,g){return M(C,g,U.js_beautify,e.css_beautify)}}}.apply(ve,ie),W!==void 0&&(qe.exports=W));else var w,L})()},"rAM+":function(qe,ve,N){"use strict";N.d(ve,"a",function(){return W});var ie=N("Qw5x");function W(O,M){var w;if(typeof Symbol=="undefined"||O[Symbol.iterator]==null){if(Array.isArray(O)||(w=Object(ie.a)(O))||M&&O&&typeof O.length=="number"){w&&(O=w);var L=0,j=function(){};return{s:j,n:function(){return L>=O.length?{done:!0}:{done:!1,value:O[L++]}},e:function(h){throw h},f:j}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,e=!1,C;return{s:function(){w=O[Symbol.iterator]()},n:function(){var h=w.next();return U=h.done,h},e:function(h){e=!0,C=h},f:function(){try{!U&&w.return!=null&&w.return()}finally{if(e)throw C}}}}},rUJ1:function(qe,ve){const N=/[&<>"']/,ie=/[&<>"']/g,W=/[<>"']|&(?!#?\w+;)/,O=/[<>"']|&(?!#?\w+;)/g,M={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},w=_=>M[_];function L(_,o){if(o){if(N.test(_))return _.replace(ie,w)}else if(W.test(_))return _.replace(O,w);return _}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(_){return _.replace(j,(o,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(_,o){_=_.source||_,o=o||"";const f={replace:(l,d)=>(d=d.source||d,d=d.replace(e,"$1"),_=_.replace(l,d),f),getRegex:()=>new RegExp(_,o)};return f}const g=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(_,o,f){if(_){let l;try{l=decodeURIComponent(U(f)).replace(g,"").toLowerCase()}catch(d){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}o&&!h.test(f)&&(f=r(o,f));try{f=encodeURI(f).replace(/%25/g,"%")}catch(l){return null}return f}const a={},i=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(_,o){a[" "+_]||(i.test(_)?a[" "+_]=_+"/":a[" "+_]=p(_,"/",!0)),_=a[" "+_];const f=_.indexOf(":")===-1;return o.substring(0,2)==="//"?f?o:_.replace(c,"$1")+o:o.charAt(0)==="/"?f?o:_.replace(s,"$1")+o:_+o}const n={exec:function(){}};function t(_){let o=1,f,l;for(;o<arguments.length;o++){f=arguments[o];for(l in f)Object.prototype.hasOwnProperty.call(f,l)&&(_[l]=f[l])}return _}function v(_,o){const f=_.replace(/\|/g,(E,y,S)=>{let D=!1,I=y;for(;--I>=0&&S[I]==="\\";)D=!D;return D?"|":" |"}),l=f.split(/ \|/);let d=0;if(l.length>o)l.splice(o);else for(;l.length<o;)l.push("");for(;d<l.length;d++)l[d]=l[d].trim().replace(/\\\|/g,"|");return l}function p(_,o,f){const l=_.length;if(l===0)return"";let d=0;for(;d<l;){const E=_.charAt(l-d-1);if(E===o&&!f)d++;else if(E!==o&&f)d++;else break}return _.substr(0,l-d)}function m(_,o){if(_.indexOf(o[1])===-1)return-1;const f=_.length;let l=0,d=0;for(;d<f;d++)if(_[d]==="\\")d++;else if(_[d]===o[0])l++;else if(_[d]===o[1]&&(l--,l<0))return d;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:L,unescape:U,edit:C,cleanUrl:u,resolveUrl:r,noopTest:n,merge:t,splitCells:v,rtrim:p,findClosingBracket:m,checkSanitizeDeprecation:b}},sboe:function(qe,ve,N){"use strict";N.d(ve,"a",function(){return O});var ie=N("q1tI"),W=N.n(ie),O=ie.createContext(null)},spXi:function(qe,ve,N){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,N){"use strict";var ie=N("VTBJ"),W=N("1OyB"),O=N("vuIU"),M=N("Ji7U"),w=N("LK+K"),L=N("q1tI"),j=N.n(L),U=N("m+aA"),e=N("Zm9Q"),C=N("Kwbf"),g=N("c+Xe"),h=N("bdgK"),u="rc-observer-key",a=function(i){Object(M.a)(s,i);var c=Object(w.a)(s);function s(){var r;return Object(W.a)(this,s),r=c.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,v=n[0].target,p=v.getBoundingClientRect(),m=p.width,b=p.height,_=v.offsetWidth,o=v.offsetHeight,f=Math.floor(m),l=Math.floor(b);if(r.state.width!==f||r.state.height!==l||r.state.offsetWidth!==_||r.state.offsetHeight!==o){var d={width:f,height:l,offsetWidth:_,offsetHeight:o};r.setState(d),t&&Promise.resolve().then(function(){t(Object(ie.a)(Object(ie.a)({},d),{},{offsetWidth:_,offsetHeight:o}))})}},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(U.a)(this.childNode||this),v=t!==this.currentElement;v&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new h.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 v=t[0];if(L.isValidElement(v)&&Object(g.c)(v)){var p=v.ref;t[0]=L.cloneElement(v,{ref:Object(g.a)(p,this.setChildNode)})}return t.length===1?t[0]:t.map(function(m,b){return!L.isValidElement(m)||"key"in m&&m.key!==null?m:L.cloneElement(m,{key:"".concat(u,"-").concat(b)})})}}]),s}(L.Component);a.displayName="ResizeObserver",ve.a=a},t9D7:function(qe,ve,N){"use strict";N.d(ve,"b",function(){return j}),N.d(ve,"g",function(){return e}),N.d(ve,"d",function(){return C}),N.d(ve,"e",function(){return g}),N.d(ve,"a",function(){return h}),N.d(ve,"f",function(){return i}),N.d(ve,"c",function(){return c});var ie=N("Vhoy"),W=N("MI8n"),O=N("pmY6"),M=N("Cg/j"),w=N("ic2d"),L=N("nEHx");const j=Object(M.c)("themeService");var U;(function(s){function r(n){return n&&typeof n=="object"&&typeof n.id=="string"}s.isThemeColor=r})(U||(U={}));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"||U.isThemeColor(b.color))}s.isThemeIcon=r;const n=new RegExp(`^\\$\\((${ie.a.iconNameExpression}(?:${ie.a.iconModifierExpression})?)\\)$`);function t(b){const _=n.exec(b);if(!_)return;let[,o]=_;return{id:o}}s.fromString=t;function v(b,_){let o=b.id;const f=o.lastIndexOf("~");return f!==-1&&(o=o.substring(0,f)),_&&(o=`${o}~${_}`),{id:o}}s.modify=v;function p(b,_){var o,f;return b.id===_.id&&((o=b.color)===null||o===void 0?void 0:o.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=ie.a.asClassNameArray,s.asClassName=ie.a.asClassName,s.asCSSSelector=ie.a.asCSSSelector})(C||(C={}));function g(s){switch(s){case L.a.DARK:return"vs-dark";case L.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const h={ThemingContribution:"base.contributions.theming"};class u{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 u;w.a.add(h.ThemingContribution,a);function i(s){return a.onColorThemeChange(s)}class c 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,N){typeof window!="undefined"&&function(W,O){qe.exports=O()}(this,function(){return function(ie){var W={};function O(M){if(W[M])return W[M].exports;var w=W[M]={i:M,l:!1,exports:{}};return ie[M].call(w.exports,w,w.exports,O),w.l=!0,w.exports}return O.m=ie,O.c=W,O.d=function(M,w,L){O.o(M,w)||Object.defineProperty(M,w,{enumerable:!0,get:L})},O.r=function(M){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(M,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(M,"__esModule",{value:!0})},O.t=function(M,w){if(w&1&&(M=O(M)),w&8)return M;if(w&4&&typeof M=="object"&&M&&M.__esModule)return M;var L=Object.create(null);if(O.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:M}),w&2&&typeof M!="string")for(var j in M)O.d(L,j,function(U){return M[U]}.bind(null,j));return L},O.n=function(M){var w=M&&M.__esModule?function(){return M.default}:function(){return M};return O.d(w,"a",w),w},O.o=function(M,w){return Object.prototype.hasOwnProperty.call(M,w)},O.p="/dist/",O(O.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,W,O){"use strict";var M=Object.prototype.hasOwnProperty,w="~";function L(){}Object.create&&(L.prototype=Object.create(null),new L().__proto__||(w=!1));function j(g,h,u){this.fn=g,this.context=h,this.once=u||!1}function U(g,h,u,a,i){if(typeof u!="function")throw new TypeError("The listener must be a function");var c=new j(u,a||g,i),s=w?w+h:h;return g._events[s]?g._events[s].fn?g._events[s]=[g._events[s],c]:g._events[s].push(c):(g._events[s]=c,g._eventsCount++),g}function e(g,h){--g._eventsCount===0?g._events=new L:delete g._events[h]}function C(){this._events=new L,this._eventsCount=0}C.prototype.eventNames=function(){var h=[],u,a;if(this._eventsCount===0)return h;for(a in u=this._events)M.call(u,a)&&h.push(w?a.slice(1):a);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(u)):h},C.prototype.listeners=function(h){var u=w?w+h:h,a=this._events[u];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,c=a.length,s=new Array(c);i<c;i++)s[i]=a[i].fn;return s},C.prototype.listenerCount=function(h){var u=w?w+h:h,a=this._events[u];return a?a.fn?1:a.length:0},C.prototype.emit=function(h,u,a,i,c,s){var r=w?w+h:h;if(!this._events[r])return!1;var n=this._events[r],t=arguments.length,v,p;if(n.fn){n.once&&this.removeListener(h,n.fn,void 0,!0);switch(t){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,u),!0;case 3:return n.fn.call(n.context,u,a),!0;case 4:return n.fn.call(n.context,u,a,i),!0;case 5:return n.fn.call(n.context,u,a,i,c),!0;case 6:return n.fn.call(n.context,u,a,i,c,s),!0}for(p=1,v=new Array(t-1);p<t;p++)v[p-1]=arguments[p];n.fn.apply(n.context,v)}else{var m=n.length,b;for(p=0;p<m;p++){n[p].once&&this.removeListener(h,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,u);break;case 3:n[p].fn.call(n[p].context,u,a);break;case 4:n[p].fn.call(n[p].context,u,a,i);break;default:if(!v)for(b=1,v=new Array(t-1);b<t;b++)v[b-1]=arguments[b];n[p].fn.apply(n[p].context,v)}}}return!0},C.prototype.on=function(h,u,a){return U(this,h,u,a,!1)},C.prototype.once=function(h,u,a){return U(this,h,u,a,!0)},C.prototype.removeListener=function(h,u,a,i){var c=w?w+h:h;if(!this._events[c])return this;if(!u)return e(this,c),this;var s=this._events[c];if(s.fn)s.fn===u&&(!i||s.once)&&(!a||s.context===a)&&e(this,c);else{for(var r=0,n=[],t=s.length;r<t;r++)(s[r].fn!==u||i&&!s[r].once||a&&s[r].context!==a)&&n.push(s[r]);n.length?this._events[c]=n.length===1?n[0]:n:e(this,c)}return this},C.prototype.removeAllListeners=function(h){var u;return h?(u=w?w+h:h,this._events[u]&&e(this,u)):(this._events=new L,this._eventsCount=0),this},C.prototype.off=C.prototype.removeListener,C.prototype.addListener=C.prototype.on,C.prefixed=w,C.EventEmitter=C,ie.exports=C},"./node_modules/url-toolkit/src/url-toolkit.js":function(ie,W,O){(function(M){var w=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,L=/^([^\/?#]*)([^]*)$/,j=/(?:\/|^)\.(?=\/)/g,U=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(C,g,h){if(h=h||{},C=C.trim(),g=g.trim(),!g){if(!h.alwaysNormalize)return C;var u=e.parseURL(C);if(!u)throw new Error("Error trying to parse base URL.");return u.path=e.normalizePath(u.path),e.buildURLFromParts(u)}var a=e.parseURL(g);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return h.alwaysNormalize?(a.path=e.normalizePath(a.path),e.buildURLFromParts(a)):g;var i=e.parseURL(C);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&i.path[0]!=="/"){var c=L.exec(i.path);i.netLoc=c[1],i.path=c[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=h.alwaysNormalize?e.normalizePath(a.path):a.path),e.buildURLFromParts(s)},parseURL:function(C){var g=w.exec(C);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(C){for(C=C.split("").reverse().join("").replace(j,"");C.length!==(C=C.replace(U,"")).length;);return C.split("").reverse().join("")},buildURLFromParts:function(C){return C.scheme+C.netLoc+C.path+C.params+C.query+C.fragment}};ie.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(ie,W,O){function M(h){var u={};function a(c){if(u[c])return u[c].exports;var s=u[c]={i:c,l:!1,exports:{}};return h[c].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=h,a.c=u,a.i=function(c){return c},a.d=function(c,s,r){a.o(c,s)||Object.defineProperty(c,s,{configurable:!1,enumerable:!0,get:r})},a.r=function(c){Object.defineProperty(c,"__esModule",{value:!0})},a.n=function(c){var s=c&&c.__esModule?function(){return c.default}:function(){return c};return a.d(s,"a",s),s},a.o=function(c,s){return Object.prototype.hasOwnProperty.call(c,s)},a.p="/",a.oe=function(c){throw console.error(c),c};var i=a(a.s=ENTRY_MODULE);return i.default||i}var w="[\\.|\\-|\\+|\\w|/|@]+",L="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+w+").*?\\)";function j(h){return(h+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function U(h){return!isNaN(1*h)}function e(h,u,a){var i={};i[a]=[];var c=u.toString(),s=c.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return i;for(var r=s[1],n=new RegExp("(\\\\n|\\W)"+j(r)+L,"g"),t;t=n.exec(c);){if(t[3]==="dll-reference")continue;i[a].push(t[3])}for(n=new RegExp("\\("+j(r)+'\\("(dll-reference\\s('+w+'))"\\)\\)'+L,"g");t=n.exec(c);)h[t[2]]||(i[a].push(t[1]),h[t[2]]=O(t[1]).m),i[t[2]]=i[t[2]]||[],i[t[2]].push(t[4]);for(var v=Object.keys(i),p=0;p<v.length;p++)for(var m=0;m<i[v[p]].length;m++)U(i[v[p]][m])&&(i[v[p]][m]=1*i[v[p]][m]);return i}function C(h){var u=Object.keys(h);return u.reduce(function(a,i){return a||h[i].length>0},!1)}function g(h,u){for(var a={main:[u]},i={main:[]},c={main:{}};C(a);)for(var s=Object.keys(a),r=0;r<s.length;r++){var n=s[r],t=a[n],v=t.pop();if(c[n]=c[n]||{},c[n][v]||!h[n][v])continue;c[n][v]=!0,i[n]=i[n]||[],i[n].push(v);for(var p=e(h,h[n][v],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}ie.exports=function(h,u){u=u||{};var a={main:O.m},i=u.all?{main:Object.keys(a.main)}:g(a,h),c="";Object.keys(i).filter(function(v){return v!=="main"}).forEach(function(v){for(var p=0;i[v][p];)p++;i[v].push(p),a[v][p]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",c=c+"var "+v+" = ("+M.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+i[v].map(function(m){return""+JSON.stringify(m)+": "+a[v][m].toString()}).join(",")+`});
`}),c=c+"new (("+M.toString().replace("ENTRY_MODULE",JSON.stringify(h))+")({"+i.main.map(function(v){return""+JSON.stringify(v)+": "+a.main[v].toString()}).join(",")+"}))(self);";var s=new window.Blob([c],{type:"text/javascript"});if(u.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(ie,W,O){"use strict";O.r(W),O.d(W,"hlsDefaultConfig",function(){return b}),O.d(W,"mergeConfig",function(){return o}),O.d(W,"enableStreamingMode",function(){return f});var M=O("./src/controller/abr-controller.ts"),w=O("./src/controller/audio-stream-controller.ts"),L=O("./src/controller/audio-track-controller.ts"),j=O("./src/controller/subtitle-stream-controller.ts"),U=O("./src/controller/subtitle-track-controller.ts"),e=O("./src/controller/buffer-controller.ts"),C=O("./src/controller/timeline-controller.ts"),g=O("./src/controller/cap-level-controller.ts"),h=O("./src/controller/fps-controller.ts"),u=O("./src/controller/eme-controller.ts"),a=O("./src/controller/cmcd-controller.ts"),i=O("./src/utils/xhr-loader.ts"),c=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(l){for(var d=1;d<arguments.length;d++){var E=arguments[d];for(var y in E)Object.prototype.hasOwnProperty.call(E,y)&&(l[y]=E[y])}return l},t.apply(this,arguments)}function v(l,d){var E=Object.keys(l);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(l);d&&(y=y.filter(function(S){return Object.getOwnPropertyDescriptor(l,S).enumerable})),E.push.apply(E,y)}return E}function p(l){for(var d=1;d<arguments.length;d++){var E=arguments[d]!=null?arguments[d]:{};d%2?v(Object(E),!0).forEach(function(y){m(l,y,E[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(E)):v(Object(E)).forEach(function(y){Object.defineProperty(l,y,Object.getOwnPropertyDescriptor(E,y))})}return l}function m(l,d,E){return d in l?Object.defineProperty(l,d,{value:E,enumerable:!0,configurable:!0,writable:!0}):l[d]=E,l}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:M.default,bufferController:e.default,capLevelController:g.default,fpsController:h.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:j.SubtitleStreamController,subtitleTrackController:U.default,timelineController:C.TimelineController,audioStreamController:w.default,audioTrackController:L.default,emeController:u.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 o(l,d){if((d.liveSyncDurationCount||d.liveMaxLatencyDurationCount)&&(d.liveSyncDuration||d.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(d.liveMaxLatencyDurationCount!==void 0&&(d.liveSyncDurationCount===void 0||d.liveMaxLatencyDurationCount<=d.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(d.liveMaxLatencyDuration!==void 0&&(d.liveSyncDuration===void 0||d.liveMaxLatencyDuration<=d.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},l,d)}function f(l){var d=l.loader;if(d!==c.default&&d!==i.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),l.progressive=!1;else{var E=Object(c.fetchSupported)();E&&(l.loader=c.default,l.progressive=!0,l.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/polyfills/number.ts"),w=O("./src/utils/ewma-bandwidth-estimator.ts"),L=O("./src/events.ts"),j=O("./src/utils/buffer-helper.ts"),U=O("./src/errors.ts"),e=O("./src/types/loader.ts"),C=O("./src/utils/logger.ts");function g(a,i){for(var c=0;c<i.length;c++){var s=i[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function h(a,i,c){return i&&g(a.prototype,i),c&&g(a,c),a}var u=function(){function a(c){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=c;var s=c.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(L.Events.FRAG_LOADING,this.onFragLoading,this),s.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(L.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var s=this.hls;s.off(L.Events.FRAG_LOADING,this.onFragLoading,this),s.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(L.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,v=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,o=Math.abs(p.playbackRate);if(_<=500*b/o)return;var f=n.levels,l=n.minAutoLevel,d=f[s.level],E=m.total||Math.max(m.loaded,Math.round(b*d.maxBitrate/8)),y=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/_),S=(E-m.loaded)/y,D=p.currentTime,I=(j.BufferHelper.bufferInfo(p,D,v.maxBufferHole).end-D)/o;if(I>=2*b/o||S<=I)return;var A=Number.POSITIVE_INFINITY,P;for(P=s.level-1;P>l;P--){var H=f[P].maxBitrate;if(A=b*H/(8*.8*y),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(M.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(L.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(M.isFiniteNumber)(n.sn)){var v=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)+v.loaded,_=(m.loaded?m.loaded.duration:0)+p;m.loaded={bytes:b,duration:_},m.realBitrate=Math.round(8*b/_)}if(n.bitrateTest){var o={stats:v,frag:n,part:t,id:n.type};this.onFragBuffered(L.Events.FRAG_BUFFERED,o),n.bitrateTest=!1}}},i.onFragBuffered=function(s,r){var n=r.frag,t=r.part,v=t?t.stats:n.stats;if(v.aborted)return;if(n.type!==e.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var p=v.parsing.end-v.loading.start;this.bwEstimator.sample(p,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=p/1e3:this.bitrateTestDelay=0},i.onError=function(s,r){switch(r.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.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,v=n.config,p=n.minAutoLevel,m=n.media,b=r?r.duration:s?s.duration:0,_=m?m.currentTime:0,o=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,f=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,l=(j.BufferHelper.bufferInfo(m,_,v.maxBufferHole).end-_)/o,d=this.findBestLevel(f,p,t,l,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(d>=0)return d;C.logger.trace((l?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=b?Math.min(b,v.maxStarvationDelay):v.maxStarvationDelay,y=v.abrBandWidthFactor,S=v.abrBandWidthUpFactor;if(!l){var D=this.bitrateTestDelay;if(D){var I=b?Math.min(b,v.maxLoadingDelay):v.maxLoadingDelay;E=I-D,C.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),y=S=1}}return d=this.findBestLevel(f,p,t,l+E,y,S),Math.max(d,0)},i.findBestLevel=function(s,r,n,t,v,p){for(var m,b=this.fragCurrent,_=this.partCurrent,o=this.lastLoadedFragLevel,f=this.hls.levels,l=f[o],d=!!(l!=null&&(m=l.details)!==null&&m!==void 0&&m.live),E=l==null?void 0:l.codecSet,y=_?_.duration:b?b.duration:0,S=n;S>=r;S--){var D=f[S];if(!D||E&&D.codecSet!==E)continue;var I=D.details,A=(_?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||y,P=void 0;S<=o?P=v*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||d&&!this.bitrateTestDelay||R<t))return S}return-1},h(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=u},"./src/controller/audio-stream-controller.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/polyfills/number.ts"),w=O("./src/controller/base-stream-controller.ts"),L=O("./src/events.ts"),j=O("./src/utils/buffer-helper.ts"),U=O("./src/controller/fragment-tracker.ts"),e=O("./src/types/level.ts"),C=O("./src/types/loader.ts"),g=O("./src/loader/fragment.ts"),h=O("./src/demux/chunk-cache.ts"),u=O("./src/demux/transmuxer-interface.ts"),a=O("./src/types/transmuxer.ts"),i=O("./src/controller/fragment-finders.ts"),c=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 o=arguments[_];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&&(b[f]=o[f])}return b},n.apply(this,arguments)}function t(b,_){b.prototype=Object.create(_.prototype),b.prototype.constructor=b,v(b,_)}function v(b,_){return v=Object.setPrototypeOf||function(f,l){return f.__proto__=l,f},v(b,_)}var p=100,m=function(b){t(_,b);function _(f,l){var d;return d=b.call(this,f,l,"[audio-stream-controller]")||this,d.videoBuffer=null,d.videoTrackCC=-1,d.waitingVideoCC=-1,d.audioSwitch=!1,d.trackId=-1,d.waitingData=null,d.mainDetails=null,d.bufferFlushed=!1,d._registerListeners(),d}var o=_.prototype;return o.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},o._registerListeners=function(){var l=this.hls;l.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.on(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(L.Events.ERROR,this.onError,this),l.on(L.Events.BUFFER_RESET,this.onBufferReset,this),l.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},o._unregisterListeners=function(){var l=this.hls;l.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.off(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(L.Events.ERROR,this.onError,this),l.off(L.Events.BUFFER_RESET,this.onBufferReset,this),l.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},o.onInitPtsFound=function(l,d){var E=d.frag,y=d.id,S=d.initPTS;if(y==="main"){var D=E.cc;this.initPTS[E.cc]=S,this.log("InitPTS for cc: "+D+" found from main: "+S),this.videoTrackCC=D,this.state===w.State.WAITING_INIT_PTS&&this.tick()}},o.startLoad=function(l){if(!this.levels){this.startPosition=l,this.state=w.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(p),this.fragLoadError=0,d>0&&l===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=w.State.IDLE):(this.loadedmetadata=!1,this.state=w.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()},o.doTick=function(){switch(this.state){case w.State.IDLE:this.doTickIdle();break;case w.State.WAITING_TRACK:{var l,d=this.levels,E=this.trackId,y=d==null||((l=d[E])===null||l===void 0)?void 0:l.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=w.State.WAITING_INIT_PTS}break}case w.State.FRAG_LOADING_WAITING_RETRY:{var S,D=performance.now(),I=this.retryDate;(!I||D>=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 V=R.flush(),oe={frag:P,part:H,payload:V,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 Q=this.getLoadPosition(),pe=j.BufferHelper.bufferInfo(this.mediaBuffer,Q,this.config.maxBufferHole),ce=Object(i.fragmentWithinToleranceTest)(pe.end,this.config.maxFragLookUpTolerance,P);ce<0&&(r.logger.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+pe.end+" is needed"),this.clearWaitingFragment())}}else this.state=w.State.IDLE}}this.onTickEnd()},o.clearWaitingFragment=function(){var l=this.waitingData;l&&(this.fragmentTracker.removeFragment(l.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=w.State.IDLE)},o.onTickEnd=function(){var l=this.media;if(!l||!l.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:l,E=d.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=l.currentTime},o.doTickIdle=function(){var l,d,E=this.hls,y=this.levels,S=this.media,D=this.trackId,I=E.config;if(!y||!y[D])return;if(!S&&(this.startFragRequested||!I.startFragPrefetch))return;var A=y[D],P=A.details;if(!P||P.live&&this.levelLastLoaded!==D||this.waitForCdnTuneIn(P)){this.state=w.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.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(),V=this.audioSwitch;if(R>=K&&!V)return;if(!V&&this._streamEnded(H,P)){E.trigger(L.Events.BUFFER_EOS,{type:"audio"}),this.state=w.State.ENDED;return}var oe=P.fragments,Q=oe[0].start,pe=H.end;if(V){var ce=this.getLoadPosition();pe=ce,P.PTSKnown&&ce<Q&&((H.end>Q||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),S.currentTime=Q+.05))}var ee=this.getNextFragment(pe,P);if(!ee){this.bufferFlushed=!0;return}((l=ee.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((d=ee.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ee,P):this.loadFragment(ee,P,pe)},o.getMaxBufferLength=function(){var l=b.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,C.PlaylistLevelType.MAIN);return d===null?l:Math.max(l,d.len)},o.onMediaDetaching=function(){this.videoBuffer=null,b.prototype.onMediaDetaching.call(this)},o.onAudioTracksUpdated=function(l,d){var E=d.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(y){return new e.Level(y)})},o.onAudioTrackSwitching=function(l,d){var E=!!d.url;this.trackId=d.id;var y=this.fragCurrent;y!=null&&y.loader&&y.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()},o.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},o.onLevelLoaded=function(l,d){this.mainDetails=d.details},o.onAudioTrackLoaded=function(l,d){var E,y=this.levels,S=d.details,D=d.id;if(!y){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+S.startSN+","+S.endSN+"],duration:"+S.totalduration);var I=y[D],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(c.alignMediaPlaylistByPDT)(S,P),A=S.fragments[0].start):A=this.alignPlaylists(S,I.details)}I.details=S,this.levelLastLoaded=D,!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()},o._handleFragmentLoadProgress=function(l){var d,E=l.frag,y=l.part,S=l.payload,D=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=D.defaultAudioCodec||P.audioCodec||"mp4a.40.2",K=this.transmuxer;K||(K=this.transmuxer=new u.default(this.hls,C.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var V=this.initPTS[E.cc],oe=(d=E.initSegment)===null||d===void 0?void 0:d.data;if(V!==void 0){var Q=!1,pe=y?y.index:-1,ce=pe!==-1,ee=new a.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,S.byteLength,pe,ce);K.push(S,oe,R,"",E,y,H.totalduration,Q,ee,V)}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 ne=this.waitingData=this.waitingData||{frag:E,part:y,cache:new h.default,complete:!1},me=ne.cache;me.push(new Uint8Array(S)),this.waitingVideoCC=this.videoTrackCC,this.state=w.State.WAITING_INIT_PTS}},o._handleFragmentLoadComplete=function(l){if(this.waitingData){this.waitingData.complete=!0;return}b.prototype._handleFragmentLoadComplete.call(this,l)},o.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},o.onBufferCreated=function(l,d){var E=d.tracks.audio;E&&(this.mediaBuffer=E.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},o.onFragBuffered=function(l,d){var E=d.frag,y=d.part;if(E.type!==C.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(y?" p: "+y.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(L.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,y)},o.onError=function(l,d){switch(d.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,d);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=d.fatal?w.State.ERROR:w.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===w.State.PARSING||this.state===w.State.PARSED)){var E=!0,y=this.getFwdBufferInfo(this.mediaBuffer,C.PlaylistLevelType.AUDIO);y&&y.len>.5&&(E=!this.reduceMaxBufferLength(y.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}},o.onBufferFlushed=function(l,d){var E=d.type;E===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},o._handleTransmuxComplete=function(l){var d,E="audio",y=this.hls,S=l.remuxResult,D=l.chunkMeta,I=this.getCurrentContext(D);if(!I){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var A=I.frag,P=I.part,H=S.audio,R=S.text,K=S.id3,V=S.initSegment;if(this.fragContextChanged(A))return;if(this.state=w.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),V!=null&&V.tracks&&(this._bufferInitSegment(V.tracks,A,D),y.trigger(L.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:E,tracks:V.tracks})),H){var oe=H.startPTS,Q=H.endPTS,pe=H.startDTS,ce=H.endDTS;P&&(P.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:Q,startDTS:pe,endDTS:ce}),A.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,oe,Q,pe,ce),this.bufferFragmentData(H,A,P,D)}if(K!=null&&(d=K.samples)!==null&&d!==void 0&&d.length){var ee=n({frag:A,id:E},K);y.trigger(L.Events.FRAG_PARSING_METADATA,ee)}if(R){var ne=n({frag:A,id:E},R);y.trigger(L.Events.FRAG_PARSING_USERDATA,ne)}},o._bufferInitSegment=function(l,d,E){if(this.state!==w.State.PARSING)return;l.video&&delete l.video;var y=l.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(L.Events.BUFFER_CODECS,l);var S=y.initSegment;if(S!=null&&S.byteLength){var D={type:"audio",frag:d,part:null,chunkMeta:E,parent:d.type,data:S};this.hls.trigger(L.Events.BUFFER_APPENDING,D)}this.tick()},o.loadFragment=function(l,d,E){var y=this.fragmentTracker.getState(l);this.fragCurrent=l,(this.audioSwitch||y===U.FragmentState.NOT_LOADED||y===U.FragmentState.PARTIAL)&&(l.sn==="initSegment"?this._loadInitSegment(l):d.live&&!Object(M.isFiniteNumber)(this.initPTS[l.cc])?(this.log("Waiting for video PTS in continuity counter "+l.cc+" of live stream before loading audio fragment "+l.sn+" of level "+this.trackId),this.state=w.State.WAITING_INIT_PTS):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,l,d,E)))},o.completeAudioSwitch=function(){var l=this.hls,d=this.media,E=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),b.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,l.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:E})},_}(w.default);W.default=m},"./src/controller/audio-track-controller.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/events.ts"),w=O("./src/errors.ts"),L=O("./src/controller/base-playlist-controller.ts"),j=O("./src/types/loader.ts");function U(u,a){for(var i=0;i<a.length;i++){var c=a[i];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function e(u,a,i){return a&&U(u.prototype,a),i&&U(u,i),u}function C(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,g(u,a)}function g(u,a){return g=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},g(u,a)}var h=function(u){C(a,u);function a(c){var s;return s=u.call(this,c,"[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(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(M.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(M.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var s=this.hls;s.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(M.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(M.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,u.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,v=this.tracksInGroup[n];if(!v){this.warn("Invalid audio track id "+n);return}var p=v.details;v.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 v={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(M.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},i.onError=function(s,r){if(u.prototype.onError.call(this,s,r),r.fatal||!r.context)return;r.context.type===j.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},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],v=t.id,p=t.groupId,m=p===void 0?"":p,b=t.name,_=t.type,o=t.url;if(this.trackId=s,this.trackName=b,this.selectDefaultTrack=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:m,name:b,type:_,url:o}),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(M.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,v=r.url;if(s)try{v=s.addDirectives(v)}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(M.Events.AUDIO_TRACK_LOADING,{url:v,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}(L.default);W.default=h},"./src/controller/base-playlist-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return e});var M=O("./src/polyfills/number.ts"),w=O("./src/types/level.ts"),L=O("./src/controller/level-helper.ts"),j=O("./src/utils/logger.ts"),U=O("./src/errors.ts"),e=function(){function C(h,u){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=j.logger.log.bind(j.logger,u+":"),this.warn=j.logger.warn.bind(j.logger,u+":"),this.hls=h}var g=C.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(u,a){a.fatal&&a.type===U.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(u,a){var i=a==null?void 0:a.renditionReports;if(i)for(var c=0;c<i.length;c++){var s=i[c],r=""+s.URI;if(r===u.substr(-r.length)){var n=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var v=Math.min(a.age-a.partTarget,a.targetduration);t!==void 0&&v>a.partTarget&&(t+=1)}if(Object(M.isFiniteNumber)(n))return new w.HlsUrlParameters(n,Object(M.isFiniteNumber)(t)?t:void 0,w.HlsSkip.No)}}},g.loadPlaylist=function(u){},g.shouldLoadTrack=function(u){return this.canLoad&&u&&!!u.url&&(!u.details||u.details.live)},g.playlistLoaded=function(u,a,i){var c=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 "+u+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),i&&s.fragments.length>0&&Object(L.mergeDetails)(i,s),!this.canLoad||!s.live)return;var t,v=void 0,p=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var m=this.hls.config.lowLatencyMode,b=s.lastPartSn,_=s.endSN,o=s.lastPartIndex,f=o!==-1,l=b===_,d=m?0:o;f?(v=l?_+1:b,p=l?d:o+1):v=_+1;var E=s.age,y=E+s.ageHeader,S=Math.min(y-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 D=Math.floor(S/s.targetduration);if(v+=D,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 "+D+" to part "+p)}s.tuneInGoal=S}if(t=this.getDeliveryDirectives(s,a.deliveryDirectives,v,p),m||!l){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,a.deliveryDirectives,v,p);var A=Object(L.computeReloadInterval)(s,r);v!==void 0&&s.canBlockReload&&(A-=s.partTarget||1),this.log("reload live playlist "+u+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return c.loadPlaylist(t)},A)}else this.clearTimer()},g.getDeliveryDirectives=function(u,a,i,c){var s=Object(w.getSkipValue)(u,i);return a!=null&&a.skip&&u.deltaUpdateFailed&&(i=a.msn,c=a.part,s=w.HlsSkip.No),new w.HlsUrlParameters(i,c,s)},g.retryLoadingOrFail=function(u){var a=this,i=this.hls.config,c=this.retryCount<i.levelLoadingMaxRetry;if(c){var s;if(this.retryCount++,u.details.indexOf("LoadTimeOut")>-1&&(s=u.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+u.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 "'+u.details+'"')}}else this.warn('cannot recover from error "'+u.details+'"'),this.clearTimer(),u.fatal=!0;return c},C}()},"./src/controller/base-stream-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"State",function(){return _}),O.d(W,"default",function(){return o});var M=O("./src/polyfills/number.ts"),w=O("./src/task-loop.ts"),L=O("./src/controller/fragment-tracker.ts"),j=O("./src/utils/buffer-helper.ts"),U=O("./src/utils/logger.ts"),e=O("./src/events.ts"),C=O("./src/errors.ts"),g=O("./src/types/transmuxer.ts"),h=O("./src/utils/mp4-tools.ts"),u=O("./src/utils/discontinuities.ts"),a=O("./src/controller/fragment-finders.ts"),i=O("./src/controller/level-helper.ts"),c=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,l){for(var d=0;d<l.length;d++){var E=l[d];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}function v(f,l,d){return l&&t(f.prototype,l),d&&t(f,d),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,l){f.prototype=Object.create(l.prototype),f.prototype.constructor=f,b(f,l)}function b(f,l){return b=Object.setPrototypeOf||function(E,y){return E.__proto__=y,E},b(f,l)}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"},o=function(f){m(l,f);function l(E,y,S){var D;return D=f.call(this)||this,D.hls=void 0,D.fragPrevious=null,D.fragCurrent=null,D.fragmentTracker=void 0,D.transmuxer=null,D._state=_.STOPPED,D.media=void 0,D.mediaBuffer=void 0,D.config=void 0,D.bitrateTest=!1,D.lastCurrentTime=0,D.nextLoadPosition=0,D.startPosition=0,D.loadedmetadata=!1,D.fragLoadError=0,D.retryDate=0,D.levels=null,D.fragmentLoader=void 0,D.levelLastLoaded=null,D.startFragRequested=!1,D.decrypter=void 0,D.initPTS=[],D.onvseeking=null,D.onvended=null,D.logPrefix="",D.log=void 0,D.warn=void 0,D.logPrefix=S,D.log=U.logger.log.bind(U.logger,S+":"),D.warn=U.logger.warn.bind(U.logger,S+":"),D.hls=E,D.fragmentLoader=new c.default(E.config),D.fragmentTracker=y,D.config=E.config,D.decrypter=new s.default(E,E.config),E.on(e.Events.KEY_LOADED,D.onKeyLoaded,p(D)),D}var d=l.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(y){},d.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},d._streamEnded=function(y,S){var D=this.fragCurrent,I=this.fragmentTracker;if(!S.live&&D&&D.sn===S.endSN&&!y.nextStart){var A=I.getState(D);return A===L.FragmentState.PARTIAL||A===L.FragmentState.OK}return!1},d.onMediaAttached=function(y,S){var D=this.media=this.mediaBuffer=S.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(I.startPosition)},d.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},d.onMediaSeeking=function(){var y=this.config,S=this.fragCurrent,D=this.media,I=this.mediaBuffer,A=this.state,P=D?D.currentTime:0,H=j.BufferHelper.bufferInfo(I||D,P,y.maxBufferHole);if(this.log("media seeking to "+(Object(M.isFiniteNumber)(P)?P.toFixed(3):P)+", state: "+A),A===_.ENDED)this.resetLoadingState();else if(S&&!H.len){var R=y.maxFragLookUpTolerance,K=S.start-R,V=S.start+S.duration+R,oe=P>V;(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())}D&&(this.lastCurrentTime=P),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=P),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(y,S){if(this.state!==_.KEY_LOADING||S.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var D=this.levels[S.frag.level].details;D&&this.loadFragment(S.frag,D,S.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),f.prototype.onHandlerDestroying.call(this)},d.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)},d.loadKey=function(y,S){this.log("Loading key for "+y.sn+" of ["+S.startSN+"-"+S.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=_.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(e.Events.KEY_LOADING,{frag:y})},d.loadFragment=function(y,S,D){this._loadFragForPlayback(y,S,D)},d._loadFragForPlayback=function(y,S,D){var I=this,A=function(H){if(I.fragContextChanged(y)){I.warn("Fragment "+y.sn+(H.part?" p: "+H.part.index:"")+" of level "+y.level+" was dropped during download."),I.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,I._handleFragmentLoadProgress(H)};this._doFragLoad(y,S,D,A).then(function(P){if(!P)return;I.fragLoadError=0;var H=I.state;if(I.fragContextChanged(y)){(H===_.FRAG_LOADING||H===_.BACKTRACKING||!I.fragCurrent&&H===_.PARSING)&&(I.fragmentTracker.removeFragment(y),I.state=_.IDLE);return}if("payload"in P&&(I.log("Loaded fragment "+y.sn+" of level "+y.level),I.hls.trigger(e.Events.FRAG_LOADED,P),I.state===_.BACKTRACKING)){I.fragmentTracker.backtrack(y,P),I.resetFragmentLoading(y);return}I._handleFragmentLoadComplete(P)}).catch(function(P){I.warn(P),I.resetFragmentLoading(y)})},d.flushMainBuffer=function(y,S,D){if(D===void 0&&(D=null),!(y-S))return;var I={startOffset:y,endOffset:S,type:D};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,I)},d._loadInitSegment=function(y){var S=this;this._doFragLoad(y).then(function(D){if(!D||S.fragContextChanged(y)||!S.levels)throw new Error("init load aborted");return D}).then(function(D){var I=S.hls,A=D.payload,P=y.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:y,payload:R,stats:{tstart:H,tdecrypt:K}}),D.payload=R,D})}return D}).then(function(D){var I=S.fragCurrent,A=S.hls,P=S.levels;if(!P)throw new Error("init load aborted, missing levels");var H=P[y.level].details;console.assert(H,"Level details are defined when init segment is loaded");var R=y.stats;S.state=_.IDLE,S.fragLoadError=0,y.data=new Uint8Array(D.payload),R.parsing.start=R.buffering.start=self.performance.now(),R.parsing.end=R.buffering.end=self.performance.now(),D.frag===I&&A.trigger(e.Events.FRAG_BUFFERED,{stats:R,frag:I,part:null,id:y.type}),S.tick()}).catch(function(D){S.warn(D),S.resetFragmentLoading(y)})},d.fragContextChanged=function(y){var S=this.fragCurrent;return!y||!S||y.level!==S.level||y.sn!==S.sn||y.urlId!==S.urlId},d.fragBufferedComplete=function(y,S){var D=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(S?" part: "+S.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+r.default.toString(j.BufferHelper.getBuffered(D))),this.state=_.IDLE,this.tick()},d._handleFragmentLoadComplete=function(y){var S=this.transmuxer;if(!S)return;var D=y.frag,I=y.part,A=y.partsLoaded,P=!A||A.length===0||A.some(function(R){return!R}),H=new g.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,I?I.index:-1,!P);S.flush(H)},d._handleFragmentLoadProgress=function(y){},d._doFragLoad=function(y,S,D,I){var A=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");if(D=Math.max(y.start,D||0),this.config.lowLatencyMode&&S){var P=S.partList;if(P&&I){D>y.end&&S.fragmentHint&&(y=S.fragmentHint);var H=this.getNextPart(P,y,D);if(H>-1){var R=P[H];return this.log("Loading part sn: "+y.sn+" p: "+R.index+" cc: "+y.cc+" of playlist ["+S.startSN+"-"+S.endSN+"] parts [0-"+H+"-"+(P.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=R.start+R.duration,this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:y,part:P[H],targetBufferTime:D}),this.doFragPartsLoad(y,P,H,I).catch(function(K){return A.handleFragLoadError(K)})}else if(!y.url||this.loadedEndOfParts(P,D))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(S?"of ["+S.startSN+"-"+S.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(D.toFixed(3))),Object(M.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:y,targetBufferTime:D}),this.fragmentLoader.load(y,I).catch(function(K){return A.handleFragLoadError(K)})},d.doFragPartsLoad=function(y,S,D,I){var A=this;return new Promise(function(P,H){var R=[],K=function V(oe){var Q=S[oe];A.fragmentLoader.loadPart(y,Q,I).then(function(pe){R[Q.index]=pe;var ce=pe.part;A.hls.trigger(e.Events.FRAG_LOADED,pe);var ee=S[oe+1];if(ee&&ee.fragment===y)V(oe+1);else return P({frag:y,part:ce,partsLoaded:R})}).catch(H)};K(D)})},d.handleFragLoadError=function(y){var S=y.data;return S&&S.details===C.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(S.frag,S.part):this.hls.trigger(e.Events.ERROR,S),null},d._handleTransmuxerFlush=function(y){var S=this.getCurrentContext(y);if(!S||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var D=S.frag,I=S.part,A=S.level,P=self.performance.now();D.stats.parsing.end=P,I&&(I.stats.parsing.end=P),this.updateLevelTiming(D,I,A,y.partial)},d.getCurrentContext=function(y){var S=this.levels,D=y.level,I=y.sn,A=y.part;if(!S||!S[D])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+D+". The current chunk will not be buffered."),null;var P=S[D],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},d.bufferFragmentData=function(y,S,D,I){if(!y||this.state!==_.PARSING)return;var A=y.data1,P=y.data2,H=A;if(A&&P&&(H=Object(h.appendUint8Array)(A,P)),!H||!H.length)return;var R={type:y.type,frag:S,part:D,chunkMeta:I,parent:S.type,data:H};this.hls.trigger(e.Events.BUFFER_APPENDING,R),y.dropped&&y.independent&&!D&&this.flushBufferGap(S)},d.flushBufferGap=function(y){var S=this.media;if(!S)return;if(!j.BufferHelper.isBuffered(S,S.currentTime)){this.flushMainBuffer(0,y.start);return}var D=S.currentTime,I=j.BufferHelper.bufferInfo(S,D,0),A=y.duration,P=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),H=Math.max(Math.min(y.start-P,I.end-P),D+P);y.start-H>P&&this.flushMainBuffer(H,y.start)},d.getFwdBufferInfo=function(y,S){var D=this.config,I=this.getLoadPosition();if(!Object(M.isFiniteNumber)(I))return null;var A=j.BufferHelper.bufferInfo(y,I,D.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var P=this.fragmentTracker.getBufferedFrag(I,S);if(P&&A.nextStart<P.end)return j.BufferHelper.bufferInfo(y,I,Math.max(A.nextStart,D.maxBufferHole))}return A},d.getMaxBufferLength=function(y){var S=this.config,D;return y?D=Math.max(8*S.maxBufferSize/y,S.maxBufferLength):D=S.maxBufferLength,Math.min(D,S.maxMaxBufferLength)},d.reduceMaxBufferLength=function(y){var S=this.config,D=y||S.maxBufferLength;return S.maxMaxBufferLength>=D?(S.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+S.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(y,S){var D,I,A=S.fragments,P=A.length;if(!P)return null;var H=this.config,R=A[0].start,K;if(S.live){var V=H.initialLiveManifestSize;if(P<V)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+V+")"),null;!S.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(K=this.getInitialLiveFragment(S,A),this.startPosition=K?this.hls.liveSyncPosition||K.start:y)}else y<=R&&(K=A[0]);if(!K){var oe=H.lowLatencyMode?S.partEnd:S.fragmentEnd;K=this.getFragmentAtPosition(y,oe,S)}return(D=K)!==null&&D!==void 0&&D.initSegment&&!((I=K)!==null&&I!==void 0&&I.initSegment.data)&&!this.bitrateTest&&(K=K.initSegment),K},d.getNextPart=function(y,S,D){for(var I=-1,A=!1,P=!0,H=0,R=y.length;H<R;H++){var K=y[H];if(P=P&&!K.independent,I>-1&&D<K.start)break;var V=K.loaded;!V&&(A||K.independent||P)&&K.fragment===S&&(I=H),A=V}return I},d.loadedEndOfParts=function(y,S){var D=y[y.length-1];return D&&S>D.start&&D.loaded},d.getInitialLiveFragment=function(y,S){var D=this.fragPrevious,I=null;if(D){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),I=Object(a.findFragmentByPDT)(S,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var A=D.sn+1;if(A>=y.startSN&&A<=y.endSN){var P=S[A-y.startSN];D.cc===P.cc&&(I=P,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(a.findFragWithCC)(S,D.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?y.fragmentEnd:y.edge,y))}return I},d.getFragmentAtPosition=function(y,S,D){var I=this.config,A=this.fragPrevious,P=D.fragments,H=D.endSN,R=D.fragmentHint,K=I.maxFragLookUpTolerance,V=!!(I.lowLatencyMode&&D.partList&&R);V&&R&&!this.bitrateTest&&(P=P.concat(R),H=R.sn);var oe;if(y<S){var Q=y>S-K?0:K;oe=Object(a.findFragmentByPTS)(A,P,y,Q)}else oe=P[P.length-1];if(oe){var pe=oe.sn-D.startSN,ce=A&&oe.level===A.level,ee=P[pe+1],ne=this.fragmentTracker.getState(oe);if(ne===L.FragmentState.BACKTRACKED){oe=null;for(var me=pe;P[me]&&this.fragmentTracker.getState(P[me])===L.FragmentState.BACKTRACKED;)A?oe=P[me--]:oe=P[--me];oe||(oe=ee)}else A&&oe.sn===A.sn&&!V&&(ce&&(oe.sn<H&&this.fragmentTracker.getState(ee)!==L.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+ee.sn),oe=ee):oe=null))}return oe},d.synchronizeToLiveEdge=function(y){var S=this.config,D=this.media;if(!D)return;var I=this.hls.liveSyncPosition,A=D.currentTime,P=y.fragments[0].start,H=y.edge,R=A>=P-S.maxFragLookUpTolerance&&A<=H;if(I!==null&&D.duration>I&&(A<I||!R)){var K=S.liveMaxLatencyDuration!==void 0?S.liveMaxLatencyDuration:S.liveMaxLatencyDurationCount*y.targetduration;(!R&&D.readyState<4||A<H-K)&&(this.loadedmetadata||(this.nextLoadPosition=I),D.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)),D.currentTime=I))}},d.alignPlaylists=function(y,S){var D=this.levels,I=this.levelLastLoaded,A=this.fragPrevious,P=I!==null?D[I]:null,H=y.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var R=y.fragments[0].start,K=!S,V=y.alignedSliding&&Object(M.isFiniteNumber)(R);if(K||!V&&!R){Object(u.alignStream)(A,P,y);var oe=y.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(S?S.startSN:"na")+"->"+y.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+H),oe}return R},d.waitForCdnTuneIn=function(y){var S=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*S)},d.setStartPosition=function(y,S){var D=this.startPosition;if(D<S&&(D=-1),D===-1||this.lastCurrentTime===-1){var I=y.startTimeOffset;Object(M.isFiniteNumber)(I)?(D=S+I,I<0&&(D+=y.totalduration),D=Math.min(Math.max(S,D),S+y.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+D),this.startPosition=D):y.live?D=this.hls.liveSyncPosition||S:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},d.getLoadPosition=function(){var y=this.media,S=0;return this.loadedmetadata&&y?S=y.currentTime:this.nextLoadPosition&&(S=this.nextLoadPosition),S},d.handleFragLoadAborted=function(y,S){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(S?" part"+S.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},d.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=_.IDLE)},d.onFragmentOrKeyLoadError=function(y,S){if(S.fatal)return;var D=S.frag;if(!D||D.type!==y)return;var I=this.fragCurrent;console.assert(I&&D.sn===I.sn&&D.level===I.level&&D.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(D.level))return;var P=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+D.sn+" of "+y+" "+D.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?(y===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(U.logger.error(S.details+" reaches max retry, redispatch as fatal ..."),S.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},d.afterBufferFlushed=function(y,S,D){if(!y)return;var I=j.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(S,I,D),this.state===_.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},d.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var S=this.levels?this.levels[y].details:null;if(S!=null&&S.live)return this.startPosition=-1,this.setStartPosition(S,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(y,S,D,I){var A=this,P=D.details;console.assert(!!P,"level.details must be defined");var H=Object.keys(y.elementaryStreams).reduce(function(R,K){var V=y.elementaryStreams[K];if(V){var oe=V.endPTS-V.startPTS;if(oe<=0)return A.warn("Could not parse fragment "+y.sn+" "+K+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),R||!1;var Q=I?0:Object(i.updateFragPTSDTS)(P,y,V.startPTS,V.endPTS,V.startDTS,V.endDTS);return A.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:P,level:D,drift:Q,type:K,frag:y,start:V.startPTS,end:V.endPTS}),!0}return R},!1);H?(this.state=_.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:y,part:S})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(l,[{key:"state",get:function(){return this._state},set:function(y){var S=this._state;S!==y&&(this._state=y,this.log(S+"->"+y))}}]),l}(w.default)},"./src/controller/buffer-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return a});var M=O("./src/polyfills/number.ts"),w=O("./src/events.ts"),L=O("./src/utils/logger.ts"),j=O("./src/errors.ts"),U=O("./src/utils/buffer-helper.ts"),e=O("./src/utils/mediasource-helper.ts"),C=O("./src/loader/fragment.ts"),g=O("./src/controller/buffer-operation-queue.ts"),h=Object(e.getMediaSource)(),u=/([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,v=r.mediaSource;L.logger.log("[buffer-controller]: Media source opened"),t&&(r.updateMediaElementDuration(),n.trigger(w.Events.MEDIA_ATTACHED,{media:t})),v&&v.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){L.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){L.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var c=i.prototype;return c.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},c.destroy=function(){this.unregisterListeners(),this.details=null},c.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)},c.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)},c._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},c.onManifestParsed=function(r,n){var t=2;(n.audio&&!n.video||!n.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,L.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},c.onMediaAttaching=function(r,n){var t=this.media=n.media;if(t&&h){var v=this.mediaSource=new h;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(v),this._objectUrl=t.src}},c.onMediaDetaching=function(){var r=this.media,n=this.mediaSource,t=this._objectUrl;if(n){if(L.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(v){L.logger.warn("[buffer-controller]: onMediaDetaching: "+v.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()):L.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)},c.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(v){L.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",v)}}),this._initSourceBuffer()},c.onBufferCodecs=function(r,n){var t=this,v=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(p){if(v){var m=t.tracks[p];if(m&&typeof m.buffer.changeType=="function"){var b=n[p],_=b.codec,o=b.levelCodec,f=b.container,l=(m.levelCodec||m.codec).replace(u,"$1"),d=(o||_).replace(u,"$1");if(l!==d){var E=f+";codecs="+(o||_);t.appendChangeType(p,E)}}}else t.pendingTracks[p]=n[p]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},c.appendChangeType=function(r,n){var t=this,v=this.operationQueue,p={execute:function(){var b=t.sourceBuffer[r];b&&(L.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+n),b.changeType(n)),v.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(b){L.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",b)}};v.append(p,r)},c.onBufferAppending=function(r,n){var t=this,v=this.hls,p=this.operationQueue,m=this.tracks,b=n.data,_=n.type,o=n.frag,f=n.part,l=n.chunkMeta,d=l.buffering[_],E=self.performance.now();d.start=E;var y=o.stats.buffering,S=f?f.stats.buffering:null;y.start===0&&(y.start=E),S&&S.start===0&&(S.start=E);var D=m.audio,I=_==="audio"&&l.id===1&&(D==null?void 0:D.container)==="audio/mpeg",A={execute:function(){if(d.executeStart=self.performance.now(),I){var H=t.sourceBuffer[_];if(H){var R=o.start-H.timestampOffset;Math.abs(R)>=.1&&(L.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+o.start+" (delta: "+R+") sn: "+o.sn+")"),H.timestampOffset=o.start)}}t.appendExecutor(b,_)},onStart:function(){},onComplete:function(){var H=self.performance.now();d.executeEnd=d.end=H,y.first===0&&(y.first=H),S&&S.first===0&&(S.first=H);var R=t.sourceBuffer,K={};for(var V in R)K[V]=U.BufferHelper.getBuffered(R[V]);t.appendError=0,t.hls.trigger(w.Events.BUFFER_APPENDED,{type:_,frag:o,part:f,chunkMeta:l,parent:o.type,timeRanges:K})},onError:function(H){L.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",H);var R={type:j.ErrorTypes.MEDIA_ERROR,parent:o.type,details:j.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=j.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,R.details=j.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>v.config.appendErrorMaxRetry&&(L.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),R.fatal=!0)),v.trigger(w.Events.ERROR,R)}};p.append(A,_)},c.onBufferFlushing=function(r,n){var t=this,v=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(o){L.logger.warn("[buffer-controller]: Failed to remove from "+b+" SourceBuffer",o)}}};n.type?v.append(p(n.type),n.type):this.getSourceBufferTypes().forEach(function(m){v.append(p(m),m)})},c.onFragParsed=function(r,n){var t=this,v=n.frag,p=n.part,m=[],b=p?p.elementaryStreams:v.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();v.stats.buffering.end=f,p&&(p.stats.buffering.end=f);var l=p?p.stats:v.stats;t.hls.trigger(w.Events.FRAG_BUFFERED,{frag:v,part:p,stats:l,id:v.type})};m.length===0&&L.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(_,m)},c.onFragChanged=function(r,n){this.flushBackBuffer()},c.onBufferEos=function(r,n){var t=this,v=this.getSourceBufferTypes().reduce(function(p,m){var b=t.sourceBuffer[m];return(!n.type||n.type===m)&&(b&&!b.ended&&(b.ended=!0,L.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),p&&!!(!b||b.ended)},!0);v&&this.blockBuffers(function(){var p=t.mediaSource;if(!p||p.readyState!=="open")return;p.endOfStream()})},c.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()},c.flushBackBuffer=function(){var r=this.hls,n=this.details,t=this.media,v=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(M.isFiniteNumber)(m)||m<0)return;var b=t.currentTime,_=n.levelTargetDuration,o=Math.max(m,_),f=Math.floor(b/_)*_-o;p.forEach(function(l){var d=v[l];if(d){var E=U.BufferHelper.getBuffered(d);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:l}))}})},c.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,n=this.hls,t=this.media,v=this.mediaSource,p=r.fragments[0].start+r.totalduration,m=t.duration,b=Object(M.isFiniteNumber)(v.duration)?v.duration:0;r.live&&n.config.liveDurationInfinity?(L.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(r)):(p>b&&p>m||!Object(M.isFiniteNumber)(m))&&(L.logger.log("[buffer-controller]: Updating Media Source duration to "+p.toFixed(3)),v.duration=p)},c.updateSeekableRange=function(r){var n=this.mediaSource,t=r.fragments,v=t.length;if(v&&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)}},c.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,n=this.operationQueue,t=this.pendingTracks,v=Object.keys(t).length;if(v&&!r||v===2){this.createSourceBuffers(t),this.pendingTracks={};var p=this.getSourceBufferTypes();if(p.length===0){this.hls.trigger(w.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}p.forEach(function(m){n.executeNext(m)})}},c.createSourceBuffers=function(r){var n=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var v=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;L.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var o=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:o,codec:b,container:m.container,levelCodec:m.levelCodec,id:m.id},v++}catch(l){L.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+l.message),this.hls.trigger(w.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:_})}}v&&this.hls.trigger(w.Events.BUFFER_CREATED,{tracks:this.tracks})},c._onSBUpdateStart=function(r){var n=this.operationQueue,t=n.current(r);t.onStart()},c._onSBUpdateEnd=function(r){var n=this.operationQueue,t=n.current(r);t.onComplete(),n.shiftAndExecuteNext(r)},c._onSBUpdateError=function(r,n){L.logger.error("[buffer-controller]: "+r+" SourceBuffer error",n),this.hls.trigger(w.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(r);t&&t.onError(n)},c.removeExecutor=function(r,n,t){var v=this.media,p=this.mediaSource,m=this.operationQueue,b=this.sourceBuffer,_=b[r];if(!v||!p||!_){L.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(r);return}var o=Object(M.isFiniteNumber)(v.duration)?v.duration:Infinity,f=Object(M.isFiniteNumber)(p.duration)?p.duration:Infinity,l=Math.max(0,n),d=Math.min(t,o,f);d>l?(L.logger.log("[buffer-controller]: Removing ["+l+","+d+"] from the "+r+" SourceBuffer"),console.assert(!_.updating,r+" sourceBuffer must not be updating"),_.remove(l,d)):m.shiftAndExecuteNext(r)},c.appendExecutor=function(r,n){var t=this.operationQueue,v=this.sourceBuffer,p=v[n];if(!p){L.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)},c.blockBuffers=function(r,n){var t=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){L.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var v=this.operationQueue,p=n.map(function(m){return v.appendBlocker(m)});Promise.all(p).then(function(){r(),n.forEach(function(m){var b=t.sourceBuffer[m];(!b||!b.updating)&&v.shiftAndExecuteNext(m)})})},c.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},c.addBufferListener=function(r,n,t){var v=this.sourceBuffer[r];if(!v)return;var p=t.bind(this,r);this.listeners[r].push({event:n,listener:p}),v.addEventListener(n,p)},c.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(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return w});var M=O("./src/utils/logger.ts"),w=function(){function L(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var j=L.prototype;return j.append=function(e,C){var g=this.queues[C];g.push(e),g.length===1&&this.buffers[C]&&this.executeNext(C)},j.insertAbort=function(e,C){var g=this.queues[C];g.unshift(e),this.executeNext(C)},j.appendBlocker=function(e){var C,g=new Promise(function(u){C=u}),h={execute:C,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(h,e),g},j.executeNext=function(e){var C=this.buffers,g=this.queues,h=C[e],u=g[e];if(u.length){var a=u[0];try{a.execute()}catch(i){M.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(i),(!h||!h.updating)&&(u.shift(),this.executeNext(e))}}},j.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},j.current=function(e){return this.queues[e][0]},L}()},"./src/controller/cap-level-controller.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/events.ts");function w(U,e){for(var C=0;C<e.length;C++){var g=e[C];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(U,g.key,g)}}function L(U,e,C){return e&&w(U.prototype,e),C&&w(U,C),U}var j=function(){function U(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=U.prototype;return e.setStreamController=function(g){this.streamController=g},e.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},e.registerListeners=function(){var g=this.hls;g.on(M.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var g=this.hls;g.off(M.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(g,h){U.isLevelAllowed(h.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(h.droppedLevel)},e.onMediaAttaching=function(g,h){this.media=h.media instanceof HTMLVideoElement?h.media:null},e.onManifestParsed=function(g,h){var u=this.hls;this.restrictedLevels=[],this.firstLevel=h.firstLevel,u.config.capLevelToPlayerSize&&h.video&&this.startCapping()},e.onBufferCodecs=function(g,h){var u=this.hls;u.config.capLevelToPlayerSize&&h.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var h=this.hls;h.autoLevelCapping=this.getMaxLevel(g.length-1),h.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=h.autoLevelCapping}}},e.getMaxLevel=function(g){var h=this,u=this.hls.levels;if(!u.length)return-1;var a=u.filter(function(i,c){return U.isLevelAllowed(c,h.restrictedLevels)&&c<=g});return this.clientRect=null,U.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},e.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},e.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},e.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,h={width:0,height:0};if(g){var u=g.getBoundingClientRect();h.width=u.width,h.height=u.height,!h.width&&!h.height&&(h.width=u.right-u.left||g.width||0,h.height=u.bottom-u.top||g.height||0)}return this.clientRect=h,h},U.isLevelAllowed=function(g,h){return h===void 0&&(h=[]),h.indexOf(g)===-1},U.getMaxLevelByMediaSize=function(g,h,u){if(!g||!g.length)return-1;for(var a=function(n,t){return t?n.width!==t.width||n.height!==t.height:!0},i=g.length-1,c=0;c<g.length;c+=1){var s=g[c];if((s.width>=h||s.height>=u)&&a(s,g[c+1])){i=c;break}}return i},L(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(h){}return g}}]),U}();W.default=j},"./src/controller/cmcd-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return a});var M=O("./src/events.ts"),w=O("./src/types/cmcd.ts"),L=O("./src/utils/buffer-helper.ts"),j=O("./src/utils/logger.ts");function U(i,c){for(var s=0;s<c.length;s++){var r=c[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function e(i,c,s){return c&&U(i.prototype,c),s&&U(i,s),i}function C(i,c){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=g(i))||c&&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 g(i,c){if(!i)return;if(typeof i=="string")return h(i,c);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 h(i,c)}function h(i,c){(c==null||c>i.length)&&(c=i.length);for(var s=0,r=new Array(c);s<c;s++)r[s]=i[s];return r}function u(){return u=Object.assign||function(i){for(var c=1;c<arguments.length;c++){var s=arguments[c];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(i[r]=s[r])}return i},u.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(v){try{r.apply(v,{ot:w.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(p){j.logger.warn("Could not generate manifest CMCD data.",p)}},this.applyFragmentData=function(v){try{var p=v.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(v,_)}catch(o){j.logger.warn("Could not generate segment CMCD data.",o)}},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 c=i.prototype;return c.registerListeners=function(){var r=this.hls;r.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(M.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this)},c.unregisterListeners=function(){var r=this.hls;r.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(M.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},c.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},c.onMediaAttached=function(r,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},c.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},c.onBufferCreated=function(r,n){var t,v;this.audioBuffer=(t=n.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(v=n.tracks.video)===null||v===void 0?void 0:v.buffer},c.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}},c.apply=function(r,n){n===void 0&&(n={}),u(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 v=i.toHeaders(n);if(!Object.keys(v).length)return;r.headers||(r.headers={}),u(r.headers,v)}else{var p=i.toQuery(n);if(!p)return;r.url=i.appendQueryToUri(r.url,p)}},c.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},c.getTopBandwidth=function(r){for(var n=0,t=r===w.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=C(t),p;!(p=v()).done;){var m=p.value;m.bitrate>n&&(n=m.bitrate)}return n>0?n:NaN},c.getBufferLength=function(r){var n=this.hls.media,t=r===w.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!n)return NaN;var v=L.BufferHelper.bufferInfo(t,n.currentTime,this.config.maxBufferHole);return v.len*1e3},c.createPlaylistLoader=function(){var r=this.config.pLoader,n=this.applyPlaylistData,t=r||this.config.loader;return function(){function v(m){this.loader=void 0,this.loader=new t(m)}var p=v.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(b,_,o){n(b),this.loader.load(b,_,o)},e(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},c.createFragmentLoader=function(){var r=this.config.fLoader,n=this.applyFragmentData,t=r||this.config.loader;return function(){function v(m){this.loader=void 0,this.loader=new t(m)}var p=v.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(b,_,o){n(b),this.loader.load(b,_,o)},e(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},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},v=function(I){return Math.round(I)},p=function(I){return v(I/100)*100},m=function(I){return encodeURIComponent(I)},b={br:v,d:v,bl:p,dl:p,mtp:p,nor:m,rtp:p,tb:v},_=Object.keys(r||{}).sort(),o=C(_),f;!(f=o()).done;){var l=f.value,d=r[l];if(!t(d))continue;if(l==="v"&&d===1)continue;if(l=="pr"&&d===1)continue;var E=b[l];E&&(d=E(d));var y=typeof d,S=void 0;l==="ot"||l==="sf"||l==="st"?S=l+"="+d:y==="boolean"?S=l:y==="number"?S=l+"="+d:S=l+"="+JSON.stringify(d),n.push(S)}return n.join(",")},i.toHeaders=function(r){for(var n=Object.keys(r),t={},v=["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 o=_[b],f=m[o]!=null?m[o]:1;p[f][o]=r[o]}for(var l=0;l<p.length;l++){var d=i.serialize(p[l]);d&&(t["CMCD-"+v[l]]=d)}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(ie,W,O){"use strict";O.r(W);var M=O("./src/events.ts"),w=O("./src/errors.ts"),L=O("./src/utils/logger.ts"),j=O("./src/utils/mediakeys-helper.ts");function U(a,i){for(var c=0;c<i.length;c++){var s=i[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,i,c){return i&&U(a.prototype,i),c&&U(a,c),a}var C=3,g=function(i,c,s){var r={audioCapabilities:[],videoCapabilities:[]};return i.forEach(function(n){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:s.audioRobustness||""})}),c.forEach(function(n){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:s.videoRobustness||""})}),[r]},h=function(i,c,s,r){switch(i){case j.KeySystems.WIDEVINE:return g(c,s,r);default:throw new Error("Unknown key-system: "+i)}},u=function(){function a(c){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=c,this._config=c.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(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(M.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i._unregisterListeners=function(){this.hls.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(M.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i.getLicenseServerUrl=function(s){switch(s){case j.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},i._attemptKeySystemAccess=function(s,r,n){var t=this,v=h(s,r,n,this._drmSystemOptions);L.logger.log("Requesting encrypted media key-system access");var p=this.requestMediaKeySystemAccess(s,v);this.mediaKeysPromise=p.then(function(m){return t._onMediaKeySystemAccessObtained(s,m)}),p.catch(function(m){L.logger.error('Failed to obtain key-system "'+s+'" access:',m)})},i._onMediaKeySystemAccessObtained=function(s,r){var n=this;L.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var v=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(p){return t.mediaKeys=p,L.logger.log('Media-keys created for key-system "'+s+'"'),n._onMediaKeysCreated(),p});return v.catch(function(p){L.logger.error("Failed to create media-keys:",p)}),v},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;L.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(n){r._onKeySessionMessage(s,n.message)},!1)},i._onKeySessionMessage=function(s,r){L.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(n){L.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),s.update(n)})},i.onMediaEncrypted=function(s){var r=this;if(L.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(M.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(v){if(!r._media)return;r._attemptSetMediaKeys(v),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){L.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(M.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}L.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){L.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(M.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){L.logger.warn("Key-Session already initialized but requested again");return}var v=t.mediaKeysSession;if(!v){L.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(M.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){L.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(M.Events.ERROR,{type:w.ErrorTypes.KEY_SYSTEM_ERROR,details:w.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}L.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,v.generateRequest(s,r).then(function(){L.logger.debug("Key-session generation succeeded")}).catch(function(p){L.logger.error("Error generating key-session request:",p),n.hls.trigger(M.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 v=this._licenseXhrSetup;if(v)try{v.call(this.hls,t,s),v=void 0}catch(p){L.logger.error(p)}try{t.readyState||t.open("POST",s,!0),v&&v.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,L.logger.log("License request succeeded");var v=s.response,p=this._licenseResponseCallback;if(p)try{v=p.call(this.hls,s,r)}catch(b){L.logger.error(b)}t(v)}else{if(L.logger.error("License Request XHR failed ("+r+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>C){this.hls.trigger(M.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;L.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(n,t)}break}},i._generateLicenseRequestChallenge=function(s,r){switch(s.mediaKeySystemDomain){case j.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},i._requestLicense=function(s,r){L.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){L.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(M.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),v=this._createLicenseXhr(t,s,r);L.logger.log("Sending license request to URL: "+t);var p=this._generateLicenseRequestChallenge(n,s);v.send(p)}catch(m){L.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(M.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(v){return v.audioCodec}).filter(function(v){return!!v}),t=r.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(j.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=u},"./src/controller/fps-controller.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/events.ts"),w=O("./src/utils/logger.ts"),L=function(){function j(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}var U=j.prototype;return U.setStreamController=function(C){this.streamController=C},U.registerListeners=function(){this.hls.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(C,g){var h=this.hls.config;if(h.capLevelOnFPSDrop){var u=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=u,u&&typeof u.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),h.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(C,g,h){var u=performance.now();if(g){if(this.lastTime){var a=u-this.lastTime,i=h-this.lastDroppedFrames,c=g-this.lastDecodedFrames,s=1e3*i/a,r=this.hls;if(r.trigger(M.Events.FPS_DROP,{currentDropped:i,currentDecoded:c,totalDroppedFrames:h}),s>0&&i>r.config.fpsDroppedMonitoringThreshold*c){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(M.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:r.currentLevel}),r.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=u,this.lastDroppedFrames=h,this.lastDecodedFrames=g}},U.checkFPSInterval=function(){var C=this.media;if(C)if(this.isVideoPlaybackQualityAvailable){var g=C.getVideoPlaybackQuality();this.checkFPS(C,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(C,C.webkitDecodedFrameCount,C.webkitDroppedFrameCount)},j}();W.default=L},"./src/controller/fragment-finders.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"findFragmentByPDT",function(){return L}),O.d(W,"findFragmentByPTS",function(){return j}),O.d(W,"fragmentWithinToleranceTest",function(){return U}),O.d(W,"pdtWithinToleranceTest",function(){return e}),O.d(W,"findFragWithCC",function(){return C});var M=O("./src/polyfills/number.ts"),w=O("./src/utils/binary-search.ts");function L(g,h,u){if(h===null||!Array.isArray(g)||!g.length||!Object(M.isFiniteNumber)(h))return null;var a=g[0].programDateTime;if(h<(a||0))return null;var i=g[g.length-1].endProgramDateTime;if(h>=(i||0))return null;u=u||0;for(var c=0;c<g.length;++c){var s=g[c];if(e(h,u,s))return s}return null}function j(g,h,u,a){u===void 0&&(u=0),a===void 0&&(a=0);var i=null;if(g?i=h[g.sn-h[0].sn+1]||null:u===0&&h[0].start===0&&(i=h[0]),i&&U(u,a,i)===0)return i;var c=w.default.search(h,U.bind(null,u,a));return c||i}function U(g,h,u){g===void 0&&(g=0),h===void 0&&(h=0);var a=Math.min(h,u.duration+(u.deltaPTS?u.deltaPTS:0));return u.start+u.duration-a<=g?1:u.start-a>g&&u.start?-1:0}function e(g,h,u){var a=Math.min(h,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,i=u.endProgramDateTime||0;return i-a>g}function C(g,h){return w.default.search(g,function(u){return u.cc<h?1:u.cc>h?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"FragmentState",function(){return L}),O.d(W,"FragmentTracker",function(){return j});var M=O("./src/events.ts"),w=O("./src/types/loader.ts"),L;(function(C){C.NOT_LOADED="NOT_LOADED",C.BACKTRACKED="BACKTRACKED",C.APPENDING="APPENDING",C.PARTIAL="PARTIAL",C.OK="OK"})(L||(L={}));var j=function(){function C(h){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=h,this._registerListeners()}var g=C.prototype;return g._registerListeners=function(){var u=this.hls;u.on(M.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(M.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var u=this.hls;u.off(M.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(M.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(u,a){if(a===w.PlaylistLevelType.MAIN){var i=this.activeFragment,c=this.activeParts;if(!i)return null;if(c)for(var s=c.length;s--;){var r=c[s],n=r?r.end:i.appendedPTS;if(r.start<=u&&n!==void 0&&u<=n)return s>9&&(this.activeParts=c.slice(s-9)),r}else if(i.start<=u&&i.appendedPTS!==void 0&&u<=i.appendedPTS)return i}return this.getBufferedFrag(u,a)},g.getBufferedFrag=function(u,a){for(var i=this.fragments,c=Object.keys(i),s=c.length;s--;){var r=i[c[s]];if((r==null?void 0:r.body.type)===a&&r.buffered){var n=r.body;if(n.start<=u&&u<=n.end)return n}}return null},g.detectEvictedFragments=function(u,a,i){var c=this;Object.keys(this.fragments).forEach(function(s){var r=c.fragments[s];if(!r)return;if(!r.buffered){r.body.type===i&&c.removeFragment(r.body);return}var n=r.range[u];if(!n)return;n.time.some(function(t){var v=!c.isTimeBuffered(t.startPTS,t.endPTS,a);return v&&c.removeFragment(r.body),v})})},g.detectPartialFragments=function(u){var a=this,i=this.timeRanges,c=u.frag,s=u.part;if(!i||c.sn==="initSegment")return;var r=e(c),n=this.fragments[r];if(!n)return;Object.keys(i).forEach(function(t){var v=c.elementaryStreams[t];if(!v)return;var p=i[t],m=s!==null||v.partial===!0;n.range[t]=a.getBufferedTimes(c,s,m,p)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},g.fragBuffered=function(u){var a=e(u),i=this.fragments[a];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},g.getBufferedTimes=function(u,a,i,c){for(var s={time:[],partial:i},r=a?a.start:u.start,n=a?a.end:u.end,t=u.minEndPTS||n,v=u.maxStartPTS||r,p=0;p<c.length;p++){var m=c.start(p)-this.bufferPadding,b=c.end(p)+this.bufferPadding;if(v>=m&&t<=b){s.time.push({startPTS:Math.max(r,c.start(p)),endPTS:Math.min(n,c.end(p))});break}else if(r<b&&n>m)s.partial=!0,s.time.push({startPTS:Math.max(r,c.start(p)),endPTS:Math.min(n,c.end(p))});else if(n<=m)break}return s},g.getPartialFragment=function(u){var a=null,i,c,s,r=0,n=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(v){var p=t[v];if(!p)return;U(p)&&(c=p.body.start-n,s=p.body.end+n,u>=c&&u<=s&&(i=Math.min(u-c,s-u),r<=i&&(a=p.body,r=i)))}),a},g.getState=function(u){var a=e(u),i=this.fragments[a];return i?i.buffered?U(i)?L.PARTIAL:L.OK:i.backtrack?L.BACKTRACKED:L.APPENDING:L.NOT_LOADED},g.backtrack=function(u,a){var i=e(u),c=this.fragments[i];if(!c||c.backtrack)return null;var s=c.backtrack=a||c.loaded;return c.loaded=null,s},g.getBacktrackData=function(u){var a=e(u),i=this.fragments[a];if(i){var c,s=i.backtrack;if(s!=null&&(c=s.payload)!==null&&c!==void 0&&c.byteLength)return s;this.removeFragment(u)}return null},g.isTimeBuffered=function(u,a,i){for(var c,s,r=0;r<i.length;r++){if(c=i.start(r)-this.bufferPadding,s=i.end(r)+this.bufferPadding,u>=c&&a<=s)return!0;if(a<=c)return!1}return!1},g.onFragLoaded=function(u,a){var i=a.frag,c=a.part;if(i.sn==="initSegment"||i.bitrateTest||c)return;var s=e(i);this.fragments[s]={body:i,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(u,a){var i=this,c=a.frag,s=a.part,r=a.timeRanges;if(c.type===w.PlaylistLevelType.MAIN)if(this.activeFragment=c,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 v=r[t];if(i.detectEvictedFragments(t,v),!s)for(var p=0;p<v.length;p++)c.appendedPTS=Math.max(v.end(p),c.appendedPTS||0)})},g.onFragBuffered=function(u,a){this.detectPartialFragments(a)},g.hasFragment=function(u){var a=e(u);return!!this.fragments[a]},g.removeFragmentsInRange=function(u,a,i){var c=this;Object.keys(this.fragments).forEach(function(s){var r=c.fragments[s];if(!r)return;if(r.buffered){var n=r.body;n.type===i&&n.start<a&&n.end>u&&c.removeFragment(n)}})},g.removeFragment=function(u){var a=e(u);u.stats.loaded=0,u.clearElementaryStreamInfo(),delete this.fragments[a]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},C}();function U(C){var g,h;return C.buffered&&(((g=C.range.video)===null||g===void 0?void 0:g.partial)||((h=C.range.audio)===null||h===void 0?void 0:h.partial))}function e(C){return C.type+"_"+C.level+"_"+C.urlId+"_"+C.sn}},"./src/controller/gap-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"STALL_MINIMUM_DURATION_MS",function(){return U}),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 g}),O.d(W,"default",function(){return h});var M=O("./src/utils/buffer-helper.ts"),w=O("./src/errors.ts"),L=O("./src/events.ts"),j=O("./src/utils/logger.ts"),U=250,e=2,C=.1,g=.05,h=function(){function u(i,c,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=c,this.fragmentTracker=s,this.hls=r}var a=u.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(c){var s=this.config,r=this.media,n=this.stalled,t=r.currentTime,v=r.seeking,p=this.seeking&&!v,m=!this.seeking&&v;if(this.seeking=v,t!==c){if(this.moved=!0,n!==null){if(this.stallReported){var b=self.performance.now()-n;j.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||!M.BufferHelper.getBuffered(r).length)return;var _=M.BufferHelper.bufferInfo(r,t,0),o=_.len>0,f=_.nextStart||0;if(!o&&!f)return;if(v){var l=_.len>e,d=!f||f-t>e&&!this.fragmentTracker.getPartialFragment(t);if(l||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,y=Math.max(f,_.start||0)-t,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,D=S==null||((E=S.details)===null||E===void 0)?void 0:E.live,I=D?S.details.targetduration*2:e;if(y>0&&y<=I){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(n===null){this.stalled=A;return}var P=A-n;!v&&P>=U&&this._reportStall(_.len);var H=M.BufferHelper.bufferInfo(r,t,s.maxBufferHole);this._tryFixBufferStall(H,P)},a._tryFixBufferStall=function(c,s){var r=this.config,n=this.fragmentTracker,t=this.media,v=t.currentTime,p=n.getPartialFragment(v);if(p){var m=this._trySkipBufferHole(p);if(m)return}c.len>r.maxBufferHole&&s>r.highBufferWatchdogPeriod*1e3&&(j.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(c){var s=this.hls,r=this.media,n=this.stallReported;n||(this.stallReported=!0,j.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+c+")"),s.trigger(L.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:c}))},a._trySkipBufferHole=function(c){for(var s=this.config,r=this.hls,n=this.media,t=n.currentTime,v=0,p=M.BufferHelper.getBuffered(n),m=0;m<p.length;m++){var b=p.start(m);if(t+s.maxBufferHole>=v&&t<b){var _=Math.max(b+g,n.currentTime+C);return j.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+_),this.moved=!0,this.stalled=null,n.currentTime=_,c&&r.trigger(L.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:c}),_}v=p.end(m)}return 0},a._tryNudgeBuffer=function(){var c=this.config,s=this.hls,r=this.media,n=r.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<c.nudgeMaxRetry){var v=n+t*c.nudgeOffset;j.logger.warn("Nudging 'currentTime' from "+n+" to "+v),r.currentTime=v,s.trigger(L.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+c.nudgeMaxRetry+" nudges"),s.trigger(L.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},u}()},"./src/controller/id3-track-controller.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/events.ts"),w=O("./src/utils/texttrack-utils.ts"),L=O("./src/demux/id3.ts"),j=.25,U=function(){function e(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var C=e.prototype;return C.destroy=function(){this._unregisterListeners()},C._registerListeners=function(){var h=this.hls;h.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(M.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var h=this.hls;h.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(M.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),h.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.onMediaAttached=function(h,u){this.media=u.media},C.onMediaDetaching=function(){if(!this.id3Track)return;Object(w.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},C.getID3Track=function(h){if(!this.media)return;for(var u=0;u<h.length;u++){var a=h[u];if(a.kind==="metadata"&&a.label==="id3")return Object(w.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},C.onFragParsingMetadata=function(h,u){if(!this.media)return;var a=u.frag,i=u.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var c=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<i.length;s++){var r=L.getID3Frames(i[s].data);if(r){var n=i[s].pts,t=s<i.length-1?i[s+1].pts:a.end,v=t-n;v<=0&&(t=n+j);for(var p=0;p<r.length;p++){var m=r[p];if(!L.isTimeStampFrame(m)){var b=new c(n,t,"");b.value=m,this.id3Track.addCue(b)}}}}},C.onBufferFlushing=function(h,u){var a=u.startOffset,i=u.endOffset,c=u.type;if(!c||c==="audio"){var s=this.id3Track;s&&Object(w.removeCuesInRange)(s,a,i)}},e}();W.default=U},"./src/controller/latency-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return e});var M=O("./src/errors.ts"),w=O("./src/events.ts"),L=O("./src/utils/logger.ts");function j(C,g){for(var h=0;h<g.length;h++){var u=g[h];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(C,u.key,u)}}function U(C,g,h){return g&&j(C.prototype,g),h&&j(C,h),C}var e=function(){function C(h){var u=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 u.timeupdate()},this.hls=h,this.config=h.config,this.registerListeners()}var g=C.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(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)},g.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)},g.onMediaAttached=function(u,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(u,a){var i=a.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(u,a){if(a.details!==M.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,L.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var u=this.media,a=this.levelDetails;if(!u||!a)return;this.currentTime=u.currentTime;var i=this.computeLatency();if(i===null)return;this._latency=i;var c=this.config,s=c.lowLatencyMode,r=c.maxLiveSyncPlaybackRate;if(!s||r===1)return;var n=this.targetLatency;if(n===null)return;var t=i-n,v=Math.min(this.maxLatency,n+a.targetduration),p=t<v;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;u.playbackRate=Math.min(m,Math.max(1,b))}else u.playbackRate!==1&&u.playbackRate!==0&&(u.playbackRate=1)},g.estimateLiveEdge=function(){var u=this.levelDetails;return u===null?null:u.edge+u.age},g.computeLatency=function(){var u=this.estimateLiveEdge();return u===null?null:u-this.currentTime},U(C,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var u=this.config,a=this.levelDetails;return u.liveMaxLatencyDuration!==void 0?u.liveMaxLatencyDuration:a?u.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var u=this.levelDetails;if(u===null)return null;var a=u.holdBack,i=u.partHoldBack,c=u.targetduration,s=this.config,r=s.liveSyncDuration,n=s.liveSyncDurationCount,t=s.lowLatencyMode,v=this.hls.userConfig,p=t&&i||a;(v.liveSyncDuration||v.liveSyncDurationCount||p===0)&&(p=r!==void 0?r:n*c);var m=c,b=1;return p+Math.min(this.stallCount*b,m)}},{key:"liveSyncPosition",get:function(){var u=this.estimateLiveEdge(),a=this.targetLatency,i=this.levelDetails;if(u===null||a===null||i===null)return null;var c=i.edge,s=u-a-this.edgeStalled,r=c-i.totalduration,n=c-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(r,s),n)}},{key:"drift",get:function(){var u=this.levelDetails;return u===null?1:u.drift}},{key:"edgeStalled",get:function(){var u=this.levelDetails;if(u===null)return 0;var a=(this.config.lowLatencyMode&&u.partTarget||u.targetduration)*3;return Math.max(u.age-a,0)}},{key:"forwardBufferLength",get:function(){var u=this.media,a=this.levelDetails;if(!u||!a)return 0;var i=u.buffered.length;return i?u.buffered.end(i-1):a.edge-this.currentTime}}]),C}()},"./src/controller/level-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return s});var M=O("./src/types/level.ts"),w=O("./src/events.ts"),L=O("./src/errors.ts"),j=O("./src/utils/codecs.ts"),U=O("./src/controller/level-helper.ts"),e=O("./src/controller/base-playlist-controller.ts"),C=O("./src/types/loader.ts");function g(){return g=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(r[v]=t[v])}return r},g.apply(this,arguments)}function h(r,n){for(var t=0;t<n.length;t++){var v=n[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(r,v.key,v)}}function u(r,n,t){return n&&h(r.prototype,n),t&&h(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(v,p){return v.__proto__=p,v},i(r,n)}var c=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(r){a(n,r);function n(v){var p;return p=r.call(this,v,"[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=[],_=[],o=[],f,l={},d,E=!1,y=!1,S=!1;if(m.levels.forEach(function(P){var H=P.attrs;E=E||!!(P.width&&P.height),y=y||!!P.videoCodec,S=S||!!P.audioCodec,c&&P.audioCodec&&P.audioCodec.indexOf("mp4a.40.34")!==-1&&(P.audioCodec=void 0);var R=P.bitrate+"-"+P.attrs.RESOLUTION+"-"+P.attrs.CODECS;d=l[R],d?d.url.push(P.url):(d=new M.Level(P),l[R]=d,b.push(d)),H&&(H.AUDIO&&Object(U.addGroupId)(d,"audio",H.AUDIO),H.SUBTITLES&&Object(U.addGroupId)(d,"text",H.SUBTITLES))}),(E||y)&&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(j.isCodecSupportedInMp4)(H,"audio"))&&(!R||Object(j.isCodecSupportedInMp4)(R,"video"))}),m.audioTracks&&(_=m.audioTracks.filter(function(P){return!P.audioCodec||Object(j.isCodecSupportedInMp4)(P.audioCodec,"audio")}),Object(U.assignTrackIdsByGroup)(_)),m.subtitles&&(o=m.subtitles,Object(U.assignTrackIdsByGroup)(o)),b.length>0){f=b[0].bitrate,b.sort(function(P,H){return P.bitrate-H.bitrate}),this._levels=b;for(var D=0;D<b.length;D++)if(b[D].bitrate===f){this._firstLevel=D,this.log("manifest loaded, "+b.length+" level(s) found, first bitrate: "+f);break}var I=S&&!y,A={levels:b,audioTracks:_,subtitleTracks:o,firstLevel:this._firstLevel,stats:m.stats,audio:S,video:y,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:L.ErrorTypes.MEDIA_ERROR,details:L.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 o=!1,f=!0,l;switch(m.details){case L.ErrorDetails.FRAG_LOAD_ERROR:case L.ErrorDetails.FRAG_LOAD_TIMEOUT:case L.ErrorDetails.KEY_LOAD_ERROR:case L.ErrorDetails.KEY_LOAD_TIMEOUT:if(m.frag){var d=this._levels[m.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(l=m.frag.level)):l=m.frag.level}break;case L.ErrorDetails.LEVEL_LOAD_ERROR:case L.ErrorDetails.LEVEL_LOAD_TIMEOUT:b&&(b.deliveryDirectives&&(f=!1),l=b.level),o=!0;break;case L.ErrorDetails.REMUX_ALLOC_ERROR:l=m.level,o=!0;break}l!==void 0&&this.recoverLevel(m,l,o,f)},t.recoverLevel=function(p,m,b,_){var o=p.details,f=this._levels[m];if(f.loadError++,b){var l=this.retryLoadingOrFail(p);if(l)p.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var d=f.url.length;if(d>1&&f.loadError<d)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(o+": 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(o){o.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,o=m.details,f=this._levels[_];if(!f){var l;this.warn("Invalid level index "+_),(l=m.deliveryDirectives)!==null&&l!==void 0&&l.skip&&(o.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&&(o.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(p,m){var b=this.hls.levels[this.currentLevelIndex];if(!b)return;if(b.audioGroupIds){for(var _=-1,o=this.hls.audioTracks[m.id].groupId,f=0;f<b.audioGroupIds.length;f++)if(b.audioGroupIds[f]===o){_=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,o=b.url[_];if(p)try{o=p.addDirectives(o)}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 "+_+" "+o),this.clearTimer(),this.hls.trigger(w.Events.LEVEL_LOADING,{url:o,level:m,id:_,deliveryDirectives:p||null})}},t.removeLevel=function(p,m){var b=function(f,l){return l!==m},_=this._levels.filter(function(o,f){return f!==p?!0:o.url.length>1&&m!==void 0?(o.url=o.url.filter(b),o.audioGroupIds&&(o.audioGroupIds=o.audioGroupIds.filter(b)),o.textGroupIds&&(o.textGroupIds=o.textGroupIds.filter(b)),o.urlId=0,!0):!1}).map(function(o,f){var l=o.details;return l!=null&&l.fragments&&l.fragments.forEach(function(d){d.level=f}),o});this._levels=_,this.hls.trigger(w.Events.LEVELS_UPDATED,{levels:_})},u(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:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.LEVEL_SWITCH_ERROR,level:p,fatal:_,reason:"invalid level idx"}),_)return;p=Math.min(p,b.length-1)}this.clearTimer();var o=this.currentLevelIndex,f=b[o],l=b[p];this.log("switching to level "+p+" from "+o),this.currentLevelIndex=p;var d=g({},l,{level:p,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete d._urlId,this.hls.trigger(w.Events.LEVEL_SWITCHING,d);var E=l.details;if(!E||E.live){var y=this.switchParams(l.uri,f==null?void 0:f.details);this.loadPlaylist(y)}}},{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(ie,W,O){"use strict";O.r(W),O.d(W,"addGroupId",function(){return L}),O.d(W,"assignTrackIdsByGroup",function(){return j}),O.d(W,"updatePTS",function(){return U}),O.d(W,"updateFragPTSDTS",function(){return C}),O.d(W,"mergeDetails",function(){return g}),O.d(W,"mapPartIntersection",function(){return h}),O.d(W,"mapFragmentIntersection",function(){return u}),O.d(W,"adjustSliding",function(){return a}),O.d(W,"addSliding",function(){return i}),O.d(W,"computeReloadInterval",function(){return c}),O.d(W,"getFragmentWithSN",function(){return s}),O.d(W,"getPartWith",function(){return r});var M=O("./src/polyfills/number.ts"),w=O("./src/utils/logger.ts");function L(n,t,v){switch(t){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(v);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(v);break}}function j(n){var t={};n.forEach(function(v){var p=v.groupId||"";v.id=t[p]=t[p]||0,t[p]++})}function U(n,t,v){var p=n[t],m=n[v];e(p,m)}function e(n,t){var v=t.startPTS;if(Object(M.isFiniteNumber)(v)){var p=0,m;t.sn>n.sn?(p=v-n.start,m=n):(p=n.start-v,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,v,p,m,b){var _=p-v;_<=0&&(w.logger.warn("Fragment should have a positive duration",t),p=v+t.duration,b=m+t.duration);var o=v,f=p,l=t.startPTS,d=t.endPTS;if(Object(M.isFiniteNumber)(l)){var E=Math.abs(l-v);Object(M.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(E,t.deltaPTS):t.deltaPTS=E,o=Math.max(v,l),v=Math.min(v,l),m=Math.min(m,t.startDTS),f=Math.min(p,d),p=Math.max(p,d),b=Math.max(b,t.endDTS)}t.duration=p-v;var y=v-t.start;t.appendedPTS=p,t.start=t.startPTS=v,t.maxStartPTS=o,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 D,I=S-n.startSN,A=n.fragments;for(A[I]=t,D=I;D>0;D--)e(A[D],A[D-1]);for(D=I;D<A.length-1;D++)e(A[D],A[D+1]);return n.fragmentHint&&e(A[A.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,y}function g(n,t){for(var v=null,p=n.fragments,m=p.length-1;m>=0;m--){var b=p[m].initSegment;if(b){v=b;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var _=0,o;if(u(n,t,function(D,I){D.relurl&&(_=D.cc-I.cc),Object(M.isFiniteNumber)(D.startPTS)&&Object(M.isFiniteNumber)(D.endPTS)&&(I.start=I.startPTS=D.startPTS,I.startDTS=D.startDTS,I.appendedPTS=D.appendedPTS,I.maxStartPTS=D.maxStartPTS,I.endPTS=D.endPTS,I.endDTS=D.endDTS,I.minEndPTS=D.minEndPTS,I.duration=D.endPTS-D.startPTS,I.duration&&(o=I),t.PTSKnown=t.alignedSliding=!0),I.elementaryStreams=D.elementaryStreams,I.loader=D.loader,I.stats=D.stats,I.urlId=D.urlId,D.initSegment&&(I.initSegment=D.initSegment,v=D.initSegment)}),v){var f=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;f.forEach(function(D){var I;(!D.initSegment||D.initSegment.relurl===((I=v)===null||I===void 0?void 0:I.relurl))&&(D.initSegment=v)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(D){return!D}),t.deltaUpdateFailed)){w.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var l=t.skippedSegments;l--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var d=t.fragments;if(_){w.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<d.length;E++)d[E].cc+=_}t.skippedSegments&&(t.startCC=t.fragments[0].cc),h(n.partList,t.partList,function(D,I){I.elementaryStreams=D.elementaryStreams,I.stats=D.stats}),o?C(t,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):a(n,t),d.length&&(t.totalduration=t.edge-d[0].start),t.driftStartTime=n.driftStartTime,t.driftStart=n.driftStart;var y=t.advancedDateTime;if(t.advanced&&y){var S=t.edge;t.driftStart||(t.driftStartTime=y,t.driftStart=S),t.driftEndTime=y,t.driftEnd=S}else t.driftEndTime=n.driftEndTime,t.driftEnd=n.driftEnd,t.advancedDateTime=n.advancedDateTime}function h(n,t,v){if(n&&t)for(var p=0,m=0,b=n.length;m<=b;m++){var _=n[m],o=t[m+p];_&&o&&_.index===o.index&&_.fragment.sn===o.fragment.sn?v(_,o):p--}}function u(n,t,v){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,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,f=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,l=m;l<=b;l++){var d=f[_+l],E=o[l];p&&!E&&l<p&&(E=t.fragments[l]=d),d&&E&&v(d,E)}}function a(n,t){var v=t.startSN+t.skippedSegments-n.startSN,p=n.fragments;if(v<0||v>=p.length)return;i(t,p[v].start)}function i(n,t){if(t){for(var v=n.fragments,p=n.skippedSegments;p<v.length;p++)v[p].start+=t;n.fragmentHint&&(n.fragmentHint.start+=t)}}function c(n,t){var v=1e3*n.levelTargetDuration,p=v/2,m=n.age,b=m>0&&m<v*3,_=t.loading.end-t.loading.start,o,f=n.availabilityDelay;if(n.updated===!1)if(b){var l=333*n.misses;o=Math.max(Math.min(p,_*2),l),n.availabilityDelay=(n.availabilityDelay||0)+o}else o=p;else b?(f=Math.min(f||v/2,m),n.availabilityDelay=f,o=f+v-m):o=v-_;return Math.round(o)}function s(n,t,v){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&&v&&v.sn===t?v:null)}function r(n,t,v){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===v&&b.fragment.sn===t)return b}return null}},"./src/controller/stream-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return p});var M=O("./src/polyfills/number.ts"),w=O("./src/controller/base-stream-controller.ts"),L=O("./src/is-supported.ts"),j=O("./src/events.ts"),U=O("./src/utils/buffer-helper.ts"),e=O("./src/controller/fragment-tracker.ts"),C=O("./src/types/loader.ts"),g=O("./src/loader/fragment.ts"),h=O("./src/demux/transmuxer-interface.ts"),u=O("./src/types/transmuxer.ts"),a=O("./src/controller/gap-controller.ts"),i=O("./src/errors.ts"),c=O("./src/utils/logger.ts");function s(m,b){for(var _=0;_<b.length;_++){var o=b[_];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}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(o,f){return o.__proto__=f,o},t(m,b)}var v=100,p=function(m){n(b,m);function b(o,f){var l;return l=m.call(this,o,f,"[stream-controller]")||this,l.audioCodecSwap=!1,l.gapController=null,l.level=-1,l._forceStartLoad=!1,l.altAudio=!1,l.audioOnly=!1,l.fragPlaying=null,l.onvplaying=null,l.onvseeked=null,l.fragLastKbps=0,l.stalled=!1,l.couldBacktrack=!1,l.audioCodecSwitch=!1,l.videoBuffer=null,l._registerListeners(),l}var _=b.prototype;return _._registerListeners=function(){var f=this.hls;f.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),f.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.on(j.Events.ERROR,this.onError,this),f.on(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var f=this.hls;f.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.off(j.Events.ERROR,this.onError,this),f.off(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(f){if(this.levels){var l=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=d.startLevel;E===-1&&(d.config.testBandwidth?(E=0,this.bitrateTest=!0):E=d.nextAutoLevel),this.level=d.nextLoadLevel=E,this.loadedmetadata=!1}l>0&&f===-1&&(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),f=l),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,l=this.levels,d=this.level,E=l==null||((f=l[d])===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 y,S=self.performance.now(),D=this.retryDate;(!D||S>=D||(y=this.media)!==null&&y!==void 0&&y.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,l,d=this.hls,E=this.levelLastLoaded,y=this.levels,S=this.media,D=d.config,I=d.nextLoadLevel;if(E===null||!S&&(this.startFragRequested||!D.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[I])return;var A=y[I];this.level=d.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 V={};this.altAudio&&(V.type="video"),this.hls.trigger(j.Events.BUFFER_EOS,V),this.state=w.State.ENDED;return}var oe=H.end,Q=this.getNextFragment(oe,P);if(this.couldBacktrack&&!this.fragPrevious&&Q&&Q.sn!=="initSegment"){var pe=Q.sn-P.startSN;pe>1&&(Q=P.fragments[pe-1],this.fragmentTracker.removeFragment(Q))}if(Q&&this.fragmentTracker.getState(Q)===e.FragmentState.OK&&this.nextLoadPosition>oe){var ce=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(S,ce,C.PlaylistLevelType.MAIN),Q=this.getNextFragment(this.nextLoadPosition,P)}if(!Q)return;Q.initSegment&&!Q.initSegment.data&&!this.bitrateTest&&(Q=Q.initSegment),((f=Q.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((l=Q.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(Q,P):this.loadFragment(Q,P,oe)},_.loadFragment=function(f,l,d){var E,y=this.fragmentTracker.getState(f);if(this.fragCurrent=f,y===e.FragmentState.BACKTRACKED){var S=this.fragmentTracker.getBacktrackData(f);if(S){this._handleFragmentLoadProgress(S),this._handleFragmentLoadComplete(S);return}else y=e.FragmentState.NOT_LOADED}y===e.FragmentState.NOT_LOADED||y===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,l,d)):y===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 l=this.fragmentTracker.getAppendedFrag(f,C.PlaylistLevelType.MAIN);return l&&"fragment"in l?l.fragment:l},_.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,l=this.media;if(l!=null&&l.readyState){var d,E=this.getAppendedFrag(l.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!l.paused&&f){var y=this.hls.nextLoadLevel,S=f[y],D=this.fragLastKbps;D&&this.fragCurrent?d=this.fragCurrent.duration*S.maxBitrate/(1e3*D)+1:d=0}else d=0;var I=this.getBufferedFrag(l.currentTime+d);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,l){m.prototype.flushMainBuffer.call(this,f,l,this.altAudio?"video":null)},_.onMediaAttached=function(f,l){m.prototype.onMediaAttached.call(this,f,l);var d=l.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),d.addEventListener("playing",this.onvplaying),d.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,d,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,l=f?f.currentTime:null;Object(M.isFiniteNumber)(l)&&this.log("Media seeked to "+l.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(j.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(f,l){var d=!1,E=!1,y;l.levels.forEach(function(S){y=S.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(d=!0),y.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=d&&E&&!Object(L.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=l.levels,this.startFragRequested=!1},_.onLevelLoading=function(f,l){var d=this.levels;if(!d||this.state!==w.State.IDLE)return;var E=d[l.level];(!E.details||E.details.live&&this.levelLastLoaded!==l.level||this.waitForCdnTuneIn(E.details))&&(this.state=w.State.WAITING_LEVEL)},_.onLevelLoaded=function(f,l){var d,E=this.levels,y=l.level,S=l.details,D=S.totalduration;if(!E){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+S.startSN+","+S.endSN+"], cc ["+S.startCC+", "+S.endCC+"] duration:"+D);var I=this.fragCurrent;I&&(this.state===w.State.FRAG_LOADING||this.state===w.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==l.level&&I.loader&&(this.state=w.State.IDLE,I.loader.abort()));var A=E[y],P=0;if(S.live||(d=A.details)!==null&&d!==void 0&&d.live){if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed)return;P=this.alignPlaylists(S,A.details)}if(A.details=S,this.levelLastLoaded=y,this.hls.trigger(j.Events.LEVEL_UPDATED,{details:S,level:y}),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 l,d=f.frag,E=f.part,y=f.payload,S=this.levels;if(!S){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var D=S[d.level],I=D.details;if(!I){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var A=D.videoCodec,P=I.PTSKnown||!I.live,H=(l=d.initSegment)===null||l===void 0?void 0:l.data,R=this._getAudioCodec(D),K=this.transmuxer=this.transmuxer||new h.default(this.hls,C.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),V=E?E.index:-1,oe=V!==-1,Q=new u.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,y.byteLength,V,oe),pe=this.initPTS[d.cc];K.push(y,H,R,A,d,E,I.totalduration,P,Q,pe)},_.onAudioTrackSwitching=function(f,l){var d=this.altAudio,E=!!l.url,y=l.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 D=this.hls;d&&D.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),D.trigger(j.Events.AUDIO_TRACK_SWITCHED,{id:y})}},_.onAudioTrackSwitched=function(f,l){var d=l.id,E=!!this.hls.audioTracks[d].url;if(E){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=E,this.tick()},_.onBufferCreated=function(f,l){var d=l.tracks,E,y,S=!1;for(var D in d){var I=d[D];if(I.id==="main"){if(y=D,E=I,D==="video"){var A=d[D];A&&(this.videoBuffer=A.buffer)}}else S=!0}S&&E?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(f,l){var d=l.frag,E=l.part;if(d&&d.type!==C.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(E?" p: "+E.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===w.State.PARSED&&(this.state=w.State.IDLE);return}var y=E?E.stats:d.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,E)},_.onError=function(f,l){switch(l.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,l);break;case i.ErrorDetails.LEVEL_LOAD_ERROR:case i.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==w.State.ERROR&&(l.fatal?(this.warn(""+l.details),this.state=w.State.ERROR):!l.levelRetry&&this.state===w.State.WAITING_LEVEL&&(this.state=w.State.IDLE));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="main"&&(this.state===w.State.PARSING||this.state===w.State.PARSED)){var d=!0,E=this.getFwdBufferInfo(this.media,C.PlaylistLevelType.MAIN);E&&E.len>.5&&(d=!this.reduceMaxBufferLength(E.len)),d&&(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,l=this.gapController;if(!f||!l||!f.readyState)return;var d=U.BufferHelper.getBuffered(f);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):l.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,l){var d=l.type;if(d!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(d===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,d,C.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(f,l){this.levels=l.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var f=this.media,l=f.currentTime,d=this.startPosition;if(d>=0&&l<d){if(f.seeking){c.logger.log("could not seek to "+d+", already seeking at "+l);return}var E=U.BufferHelper.getBuffered(f),y=E.length?E.start(0):0,S=y-d;S>0&&(S<this.config.maxBufferHole||S<this.config.maxFragLookUpTolerance)&&(c.logger.log("adjusting start position by "+S+" to match buffer start"),d+=S,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+l),f.currentTime=d}},_._getAudioCodec=function(f){var l=this.config.defaultAudioCodec||f.audioCodec;return this.audioCodecSwap&&l&&(this.log("Swapping audio codec"),l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5"),l},_._loadBitrateTestFrag=function(f){var l=this;this._doFragLoad(f).then(function(d){var E=l.hls;if(!d||E.nextLoadLevel||l.fragContextChanged(f))return;l.fragLoadError=0,l.state=w.State.IDLE,l.startFragRequested=!1,l.bitrateTest=!1;var y=f.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),E.trigger(j.Events.FRAG_LOADED,d)})},_._handleTransmuxComplete=function(f){var l,d="main",E=this.hls,y=f.remuxResult,S=f.chunkMeta,D=this.getCurrentContext(S);if(!D){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=D.frag,A=D.part,P=D.level,H=y.video,R=y.text,K=y.id3,V=y.initSegment,oe=this.altAudio?void 0:y.audio;if(this.fragContextChanged(I))return;if(this.state=w.State.PARSING,V){V.tracks&&(this._bufferInitSegment(P,V.tracks,I,S),E.trigger(j.Events.FRAG_PARSING_INIT_SEGMENT,{frag:I,id:d,tracks:V.tracks}));var Q=V.initPTS,pe=V.timescale;Object(M.isFiniteNumber)(Q)&&(this.initPTS[I.cc]=Q,E.trigger(j.Events.INIT_PTS_FOUND,{frag:I,id:d,initPTS:Q,timescale:pe}))}if(H&&y.independent!==!1){if(P.details){var ce=H.startPTS,ee=H.endPTS,ne=H.startDTS,me=H.endDTS;if(A)A.elementaryStreams[H.type]={startPTS:ce,endPTS:ee,startDTS:ne,endDTS:me};else if(H.firstKeyFrame&&H.independent&&(this.couldBacktrack=!0),H.dropped&&H.independent){var Z=this.getLoadPosition()+this.config.maxBufferHole;if(Z<ce){this.backtrack(I);return}I.setElementaryStreamInfo(H.type,I.start,ee,I.start,me,!0)}I.setElementaryStreamInfo(H.type,ce,ee,ne,me),this.bufferFragmentData(H,I,A,S)}}else if(y.independent===!1){this.backtrack(I);return}if(oe){var Y=oe.startPTS,Se=oe.endPTS,Me=oe.startDTS,ke=oe.endDTS;A&&(A.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:Y,endPTS:Se,startDTS:Me,endDTS:ke}),I.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,Y,Se,Me,ke),this.bufferFragmentData(oe,I,A,S)}if(K!=null&&(l=K.samples)!==null&&l!==void 0&&l.length){var Re={frag:I,id:d,samples:K.samples};E.trigger(j.Events.FRAG_PARSING_METADATA,Re)}if(R){var Pe={frag:I,id:d,samples:R.samples};E.trigger(j.Events.FRAG_PARSING_USERDATA,Pe)}},_._bufferInitSegment=function(f,l,d,E){var y=this;if(this.state!==w.State.PARSING)return;this.audioOnly=!!l.audio&&!l.video,this.altAudio&&!this.audioOnly&&delete l.audio;var S=l.audio,D=l.video,I=l.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+"]")}D&&(D.levelCodec=f.videoCodec,D.id="main",this.log("Init video buffer, container:"+D.container+", codecs[level/parsed]=["+(f.videoCodec||"")+"/"+D.codec+"]")),I&&this.log("Init audiovideo buffer, container:"+I.container+", codecs[level/parsed]=["+(f.attrs.CODECS||"")+"/"+I.codec+"]"),this.hls.trigger(j.Events.BUFFER_CODECS,l),Object.keys(l).forEach(function(H){var R=l[H],K=R.initSegment;K!=null&&K.byteLength&&y.hls.trigger(j.Events.BUFFER_APPENDING,{type:H,data:K,frag:d,part:null,chunkMeta:E,parent:d.type})}),this.tick()},_.backtrack=function(f){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(f);var l=this.fragmentTracker.backtrack(f);this.fragPrevious=null,this.nextLoadPosition=f.start,l?this.resetFragmentLoading(f):this.state=w.State.BACKTRACKING},_.checkFragmentChanged=function(){var f=this.media,l=null;if(f&&f.readyState>1&&f.seeking===!1){var d=f.currentTime;if(U.BufferHelper.isBuffered(f,d)?l=this.getAppendedFrag(d):U.BufferHelper.isBuffered(f,d+.1)&&(l=this.getAppendedFrag(d+.1)),l){var E=this.fragPlaying,y=l.level;(!E||l.sn!==E.sn||E.level!==y||l.urlId!==E.urlId)&&(this.hls.trigger(j.Events.FRAG_CHANGED,{frag:l}),(!E||E.level!==y)&&this.hls.trigger(j.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=l)}}},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 l=this.getAppendedFrag(f.currentTime);if(l)return l.level}return-1}},{key:"nextBufferedFrag",get:function(){var f=this.media;if(f){var l=this.getAppendedFrag(f.currentTime);return this.followingBufferedFrag(l)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),b}(w.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"SubtitleStreamController",function(){return n});var M=O("./src/events.ts"),w=O("./src/utils/logger.ts"),L=O("./src/utils/buffer-helper.ts"),j=O("./src/controller/fragment-finders.ts"),U=O("./src/utils/discontinuities.ts"),e=O("./src/controller/level-helper.ts"),C=O("./src/controller/fragment-tracker.ts"),g=O("./src/controller/base-stream-controller.ts"),h=O("./src/types/loader.ts"),u=O("./src/types/level.ts");function a(t,v){for(var p=0;p<v.length;p++){var m=v[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function i(t,v,p){return v&&a(t.prototype,v),p&&a(t,p),t}function c(t,v){t.prototype=Object.create(v.prototype),t.prototype.constructor=t,s(t,v)}function s(t,v){return s=Object.setPrototypeOf||function(m,b){return m.__proto__=b,m},s(t,v)}var r=500,n=function(t){c(v,t);function v(m,b){var _;return _=t.call(this,m,b,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var p=v.prototype;return p.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},p._registerListeners=function(){var b=this.hls;b.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(M.Events.ERROR,this.onError,this),b.on(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),b.on(M.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),b.on(M.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),b.on(M.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),b.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var b=this.hls;b.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(M.Events.ERROR,this.onError,this),b.off(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),b.off(M.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),b.off(M.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),b.off(M.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),b.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.startLoad=function(){this.stopLoad(),this.state=g.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 o=_.frag,f=_.success;if(this.fragPrevious=o,this.state=g.State.IDLE,!f)return;var l=this.tracksBuffered[this.currentTrackId];if(!l)return;for(var d,E=o.start,y=0;y<l.length;y++)if(E>=l[y].start&&E<=l[y].end){d=l[y];break}var S=o.start+o.duration;d?d.end=S:(d={start:E,end:S},l.push(d)),this.fragmentTracker.fragBuffered(o)},p.onBufferFlushing=function(b,_){var o=_.startOffset,f=_.endOffset;if(o===0&&f!==Number.POSITIVE_INFINITY){var l=this.currentTrackId,d=this.levels;if(!d.length||!d[l]||!d[l].details)return;var E=d[l].details,y=E.targetduration,S=f-y;if(S<=0)return;_.endOffsetSubtitles=Math.max(0,S),this.tracksBuffered.forEach(function(D){for(var I=0;I<D.length;){if(D[I].end<=S){D.shift();continue}else if(D[I].start<S)D[I].start=S;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(o,S,h.PlaylistLevelType.SUBTITLE)}},p.onError=function(b,_){var o,f=_.frag;if(!f||f.type!==h.PlaylistLevelType.SUBTITLE)return;(o=this.fragCurrent)!==null&&o!==void 0&&o.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},p.onSubtitleTracksUpdated=function(b,_){var o=this,f=_.subtitleTracks;this.tracksBuffered=[],this.levels=f.map(function(l){return new u.Level(l)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(l){o.tracksBuffered[l.id]=[]}),this.mediaBuffer=null},p.onSubtitleTrackSwitch=function(b,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var o=this.levels[this.currentTrackId];o!=null&&o.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,o&&this.setInterval(r)},p.onSubtitleTrackLoaded=function(b,_){var o,f=_.details,l=_.id,d=this.currentTrackId,E=this.levels;if(!E.length)return;var y=E[d];if(l>=E.length||l!==d||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,f.live||(o=y.details)!==null&&o!==void 0&&o.live){var S=this.mainDetails;if(f.deltaUpdateFailed||!S)return;var D=S.fragments[0];if(!y.details)f.hasProgramDateTime&&S.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(f,S):D&&Object(e.addSliding)(f,D.start);else{var I=this.alignPlaylists(f,y.details);I===0&&D&&Object(e.addSliding)(f,D.start)}}if(y.details=f,this.levelLastLoaded=l,this.tick(),f.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var A=Object(j.findFragmentByPTS)(null,f.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},p._handleFragmentLoadComplete=function(b){var _=b.frag,o=b.payload,f=_.decryptdata,l=this.hls;if(this.fragContextChanged(_))return;if(o&&o.byteLength>0&&f&&f.key&&f.iv&&f.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(o),f.key.buffer,f.iv.buffer).then(function(E){var y=performance.now();l.trigger(M.Events.FRAG_DECRYPTED,{frag:_,payload:E,stats:{tstart:d,tdecrypt:y}})})}},p.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var b,_=this.currentTrackId,o=this.levels;if(!o.length||!o[_]||!o[_].details)return;var f=o[_].details,l=f.targetduration,d=this.config,E=this.media,y=L.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-l,d.maxBufferHole),S=y.end,D=y.len,I=this.getMaxBufferLength()+l;if(D>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 V=d.maxFragLookUpTolerance;K&&f.hasProgramDateTime&&(R=Object(j.findFragmentByPDT)(A,K.endProgramDateTime,V)),R||(R=Object(j.findFragmentByPTS)(K,A,S,V),!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=g.State.KEY_LOADING,this.hls.trigger(M.Events.KEY_LOADING,{frag:R})):R&&this.fragmentTracker.getState(R)===C.FragmentState.NOT_LOADED&&this.loadFragment(R,f,S)}},p.loadFragment=function(b,_,o){this.fragCurrent=b,t.prototype.loadFragment.call(this,b,_,o)},i(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(g.default)},"./src/controller/subtitle-track-controller.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/events.ts"),w=O("./src/utils/texttrack-utils.ts"),L=O("./src/controller/base-playlist-controller.ts"),j=O("./src/types/loader.ts");function U(a,i){for(var c=0;c<i.length;c++){var s=i[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,i,c){return i&&U(a.prototype,i),c&&U(a,c),a}function C(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,g(a,i)}function g(a,i){return g=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},g(a,i)}var h=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 c=i.prototype;return c.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},c.registerListeners=function(){var r=this.hls;r.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(M.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(M.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(M.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var r=this.hls;r.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(M.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(M.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(M.Events.ERROR,this.onError,this)},c.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)},c.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},c.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=u(this.media.textTracks);r.forEach(function(n){Object(w.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},c.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},c.onManifestParsed=function(r,n){this.tracks=n.subtitleTracks},c.onSubtitleTrackLoaded=function(r,n){var t=n.id,v=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 ["+v.startSN+"-"+v.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,n,b))},c.onLevelLoading=function(r,n){this.switchLevel(n.level)},c.onLevelSwitching=function(r,n){this.switchLevel(n.level)},c.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 v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,p=this.tracks.filter(function(_){return!t||_.groupId===t});this.tracksInGroup=p;var m=this.findTrackId(v==null?void 0:v.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(M.Events.SUBTITLE_TRACKS_UPDATED,b),m!==-1&&this.setSubtitleTrack(m,v)}},c.findTrackId=function(r){for(var n=this.tracksInGroup,t=0;t<n.length;t++){var v=n[t];if((!this.selectDefaultTrack||v.default)&&(!r||r===v.name))return v.id}return-1},c.onError=function(r,n){if(a.prototype.onError.call(this,r,n),n.fatal||!n.context)return;n.context.type===j.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},c.loadPlaylist=function(r){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var t=n.id,v=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(M.Events.SUBTITLE_TRACK_LOADING,{url:p,id:t,groupId:v,deliveryDirectives:r||null})}},c.toggleTrackModes=function(r){var n=this,t=this.media,v=this.subtitleDisplay,p=this.trackId;if(!t)return;var m=u(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 o=b[r];o&&(o.mode=v?"showing":"hidden")},c.setSubtitleTrack=function(r,n){var t,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(t=v[r])!==null&&t!==void 0&&t.details)||r<-1||r>=v.length)return;this.clearTimer();var p=v[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,p){var m=p.id,b=p.groupId,_=b===void 0?"":b,o=p.name,f=p.type,l=p.url;this.hls.trigger(M.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:_,name:o,type:f,url:l});var d=this.switchParams(p.url,n==null?void 0:n.details);this.loadPlaylist(d)}else this.hls.trigger(M.Events.SUBTITLE_TRACK_SWITCH,{id:r})},c.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,n=u(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}(L.default);function u(a){for(var i=[],c=0;c<a.length;c++){var s=a[c];s.kind==="subtitles"&&s.label&&i.push(a[c])}return i}W.default=h},"./src/controller/timeline-controller.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"TimelineController",function(){return u});var M=O("./src/polyfills/number.ts"),w=O("./src/events.ts"),L=O("./src/utils/cea-608-parser.ts"),j=O("./src/utils/output-filter.ts"),U=O("./src/utils/webvtt-parser.ts"),e=O("./src/utils/texttrack-utils.ts"),C=O("./src/utils/imsc1-ttml-parser.ts"),g=O("./src/types/loader.ts"),h=O("./src/utils/logger.ts"),u=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=c(),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 j.default(this,"textTrack1"),v=new j.default(this,"textTrack2"),p=new j.default(this,"textTrack3"),m=new j.default(this,"textTrack4");this.cea608Parser1=new L.default(1,t,v),this.cea608Parser2=new L.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,v,p,m,b){for(var _=!1,o=b.length;o--;){var f=b[o],l=i(f[0],f[1],v,p);if(l>=0&&(f[0]=Math.min(f[0],v),f[1]=Math.max(f[1],p),_=!0,l/(p-v)>.5))return}if(_||b.push([v,p]),this.config.renderTextTracksNatively){var d=this.captionsTracks[t];this.Cues.newCue(d,v,p,m)}else{var E=this.Cues.newCue(null,v,p,m);this.hls.trigger(w.Events.CUES_PARSED,{type:"captions",cues:E,track:t})}},r.onInitPtsFound=function(t,v){var p=this,m=v.frag,b=v.id,_=v.initPTS,o=v.timescale,f=this.unparsedVttFrags;b==="main"&&(this.initPTS[m.cc]=_,this.timescale[m.cc]=o),f.length&&(this.unparsedVttFrags=[],f.forEach(function(l){p.onFragLoaded(w.Events.FRAG_LOADED,l)}))},r.getExistingTrack=function(t){var v=this.media;if(v)for(var p=0;p<v.textTracks.length;p++){var m=v.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 v=this.captionsProperties,p=this.captionsTracks,m=this.media,b=v[t],_=b.label,o=b.languageCode,f=this.getExistingTrack(t);if(f)p[t]=f,Object(e.clearCurrentCues)(p[t]),Object(e.sendAddTrackEvent)(p[t],m);else{var l=this.createTextTrack("captions",_,o);l&&(l[t]=!0,p[t]=l)}},r.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var v=this.captionsProperties[t];if(!v)return;var p=v.label,m={_id:t,label:p,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[t]=m,this.hls.trigger(w.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},r.createTextTrack=function(t,v,p){var m=this.media;return m?m.addTextTrack(t,v,p):void 0},r.onMediaAttaching=function(t,v){this.media=v.media,this._cleanTracks()},r.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(v){Object(e.clearCurrentCues)(t[v]),delete t[v]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=c(),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 v=t.textTracks;if(v)for(var p=0;p<v.length;p++)Object(e.clearCurrentCues)(v[p])},r.onSubtitleTracksUpdated=function(t,v){var p=this;this.textTracks=[];var m=v.subtitleTracks||[],b=m.some(function(l){return l.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 o=this.media?this.media.textTracks:[];this.tracks.forEach(function(l,d){var E;if(d<o.length){for(var y=null,S=0;S<o.length;S++)if(a(o[S],l)){y=o[S];break}y&&(E=y)}E?Object(e.clearCurrentCues)(E):(E=p.createTextTrack("subtitles",l.name,l.lang),E&&(E.mode="disabled")),E&&(E.groupId=l.groupId,p.textTracks.push(E))})}else if(!_&&this.tracks&&this.tracks.length){var f=this.tracks.map(function(l){return{label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}});this.hls.trigger(w.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:f})}}},r.onManifestLoaded=function(t,v){var p=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(m){var b=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!b)return;var _="textTrack"+b[1],o=p.captionsProperties[_];if(!o)return;o.label=m.name,m.lang&&(o.languageCode=m.lang),o.media=m})},r.onFragLoading=function(t,v){var p=this.cea608Parser1,m=this.cea608Parser2,b=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(p&&m))return;if(v.frag.type===g.PlaylistLevelType.MAIN){var o,f,l=v.frag.sn,d=(o=v==null||((f=v.part)===null||f===void 0)?void 0:f.index)!=null?o:-1;l===b+1||l===b&&d===_+1||(p.reset(),m.reset()),this.lastSn=l,this.lastPartIndex=d}},r.onFragLoaded=function(t,v){var p=v.frag,m=v.payload,b=this.initPTS,_=this.unparsedVttFrags;if(p.type===g.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(M.isFiniteNumber)(b[p.cc])){_.push(v),b.length&&this.hls.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Missing initial subtitle PTS")});return}var o=p.decryptdata;if(o==null||o.key==null||o.method!=="AES-128"){var f=this.tracks[p.level],l=this.vttCCs;l[p.cc]||(l[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,l)}}else this.hls.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(t,v){var p=this,m=this.hls;Object(C.parseIMSC1)(v,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){h.logger.log("Failed to parse IMSC1: "+b),m.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:b})})},r._parseVTTs=function(t,v,p){var m=this,b=this.hls;Object(U.parseWebVTT)(v,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,v),h.logger.log("Failed to parse VTT cue: "+_),b.trigger(w.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:_})})},r._fallbackToIMSC1=function(t,v){var p=this,m=this.tracks[t.level];m.textCodec||Object(C.parseIMSC1)(v,this.initPTS[t.cc],this.timescale[t.cc],function(){m.textCodec=C.IMSC1_CODEC,p._parseIMSC1(t,v)},function(){m.textCodec="wvtt"})},r._appendCues=function(t,v){var p=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[v];if(m.mode==="disabled")return;t.forEach(function(o){return Object(e.addCueToTrack)(m,o)})}else{var b=this.tracks[v],_=b.default?"default":"subtitles"+v;p.trigger(w.Events.CUES_PARSED,{type:"subtitles",cues:t,track:_})}},r.onFragDecrypted=function(t,v){var p=v.frag;if(p.type===g.PlaylistLevelType.SUBTITLE){if(!Object(M.isFiniteNumber)(this.initPTS[p.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(w.Events.FRAG_LOADED,v)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(t,v){var p=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(p&&m))return;for(var b=0;b<v.samples.length;b++){var _=v.samples[b].bytes;if(_){var o=this.extractCea608Data(_);p.addData(v.samples[b].pts,o[0]),m.addData(v.samples[b].pts,o[1])}}},r.onBufferFlushing=function(t,v){var p=v.startOffset,m=v.endOffset,b=v.endOffsetSubtitles,_=v.type,o=this.media;if(!o||o.currentTime<m)return;if(!_||_==="video"){var f=this.captionsTracks;Object.keys(f).forEach(function(d){return Object(e.removeCuesInRange)(f[d],p,m)})}if(this.config.renderTextTracksNatively&&(p===0&&b!==void 0)){var l=this.textTracks;Object.keys(l).forEach(function(d){return Object(e.removeCuesInRange)(l[d],p,b)})}},r.extractCea608Data=function(t){for(var v=t[0]&31,p=2,m=[[],[]],b=0;b<v;b++){var _=t[p++],o=127&t[p++],f=127&t[p++],l=(4&_)!==0,d=3&_;if(o===0&&f===0)continue;l&&((d===0||d===1)&&(m[d].push(o),m[d].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 c(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return M});var M=function(){function w(j,U){this.subtle=void 0,this.aesIV=void 0,this.subtle=j,this.aesIV=U}var L=w.prototype;return L.decrypt=function(U,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,U)},w}()},"./src/crypt/aes-decryptor.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"removePadding",function(){return w}),O.d(W,"default",function(){return L});var M=O("./src/utils/typed-array.ts");function w(j){var U=j.byteLength,e=U&&new DataView(j.buffer).getUint8(U-1);return e?Object(M.sliceUint8)(j,0,U-e):j}var L=function(){function j(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var U=j.prototype;return U.uint8ArrayToUint32Array_=function(C){for(var g=new DataView(C),h=new Uint32Array(4),u=0;u<4;u++)h[u]=g.getUint32(u*4);return h},U.initTable=function(){var C=this.sBox,g=this.invSBox,h=this.subMix,u=h[0],a=h[1],i=h[2],c=h[3],s=this.invSubMix,r=s[0],n=s[1],t=s[2],v=s[3],p=new Uint32Array(256),m=0,b=0,_=0;for(_=0;_<256;_++)_<128?p[_]=_<<1:p[_]=_<<1^283;for(_=0;_<256;_++){var o=b^b<<1^b<<2^b<<3^b<<4;o=o>>>8^o&255^99,C[m]=o,g[o]=m;var f=p[m],l=p[f],d=p[l],E=p[o]*257^o*16843008;u[m]=E<<24|E>>>8,a[m]=E<<16|E>>>16,i[m]=E<<8|E>>>24,c[m]=E,E=d*16843009^l*65537^f*257^m*16843008,r[o]=E<<24|E>>>8,n[o]=E<<16|E>>>16,t[o]=E<<8|E>>>24,v[o]=E,m?(m=f^p[p[p[d^f]]],b^=p[p[b]]):m=b=1}},U.expandKey=function(C){for(var g=this.uint8ArrayToUint32Array_(C),h=!0,u=0;u<g.length&&h;)h=g[u]===this.key[u],u++;if(h)return;this.key=g;var a=this.keySize=g.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var i=this.ksRows=(a+6+1)*4,c,s,r=this.keySchedule=new Uint32Array(i),n=this.invKeySchedule=new Uint32Array(i),t=this.sBox,v=this.rcon,p=this.invSubMix,m=p[0],b=p[1],_=p[2],o=p[3],f,l;for(c=0;c<i;c++){if(c<a){f=r[c]=g[c];continue}l=f,c%a===0?(l=l<<8|l>>>24,l=t[l>>>24]<<24|t[l>>>16&255]<<16|t[l>>>8&255]<<8|t[l&255],l^=v[c/a|0]<<24):a>6&&c%a===4&&(l=t[l>>>24]<<24|t[l>>>16&255]<<16|t[l>>>8&255]<<8|t[l&255]),r[c]=f=(r[c-a]^l)>>>0}for(s=0;s<i;s++)c=i-s,s&3?l=r[c]:l=r[c-4],s<4||c<=4?n[s]=l:n[s]=m[t[l>>>24]]^b[t[l>>>16&255]]^_[t[l>>>8&255]]^o[t[l&255]],n[s]=n[s]>>>0},U.networkToHostOrderSwap=function(C){return C<<24|(C&65280)<<8|(C&16711680)>>8|C>>>24},U.decrypt=function(C,g,h){for(var u=this.keySize+6,a=this.invKeySchedule,i=this.invSBox,c=this.invSubMix,s=c[0],r=c[1],n=c[2],t=c[3],v=this.uint8ArrayToUint32Array_(h),p=v[0],m=v[1],b=v[2],_=v[3],o=new Int32Array(C),f=new Int32Array(o.length),l,d,E,y,S,D,I,A,P,H,R,K,V,oe,Q=this.networkToHostOrderSwap;g<o.length;){for(P=Q(o[g]),H=Q(o[g+1]),R=Q(o[g+2]),K=Q(o[g+3]),S=P^a[0],D=K^a[1],I=R^a[2],A=H^a[3],V=4,oe=1;oe<u;oe++)l=s[S>>>24]^r[D>>16&255]^n[I>>8&255]^t[A&255]^a[V],d=s[D>>>24]^r[I>>16&255]^n[A>>8&255]^t[S&255]^a[V+1],E=s[I>>>24]^r[A>>16&255]^n[S>>8&255]^t[D&255]^a[V+2],y=s[A>>>24]^r[S>>16&255]^n[D>>8&255]^t[I&255]^a[V+3],S=l,D=d,I=E,A=y,V=V+4;l=i[S>>>24]<<24^i[D>>16&255]<<16^i[I>>8&255]<<8^i[A&255]^a[V],d=i[D>>>24]<<24^i[I>>16&255]<<16^i[A>>8&255]<<8^i[S&255]^a[V+1],E=i[I>>>24]<<24^i[A>>16&255]<<16^i[S>>8&255]<<8^i[D&255]^a[V+2],y=i[A>>>24]<<24^i[S>>16&255]<<16^i[D>>8&255]<<8^i[I&255]^a[V+3],f[g]=Q(l^p),f[g+1]=Q(y^m),f[g+2]=Q(E^b),f[g+3]=Q(d^_),p=P,m=H,b=R,_=K,g=g+4}return f.buffer},j}()},"./src/crypt/decrypter.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return g});var M=O("./src/crypt/aes-crypto.ts"),w=O("./src/crypt/fast-aes-key.ts"),L=O("./src/crypt/aes-decryptor.ts"),j=O("./src/utils/logger.ts"),U=O("./src/utils/mp4-tools.ts"),e=O("./src/utils/typed-array.ts"),C=16,g=function(){function h(a,i,c){var s=c===void 0?{}:c,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(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var u=h.prototype;return u.destroy=function(){this.observer=null},u.isSync=function(){return this.config.enableSoftwareAES},u.flush=function(){var i=this.currentResult;if(!i){this.reset();return}var c=new Uint8Array(i);return this.reset(),this.removePKCS7Padding?Object(L.removePadding)(c):c},u.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},u.decrypt=function(i,c,s,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(i),c,s);var n=this.flush();n&&r(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(i),c,s).then(r)},u.softwareDecrypt=function(i,c,s){var r=this.currentIV,n=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(i=Object(U.appendUint8Array)(t,i),this.remainderData=null);var v=this.getValidChunk(i);if(!v.length)return null;r&&(s=r);var p=this.softwareDecrypter;p||(p=this.softwareDecrypter=new L.default),p.expandKey(c);var m=n;return this.currentResult=p.decrypt(v.buffer,0,s),this.currentIV=Object(e.sliceUint8)(v,-16).buffer,m||null},u.webCryptoDecrypt=function(i,c,s){var r=this,n=this.subtle;return(this.key!==c||!this.fastAesKey)&&(this.key=c,this.fastAesKey=new w.default(n,c)),this.fastAesKey.expandKey().then(function(t){if(!n)return Promise.reject(new Error("web crypto not initialized"));var v=new M.default(n,s);return v.decrypt(i.buffer,t)}).catch(function(t){return r.onWebCryptoError(t,i,c,s)})},u.onWebCryptoError=function(i,c,s,r){return j.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",i),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(c,s,r)},u.getValidChunk=function(i){var c=i,s=i.length-i.length%C;return s!==i.length&&(c=Object(e.sliceUint8)(i,0,s),this.remainderData=Object(e.sliceUint8)(i,s)),c},u.logOnce=function(i){if(!this.logEnabled)return;j.logger.log("[decrypter.ts]: "+i),this.logEnabled=!1},h}()},"./src/crypt/fast-aes-key.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return M});var M=function(){function w(j,U){this.subtle=void 0,this.key=void 0,this.subtle=j,this.key=U}var L=w.prototype;return L.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},w}()},"./src/demux/aacdemuxer.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/demux/base-audio-demuxer.ts"),w=O("./src/demux/adts.ts"),L=O("./src/utils/logger.ts"),j=O("./src/demux/id3.ts");function U(g,h){g.prototype=Object.create(h.prototype),g.prototype.constructor=g,e(g,h)}function e(g,h){return e=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},e(g,h)}var C=function(g){U(h,g);function h(a,i){var c;return c=g.call(this)||this,c.observer=void 0,c.config=void 0,c.observer=a,c.config=i,c}var u=h.prototype;return u.resetInitSegment=function(i,c,s){g.prototype.resetInitSegment.call(this,i,c,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}},h.probe=function(i){if(!i)return!1;for(var c=j.getID3Data(i,0)||[],s=c.length,r=i.length;s<r;s++)if(w.probe(i,s))return L.logger.log("ADTS sync word found !"),!0;return!1},u.canParse=function(i,c){return w.canParse(i,c)},u.appendFrame=function(i,c,s){w.initTrackConfig(i,this.observer,c,s,i.manifestCodec);var r=w.appendFrame(i,c,s,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},h}(M.default);C.minProbeByteLength=9,W.default=C},"./src/demux/adts.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"getAudioConfig",function(){return j}),O.d(W,"isHeaderPattern",function(){return U}),O.d(W,"getHeaderLength",function(){return e}),O.d(W,"getFullFrameLength",function(){return C}),O.d(W,"canGetFrameLength",function(){return g}),O.d(W,"isHeader",function(){return h}),O.d(W,"canParse",function(){return u}),O.d(W,"probe",function(){return a}),O.d(W,"initTrackConfig",function(){return i}),O.d(W,"getFrameDuration",function(){return c}),O.d(W,"parseFrameHeader",function(){return s}),O.d(W,"appendFrame",function(){return r});var M=O("./src/utils/logger.ts"),w=O("./src/errors.ts"),L=O("./src/events.ts");function j(n,t,v,p){var m,b,_,o,f=navigator.userAgent.toLowerCase(),l=p,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((t[v+2]&192)>>>6)+1;var E=(t[v+2]&60)>>>2;if(E>d.length-1){n.trigger(L.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return _=(t[v+2]&1)<<2,_|=(t[v+3]&192)>>>6,M.logger.log("manifest codec:"+p+", ADTS type:"+m+", samplingIndex:"+E),/firefox/i.test(f)?E>=6?(m=5,o=new Array(4),b=E-3):(m=2,o=new Array(2),b=E):f.indexOf("android")!==-1?(m=2,o=new Array(2),b=E):(m=5,o=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,o=new Array(2)),b=E)),o[0]=m<<3,o[0]|=(E&14)>>1,o[1]|=(E&1)<<7,o[1]|=_<<3,m===5&&(o[1]|=(b&14)>>1,o[2]=(b&1)<<7,o[2]|=2<<2,o[3]=0),{config:o,samplerate:d[E],channelCount:_,codec:"mp4a.40."+m,manifestCodec:l}}function U(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 g(n,t){return t+5<n.length}function h(n,t){return t+1<n.length&&U(n,t)}function u(n,t){return g(n,t)&&U(n,t)&&C(n,t)<=n.length-t}function a(n,t){if(h(n,t)){var v=e(n,t);if(t+v>=n.length)return!1;var p=C(n,t);if(p<=v)return!1;var m=t+p;return m===n.length||h(n,m)}return!1}function i(n,t,v,p,m){if(!n.samplerate){var b=j(t,v,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,M.logger.log("parsed codec:"+n.codec+", rate:"+b.samplerate+", channels:"+b.channelCount)}}function c(n){return 1024*9e4/n}function s(n,t,v,p,m){var b=e(n,t),_=C(n,t);if(_-=b,_>0){var o=v+p*m;return{headerLength:b,frameLength:_,stamp:o}}}function r(n,t,v,p,m){var b=c(n.samplerate),_=s(t,v,p,m,b);if(_){var o=_.frameLength,f=_.headerLength,l=_.stamp,d=f+o,E=Math.max(0,v+d-t.length),y;E?(y=new Uint8Array(d-f),y.set(t.subarray(v+f,t.length),0)):y=t.subarray(v+f,v+d);var S={unit:y,pts:l};return E||n.samples.push(S),{sample:S,length:d,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"initPTSFn",function(){return C});var M=O("./src/polyfills/number.ts"),w=O("./src/demux/id3.ts"),L=O("./src/demux/dummy-demuxed-track.ts"),j=O("./src/utils/mp4-tools.ts"),U=O("./src/utils/typed-array.ts"),e=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var h=g.prototype;return h.resetInitSegment=function(a,i,c){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},h.resetTimeStamp=function(){},h.resetContiguity=function(){},h.canParse=function(a,i){return!1},h.appendFrame=function(a,i,c){},h.demux=function(a,i){this.cachedData&&(a=Object(j.appendUint8Array)(this.cachedData,a),this.cachedData=null);var c=w.getID3Data(a,0),s=c?c.length:0,r,n,t=this._audioTrack,v=this._id3Track,p=c?w.getTimeStamp(c):void 0,m=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=C(p,i)),c&&c.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:c}),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)?(c=w.getID3Data(a,s),v.samples.push({pts:n,dts:n,data:c}),s+=c.length,r=s):s++;if(s===m&&r!==m){var _=Object(U.sliceUint8)(a,r);this.cachedData?this.cachedData=Object(j.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:t,avcTrack:Object(L.dummyTrack)(),id3Track:v,textTrack:Object(L.dummyTrack)()}},h.demuxSampleAes=function(a,i,c){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},h.flush=function(a){var i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(L.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(L.dummyTrack)()}},h.destroy=function(){},g}(),C=function(h,u){return Object(M.isFiniteNumber)(h)?h*90:u*9e4};W.default=e},"./src/demux/chunk-cache.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return M});var M=function(){function L(){this.chunks=[],this.dataLength=0}var j=L.prototype;return j.push=function(e){this.chunks.push(e),this.dataLength+=e.length},j.flush=function(){var e=this.chunks,C=this.dataLength,g;if(e.length)e.length===1?g=e[0]:g=w(e,C);else return new Uint8Array(0);return this.reset(),g},j.reset=function(){this.chunks.length=0,this.dataLength=0},L}();function w(L,j){for(var U=new Uint8Array(j),e=0,C=0;C<L.length;C++){var g=L[C];U.set(g,e),e+=g.length}return U}},"./src/demux/dummy-demuxed-track.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"dummyTrack",function(){return M});function M(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/utils/logger.ts"),w=function(){function L(U){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=U,this.bytesAvailable=U.byteLength,this.word=0,this.bitsAvailable=0}var j=L.prototype;return j.loadWord=function(){var e=this.data,C=this.bytesAvailable,g=e.byteLength-C,h=new Uint8Array(4),u=Math.min(4,C);if(u===0)throw new Error("no bytes available");h.set(e.subarray(g,g+u)),this.word=new DataView(h.buffer).getUint32(0),this.bitsAvailable=u*8,this.bytesAvailable-=u},j.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)},j.readBits=function(e){var C=Math.min(this.bitsAvailable,e),g=this.word>>>32-C;return e>32&&M.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=C,this.bitsAvailable>0?this.word<<=C:this.bytesAvailable>0&&this.loadWord(),C=e-C,C>0&&this.bitsAvailable?g<<C|this.readBits(C):g},j.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},j.skipUEG=function(){this.skipBits(1+this.skipLZ())},j.skipEG=function(){this.skipBits(1+this.skipLZ())},j.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},j.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},j.readBoolean=function(){return this.readBits(1)===1},j.readUByte=function(){return this.readBits(8)},j.readUShort=function(){return this.readBits(16)},j.readUInt=function(){return this.readBits(32)},j.skipScalingList=function(e){for(var C=8,g=8,h,u=0;u<e;u++)g!==0&&(h=this.readEG(),g=(C+h+256)%256),C=g===0?C:g},j.readSPS=function(){var e=0,C=0,g=0,h=0,u,a,i,c=this.readUByte.bind(this),s=this.readBits.bind(this),r=this.readUEG.bind(this),n=this.readBoolean.bind(this),t=this.skipBits.bind(this),v=this.skipEG.bind(this),p=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);c();var b=c();if(s(5),t(3),c(),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 o=r();if(o===0)r();else if(o===1)for(t(1),v(),v(),u=r(),i=0;i<u;i++)v();p(),t(1);var f=r(),l=r(),d=s(1);d===0&&t(1),t(1),n()&&(e=r(),C=r(),g=r(),h=r());var E=[1,1];if(n()&&n()){var y=c();switch(y){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=[c()<<8|c(),c()<<8|c()];break}}}return{width:Math.ceil((f+1)*16-e*2-C*2),height:(2-d)*(l+1)*16-(d?2:4)*(g+h),pixelRatio:E}},j.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},L}();W.default=w},"./src/demux/id3.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"isHeader",function(){return M}),O.d(W,"isFooter",function(){return w}),O.d(W,"getID3Data",function(){return L}),O.d(W,"canParse",function(){return U}),O.d(W,"getTimeStamp",function(){return e}),O.d(W,"isTimeStampFrame",function(){return C}),O.d(W,"getID3Frames",function(){return h}),O.d(W,"decodeFrame",function(){return u}),O.d(W,"utf8ArrayToStr",function(){return r}),O.d(W,"testables",function(){return n});var M=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)))},L=function(m,b){for(var _=b,o=0;M(m,b);){o+=10;var f=j(m,b+6);o+=f,w(m,b+10)&&(o+=10),b+=o}return o>0?m.subarray(_,_+o):void 0},j=function(m,b){var _=0;return _=(m[b]&127)<<21,_|=(m[b+1]&127)<<14,_|=(m[b+2]&127)<<7,_|=m[b+3]&127,_},U=function(m,b){return M(m,b)&&j(m,b+6)+10<=m.length-b},e=function(m){for(var b=h(m),_=0;_<b.length;_++){var o=b[_];if(C(o))return s(o)}return},C=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},g=function(m){var b=String.fromCharCode(m[0],m[1],m[2],m[3]),_=j(m,4),o=10;return{type:b,size:_,data:m.subarray(o,o+_)}},h=function(m){for(var b=0,_=[];M(m,b);){var o=j(m,b+6);b+=10;for(var f=b+o;b+8<f;){var l=g(m.subarray(b)),d=u(l);d&&_.push(d),b+=l.size+10}w(m,b)&&(b+=10)}return _},u=function(m){return m.type==="PRIV"?a(m):m.type[0]==="W"?c(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 o=r(m.data.subarray(b));return{key:m.type,info:_,data:o}}var f=r(m.data.subarray(1));return{key:m.type,data:f}},c=function(m){if(m.type==="WXXX"){if(m.size<2)return;var b=1,_=r(m.data.subarray(b),!0);b+=_.length+1;var o=r(m.data.subarray(b));return{key:m.type,info:_,data:o}}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,o=(b[4]<<23)+(b[5]<<15)+(b[6]<<7)+b[7];return o/=45,_&&(o+=4772185884e-2),Math.round(o)}return},r=function(m,b){b===void 0&&(b=!1);var _=v();if(_){var o=_.decode(m);if(b){var f=o.indexOf("\0");return f!==-1?o.substring(0,f):o}return o.replace(/\0/g,"")}for(var l=m.length,d,E,y,S="",D=0;D<l;){if(d=m[D++],d===0&&b)return S;if(d===0||d===3)continue;switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:S+=String.fromCharCode(d);break;case 12:case 13:E=m[D++],S+=String.fromCharCode((d&31)<<6|E&63);break;case 14:E=m[D++],y=m[D++],S+=String.fromCharCode((d&15)<<12|(E&63)<<6|(y&63)<<0);break;default:}}return S},n={decodeTextFrame:i},t;function v(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/demux/base-audio-demuxer.ts"),w=O("./src/demux/id3.ts"),L=O("./src/utils/logger.ts"),j=O("./src/demux/mpegaudio.ts");function U(g,h){g.prototype=Object.create(h.prototype),g.prototype.constructor=g,e(g,h)}function e(g,h){return e=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},e(g,h)}var C=function(g){U(h,g);function h(){return g.apply(this,arguments)||this}var u=h.prototype;return u.resetInitSegment=function(i,c,s){g.prototype.resetInitSegment.call(this,i,c,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}},h.probe=function(i){if(!i)return!1;for(var c=w.getID3Data(i,0)||[],s=c.length,r=i.length;s<r;s++)if(j.probe(i,s))return L.logger.log("MPEG Audio sync word found !"),!0;return!1},u.canParse=function(i,c){return j.canParse(i,c)},u.appendFrame=function(i,c,s){return this.initPTS===null?void 0:j.appendFrame(i,c,s,this.initPTS,this.frameIndex)},h}(M.default);C.minProbeByteLength=4,W.default=C},"./src/demux/mp4demuxer.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/utils/mp4-tools.ts"),w=O("./src/demux/dummy-demuxed-track.ts"),L=function(){function j(e,C){this.remainderData=null,this.config=void 0,this.config=C}var U=j.prototype;return U.resetTimeStamp=function(){},U.resetInitSegment=function(){},U.resetContiguity=function(){},j.probe=function(C){return Object(M.findBox)({data:C,start:0,end:Math.min(C.length,16384)},["moof"]).length>0},U.demux=function(C){var g=C,h=Object(w.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(M.appendUint8Array)(this.remainderData,C));var u=Object(M.segmentValidRange)(g);this.remainderData=u.remainder,h.samples=u.valid||new Uint8Array}else h.samples=g;return{audioTrack:Object(w.dummyTrack)(),avcTrack:h,id3Track:Object(w.dummyTrack)(),textTrack:Object(w.dummyTrack)()}},U.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)()}},U.demuxSampleAes=function(C,g,h){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},j}();L.minProbeByteLength=1024,W.default=L},"./src/demux/mpegaudio.ts":function(ie,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 g}),O.d(W,"isHeader",function(){return h}),O.d(W,"canParse",function(){return u}),O.d(W,"probe",function(){return a});var M=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],L=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],j=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function e(i,c,s,r,n){if(s+24>c.length)return;var t=C(c,s);if(t&&s+t.frameLength<=c.length){var v=t.samplesPerFrame*9e4/t.sampleRate,p=r+n*v,m={unit:c.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,c){var s=i[c+1]>>3&3,r=i[c+1]>>1&3,n=i[c+2]>>4&15,t=i[c+2]>>2&3;if(s!==1&&n!==0&&n!==15&&t!==3){var v=i[c+2]>>1&1,p=i[c+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,o=L[_*3+t],f=p===3?1:2,l=j[s][r],d=U[r],E=l*8*d,y=Math.floor(l*b/o+v)*d;if(M===null){var S=navigator.userAgent||"",D=S.match(/Chrome\/(\d+)/i);M=D?parseInt(D[1]):0}var I=!!M&&M<=87;return I&&r===2&&b>=224e3&&p===0&&(i[c+3]=i[c+3]|128),{sampleRate:o,channelCount:f,frameLength:y,samplesPerFrame:E}}}function g(i,c){return i[c]===255&&(i[c+1]&224)===224&&(i[c+1]&6)!==0}function h(i,c){return c+1<i.length&&g(i,c)}function u(i,c){var s=4;return g(i,c)&&s<=i.length-c}function a(i,c){if(c+1<i.length&&g(i,c)){var s=4,r=C(i,c),n=s;r!=null&&r.frameLength&&(n=r.frameLength);var t=c+n;return t===i.length||h(i,t)}return!1}},"./src/demux/sample-aes.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/crypt/decrypter.ts"),w=O("./src/demux/tsdemuxer.ts"),L=function(){function j(e,C,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new M.default(e,C,{removePKCS7Padding:!1})}var U=j.prototype;return U.decryptBuffer=function(C,g){this.decrypter.decrypt(C,this.keyData.key.buffer,this.keyData.iv.buffer,g)},U.decryptAacSample=function(C,g,h,u){var a=C[g].unit,i=a.subarray(16,a.length-a.length%16),c=i.buffer.slice(i.byteOffset,i.byteOffset+i.length),s=this;this.decryptBuffer(c,function(r){var n=new Uint8Array(r);a.set(n,16),u||s.decryptAacSamples(C,g+1,h)})},U.decryptAacSamples=function(C,g,h){for(;;g++){if(g>=C.length){h();return}if(C[g].unit.length<32)continue;var u=this.decrypter.isSync();if(this.decryptAacSample(C,g,h,u),!u)return}},U.getAvcEncryptedData=function(C){for(var g=Math.floor((C.length-48)/160)*16+16,h=new Int8Array(g),u=0,a=32;a<=C.length-16;a+=160,u+=16)h.set(C.subarray(a,a+16),u);return h},U.getAvcDecryptedUnit=function(C,g){for(var h=new Uint8Array(g),u=0,a=32;a<=C.length-16;a+=160,u+=16)C.set(h.subarray(u,u+16),a);return C},U.decryptAvcSample=function(C,g,h,u,a,i){var c=Object(w.discardEPB)(a.data),s=this.getAvcEncryptedData(c),r=this;this.decryptBuffer(s.buffer,function(n){a.data=r.getAvcDecryptedUnit(c,n),i||r.decryptAvcSamples(C,g,h+1,u)})},U.decryptAvcSamples=function(C,g,h,u){if(C instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,h=0){if(g>=C.length){u();return}for(var a=C[g].units;!(h>=a.length);h++){var i=a[h];if(i.data.length<=48||i.type!==1&&i.type!==5)continue;var c=this.decrypter.isSync();if(this.decryptAvcSample(C,g,h,u,i,c),!c)return}}},j}();W.default=L},"./src/demux/transmuxer-interface.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return a});var M=O("./node_modules/webworkify-webpack/index.js"),w=O.n(M),L=O("./src/events.ts"),j=O("./src/demux/transmuxer.ts"),U=O("./src/utils/logger.ts"),e=O("./src/errors.ts"),C=O("./src/utils/mediasource-helper.ts"),g=O("./node_modules/eventemitter3/index.js"),h=O.n(g),u=Object(C.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function i(s,r,n,t){var v=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(l,d){d=d||{},d.frag=v.frag,d.id=v.id,s.trigger(l,d)};this.observer=new g.EventEmitter,this.observer.on(L.Events.FRAG_DECRYPTED,m),this.observer.on(L.Events.ERROR,m);var b={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(p.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var o;try{o=this.worker=M("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),o.addEventListener("message",this.onwmsg),o.onerror=function(f){s.trigger(L.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+")")})},o.postMessage({cmd:"init",typeSupported:b,vendor:_,id:r,config:JSON.stringify(p)})}catch(f){U.logger.warn("Error in worker:",f),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),o&&self.URL.revokeObjectURL(o.objectURL),this.transmuxer=new j.default(this.observer,b,p,_,r),this.worker=null}}else this.transmuxer=new j.default(this.observer,b,p,_,r)}var c=i.prototype;return c.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},c.push=function(r,n,t,v,p,m,b,_,o,f){var l=this;o.transmuxing.start=self.performance.now();var d=this.transmuxer,E=this.worker,y=m?m.start:p.start,S=p.decryptdata,D=this.frag,I=!(D&&p.cc===D.cc),A=!(D&&o.level===D.level),P=D?o.sn-D.sn:-1,H=this.part?o.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 V=new j.TransmuxState(I,R,_,A,y);if(!R||I){U.logger.log("[transmuxer-interface, "+p.type+"]: Starting new transmux session for sn: "+o.sn+" p: "+o.part+" level: "+o.level+" id: "+o.id+`
discontinuity: `+I+`
trackSwitch: `+A+`
contiguous: `+R+`
accurateTimeOffset: `+_+`
timeOffset: `+y);var oe=new j.TransmuxConfig(t,v,n,b,f);this.configureTransmuxer(oe)}if(this.frag=p,this.part=m,E)E.postMessage({cmd:"demux",data:r,decryptdata:S,chunkMeta:o,state:V},r instanceof ArrayBuffer?[r]:[]);else if(d){var Q=d.push(r,S,o,V);Object(j.isPromise)(Q)?Q.then(function(pe){l.handleTransmuxComplete(pe)}):this.handleTransmuxComplete(Q)}},c.flush=function(r){var n=this;r.transmuxing.start=self.performance.now();var t=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:r});else if(t){var p=t.flush(r);Object(j.isPromise)(p)?p.then(function(m){n.handleFlushResult(m,r)}):this.handleFlushResult(p,r)}},c.handleFlushResult=function(r,n){var t=this;r.forEach(function(v){t.handleTransmuxComplete(v)}),this.onFlush(n)},c.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}}},c.configureTransmuxer=function(r){var n=this.worker,t=this.transmuxer;n?n.postMessage({cmd:"configure",config:r}):t&&t.configure(r)},c.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},i}()},"./src/demux/transmuxer-worker.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return e});var M=O("./src/demux/transmuxer.ts"),w=O("./src/events.ts"),L=O("./src/utils/logger.ts"),j=O("./node_modules/eventemitter3/index.js"),U=O.n(j);function e(a){var i=new j.EventEmitter,c=function(r,n){a.postMessage({event:r,data:n})};i.on(w.Events.FRAG_DECRYPTED,c),i.on(w.Events.ERROR,c),a.addEventListener("message",function(s){var r=s.data;switch(r.cmd){case"init":{var n=JSON.parse(r.config);a.transmuxer=new M.default(i,r.typeSupported,n,r.vendor,r.id),Object(L.enableLogs)(n.debug),c("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(M.isPromise)(t)?t.then(function(m){C(a,m)}):C(a,t);break}case"flush":{var v=r.chunkMeta,p=a.transmuxer.flush(v);Object(M.isPromise)(p)?p.then(function(m){h(a,m,v)}):h(a,p,v);break}default:break}})}function C(a,i){if(u(i.remuxResult))return;var c=[],s=i.remuxResult,r=s.audio,n=s.video;r&&g(c,r),n&&g(c,n),a.postMessage({event:"transmuxComplete",data:i},c)}function g(a,i){i.data1&&a.push(i.data1.buffer),i.data2&&a.push(i.data2.buffer)}function h(a,i,c){i.forEach(function(s){C(a,s)}),a.postMessage({event:"flush",data:c})}function u(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(ie,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 M=O("./src/events.ts"),w=O("./src/errors.ts"),L=O("./src/crypt/decrypter.ts"),j=O("./src/demux/aacdemuxer.ts"),U=O("./src/demux/mp4demuxer.ts"),e=O("./src/demux/tsdemuxer.ts"),C=O("./src/demux/mp3demuxer.ts"),g=O("./src/remux/mp4-remuxer.ts"),h=O("./src/remux/passthrough-remuxer.ts"),u=O("./src/demux/chunk-cache.ts"),a=O("./src/utils/mp4-tools.ts"),i=O("./src/utils/logger.ts"),c;try{c=self.performance.now.bind(self.performance)}catch(_){i.logger.debug("Unable to use Performance API on this environment"),c=self.Date.now}var s=[{demux:e.default,remux:g.default},{demux:U.default,remux:h.default},{demux:j.default,remux:g.default},{demux:C.default,remux:g.default}],r=1024;s.forEach(function(_){var o=_.demux;r=Math.max(r,o.minProbeByteLength)});var n=function(){function _(f,l,d,E,y){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 u.default,this.observer=f,this.typeSupported=l,this.config=d,this.vendor=E,this.id=y}var o=_.prototype;return o.configure=function(l){this.transmuxConfig=l,this.decrypter&&this.decrypter.reset()},o.push=function(l,d,E,y){var S=this,D=E.transmuxing;D.executeStart=c();var I=new Uint8Array(l),A=this.cache,P=this.config,H=this.currentTransmuxState,R=this.transmuxConfig;y&&(this.currentTransmuxState=y);var K=t(I,d);if(K&&K.method==="AES-128"){var V=this.getDecrypter();if(P.enableSoftwareAES){var oe=V.softwareDecrypt(I,K.key.buffer,K.iv.buffer);if(!oe)return D.executeEnd=c(),v(E);I=new Uint8Array(oe)}else return this.decryptionPromise=V.webCryptoDecrypt(I,K.key.buffer,K.iv.buffer).then(function(De){var Ne=S.push(De,null,E);return S.decryptionPromise=null,Ne}),this.decryptionPromise}var Q=y||H,pe=Q.contiguous,ce=Q.discontinuity,ee=Q.trackSwitch,ne=Q.accurateTimeOffset,me=Q.timeOffset,Z=R.audioCodec,Y=R.videoCodec,Se=R.defaultInitPts,Me=R.duration,ke=R.initSegmentData;if((ce||ee)&&this.resetInitSegment(ke,Z,Y,Me),ce&&this.resetInitialTimestamp(Se),pe||this.resetContiguity(),this.needsProbing(I,ce,ee)){if(A.dataLength){var Re=A.flush();I=Object(a.appendUint8Array)(Re,I)}this.configureTransmuxer(I,R)}var Pe=this.transmux(I,K,me,ne,E),Ce=this.currentTransmuxState;return Ce.contiguous=!0,Ce.discontinuity=!1,Ce.trackSwitch=!1,D.executeEnd=c(),Pe},o.flush=function(l){var d=this,E=l.transmuxing;E.executeStart=c();var y=this.decrypter,S=this.cache,D=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return d.flush(l)});var A=[],P=D.timeOffset;if(y){var H=y.flush();H&&A.push(this.push(H,null,l))}var R=S.dataLength;S.reset();var K=this.demuxer,V=this.remuxer;if(!K||!V)return R>=r&&this.observer.emit(M.Events.ERROR,M.Events.ERROR,{type:w.ErrorTypes.MEDIA_ERROR,details:w.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=c(),[v(l)];var oe=K.flush(P);return p(oe)?oe.then(function(Q){return d.flushRemux(A,Q,l),A}):(this.flushRemux(A,oe,l),A)},o.flushRemux=function(l,d,E){var y=d.audioTrack,S=d.avcTrack,D=d.id3Track,I=d.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(y,S,D,I,H,P,!0,this.id);l.push({remuxResult:R,chunkMeta:E}),E.transmuxing.executeEnd=c()},o.resetInitialTimestamp=function(l){var d=this.demuxer,E=this.remuxer;if(!d||!E)return;d.resetTimeStamp(l),E.resetTimeStamp(l)},o.resetContiguity=function(){var l=this.demuxer,d=this.remuxer;if(!l||!d)return;l.resetContiguity(),d.resetNextTimestamp()},o.resetInitSegment=function(l,d,E,y){var S=this.demuxer,D=this.remuxer;if(!S||!D)return;S.resetInitSegment(d,E,y),D.resetInitSegment(l,d,E)},o.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},o.transmux=function(l,d,E,y,S){var D;return d&&d.method==="SAMPLE-AES"?D=this.transmuxSampleAes(l,d,E,y,S):D=this.transmuxUnencrypted(l,E,y,S),D},o.transmuxUnencrypted=function(l,d,E,y){var S=this.demuxer.demux(l,d,!1,!this.config.progressive),D=S.audioTrack,I=S.avcTrack,A=S.id3Track,P=S.textTrack,H=this.remuxer.remux(D,I,A,P,d,E,!1,this.id);return{remuxResult:H,chunkMeta:y}},o.transmuxSampleAes=function(l,d,E,y,S){var D=this;return this.demuxer.demuxSampleAes(l,d,E).then(function(I){var A=D.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,E,y,!1,D.id);return{remuxResult:A,chunkMeta:S}})},o.configureTransmuxer=function(l,d){for(var E=this.config,y=this.observer,S=this.typeSupported,D=this.vendor,I=d.audioCodec,A=d.defaultInitPts,P=d.duration,H=d.initSegmentData,R=d.videoCodec,K,V=0,oe=s.length;V<oe;V++)if(s[V].demux.probe(l)){K=s[V];break}K||(i.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),K={demux:U.default,remux:h.default});var Q=this.demuxer,pe=this.remuxer,ce=K.remux,ee=K.demux;(!pe||!(pe instanceof ce))&&(this.remuxer=new ce(y,E,S,D)),(!Q||!(Q instanceof ee))&&(this.demuxer=new ee(y,E,S),this.probe=ee.probe),this.resetInitSegment(H,I,R,P),this.resetInitialTimestamp(A)},o.needsProbing=function(l,d,E){return!this.demuxer||!this.remuxer||d||E},o.getDecrypter=function(){var l=this.decrypter;return l||(l=this.decrypter=new L.default(this.observer,this.config)),l},_}();function t(_,o){var f=null;return _.byteLength>0&&o!=null&&o.key!=null&&o.iv!==null&&o.method!=null&&(f=o),f}var v=function(o){return{remuxResult:{},chunkMeta:o}};function p(_){return"then"in _&&_.then instanceof Function}var m=function(o,f,l,d,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=o,this.videoCodec=f,this.initSegmentData=l,this.duration=d,this.defaultInitPts=E},b=function(o,f,l,d,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=o,this.contiguous=f,this.accurateTimeOffset=l,this.trackSwitch=d,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"discardEPB",function(){return v});var M=O("./src/demux/adts.ts"),w=O("./src/demux/mpegaudio.ts"),L=O("./src/demux/exp-golomb.ts"),j=O("./src/demux/id3.ts"),U=O("./src/demux/sample-aes.ts"),e=O("./src/events.ts"),C=O("./src/utils/mp4-tools.ts"),g=O("./src/utils/logger.ts"),h=O("./src/errors.ts"),u={video:1,audio:2,id3:3,text:4},a=function(){function p(b,_,o){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=o}p.probe=function(_){var o=p.syncOffset(_);return o<0?!1:(o&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+o+", junk ahead ?"),!0)},p.syncOffset=function(_){for(var o=Math.min(1e3,_.length-3*188),f=0;f<o;){if(_[f]===71&&_[f+188]===71&&_[f+2*188]===71)return f;f++}return-1},p.createTrack=function(_,o){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:u[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?o:void 0}};var m=p.prototype;return m.resetInitSegment=function(_,o,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=o,this._duration=f},m.resetTimeStamp=function(){},m.resetContiguity=function(){var _=this._audioTrack,o=this._avcTrack,f=this._id3Track;_&&(_.pesData=null),o&&(o.pesData=null),f&&(f.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(_,o,f,l){f===void 0&&(f=!1),l===void 0&&(l=!1),f||(this.sampleAes=null);var d,E=this._avcTrack,y=this._audioTrack,S=this._id3Track,D=E.pid,I=E.pesData,A=y.pid,P=S.pid,H=y.pesData,R=S.pesData,K=!1,V=this.pmtParsed,oe=this._pmtId,Q=_.length;if(this.remainderData&&(_=Object(C.appendUint8Array)(this.remainderData,_),Q=_.length,this.remainderData=null),Q<188&&!l)return this.remainderData=_,{audioTrack:y,avcTrack:E,id3Track:S,textTrack:this._txtTrack};var pe=Math.max(0,p.syncOffset(_));Q-=(Q+pe)%188,Q<_.byteLength&&!l&&(this.remainderData=new Uint8Array(_.buffer,Q,_.buffer.byteLength-Q));for(var ce=pe;ce<Q;ce+=188)if(_[ce]===71){var ee=!!(_[ce+1]&64),ne=((_[ce+1]&31)<<8)+_[ce+2],me=(_[ce+3]&48)>>4,Z=void 0;if(me>1){if(Z=ce+5+_[ce+4],Z===ce+188)continue}else Z=ce+4;switch(ne){case D:ee&&(I&&(d=r(I))&&this.parseAVCPES(d,!1),I={data:[],size:0}),I&&(I.data.push(_.subarray(Z,ce+188)),I.size+=ce+188-Z);break;case A:ee&&(H&&(d=r(H))&&(y.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),H={data:[],size:0}),H&&(H.data.push(_.subarray(Z,ce+188)),H.size+=ce+188-Z);break;case P:ee&&(R&&(d=r(R))&&this.parseID3PES(d),R={data:[],size:0}),R&&(R.data.push(_.subarray(Z,ce+188)),R.size+=ce+188-Z);break;case 0:ee&&(Z+=_[Z]+1),oe=this._pmtId=c(_,Z);break;case oe:{ee&&(Z+=_[Z]+1);var Y=s(_,Z,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,f);D=Y.avc,D>0&&(E.pid=D),A=Y.audio,A>0&&(y.pid=A,y.isAAC=Y.isAAC),P=Y.id3,P>0&&(S.pid=P),K&&!V&&(g.logger.log("reparse from beginning"),K=!1,ce=pe-188),V=this.pmtParsed=!0;break}case 17:case 8191:break;default:K=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=I,y.pesData=H,S.pesData=R;var Se={audioTrack:y,avcTrack:E,id3Track:S,textTrack:this._txtTrack};return l&&this.extractRemainingSamples(Se),Se},m.flush=function(){var _=this.remainderData;this.remainderData=null;var o;return _?o=this.demux(_,-1,!1,!0):o={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(o),this.sampleAes?this.decrypt(o,this.sampleAes):o},m.extractRemainingSamples=function(_){var o=_.audioTrack,f=_.avcTrack,l=_.id3Track,d=f.pesData,E=o.pesData,y=l.pesData,S;d&&(S=r(d))?(this.parseAVCPES(S,!0),f.pesData=null):f.pesData=d,E&&(S=r(E))?(o.isAAC?this.parseAACPES(S):this.parseMPEGPES(S),o.pesData=null):(E!=null&&E.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),o.pesData=E),y&&(S=r(y))?(this.parseID3PES(S),l.pesData=null):l.pesData=y},m.demuxSampleAes=function(_,o,f){var l=this.demux(_,f,!0,!this.config.progressive),d=this.sampleAes=new U.default(this.observer,this.config,o);return this.decrypt(l,d)},m.decrypt=function(_,o){return new Promise(function(f){var l=_.audioTrack,d=_.avcTrack;l.samples&&l.isAAC?o.decryptAacSamples(l.samples,0,function(){d.samples?o.decryptAvcSamples(d.samples,0,0,function(){f(_)}):f(_)}):d.samples&&o.decryptAvcSamples(d.samples,0,0,function(){f(_)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(_,o){var f=this,l=this._avcTrack,d=this.parseAVCNALu(_.data),E=!1,y=this.avcSample,S,D=!1;_.data=null,y&&d.length&&!l.audFound&&(n(y,l),y=this.avcSample=i(!1,_.pts,_.dts,"")),d.forEach(function(I){switch(I.type){case 1:{S=!0,y||(y=f.avcSample=i(!0,_.pts,_.dts,"")),E&&(y.debug+="NDR "),y.frame=!0;var A=I.data;if(D&&A.length>4){var P=new L.default(A).readSliceType();(P===2||P===4||P===7||P===9)&&(y.key=!0)}break}case 5:S=!0,y||(y=f.avcSample=i(!0,_.pts,_.dts,"")),E&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{S=!0,E&&y&&(y.debug+="SEI ");var H=new L.default(v(I.data));H.readUByte();for(var R=0,K=0,V=!1,oe=0;!V&&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){V=!0;var Q=H.readUByte();if(Q===181){var pe=H.readUShort();if(pe===49){var ce=H.readUInt();if(ce===1195456820){var ee=H.readUByte();if(ee===3){for(var ne=H.readUByte(),me=H.readUByte(),Z=31&ne,Y=[ne,me],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(V=!0,K>16){for(var Me=[],ke=0;ke<16;ke++)Me.push(H.readUByte().toString(16)),(ke===3||ke===5||ke===7||ke===9)&&Me.push("-");for(var Re=K-16,Pe=new Uint8Array(Re),Ce=0;Ce<Re;Ce++)Pe[Ce]=H.readUByte();t(f._txtTrack.samples,{pts:_.pts,payloadType:R,uuid:Me.join(""),userData:Object(j.utf8ArrayToStr)(Pe),userDataBytes:Pe})}}else if(K<H.bytesAvailable)for(var De=0;De<K;De++)H.readUByte()}break}case 7:if(S=!0,D=!0,E&&y&&(y.debug+="SPS "),!l.sps){var Ne=new L.default(I.data),J=Ne.readSPS();l.width=J.width,l.height=J.height,l.pixelRatio=J.pixelRatio,l.sps=[I.data],l.duration=f._duration;for(var fe=I.data.subarray(1,4),Te="avc1.",Ee=0;Ee<3;Ee++){var je=fe[Ee].toString(16);je.length<2&&(je="0"+je),Te+=je}l.codec=Te}break;case 8:S=!0,E&&y&&(y.debug+="PPS "),l.pps||(l.pps=[I.data]);break;case 9:S=!1,l.audFound=!0,y&&n(y,l),y=f.avcSample=i(!1,_.pts,_.dts,E?"AUD ":"");break;case 12:S=!1;break;default:S=!1,y&&(y.debug+="unknown NAL "+I.type+" ");break}if(y&&S){var He=y.units;He.push(I)}}),o&&y&&(n(y,l),this.avcSample=null)},m.getLastNalUnit=function(){var _,o=this.avcSample,f;if(!o||o.units.length===0){var l=this._avcTrack.samples;o=l[l.length-1]}if((_=o)!==null&&_!==void 0&&_.units){var d=o.units;f=d[d.length-1]}return f},m.parseAVCNALu=function(_){var o=_.byteLength,f=this._avcTrack,l=f.naluState||0,d=l,E=[],y=0,S,D,I,A=-1,P=0;for(l===-1&&(A=0,P=_[0]&31,l=0,y=1);y<o;){if(S=_[y++],!l){l=S?0:1;continue}if(l===1){l=S?0:2;continue}if(!S)l=3;else if(S===1){if(A>=0){var H={data:_.subarray(A,y-l-1),type:P};E.push(H)}else{var R=this.getLastNalUnit();if(R&&(d&&y<=4-d&&(R.state&&(R.data=R.data.subarray(0,R.data.byteLength-d))),D=y-l-1,D>0)){var K=new Uint8Array(R.data.byteLength+D);K.set(R.data,0),K.set(_.subarray(0,D),R.data.byteLength),R.data=K,R.state=0}}y<o?(I=_[y]&31,A=y,P=I,l=0):l=-1}else l=0}if(A>=0&&l>=0){var V={data:_.subarray(A,o),type:P,state:l};E.push(V)}if(E.length===0){var oe=this.getLastNalUnit();if(oe){var Q=new Uint8Array(oe.data.byteLength+_.byteLength);Q.set(oe.data,0),Q.set(_,oe.data.byteLength),oe.data=Q}}return f.naluState=l,E},m.parseAACPES=function(_){var o=0,f=this._audioTrack,l=this.aacOverFlow,d=_.data;if(l){this.aacOverFlow=null;var E=l.sample.unit.byteLength,y=Math.min(l.missing,E),S=E-y;l.sample.unit.set(d.subarray(0,y),S),f.samples.push(l.sample),o=l.missing}var D,I;for(D=o,I=d.length;D<I-1&&!M.isHeader(d,D);D++);if(D!==o){var A,P;if(D<I-1?(A="AAC PES did not start with ADTS header,offset:"+D,P=!1):(A="no ADTS header found in AAC PES",P=!0),g.logger.warn("parsing error:"+A),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:P,reason:A}),P)return}M.initTrackConfig(f,this.observer,d,D,this.audioCodec);var H;if(_.pts!==void 0)H=_.pts;else if(l){var R=M.getFrameDuration(f.samplerate);H=l.sample.pts+R}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var K=0;D<I;)if(M.isHeader(d,D)){if(D+5<I){var V=M.appendFrame(f,d,D,H,K);if(V)if(V.missing)this.aacOverFlow=V;else{D+=V.length,K++;continue}}break}else D++},m.parseMPEGPES=function(_){var o=_.data,f=o.length,l=0,d=0,E=_.pts;if(E===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<f;)if(w.isHeader(o,d)){var y=w.appendFrame(this._audioTrack,o,d,E,l);if(y)d+=y.length,l++;else break}else d++},m.parseID3PES=function(_){if(_.pts===void 0){g.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 c(p,m){return(p[m+10]&31)<<8|p[m+11]}function s(p,m,b,_){var o={audio:-1,avc:-1,id3:-1,isAAC:!0},f=(p[m+1]&15)<<8|p[m+2],l=m+3+f-4,d=(p[m+10]&15)<<8|p[m+11];for(m+=12+d;m<l;){var E=(p[m+1]&31)<<8|p[m+2];switch(p[m]){case 207:if(!_){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:o.audio===-1&&(o.audio=E);break;case 21:o.id3===-1&&(o.id3=E);break;case 219:if(!_){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:o.avc===-1&&(o.avc=E);break;case 3:case 4:b?o.audio===-1&&(o.audio=E,o.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((p[m+3]&15)<<8|p[m+4])+5}return o}function r(p){var m=0,b,_,o,f,l,d=p.data;if(!p||p.size===0)return null;for(;d[0].length<19&&d.length>1;){var E=new Uint8Array(d[0].length+d[1].length);E.set(d[0]),E.set(d[1],d[0].length),d[0]=E,d.splice(1,1)}b=d[0];var y=(b[0]<<16)+(b[1]<<8)+b[2];if(y===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?(l=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,f-l>60*9e4&&(g.logger.warn(Math.round((f-l)/9e4)+"s delta between PTS and DTS, align them"),f=l)):l=f),o=b[8];var D=o+9;if(p.size<=D)return null;p.size-=D;for(var I=new Uint8Array(p.size),A=0,P=d.length;A<P;A++){b=d[A];var H=b.byteLength;if(D)if(D>H){D-=H;continue}else b=b.subarray(D),H-=D,D=0;I.set(b,m),m+=H}return _&&(_-=o+3),{data:I,pts:f,dts:l,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 o=b[_-1];p.pts=o.pts,p.dts=o.dts}else{m.dropped++;return}}m.samples.push(p)}p.debug.length&&g.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 v(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 o=m-b.length,f=new Uint8Array(o),l=0;for(_=0;_<o;l++,_++)l===b[0]&&(l++,b.shift()),f[_]=p[l];return f}W.default=a},"./src/errors.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"ErrorTypes",function(){return M}),O.d(W,"ErrorDetails",function(){return w});var M;(function(L){L.NETWORK_ERROR="networkError",L.MEDIA_ERROR="mediaError",L.KEY_SYSTEM_ERROR="keySystemError",L.MUX_ERROR="muxError",L.OTHER_ERROR="otherError"})(M||(M={}));var w;(function(L){L.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",L.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",L.KEY_SYSTEM_NO_SESSION="keySystemNoSession",L.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",L.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",L.MANIFEST_LOAD_ERROR="manifestLoadError",L.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",L.MANIFEST_PARSING_ERROR="manifestParsingError",L.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",L.LEVEL_EMPTY_ERROR="levelEmptyError",L.LEVEL_LOAD_ERROR="levelLoadError",L.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",L.LEVEL_SWITCH_ERROR="levelSwitchError",L.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",L.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",L.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",L.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",L.FRAG_LOAD_ERROR="fragLoadError",L.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",L.FRAG_DECRYPT_ERROR="fragDecryptError",L.FRAG_PARSING_ERROR="fragParsingError",L.REMUX_ALLOC_ERROR="remuxAllocError",L.KEY_LOAD_ERROR="keyLoadError",L.KEY_LOAD_TIMEOUT="keyLoadTimeOut",L.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",L.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",L.BUFFER_APPEND_ERROR="bufferAppendError",L.BUFFER_APPENDING_ERROR="bufferAppendingError",L.BUFFER_STALLED_ERROR="bufferStalledError",L.BUFFER_FULL_ERROR="bufferFullError",L.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",L.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",L.INTERNAL_EXCEPTION="internalException",L.INTERNAL_ABORTED="aborted",L.UNKNOWN="unknown"})(w||(w={}))},"./src/events.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"Events",function(){return M});var M;(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"})(M||(M={}))},"./src/hls.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return p});var M=O("./node_modules/url-toolkit/src/url-toolkit.js"),w=O.n(M),L=O("./src/loader/playlist-loader.ts"),j=O("./src/loader/key-loader.ts"),U=O("./src/controller/id3-track-controller.ts"),e=O("./src/controller/latency-controller.ts"),C=O("./src/controller/level-controller.ts"),g=O("./src/controller/fragment-tracker.ts"),h=O("./src/controller/stream-controller.ts"),u=O("./src/is-supported.ts"),a=O("./src/utils/logger.ts"),i=O("./src/config.ts"),c=O("./node_modules/eventemitter3/index.js"),s=O.n(c),r=O("./src/events.ts"),n=O("./src/errors.ts");function t(m,b){for(var _=0;_<b.length;_++){var o=b[_];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}function v(m,b,_){return b&&t(m.prototype,b),_&&t(m,_),m}var p=function(){m.isSupported=function(){return Object(u.isSupported)()};function m(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new c.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 o=this.config=Object(i.mergeConfig)(m.DefaultConfig,_);this.userConfig=_,Object(a.enableLogs)(o.debug),this._autoLevelCapping=-1,o.progressive&&Object(i.enableStreamingMode)(o);var f=o.abrController,l=o.bufferController,d=o.capLevelController,E=o.fpsController,y=this.abrController=new f(this),S=this.bufferController=new l(this),D=this.capLevelController=new d(this),I=new E(this),A=new L.default(this),P=new j.default(this),H=new U.default(this),R=this.levelController=new C.default(this),K=new g.FragmentTracker(this),V=this.streamController=new h.default(this,K);D.setStreamController(V),I.setStreamController(V);var oe=[R,V];this.networkControllers=oe;var Q=[A,P,y,S,D,I,H,K];this.audioTrackController=this.createController(o.audioTrackController,null,oe),this.createController(o.audioStreamController,K,oe),this.subtitleTrackController=this.createController(o.subtitleTrackController,null,oe),this.createController(o.subtitleStreamController,K,oe),this.createController(o.timelineController,null,Q),this.emeController=this.createController(o.emeController,null,Q),this.cmcdController=this.createController(o.cmcdController,null,Q),this.latencyController=this.createController(e.default,null,Q),this.coreComponents=Q}var b=m.prototype;return b.createController=function(o,f,l){if(o){var d=f?new o(this,f):new o(this);return l&&l.push(d),d}return null},b.on=function(o,f,l){l===void 0&&(l=this),this._emitter.on(o,f,l)},b.once=function(o,f,l){l===void 0&&(l=this),this._emitter.once(o,f,l)},b.removeAllListeners=function(o){this._emitter.removeAllListeners(o)},b.off=function(o,f,l,d){l===void 0&&(l=this),this._emitter.off(o,f,l,d)},b.listeners=function(o){return this._emitter.listeners(o)},b.emit=function(o,f,l){return this._emitter.emit(o,f,l)},b.trigger=function(o,f){if(this.config.debug)return this.emit(o,o,f);try{return this.emit(o,o,f)}catch(l){a.logger.error("An internal error happened while handling event "+o+'. Error message: "'+l.message+'". Here is a stacktrace:',l),this.trigger(r.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:o,error:l})}return!1},b.listenerCount=function(o){return this._emitter.listenerCount(o)},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(o){return o.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(o){return o.destroy()}),this.coreComponents.length=0},b.attachMedia=function(o){a.logger.log("attachMedia"),this._media=o,this.trigger(r.Events.MEDIA_ATTACHING,{media:o})},b.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},b.loadSource=function(o){this.stopLoad();var f=this.media,l=this.url,d=this.url=M.buildAbsoluteURL(self.location.href,o,{alwaysNormalize:!0});a.logger.log("loadSource:"+d),f&&l&&l!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(f)),this.trigger(r.Events.MANIFEST_LOADING,{url:o})},b.startLoad=function(o){o===void 0&&(o=-1),a.logger.log("startLoad("+o+")"),this.networkControllers.forEach(function(f){f.startLoad(o)})},b.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(o){o.stopLoad()})},b.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},b.recoverMediaError=function(){a.logger.log("recoverMediaError");var o=this._media;this.detachMedia(),o&&this.attachMedia(o)},b.removeLevel=function(o,f){f===void 0&&(f=0),this.levelController.removeLevel(o,f)},v(m,[{key:"levels",get:function(){var o=this.levelController.levels;return o||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(o){a.logger.log("set currentLevel:"+o),this.loadLevel=o,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(o){a.logger.log("set nextLevel:"+o),this.levelController.manualLevel=o,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(o){a.logger.log("set loadLevel:"+o),this.levelController.manualLevel=o}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(o){this.levelController.nextLoadLevel=o}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(o){a.logger.log("set firstLevel:"+o),this.levelController.firstLevel=o}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(o){a.logger.log("set startLevel:"+o),o!==-1&&(o=Math.max(o,this.minAutoLevel)),this.levelController.startLevel=o}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(o){var f=!!o;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(o){this._autoLevelCapping!==o&&(a.logger.log("set autoLevelCapping:"+o),this._autoLevelCapping=o)}},{key:"bandwidthEstimate",get:function(){var o=this.abrController.bwEstimator;return o?o.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var o=this.levels,f=this.config.minAutoBitrate;if(!o)return 0;for(var l=o.length,d=0;d<l;d++)if(o[d].maxBitrate>f)return d;return 0}},{key:"maxAutoLevel",get:function(){var o=this.levels,f=this.autoLevelCapping,l;return f===-1&&o&&o.length?l=o.length-1:l=f,l}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(o){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,o)}},{key:"audioTracks",get:function(){var o=this.audioTrackController;return o?o.audioTracks:[]}},{key:"audioTrack",get:function(){var o=this.audioTrackController;return o?o.audioTrack:-1},set:function(o){var f=this.audioTrackController;f&&(f.audioTrack=o)}},{key:"subtitleTracks",get:function(){var o=this.subtitleTrackController;return o?o.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var o=this.subtitleTrackController;return o?o.subtitleTrack:-1},set:function(o){var f=this.subtitleTrackController;f&&(f.subtitleTrack=o)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var o=this.subtitleTrackController;return o?o.subtitleDisplay:!1},set:function(o){var f=this.subtitleTrackController;f&&(f.subtitleDisplay=o)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(o){this.config.lowLatencyMode=o}},{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(o){m.defaultConfig=o}}]),m}();p.defaultConfig=void 0},"./src/is-supported.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"isSupported",function(){return L}),O.d(W,"changeTypeSupported",function(){return j});var M=O("./src/utils/mediasource-helper.ts");function w(){return self.SourceBuffer||self.WebKitSourceBuffer}function L(){var U=Object(M.getMediaSource)();if(!U)return!1;var e=w(),C=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!C&&!!g}function j(){var U,e=w();return typeof(e==null||((U=e.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return a}),O.d(W,"LoadError",function(){return c});var M=O("./src/polyfills/number.ts"),w=O("./src/errors.ts");function L(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,g(s,r)}function j(s){var r=typeof Map=="function"?new Map:void 0;return j=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,v)}function v(){return U(t,arguments,h(this).constructor)}return v.prototype=Object.create(t.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g(v,t)},j(s)}function U(s,r,n){return e()?U=Reflect.construct:U=function(v,p,m){var b=[null];b.push.apply(b,p);var _=Function.bind.apply(v,b),o=new _;return m&&g(o,m.prototype),o},U.apply(null,arguments)}function e(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function C(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function g(s,r){return g=Object.setPrototypeOf||function(t,v){return t.__proto__=v,t},g(s,r)}function h(s){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},h(s)}var u=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,v){var p=this,m=t.url;if(!m)return Promise.reject(new c({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,o=b.loader;return new Promise(function(f,l){p.loader&&p.loader.destroy();var d=p.loader=t.loader=_?new _(b):new o(b),E=i(t),y={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:b.fragLoadingMaxRetryTimeout,highWaterMark:u};t.stats=d.stats,d.load(E,y,{onSuccess:function(D,I,A,P){p.resetLoader(t,d),f({frag:t,part:null,payload:D.data,networkDetails:P})},onError:function(D,I,A){p.resetLoader(t,d),l(new c({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:D,networkDetails:A}))},onAbort:function(D,I,A){p.resetLoader(t,d),l(new c({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:A}))},onTimeout:function(D,I,A){p.resetLoader(t,d),l(new c({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:A}))},onProgress:function(D,I,A,P){v&&v({frag:t,part:null,payload:A,networkDetails:P})}})})},r.loadPart=function(t,v,p){var m=this;this.abort();var b=this.config,_=b.fLoader,o=b.loader;return new Promise(function(f,l){m.loader&&m.loader.destroy();var d=m.loader=t.loader=_?new _(b):new o(b),E=i(t,v),y={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:b.fragLoadingMaxRetryTimeout,highWaterMark:u};v.stats=d.stats,d.load(E,y,{onSuccess:function(D,I,A,P){m.resetLoader(t,d),m.updateStatsFromPart(t,v);var H={frag:t,part:v,payload:D.data,networkDetails:P};p(H),f(H)},onError:function(D,I,A){m.resetLoader(t,d),l(new c({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:v,response:D,networkDetails:A}))},onAbort:function(D,I,A){t.stats.aborted=v.stats.aborted,m.resetLoader(t,d),l(new c({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:v,networkDetails:A}))},onTimeout:function(D,I,A){m.resetLoader(t,d),l(new c({type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:v,networkDetails:A}))}})})},r.updateStatsFromPart=function(t,v){var p=t.stats,m=v.stats,b=m.total;if(p.loaded+=m.loaded,b){var _=Math.round(t.duration/v.duration),o=Math.min(Math.round(p.loaded/b),_),f=_-o,l=f*Math.round(p.loaded/o);p.total=p.loaded+l}else p.total=Math.max(p.loaded,p.total);var d=p.loading,E=m.loading;d.start?d.first+=E.first-E.start:(d.start=E.start,d.first=E.first),d.end=E.end},r.resetLoader=function(t,v){t.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.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},v=n.byteRangeStartOffset,p=n.byteRangeEndOffset;return Object(M.isFiniteNumber)(v)&&Object(M.isFiniteNumber)(p)&&(t.rangeStart=v,t.rangeEnd=p),t}var c=function(s){L(r,s);function r(n){for(var t,v=arguments.length,p=new Array(v>1?v-1:0),m=1;m<v;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}(j(Error))},"./src/loader/fragment.ts":function(ie,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 c}),O.d(W,"Part",function(){return s});var M=O("./src/polyfills/number.ts"),w=O("./node_modules/url-toolkit/src/url-toolkit.js"),L=O.n(w),j=O("./src/utils/logger.ts"),U=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,g(r,n)}function g(r,n){return g=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v},g(r,n)}function h(r,n){for(var t=0;t<n.length;t++){var v=n[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(r,v.key,v)}}function u(r,n,t){return n&&h(r.prototype,n),t&&h(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 v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[a.AUDIO]=null,v[a.VIDEO]=null,v[a.AUDIOVIDEO]=null,v),this.baseurl=t}var n=r.prototype;return n.setByteRange=function(v,p){var m=v.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},u(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(v){this._url=v}}]),r}(),c=function(r){C(n,r);function n(v,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=v,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=U.LevelKey.fromURI(p.uri),b.method=p.method,b.iv=this.createInitializationVector(m),b.keyFormat="identity"),b},t.setElementaryStreamInfo=function(p,m,b,_,o,f){f===void 0&&(f=!1);var l=this.elementaryStreams,d=l[p];if(!d){l[p]={startPTS:m,endPTS:b,startDTS:_,endDTS:o,partial:f};return}d.startPTS=Math.min(d.startPTS,m),d.endPTS=Math.max(d.endPTS,b),d.startDTS=Math.min(d.startDTS,_),d.endDTS=Math.max(d.endDTS,o)},t.clearElementaryStreamInfo=function(){var p=this.elementaryStreams;p[a.AUDIO]=null,p[a.VIDEO]=null,p[a.AUDIOVIDEO]=null},u(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&&j.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(M.isFiniteNumber)(this.programDateTime))return null;var p=Object(M.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,v,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=v,_.index=m;var o=t.enumeratedString("BYTERANGE");return o&&_.setByteRange(o,b),b&&(_.fragOffset=b.fragOffset+b.duration),_}return u(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 v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),n}(i)},"./src/loader/key-loader.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return j});var M=O("./src/events.ts"),w=O("./src/errors.ts"),L=O("./src/utils/logger.ts"),j=function(){function U(C){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=C,this._registerListeners()}var e=U.prototype;return e._registerListeners=function(){this.hls.on(M.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(M.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var h=this.loaders[g];h&&h.destroy()}this.loaders={}},e.onKeyLoading=function(g,h){var u=h.frag,a=u.type,i=this.loaders[a];if(!u.decryptdata){L.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var c=u.decryptdata.uri;if(c!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(i&&(L.logger.warn("abort previous key loader for type:"+a),i.abort()),!c){L.logger.warn("key uri is falsy");return}var r=s.loader,n=u.loader=this.loaders[a]=new r(s);this.decrypturl=c,this.decryptkey=null;var t={url:c,frag:u,responseType:"arraybuffer"},v={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,v,p)}else this.decryptkey&&(u.decryptdata.key=this.decryptkey,this.hls.trigger(M.Events.KEY_LOADED,{frag:u}))},e.loadsuccess=function(g,h,u){var a=u.frag;if(!a.decryptdata){L.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(g.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(M.Events.KEY_LOADED,{frag:a})},e.loaderror=function(g,h){var u=h.frag,a=u.loader;a&&a.abort(),delete this.loaders[u.type],this.hls.trigger(M.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:u,response:g})},e.loadtimeout=function(g,h){var u=h.frag,a=u.loader;a&&a.abort(),delete this.loaders[u.type],this.hls.trigger(M.Events.ERROR,{type:w.ErrorTypes.NETWORK_ERROR,details:w.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:u})},U}()},"./src/loader/level-details.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"LevelDetails",function(){return U});var M=O("./src/polyfills/number.ts");function w(e,C){for(var g=0;g<C.length;g++){var h=C[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(e,h.key,h)}}function L(e,C,g){return C&&w(e.prototype,C),g&&w(e,g),e}var j=10,U=function(){function e(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var C=e.prototype;return C.reloaded=function(h){if(!h){this.advanced=!0,this.updated=!0;return}var u=this.lastPartSn-h.lastPartSn,a=this.lastPartIndex-h.lastPartIndex;this.updated=this.endSN!==h.endSN||!!a||!!u,this.advanced=this.endSN>h.endSN||u>0||u===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(h.misses*.6):this.misses=h.misses+1,this.availabilityDelay=h.availabilityDelay},L(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(M.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||j}},{key:"drift",get:function(){var h=this.driftEndTime-this.driftStartTime;if(h>0){var u=this.driftEnd-this.driftStart;return u*1e3/h}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var h;return(h=this.fragments)!==null&&h!==void 0&&h.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 h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var h;return(h=this.partList)!==null&&h!==void 0&&h.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"LevelKey",function(){return U});var M=O("./node_modules/url-toolkit/src/url-toolkit.js"),w=O.n(M);function L(e,C){for(var g=0;g<C.length;g++){var h=C[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(e,h.key,h)}}function j(e,C,g){return C&&L(e.prototype,C),g&&L(e,g),e}var U=function(){e.fromURL=function(g,h){return new e(g,h)},e.fromURI=function(g){return new e(g)};function e(C,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(M.buildAbsoluteURL)(C,g,{alwaysNormalize:!0}):this._uri=C}return j(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"LoadStats",function(){return M});var M=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(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return n});var M=O("./src/polyfills/number.ts"),w=O("./node_modules/url-toolkit/src/url-toolkit.js"),L=O.n(w),j=O("./src/loader/fragment.ts"),U=O("./src/loader/level-details.ts"),e=O("./src/loader/level-key.ts"),C=O("./src/utils/attr-list.ts"),g=O("./src/utils/logger.ts"),h=O("./src/utils/codecs.ts"),u=/#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"),c=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 _,o;return s.test((_=(o=w.parseURL(b))===null||o===void 0?void 0:o.path)!=null?_:"")}var n=function(){function b(){}return b.findGroup=function(o,f){for(var l=0;l<o.length;l++){var d=o[l];if(d.id===f)return d}},b.convertAVC1ToAVCOTI=function(o){var f=o.split(".");if(f.length>2){var l=f.shift()+".";return l+=parseInt(f.shift()).toString(16),l+=("000"+parseInt(f.shift()).toString(16)).substr(-4),l}return o},b.resolve=function(o,f){return w.buildAbsoluteURL(f,o,{alwaysNormalize:!0})},b.parseMasterPlaylist=function(o,f){var l=[],d={},E=!1;u.lastIndex=0;for(var y;(y=u.exec(o))!=null;)if(y[1]){var S=new C.AttrList(y[1]),D={attrs:S,bitrate:S.decimalInteger("AVERAGE-BANDWIDTH")||S.decimalInteger("BANDWIDTH"),name:S.NAME,url:b.resolve(y[2],f)},I=S.decimalResolution("RESOLUTION");I&&(D.width=I.width,D.height=I.height),t((S.CODECS||"").split(/[ ,]+/).filter(function(P){return P}),D),D.videoCodec&&D.videoCodec.indexOf("avc1")!==-1&&(D.videoCodec=b.convertAVC1ToAVCOTI(D.videoCodec)),l.push(D)}else if(y[3]){var A=new C.AttrList(y[3]);A["DATA-ID"]&&(E=!0,d[A["DATA-ID"]]=A)}return{levels:l,sessionData:E?d:null}},b.parseMasterPlaylistMedia=function(o,f,l,d){d===void 0&&(d=[]);var E,y=[],S=0;for(a.lastIndex=0;(E=a.exec(o))!==null;){var D=new C.AttrList(E[1]);if(D.TYPE===l){var I={attrs:D,bitrate:0,id:S++,groupId:D["GROUP-ID"],instreamId:D["INSTREAM-ID"],name:D.NAME||D.LANGUAGE||"",type:l,default:D.bool("DEFAULT"),autoselect:D.bool("AUTOSELECT"),forced:D.bool("FORCED"),lang:D.LANGUAGE,url:D.URI?b.resolve(D.URI,f):""};if(d.length){var A=b.findGroup(d,I.groupId)||d[0];v(I,A,"audioCodec"),v(I,A,"textCodec")}y.push(I)}}return y},b.parseLevelPlaylist=function(o,f,l,d,E){var y=new U.LevelDetails(f),S=y.fragments,D=null,I=0,A=0,P=0,H=0,R=null,K=new j.Fragment(d,f),V,oe,Q,pe=-1,ce=!1;for(i.lastIndex=0,y.m3u8=o;(V=i.exec(o))!==null;){ce&&(ce=!1,K=new j.Fragment(d,f),K.start=P,K.sn=I,K.cc=H,K.level=l,D&&(K.initSegment=D,K.rawProgramDateTime=D.rawProgramDateTime));var ee=V[1];if(ee){K.duration=parseFloat(ee);var ne=(" "+V[2]).slice(1);K.title=ne||null,K.tagList.push(ne?["INF",ee,ne]:["INF",ee])}else if(V[3])Object(M.isFiniteNumber)(K.duration)&&(K.start=P,Q&&(K.levelkey=Q),K.sn=I,K.level=l,K.cc=H,K.urlId=E,S.push(K),K.relurl=(" "+V[3]).slice(1),m(K,R),R=K,P+=K.duration,I++,A=0,ce=!0);else if(V[4]){var me=(" "+V[4]).slice(1);R?K.setByteRange(me,R):K.setByteRange(me)}else if(V[5])K.rawProgramDateTime=(" "+V[5]).slice(1),K.tagList.push(["PROGRAM-DATE-TIME",K.rawProgramDateTime]),pe===-1&&(pe=S.length);else{if(V=V[0].match(c),!V){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<V.length&&!(typeof V[oe]!="undefined");oe++);var Z=(" "+V[oe]).slice(1),Y=(" "+V[oe+1]).slice(1),Se=V[oe+2]?(" "+V[oe+2]).slice(1):"";switch(Z){case"PLAYLIST-TYPE":y.type=Y.toUpperCase();break;case"MEDIA-SEQUENCE":I=y.startSN=parseInt(Y);break;case"SKIP":{var Me=new C.AttrList(Y),ke=Me.decimalInteger("SKIPPED-SEGMENTS");if(Object(M.isFiniteNumber)(ke)){y.skippedSegments=ke;for(var Re=ke;Re--;)S.unshift(null);I+=ke}var Pe=Me.enumeratedString("RECENTLY-REMOVED-DATERANGES");Pe&&(y.recentlyRemovedDateranges=Pe.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(Y);break;case"VERSION":y.version=parseInt(Y);break;case"EXTM3U":break;case"ENDLIST":y.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,De=new C.AttrList(Y),Ne=De.enumeratedString("METHOD"),J=De.URI,fe=De.hexadecimalInteger("IV"),Te=De.enumeratedString("KEYFORMATVERSIONS"),Ee=De.enumeratedString("KEYID"),je=(Ce=De.enumeratedString("KEYFORMAT"))!=null?Ce:"identity",He=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(He.indexOf(je)>-1){g.logger.warn("Keyformat "+je+" is not supported from the manifest");continue}else if(je!=="identity")continue;Ne&&(Q=e.LevelKey.fromURL(f,J),J&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ne)>=0&&(Q.method=Ne,Q.keyFormat=je,Ee&&(Q.keyID=Ee),Te&&(Q.keyFormatVersions=Te),Q.iv=fe));break}case"START":{var Oe=new C.AttrList(Y),Ue=Oe.decimalFloatingPoint("TIME-OFFSET");Object(M.isFiniteNumber)(Ue)&&(y.startTimeOffset=Ue);break}case"MAP":{var Ze=new C.AttrList(Y);K.relurl=Ze.URI,Ze.BYTERANGE&&K.setByteRange(Ze.BYTERANGE),K.level=l,K.sn="initSegment",Q&&(K.levelkey=Q),K.initSegment=null,D=K,ce=!0;break}case"SERVER-CONTROL":{var $e=new C.AttrList(Y);y.canBlockReload=$e.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=$e.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&$e.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=$e.optionalFloat("PART-HOLD-BACK",0),y.holdBack=$e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Je=new C.AttrList(Y);y.partTarget=Je.decimalFloatingPoint("PART-TARGET");break}case"PART":{var ze=y.partList;ze||(ze=y.partList=[]);var nt=A>0?ze[ze.length-1]:void 0,it=A++,Fe=new j.Part(new C.AttrList(Y),K,f,it,nt);ze.push(Fe),K.duration+=Fe.duration;break}case"PRELOAD-HINT":{var Ke=new C.AttrList(Y);y.preloadHint=Ke;break}case"RENDITION-REPORT":{var ae=new C.AttrList(Y);y.renditionReports=y.renditionReports||[],y.renditionReports.push(ae);break}default:g.logger.warn("line parsed but not handled: "+V);break}}}R&&!R.relurl?(S.pop(),P-=R.duration,y.partList&&(y.fragmentHint=R)):y.partList&&(m(K,R),K.cc=H,y.fragmentHint=K);var de=S.length,ye=S[0],$=S[de-1];if(P+=y.skippedSegments*y.targetduration,P>0&&de&&$){y.averagetargetduration=P/de;var q=$.sn;y.endSN=q!=="initSegment"?q:0,ye&&(y.startCC=ye.cc,ye.initSegment||y.fragments.every(function(se){return se.relurl&&r(se.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),K=new j.Fragment(d,f),K.relurl=$.relurl,K.level=l,K.sn="initSegment",ye.initSegment=K,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(P+=y.fragmentHint.duration),y.totalduration=P,y.endCC=H,pe>0&&p(S,pe),y},b}();function t(b,_){["video","audio","text"].forEach(function(o){var f=b.filter(function(d){return Object(h.isCodecType)(d,o)});if(f.length){var l=f.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});_[o+"Codec"]=l.length>0?l[0]:f[0],b=b.filter(function(d){return f.indexOf(d)===-1})}}),_.unknownCodecs=b}function v(b,_,o){var f=_[o];f&&(b[o]=f)}function p(b,_){for(var o=b[_],f=_;f--;){var l=b[f];if(!l)return;l.programDateTime=o.programDateTime-l.duration*1e3,o=l}}function m(b,_){b.rawProgramDateTime?b.programDateTime=Date.parse(b.rawProgramDateTime):_!=null&&_.programDateTime&&(b.programDateTime=_.endProgramDateTime),Object(M.isFiniteNumber)(b.programDateTime)||(b.programDateTime=null,b.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/polyfills/number.ts"),w=O("./src/events.ts"),L=O("./src/errors.ts"),j=O("./src/utils/logger.ts"),U=O("./src/utils/mp4-tools.ts"),e=O("./src/loader/m3u8-parser.ts"),C=O("./src/types/loader.ts"),g=O("./src/utils/attr-list.ts");function h(i){var c=i.type;switch(c){case C.PlaylistContextType.AUDIO_TRACK:return C.PlaylistLevelType.AUDIO;case C.PlaylistContextType.SUBTITLE_TRACK:return C.PlaylistLevelType.SUBTITLE;default:return C.PlaylistLevelType.MAIN}}function u(i,c){var s=i.url;return(s===void 0||s.indexOf("data:")===0)&&(s=c.url),s}var a=function(){function i(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var c=i.prototype;return c.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)},c.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)},c.createInternalLoader=function(r){var n=this.hls.config,t=n.pLoader,v=n.loader,p=t||v,m=new p(n);return r.loader=m,this.loaders[r.type]=m,m},c.getInternalLoader=function(r){return this.loaders[r.type]},c.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},c.destroyInternalLoaders=function(){for(var r in this.loaders){var n=this.loaders[r];n&&n.destroy(),this.resetInternalLoader(r)}},c.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},c.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})},c.onLevelLoading=function(r,n){var t=n.id,v=n.level,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:null,level:v,responseType:"text",type:C.PlaylistContextType.LEVEL,url:p,deliveryDirectives:m})},c.onAudioTrackLoading=function(r,n){var t=n.id,v=n.groupId,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:v,level:null,responseType:"text",type:C.PlaylistContextType.AUDIO_TRACK,url:p,deliveryDirectives:m})},c.onSubtitleTrackLoading=function(r,n){var t=n.id,v=n.groupId,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:v,level:null,responseType:"text",type:C.PlaylistContextType.SUBTITLE_TRACK,url:p,deliveryDirectives:m})},c.load=function(r){var n,t=this.hls.config,v=this.getInternalLoader(r);if(v){var p=v.context;if(p&&p.url===r.url){j.logger.trace("[playlist-loader]: playlist request ongoing");return}j.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),v.abort()}var m,b,_,o;switch(r.type){case C.PlaylistContextType.MANIFEST:m=t.manifestLoadingMaxRetry,b=t.manifestLoadingTimeOut,_=t.manifestLoadingRetryDelay,o=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,o=t.levelLoadingMaxRetryTimeout;break}if(v=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 l=f.partTarget,d=f.targetduration;l&&d&&(b=Math.min(Math.max(l*3,d*.8)*1e3,b))}}var E={timeout:b,maxRetry:m,retryDelay:_,maxRetryDelay:o,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(r,E,y)},c.loadsuccess=function(r,n,t,v){if(v===void 0&&(v=null),t.isSidxRequest){this.handleSidxRequest(r,t),this.handlePlaylistLoaded(r,n,t,v);return}this.resetInternalLoader(t.type);var p=r.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,"no EXTM3U delimiter",v);return}n.parsing.start=performance.now(),p.indexOf("#EXTINF:")>0||p.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,n,t,v):this.handleMasterPlaylist(r,n,t,v)},c.loaderror=function(r,n,t){t===void 0&&(t=null),this.handleNetworkError(n,t,!1,r)},c.loadtimeout=function(r,n,t){t===void 0&&(t=null),this.handleNetworkError(n,t,!0)},c.handleMasterPlaylist=function(r,n,t,v){var p=this.hls,m=r.data,b=u(r,t),_=e.default.parseMasterPlaylist(m,b),o=_.levels,f=_.sessionData;if(!o.length){this.handleManifestParsingError(r,t,"no level found in manifest",v);return}var l=o.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),d=o.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),E=e.default.parseMasterPlaylistMedia(m,b,"AUDIO",l),y=e.default.parseMasterPlaylistMedia(m,b,"SUBTITLES",d),S=e.default.parseMasterPlaylistMedia(m,b,"CLOSED-CAPTIONS");if(E.length){var D=E.some(function(I){return!I.url});!D&&o[0].audioCodec&&!o[0].attrs.AUDIO&&(j.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 g.AttrList({}),bitrate:0,url:""}))}p.trigger(w.Events.MANIFEST_LOADED,{levels:o,audioTracks:E,subtitles:y,captions:S,url:b,stats:n,networkDetails:v,sessionData:f})},c.handleTrackOrLevelPlaylist=function(r,n,t,v){var p=this.hls,m=t.id,b=t.level,_=t.type,o=u(r,t),f=Object(M.isFiniteNumber)(m)?m:0,l=Object(M.isFiniteNumber)(b)?b:f,d=h(t),E=e.default.parseLevelPlaylist(r.data,o,l,d,f);if(!E.fragments.length){p.trigger(w.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:o,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(_===C.PlaylistContextType.MANIFEST){var y={attrs:new g.AttrList({}),bitrate:0,details:E,name:"",url:o};p.trigger(w.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:o,stats:n,networkDetails:v,sessionData:null})}if(n.parsing.end=performance.now(),E.needSidxRanges){var S,D=(S=E.fragments[0].initSegment)===null||S===void 0?void 0:S.url;this.load({url:D,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,v)},c.handleSidxRequest=function(r,n){var t=Object(U.parseSegmentIndex)(new Uint8Array(r.data));if(!t)return;var v=t.references,p=n.levelDetails;v.forEach(function(m,b){var _=m.info,o=p.fragments[b];o.byteRange.length===0&&o.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),o.initSegment&&o.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},c.handleManifestParsingError=function(r,n,t,v){this.hls.trigger(w.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===C.PlaylistContextType.MANIFEST,url:r.url,reason:t,response:r,context:n,networkDetails:v})},c.handleNetworkError=function(r,n,t,v){t===void 0&&(t=!1),j.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=L.ErrorDetails.UNKNOWN,m=!1,b=this.getInternalLoader(r);switch(r.type){case C.PlaylistContextType.MANIFEST:p=t?L.ErrorDetails.MANIFEST_LOAD_TIMEOUT:L.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case C.PlaylistContextType.LEVEL:p=t?L.ErrorDetails.LEVEL_LOAD_TIMEOUT:L.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case C.PlaylistContextType.AUDIO_TRACK:p=t?L.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case C.PlaylistContextType.SUBTITLE_TRACK:p=t?L.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:L.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}b&&this.resetInternalLoader(r.type);var _={type:L.ErrorTypes.NETWORK_ERROR,details:p,fatal:m,url:r.url,loader:b,context:r,networkDetails:n};v&&(_.response=v),this.hls.trigger(w.Events.ERROR,_)},c.handlePlaylistLoaded=function(r,n,t,v){var p=t.type,m=t.level,b=t.id,_=t.groupId,o=t.loader,f=t.levelDetails,l=t.deliveryDirectives;if(!(f!=null&&f.targetduration)){this.handleManifestParsingError(r,t,"invalid target duration",v);return}if(!o)return;f.live&&(o.getCacheAge&&(f.ageHeader=o.getCacheAge()||0),(!o.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:v,deliveryDirectives:l});break;case C.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(w.Events.AUDIO_TRACK_LOADED,{details:f,id:b||0,groupId:_||"",stats:n,networkDetails:v,deliveryDirectives:l});break;case C.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(w.Events.SUBTITLE_TRACK_LOADED,{details:f,id:b||0,groupId:_||"",stats:n,networkDetails:v,deliveryDirectives:l});break}},i}();W.default=a},"./src/polyfills/number.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"isFiniteNumber",function(){return M}),O.d(W,"MAX_SAFE_INTEGER",function(){return w});var M=Number.isFinite||function(L){return typeof L=="number"&&isFinite(L)},w=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,W,O){"use strict";O.r(W);var M=function(){function w(){}return w.getSilentFrame=function(j,U){switch(j){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(U===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(U===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},w}();W.default=M},"./src/remux/mp4-generator.ts":function(ie,W,O){"use strict";O.r(W);var M=Math.pow(2,32)-1,w=function(){function L(){}return L.init=function(){L.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var U;for(U in L.types)L.types.hasOwnProperty(U)&&(L.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var e=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),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]);L.HDLR_TYPES={video:e,audio:C};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),h=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=h,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var u=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,u,i,u,a),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,g))},L.box=function(U){for(var e=8,C=arguments.length,g=new Array(C>1?C-1:0),h=1;h<C;h++)g[h-1]=arguments[h];for(var u=g.length,a=u;u--;)e+=g[u].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(U,4),u=0,e=8;u<a;u++)i.set(g[u],e),e+=g[u].byteLength;return i},L.hdlr=function(U){return L.box(L.types.hdlr,L.HDLR_TYPES[U])},L.mdat=function(U){return L.box(L.types.mdat,U)},L.mdhd=function(U,e){e*=U;var C=Math.floor(e/(M+1)),g=Math.floor(e%(M+1));return L.box(L.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,C>>24,C>>16&255,C>>8&255,C&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},L.mdia=function(U){return L.box(L.types.mdia,L.mdhd(U.timescale,U.duration),L.hdlr(U.type),L.minf(U))},L.mfhd=function(U){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},L.minf=function(U){return U.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(U)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(U))},L.moof=function(U,e,C){return L.box(L.types.moof,L.mfhd(U),L.traf(C,e))},L.moov=function(U){for(var e=U.length,C=[];e--;)C[e]=L.trak(U[e]);return L.box.apply(null,[L.types.moov,L.mvhd(U[0].timescale,U[0].duration)].concat(C).concat(L.mvex(U)))},L.mvex=function(U){for(var e=U.length,C=[];e--;)C[e]=L.trex(U[e]);return L.box.apply(null,[L.types.mvex].concat(C))},L.mvhd=function(U,e){e*=U;var C=Math.floor(e/(M+1)),g=Math.floor(e%(M+1)),h=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,C>>24,C>>16&255,C>>8&255,C&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return L.box(L.types.mvhd,h)},L.sdtp=function(U){var e=U.samples||[],C=new Uint8Array(4+e.length),g,h;for(g=0;g<e.length;g++)h=e[g].flags,C[g+4]=h.dependsOn<<4|h.isDependedOn<<2|h.hasRedundancy;return L.box(L.types.sdtp,C)},L.stbl=function(U){return L.box(L.types.stbl,L.stsd(U),L.box(L.types.stts,L.STTS),L.box(L.types.stsc,L.STSC),L.box(L.types.stsz,L.STSZ),L.box(L.types.stco,L.STCO))},L.avc1=function(U){var e=[],C=[],g,h,u;for(g=0;g<U.sps.length;g++)h=U.sps[g],u=h.byteLength,e.push(u>>>8&255),e.push(u&255),e=e.concat(Array.prototype.slice.call(h));for(g=0;g<U.pps.length;g++)h=U.pps[g],u=h.byteLength,C.push(u>>>8&255),C.push(u&255),C=C.concat(Array.prototype.slice.call(h));var a=L.box(L.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|U.sps.length].concat(e).concat([U.pps.length]).concat(C))),i=U.width,c=U.height,s=U.pixelRatio[0],r=U.pixelRatio[1];return L.box(L.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,c>>8&255,c&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,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,r>>24,r>>16&255,r>>8&255,r&255])))},L.esds=function(U){var e=U.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(U.config).concat([6,1,2]))},L.mp4a=function(U){var e=U.samplerate;return L.box(L.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),L.box(L.types.esds,L.esds(U)))},L.mp3=function(U){var e=U.samplerate;return L.box(L.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},L.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(U)):L.box(L.types.stsd,L.STSD,L.mp4a(U)):L.box(L.types.stsd,L.STSD,L.avc1(U))},L.tkhd=function(U){var e=U.id,C=U.duration*U.timescale,g=U.width,h=U.height,u=Math.floor(C/(M+1)),a=Math.floor(C%(M+1));return L.box(L.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,u>>24,u>>16&255,u>>8&255,u&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,g>>8&255,g&255,0,0,h>>8&255,h&255,0,0]))},L.traf=function(U,e){var C=L.sdtp(U),g=U.id,h=Math.floor(e/(M+1)),u=Math.floor(e%(M+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,u>>24,u>>16&255,u>>8&255,u&255])),L.trun(U,C.length+16+20+8+16+8+8),C)},L.trak=function(U){return U.duration=U.duration||4294967295,L.box(L.types.trak,L.tkhd(U),L.mdia(U))},L.trex=function(U){var e=U.id;return L.box(L.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]))},L.trun=function(U,e){var C=U.samples||[],g=C.length,h=12+16*g,u=new Uint8Array(h),a,i,c,s,r,n;for(e+=8+h,u.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),a=0;a<g;a++)i=C[a],c=i.duration,s=i.size,r=i.flags,n=i.cts,u.set([c>>>24&255,c>>>16&255,c>>>8&255,c&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 L.box(L.types.trun,u)},L.initSegment=function(U){L.types||L.init();var e=L.moov(U),C=new Uint8Array(L.FTYP.byteLength+e.byteLength);return C.set(L.FTYP),C.set(e,L.FTYP.byteLength),C},L}();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(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return n}),O.d(W,"normalizePts",function(){return t});var M=O("./src/polyfills/number.ts"),w=O("./src/remux/aac-helper.ts"),L=O("./src/remux/mp4-generator.ts"),j=O("./src/events.ts"),U=O("./src/errors.ts"),e=O("./src/utils/logger.ts"),C=O("./src/types/loader.ts"),g=O("./src/utils/timescale-conversion.ts");function h(){return h=Object.assign||function(b){for(var _=1;_<arguments.length;_++){var o=arguments[_];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&&(b[f]=o[f])}return b},h.apply(this,arguments)}var u=10*1e3,a=1024,i=1152,c=null,s=null,r=!1,n=function(){function b(o,f,l,d){if(d===void 0&&(d=""),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=o,this.config=f,this.typeSupported=l,this.ISGenerated=!1,c===null){var E=navigator.userAgent||"",y=E.match(/Chrome\/(\d+)/i);c=y?parseInt(y[1]):0}if(s===null){var S=navigator.userAgent.match(/Safari\/(\d+)/i);s=S?parseInt(S[1]):0}r=!!c&&c<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 l=!1,d=f.reduce(function(E,y){var S=y.pts-E;return S<-4294967296?(l=!0,t(E,y.pts)):S>0?E:y.pts},f[0].pts);return l&&e.logger.debug("PTS rollover detected"),d},_.remux=function(f,l,d,E,y,S,D,I){var A,P,H,R,K,V,oe=y,Q=y,pe=f.pid>-1,ce=l.pid>-1,ee=l.samples.length,ne=f.samples.length>0,me=ee>1,Z=(!pe||ne)&&(!ce||me)||this.ISGenerated||D;if(Z){this.ISGenerated||(H=this.generateIS(f,l,y));var Y=this.isVideoContiguous,Se=-1;if(me&&(Se=v(l.samples),!Y&&this.config.forceKeyFrameOnDiscontinuity))if(V=!0,Se>0){e.logger.warn("[mp4-remuxer]: Dropped "+Se+" out of "+ee+" video samples due to a missing keyframe");var Me=this.getVideoStartPts(l.samples);l.samples=l.samples.slice(Se),l.dropped+=Se,Q+=(l.samples[0].pts-Me)/(l.timescale||9e4)}else Se===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+ee+" video samples"),V=!1);if(this.ISGenerated){if(ne&&me){var ke=this.getVideoStartPts(l.samples),Re=t(f.samples[0].pts,ke)-ke,Pe=Re/l.inputTimeScale;oe+=Math.max(0,Pe),Q+=Math.max(0,-Pe)}if(ne){if(f.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(f,l,y)),P=this.remuxAudio(f,oe,this.isAudioContiguous,S,ce||me||I===C.PlaylistLevelType.AUDIO?Q:void 0),me){var Ce=P?P.endPTS-P.startPTS:0;l.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(f,l,y)),A=this.remuxVideo(l,Q,Y,Ce)}}else me&&(A=this.remuxVideo(l,Q,Y,0));A&&(A.firstKeyFrame=Se,A.independent=Se!==-1)}}return this.ISGenerated&&(d.samples.length&&(K=this.remuxID3(d,y)),E.samples.length&&(R=this.remuxText(E,y))),{audio:P,video:A,initSegment:H,independent:V,text:R,id3:K}},_.generateIS=function(f,l,d){var E=f.samples,y=l.samples,S=this.typeSupported,D={},I=!Object(M.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")),D.audio={id:"audio",container:A,codec:f.codec,initSegment:!f.isAAC&&S.mpeg?new Uint8Array(0):L.default.initSegment([f]),metadata:{channelCount:f.channelCount}},I&&(R=f.inputTimeScale,P=H=E[0].pts-Math.round(R*d))),l.sps&&l.pps&&y.length&&(l.timescale=l.inputTimeScale,D.video={id:"main",container:"video/mp4",codec:l.codec,initSegment:L.default.initSegment([l]),metadata:{width:l.width,height:l.height}},I)){R=l.inputTimeScale;var K=this.getVideoStartPts(y),V=Math.round(R*d);H=Math.min(H,t(y[0].dts,K)-V),P=Math.min(P,K-V)}if(Object.keys(D).length)return this.ISGenerated=!0,I&&(this._initPTS=P,this._initDTS=H),{tracks:D,initPTS:P,timescale:R}},_.remuxVideo=function(f,l,d,E){var y=f.inputTimeScale,S=f.samples,D=[],I=S.length,A=this._initPTS,P=this.nextAvcDts,H=8,R,K,V,oe=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,pe=0,ce=!1;if(!d||P===null){var ee=l*y,ne=S[0].pts-t(S[0].dts,S[0].pts);P=ee-ne}for(var me=0;me<I;me++){var Z=S[me];if(Z.pts=t(Z.pts-A,P),Z.dts=t(Z.dts-A,P),Z.dts>Z.pts){var Y=9e4*.2;pe=Math.max(Math.min(pe,Z.pts-Z.dts),-1*Y)}Z.dts<S[me>0?me-1:me].dts&&(ce=!0)}ce&&S.sort(function(_t,xt){var rt=_t.dts-xt.dts,Yt=_t.pts-xt.pts;return rt||Yt}),K=S[0].dts,V=S[S.length-1].dts;var Se=Math.round((V-K)/(I-1));if(pe<0){if(pe<Se*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-Se,!0)+" ms");for(var Me=pe,ke=0;ke<I;ke++)S[ke].dts=Me=Math.max(Me,S[ke].pts-Se),S[ke].pts=Math.max(Me,S[ke].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(pe,!0)+" ms to overcome this issue");for(var Re=0;Re<I;Re++)S[Re].dts=S[Re].dts+pe}K=S[0].dts}if(d){var Pe=K-P,Ce=Pe>Se,De=Pe<-1;if(Ce||De){Ce?e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(Pe,!0)+" ms ("+Pe+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-Pe,!0)+" ms ("+Pe+"dts) overlapping between fragments detected"),K=P;var Ne=S[0].pts-Pe;S[0].dts=K,S[0].pts=Ne,e.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Ne,!0)+"/"+Object(g.toMsFromMpegTsClock)(K,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(Pe,!0)+" ms")}}r&&(K=Math.max(0,K));for(var J=0,fe=0,Te=0;Te<I;Te++){for(var Ee=S[Te],je=Ee.units,He=je.length,Oe=0,Ue=0;Ue<He;Ue++)Oe+=je[Ue].data.length;fe+=Oe,J+=He,Ee.length=Oe,Ee.dts=Math.max(Ee.dts,K),Ee.pts=Math.max(Ee.pts,Ee.dts,0),oe=Math.min(Ee.pts,oe),Q=Math.max(Ee.pts,Q)}V=S[I-1].dts;var Ze=fe+4*J+8,$e;try{$e=new Uint8Array(Ze)}catch(_t){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ze,reason:"fail allocating video mdat "+Ze});return}var Je=new DataView($e.buffer);Je.setUint32(0,Ze),$e.set(L.default.types.mdat,4);for(var ze=0;ze<I;ze++){for(var nt=S[ze],it=nt.units,Fe=0,Ke=0,ae=it.length;Ke<ae;Ke++){var de=it[Ke],ye=de.data,$=de.data.byteLength;Je.setUint32(H,$),H+=4,$e.set(ye,H),H+=$,Fe+=4+$}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 ge=Math.floor(q.maxBufferHole*y),Le=(E?oe+E*y:this.nextAudioPts)-nt.pts;Le>ge?(R=Le-se,R<0&&(R=se),e.logger.log("[mp4-remuxer]: It is approximately "+Le/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);D.push(new p(nt.key,R,Fe,Be))}if(D.length&&c&&c<70){var Xe=D[0].flags;Xe.dependsOn=2,Xe.isNonSync=0}console.assert(R!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=P=V+R,this.isVideoContiguous=!0;var ut=L.default.moof(f.sequenceNumber++,K,h({},f,{samples:D})),vt="video",dt={data1:ut,data2:$e,startPTS:oe/y,endPTS:(Q+R)/y,startDTS:K/y,endDTS:P/y,type:vt,hasAudio:!1,hasVideo:!0,nb:D.length,dropped:f.dropped};return f.samples=[],f.dropped=0,console.assert($e.length,"MDAT length must not be zero"),dt},_.remuxAudio=function(f,l,d,E,y){var S=f.inputTimeScale,D=f.samplerate?f.samplerate:S,I=S/D,A=f.isAAC?a:i,P=A*I,H=this._initPTS,R=!f.isAAC&&this.typeSupported.mpeg,K=[],V=f.samples,oe=R?0:8,Q=this.nextAudioPts||-1,pe=l*S;if(this.isAudioContiguous=d=d||V.length&&Q>0&&(E&&Math.abs(pe-Q)<9e3||Math.abs(t(V[0].pts-H,pe)-Q)<20*P),V.forEach(function(ye){ye.pts=t(ye.pts-H,pe)}),!d||Q<0){if(V=V.filter(function(ye){return ye.pts>=0}),!V.length)return;y===0?Q=0:E?Q=Math.max(0,pe):Q=V[0].pts}if(f.isAAC)for(var ce=y!==void 0,ee=this.config.maxAudioFramesDrift,ne=0,me=Q;ne<V.length;ne++){var Z=V[ne],Y=Z.pts,Se=Y-me,Me=Math.abs(1e3*Se/S);if(Se<=-ee*P&&ce)ne===0&&(e.logger.warn("Audio frame @ "+(Y/S).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Se/S)+" ms."),this.nextAudioPts=Q=me=Y);else if(Se>=ee*P&&Me<u&&ce){var ke=Math.round(Se/P);me=Y-ke*P,me<0&&(ke--,me+=P),ne===0&&(this.nextAudioPts=Q=me),e.logger.warn("[mp4-remuxer]: Injecting "+ke+" audio frame @ "+(me/S).toFixed(3)+"s due to "+Math.round(1e3*Se/S)+" ms gap.");for(var Re=0;Re<ke;Re++){var Pe=Math.max(me,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()),V.splice(ne,0,{unit:Ce,pts:Pe}),me+=P,ne++}}Z.pts=me,me+=P}for(var De=null,Ne=null,J,fe=0,Te=V.length;Te--;)fe+=V[Te].unit.byteLength;for(var Ee=0,je=V.length;Ee<je;Ee++){var He=V[Ee],Oe=He.unit,Ue=He.pts;if(Ne!==null){var Ze=K[Ee-1];Ze.duration=Math.round((Ue-Ne)/I)}else if(d&&f.isAAC&&(Ue=Q),De=Ue,fe>0){fe+=oe;try{J=new Uint8Array(fe)}catch(ye){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:fe,reason:"fail allocating audio mdat "+fe});return}if(!R){var $e=new DataView(J.buffer);$e.setUint32(0,fe),J.set(L.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=Q=Ne+I*nt.duration;var it=R?new Uint8Array(0):L.default.moof(f.sequenceNumber++,De/I,h({},f,{samples:K}));f.samples=[];var Fe=De/S,Ke=Q/S,ae="audio",de={data1:it,data2:J,startPTS:Fe,endPTS:Ke,startDTS:Fe,endDTS:Ke,type:ae,hasAudio:!0,hasVideo:!1,nb:ze};return this.isAudioContiguous=!0,console.assert(J.length,"MDAT length must not be zero"),de},_.remuxEmptyAudio=function(f,l,d,E){var y=f.inputTimeScale,S=f.samplerate?f.samplerate:y,D=y/S,I=this.nextAudioPts,A=(I!==null?I:E.startDTS*y)+this._initDTS,P=E.endDTS*y+this._initDTS,H=D*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 V=[],oe=0;oe<R;oe++){var Q=A+oe*H;V.push({unit:K,pts:Q,dts:Q})}return f.samples=V,this.remuxAudio(f,l,d,!1)},_.remuxID3=function(f,l){var d=f.samples.length;if(!d)return;for(var E=f.inputTimeScale,y=this._initPTS,S=this._initDTS,D=0;D<d;D++){var I=f.samples[D];I.pts=t(I.pts-y,l*E)/E,I.dts=t(I.dts-S,l*E)/E}var A=f.samples;return f.samples=[],{samples:A}},_.remuxText=function(f,l){var d=f.samples.length;if(!d)return;for(var E=f.inputTimeScale,y=this._initPTS,S=0;S<d;S++){var D=f.samples[S];D.pts=t(D.pts-y,l*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 o;if(_===null)return b;for(_<b?o=-8589934592:o=8589934592;Math.abs(b-_)>4294967296;)b+=o;return b}function v(b){for(var _=0;_<b.length;_++)if(b[_].key)return _;return-1}var p=function(_,o,f,l){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=o,this.size=f,this.cts=l,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(ie,W,O){"use strict";O.r(W);var M=O("./src/polyfills/number.ts"),w=O("./src/utils/mp4-tools.ts"),L=O("./src/loader/fragment.ts"),j=O("./src/utils/logger.ts"),U=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var h=g.prototype;return h.destroy=function(){},h.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},h.resetNextTimestamp=function(){this.lastEndDTS=null},h.resetInitSegment=function(a,i,c){this.audioCodec=i,this.videoCodec=c,this.generateInitSegment(a),this.emitInitSegment=!0},h.generateInitSegment=function(a){var i=this.audioCodec,c=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,L.ElementaryStreamTypes.AUDIO)),c||(c=C(s.video,L.ElementaryStreamTypes.VIDEO));var r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:i+","+c,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:c,initSegment:a,id:"main"}:j.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},h.remux=function(a,i,c,s,r){var n=this.initPTS,t=this.lastEndDTS,v={audio:void 0,video:void 0,text:s,id3:c,initSegment:void 0};Object(M.isFiniteNumber)(t)||(t=this.lastEndDTS=r||0);var p=i.samples;if(!p||!p.length)return v;var m={initPTS:void 0,timescale:1},b=this.initData;if((!b||!b.length)&&(this.generateInitSegment(p),b=this.initData),!b||!b.length)return j.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(M.isFiniteNumber)(n)||(this.initPTS=m.initPTS=n=e(b,p,t));var _=Object(w.getDuration)(p,b),o=t,f=_+o;Object(w.offsetStartDTS)(b,p,n),_>0?this.lastEndDTS=f:(j.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var l=!!b.audio,d=!!b.video,E="";l&&(E+="audio"),d&&(E+="video");var y={data1:p,startPTS:o,startDTS:o,endPTS:f,endDTS:f,type:E,hasAudio:l,hasVideo:d,nb:1,dropped:0};return v.audio=y.type==="audio"?y:void 0,v.video=y.type!=="audio"?y:void 0,v.text=s,v.id3=c,v.initSegment=m,v},g}(),e=function(h,u,a){return Object(w.getStartDTS)(h,u)-a};function C(g,h){var u=g==null?void 0:g.codec;return u&&u.length>4?u:u==="hvc1"?"hvc1.1.c.L120.90":u==="av01"?"av01.0.04M.08":u==="avc1"||h===L.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}W.default=U},"./src/task-loop.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return M});var M=function(){function w(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var L=w.prototype;return L.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},L.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},L.onHandlerDestroyed=function(){},L.hasInterval=function(){return!!this._tickInterval},L.hasNextTick=function(){return!!this._tickTimer},L.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},L.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},L.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},L.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},L.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},L.doTick=function(){},w}()},"./src/types/cmcd.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"CMCDVersion",function(){return M}),O.d(W,"CMCDObjectType",function(){return w}),O.d(W,"CMCDStreamingFormat",function(){return L}),O.d(W,"CMCDStreamType",function(){return j});var M=1,w;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(w||(w={}));var L;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(L||(L={}));var j;(function(U){U.VOD="v",U.LIVE="l"})(j||(j={}))},"./src/types/level.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"HlsSkip",function(){return L}),O.d(W,"getSkipValue",function(){return j}),O.d(W,"HlsUrlParameters",function(){return U}),O.d(W,"Level",function(){return e});function M(C,g){for(var h=0;h<g.length;h++){var u=g[h];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(C,u.key,u)}}function w(C,g,h){return g&&M(C.prototype,g),h&&M(C,h),C}var L;(function(C){C.No="",C.Yes="YES",C.v2="v2"})(L||(L={}));function j(C,g){var h=C.canSkipUntil,u=C.canSkipDateRanges,a=C.endSN,i=g!==void 0?g-a:0;return h&&i<h?u?L.v2:L.Yes:L.No}var U=function(){function C(h,u,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=h,this.part=u,this.skip=a}var g=C.prototype;return g.addDirectives=function(u){var a=new self.URL(u);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(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(h){return h}).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(h){var u=h%this.url.length;this._urlId!==u&&(this.details=void 0,this._urlId=u)}}]),C}()},"./src/types/loader.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"PlaylistContextType",function(){return M}),O.d(W,"PlaylistLevelType",function(){return w});var M;(function(L){L.MANIFEST="manifest",L.LEVEL="level",L.AUDIO_TRACK="audioTrack",L.SUBTITLE_TRACK="subtitleTrack"})(M||(M={}));var w;(function(L){L.MAIN="main",L.AUDIO="audio",L.SUBTITLE="subtitle"})(w||(w={}))},"./src/types/transmuxer.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"ChunkMetadata",function(){return M});var M=function(j,U,e,C,g,h){C===void 0&&(C=0),g===void 0&&(g=-1),h===void 0&&(h=!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=j,this.sn=U,this.id=e,this.size=C,this.part=g,this.partial=h};function w(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"AttrList",function(){return L});var M=/^(\d+)x(\d+)$/,w=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,L=function(){function j(e){typeof e=="string"&&(e=j.parseAttrList(e));for(var C in e)e.hasOwnProperty(C)&&(this[C]=e[C])}var U=j.prototype;return U.decimalInteger=function(C){var g=parseInt(this[C],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},U.hexadecimalInteger=function(C){if(this[C]){var g=(this[C]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var h=new Uint8Array(g.length/2),u=0;u<g.length/2;u++)h[u]=parseInt(g.slice(u*2,u*2+2),16);return h}else return null},U.hexadecimalIntegerAsNumber=function(C){var g=parseInt(this[C],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},U.decimalFloatingPoint=function(C){return parseFloat(this[C])},U.optionalFloat=function(C,g){var h=this[C];return h?parseFloat(h):g},U.enumeratedString=function(C){return this[C]},U.bool=function(C){return this[C]==="YES"},U.decimalResolution=function(C){var g=M.exec(this[C]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},j.parseAttrList=function(C){var g,h={},u='"';for(w.lastIndex=0;(g=w.exec(C))!==null;){var a=g[2];a.indexOf(u)===0&&a.lastIndexOf(u)===a.length-1&&(a=a.slice(1,-1)),h[g[1]]=a}return h},j}()},"./src/utils/binary-search.ts":function(ie,W,O){"use strict";O.r(W);var M={search:function(L,j){for(var U=0,e=L.length-1,C=null,g=null;U<=e;){C=(U+e)/2|0,g=L[C];var h=j(g);if(h>0)U=C+1;else if(h<0)e=C-1;else return g}return null}};W.default=M},"./src/utils/buffer-helper.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"BufferHelper",function(){return L});var M=O("./src/utils/logger.ts"),w={length:0,start:function(){return 0},end:function(){return 0}},L=function(){function j(){}return j.isBuffered=function(e,C){try{if(e){for(var g=j.getBuffered(e),h=0;h<g.length;h++)if(C>=g.start(h)&&C<=g.end(h))return!0}}catch(u){}return!1},j.bufferInfo=function(e,C,g){try{if(e){var h=j.getBuffered(e),u=[],a;for(a=0;a<h.length;a++)u.push({start:h.start(a),end:h.end(a)});return this.bufferedInfo(u,C,g)}}catch(i){}return{len:0,start:C,end:C,nextStart:void 0}},j.bufferedInfo=function(e,C,g){C=Math.max(0,C),e.sort(function(m,b){var _=m.start-b.start;return _||b.end-m.end});var h=[];if(g)for(var u=0;u<e.length;u++){var a=h.length;if(a){var i=h[a-1].end;e[u].start-i<g?e[u].end>i&&(h[a-1].end=e[u].end):h.push(e[u])}else h.push(e[u])}else h=e;for(var c=0,s,r=C,n=C,t=0;t<h.length;t++){var v=h[t].start,p=h[t].end;if(C+g>=v&&C<p)r=v,n=p,c=n-C;else if(C+g<v){s=v;break}}return{len:c,start:r||0,end:n||0,nextStart:s}},j.getBuffered=function(e){try{return e.buffered}catch(C){return M.logger.log("failed to get media.buffered",C),w}},j}()},"./src/utils/cea-608-parser.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"Row",function(){return n}),O.d(W,"CaptionScreen",function(){return t});var M=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},L=function(f){var l=f;return w.hasOwnProperty(f)&&(l=w[f]),String.fromCharCode(l)},j=15,U=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},C={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},u=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(o){o[o.ERROR=0]="ERROR",o[o.TEXT=1]="TEXT",o[o.WARNING=2]="WARNING",o[o.INFO=2]="INFO",o[o.DEBUG=3]="DEBUG",o[o.DATA=3]="DATA"})(a||(a={}));var i=function(){function o(){this.time=null,this.verboseLevel=a.ERROR}var f=o.prototype;return f.log=function(d,E){this.verboseLevel>=d&&M.logger.log(this.time+" ["+d+"] "+E)},o}(),c=function(f){for(var l=[],d=0;d<f.length;d++)l.push(f[d].toString(16));return l},s=function(){function o(l,d,E,y,S){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=l||"white",this.underline=d||!1,this.italics=E||!1,this.background=y||"black",this.flash=S||!1}var f=o.prototype;return f.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},f.setStyles=function(d){for(var E=["foreground","underline","italics","background","flash"],y=0;y<E.length;y++){var S=E[y];d.hasOwnProperty(S)&&(this[S]=d[S])}},f.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},f.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},f.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},f.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},o}(),r=function(){function o(l,d,E,y,S,D){this.uchar=void 0,this.penState=void 0,this.uchar=l||" ",this.penState=new s(d,E,y,S,D)}var f=o.prototype;return f.reset=function(){this.uchar=" ",this.penState.reset()},f.setChar=function(d,E){this.uchar=d,this.penState.copy(E)},f.setPenState=function(d){this.penState.copy(d)},f.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},f.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},f.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},o}(),n=function(){function o(l){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var d=0;d<U;d++)this.chars.push(new r);this.logger=l,this.pos=0,this.currPenState=new s}var f=o.prototype;return f.equals=function(d){for(var E=!0,y=0;y<U;y++)if(!this.chars[y].equals(d.chars[y])){E=!1;break}return E},f.copy=function(d){for(var E=0;E<U;E++)this.chars[E].copy(d.chars[E])},f.isEmpty=function(){for(var d=!0,E=0;E<U;E++)if(!this.chars[E].isEmpty()){d=!1;break}return d},f.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>U&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},f.moveCursor=function(d){var E=this.pos+d;if(d>1)for(var y=this.pos+1;y<E+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(E)},f.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},f.insertChar=function(d){d>=144&&this.backSpace();var E=L(d);if(this.pos>=U){this.logger.log(a.ERROR,"Cannot insert "+d.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},f.clearFromPos=function(d){var E;for(E=d;E<U;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 d=[],E=!0,y=0;y<U;y++){var S=this.chars[y].uchar;S!==" "&&(E=!1),d.push(S)}return E?"":d.join("")},f.setPenStyles=function(d){this.currPenState.setStyles(d);var E=this.chars[this.pos];E.setPenState(this.currPenState)},o}(),t=function(){function o(l){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var d=0;d<j;d++)this.rows.push(new n(l));this.logger=l,this.currRow=j-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var f=o.prototype;return f.reset=function(){for(var d=0;d<j;d++)this.rows[d].clear();this.currRow=j-1},f.equals=function(d){for(var E=!0,y=0;y<j;y++)if(!this.rows[y].equals(d.rows[y])){E=!1;break}return E},f.copy=function(d){for(var E=0;E<j;E++)this.rows[E].copy(d.rows[E])},f.isEmpty=function(){for(var d=!0,E=0;E<j;E++)if(!this.rows[E].isEmpty()){d=!1;break}return d},f.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},f.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},f.insertChar=function(d){var E=this.rows[this.currRow];E.insertChar(d)},f.setPen=function(d){var E=this.rows[this.currRow];E.setPenStyles(d)},f.moveCursor=function(d){var E=this.rows[this.currRow];E.moveCursor(d)},f.setCursor=function(d){this.logger.log(a.INFO,"setCursor: "+d);var E=this.rows[this.currRow];E.setCursor(d)},f.setPAC=function(d){this.logger.log(a.INFO,"pacData = "+JSON.stringify(d));var E=d.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var y=0;y<j;y++)this.rows[y].clear();var S=this.currRow+1-this.nrRollUpRows,D=this.lastOutputScreen;if(D){var I=D.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(D.rows[S+P])}}this.currRow=E;var H=this.rows[this.currRow];if(d.indent!==null){var R=d.indent,K=Math.max(R-1,0);H.setCursor(d.indent),d.color=H.chars[K].penState.foreground}var V={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(V)},f.setBkgData=function(d){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},f.setRollUpRows=function(d){this.nrRollUpRows=d},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 d=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(d,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(a.INFO,"Rolling up")},f.getDisplayText=function(d){d=d||!1;for(var E=[],y="",S=-1,D=0;D<j;D++){var I=this.rows[D].getTextString();I&&(S=D+1,d?E.push("Row "+S+": '"+I+"'"):E.push(I.trim()))}return E.length>0&&(d?y="["+E.join(" | ")+"]":y=E.join(`
`)),y},f.getTextAndFormat=function(){return this.rows},o}(),v=function(){function o(l,d,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=l,this.outputFilter=d,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[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var f=o.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[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},f.getHandler=function(){return this.outputFilter},f.setHandler=function(d){this.outputFilter=d},f.setPAC=function(d){this.writeScreen.setPAC(d)},f.setBkgData=function(d){this.writeScreen.setBkgData(d)},f.setMode=function(d){if(d===this.mode)return;this.mode=d,this.logger.log(a.INFO,"MODE="+d),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=d},f.insertChars=function(d){for(var E=0;E<d.length;E++)this.writeScreen.insertChar(d[E]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,y+": "+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(d){this.logger.log(a.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},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 d=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=d,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},f.ccTO=function(d){this.logger.log(a.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},f.ccMIDROW=function(d){var E={flash:!1};if(E.underline=d%2===1,E.italics=d>=46,E.italics)E.foreground="white";else{var y=Math.floor(d/2)-16,S=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=S[y]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},f.outputDataUpdate=function(d){d===void 0&&(d=!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),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},f.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},o}(),p=function(){function o(l,d,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new i;this.channels=[null,new v(l,d,y),new v(l+1,E,y)],this.cmdHistory=_(),this.logger=y}var f=o.prototype;return f.getHandler=function(d){return this.channels[d].getHandler()},f.setHandler=function(d,E){this.channels[d].setHandler(E)},f.addData=function(d,E){var y,S,D,I=!1;this.logger.time=d;for(var A=0;A<E.length;A+=2){if(S=E[A]&127,D=E[A+1]&127,S===0&&D===0)continue;if(this.logger.log(a.DATA,"["+c([E[A],E[A+1]])+"] -> ("+c([S,D])+")"),y=this.parseCmd(S,D),y||(y=this.parseMidrow(S,D)),y||(y=this.parsePAC(S,D)),y||(y=this.parseBackgroundAttributes(S,D)),!y&&(I=this.parseChars(S,D),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?")}!y&&!I&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+c([S,D])+" orig: "+c([E[A],E[A+1]]))}},f.parseCmd=function(d,E){var y=this.cmdHistory,S=(d===20||d===28||d===21||d===29)&&E>=32&&E<=47,D=(d===23||d===31)&&E>=33&&E<=35;if(!(S||D))return!1;if(b(d,E,y))return m(null,null,y),this.logger.log(a.DEBUG,"Repeated command ("+c([d,E])+") is dropped"),!0;var I=d===20||d===21||d===23?1:2,A=this.channels[I];return d===20||d===21||d===28||d===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(d,E,y),this.currentChannel=I,!0},f.parseMidrow=function(d,E){var y=0;if((d===17||d===25)&&E>=32&&E<=47){if(d===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var S=this.channels[y];return S?(S.ccMIDROW(E),this.logger.log(a.DEBUG,"MIDROW ("+c([d,E])+")"),!0):!1}return!1},f.parsePAC=function(d,E){var y,S=this.cmdHistory,D=(d>=17&&d<=23||d>=25&&d<=31)&&E>=64&&E<=127,I=(d===16||d===24)&&E>=64&&E<=95;if(!(D||I))return!1;if(b(d,E,S))return m(null,null,S),!0;var A=d<=23?1:2;E>=64&&E<=95?y=A===1?e[d]:g[d]:y=A===1?C[d]:h[d];var P=this.channels[A];return P?(P.setPAC(this.interpretPAC(y,E)),m(d,E,S),this.currentChannel=A,!0):!1},f.interpretPAC=function(d,E){var y,S={color:null,italics:!1,indent:null,underline:!1,row:d};return E>95?y=E-96:y=E-64,S.underline=(y&1)===1,y<=13?S.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(S.italics=!0,S.color="white"):S.indent=Math.floor((y-16)/2)*4,S},f.parseChars=function(d,E){var y,S=null,D=null;if(d>=25?(y=2,D=d-8):(y=1,D=d),D>=17&&D<=19){var I;D===17?I=E+80:D===18?I=E+112:I=E+144,this.logger.log(a.INFO,"Special char '"+L(I)+"' in channel "+y),S=[I]}else d>=32&&d<=127&&(S=E===0?[d]:[d,E]);if(S){var A=c(S);this.logger.log(a.DEBUG,"Char codes = "+A.join(",")),m(d,E,this.cmdHistory)}return S},f.parseBackgroundAttributes=function(d,E){var y=(d===16||d===24)&&E>=32&&E<=47,S=(d===23||d===31)&&E>=45&&E<=47;if(!(y||S))return!1;var D,I={};d===16||d===24?(D=Math.floor((E-32)/2),I.background=u[D],E%2===1&&(I.background=I.background+"_semi")):E===45?I.background="transparent":(I.foreground="black",E===47&&(I.underline=!0));var A=d<=23?1:2,P=this.channels[A];return P.setBkgData(I),m(d,E,this.cmdHistory),!0},f.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var E=this.channels[d];E&&E.reset()}this.cmdHistory=_()},f.cueSplitAtTime=function(d){for(var E=0;E<this.channels.length;E++){var y=this.channels[E];y&&y.cueSplitAtTime(d)}},o}();function m(o,f,l){l.a=o,l.b=f}function b(o,f,l){return l.a===o&&l.b===f}function _(){return{a:null,b:null}}W.default=p},"./src/utils/codecs.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"isCodecType",function(){return w}),O.d(W,"isCodecSupportedInMp4",function(){return L});var M={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(j,U){var e=M[U];return!!e&&e[j.slice(0,4)]===!0}function L(j,U){return MediaSource.isTypeSupported((U||"video")+'/mp4;codecs="'+j+'"')}},"./src/utils/cues.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/utils/vttparser.ts"),w=O("./src/utils/webvtt-parser.ts"),L=O("./src/utils/texttrack-utils.ts"),j=/\s/,U={newCue:function(C,g,h,u){for(var a=[],i,c,s,r,n,t=self.VTTCue||self.TextTrackCue,v=0;v<u.rows.length;v++)if(i=u.rows[v],s=!0,r=0,n="",!i.isEmpty()){for(var p=0;p<i.chars.length;p++)j.test(i.chars[p].uchar)&&s?r++:(n+=i.chars[p].uchar,s=!1);i.cueStartTime=g,g===h&&(h+=1e-4),r>=16?r--:r++;var m=Object(M.fixLineBreaks)(n.trim()),b=Object(w.generateCueId)(g,h,m);(!C||!C.cues||!C.cues.getCueById(b))&&(c=new t(g,h,m),c.id=b,c.line=v+1,c.align="left",c.position=10+Math.min(80,Math.floor(r*8/32)*10),a.push(c))}return C&&a.length&&(a.sort(function(_,o){return _.line==="auto"||o.line==="auto"?0:_.line>8&&o.line>8?o.line-_.line:_.line-o.line}),a.forEach(function(_){return Object(L.addCueToTrack)(C,_)})),a}};W.default=U},"./src/utils/discontinuities.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"findFirstFragWithCC",function(){return j}),O.d(W,"shouldAlignOnDiscontinuities",function(){return U}),O.d(W,"findDiscontinuousReferenceFrag",function(){return e}),O.d(W,"adjustSlidingStart",function(){return g}),O.d(W,"alignStream",function(){return h}),O.d(W,"alignPDT",function(){return a}),O.d(W,"alignFragmentByPDTDelta",function(){return i}),O.d(W,"alignMediaPlaylistByPDT",function(){return c});var M=O("./src/polyfills/number.ts"),w=O("./src/utils/logger.ts"),L=O("./src/controller/level-helper.ts");function j(s,r){for(var n=null,t=0,v=s.length;t<v;t++){var p=s[t];if(p&&p.cc===r){n=p;break}}return n}function U(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 v=j(n,t[0].cc);if(!v||v&&!v.startPTS){w.logger.log("No frag in previous level to align on");return}return v}function C(s,r){if(s){var n=s.start+r;s.start=s.startPTS=n,s.endPTS=n+s.duration}}function g(s,r){for(var n=r.fragments,t=0,v=n.length;t<v;t++)C(n[t],s);r.fragmentHint&&C(r.fragmentHint,s),r.alignedSliding=!0}function h(s,r,n){if(!r)return;u(s,n,r),!n.alignedSliding&&r.details&&a(n,r.details),!n.alignedSliding&&r.details&&!n.skippedSegments&&Object(L.adjustSliding)(r.details,n)}function u(s,r,n){if(U(s,n,r)){var t=e(n.details,r);t&&Object(M.isFiniteNumber)(t.start)&&(w.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),g(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,v=(t-n)/1e3+r.fragments[0].start;v&&Object(M.isFiniteNumber)(v)&&(w.logger.log("Adjusting PTS using programDateTime delta "+(t-n)+"ms, sliding:"+v.toFixed(3)+" "+s.url+" "),g(v,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 c(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,t=r.fragments[0].start,v=n-t*1e3;s.fragments.forEach(function(p){i(p,v)}),s.fragmentHint&&i(s.fragmentHint,v),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/utils/ewma.ts"),w=function(){function L(U,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 M.default(U),this.fast_=new M.default(e)}var j=L.prototype;return j.update=function(e,C){var g=this.slow_,h=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new M.default(e,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==C&&(this.fast_=new M.default(C,h.getEstimate(),h.getTotalWeight()))},j.sample=function(e,C){e=Math.max(e,this.minDelayMs_);var g=8*C,h=e/1e3,u=g/h;this.fast_.sample(h,u),this.slow_.sample(h,u)},j.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},j.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},j.destroy=function(){},L}();W.default=w},"./src/utils/ewma.ts":function(ie,W,O){"use strict";O.r(W);var M=function(){function w(j,U,e){U===void 0&&(U=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=j,this.alpha_=j?Math.exp(Math.log(.5)/j):0,this.estimate_=U,this.totalWeight_=e}var L=w.prototype;return L.sample=function(U,e){var C=Math.pow(this.alpha_,U);this.estimate_=e*(1-C)+C*this.estimate_,this.totalWeight_+=U},L.getTotalWeight=function(){return this.totalWeight_},L.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},w}();W.default=M},"./src/utils/fetch-loader.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"fetchSupported",function(){return i});var M=O("./src/polyfills/number.ts"),w=O("./src/loader/load-stats.ts"),L=O("./src/demux/chunk-cache.ts");function j(t,v){t.prototype=Object.create(v.prototype),t.prototype.constructor=t,h(t,v)}function U(t){var v=typeof Map=="function"?new Map:void 0;return U=function(m){if(m===null||!g(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(m))return v.get(m);v.set(m,b)}function b(){return e(m,arguments,u(this).constructor)}return b.prototype=Object.create(m.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),h(b,m)},U(t)}function e(t,v,p){return C()?e=Reflect.construct:e=function(b,_,o){var f=[null];f.push.apply(f,_);var l=Function.bind.apply(b,f),d=new l;return o&&h(d,o.prototype),d},e.apply(null,arguments)}function C(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function h(t,v){return h=Object.setPrototypeOf||function(m,b){return m.__proto__=b,m},h(t,v)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},u(t)}function a(){return a=Object.assign||function(t){for(var v=1;v<arguments.length;v++){var p=arguments[v];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 c=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 v=t.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(m,b,_){var o=this,f=this.stats;if(f.loading.start)throw new Error("Loader can only be used once.");f.loading.start=self.performance.now();var l=s(m,this.controller.signal),d=_.onProgress,E=m.responseType==="arraybuffer",y=E?"byteLength":"length";this.context=m,this.config=b,this.callbacks=_,this.request=this.fetchSetup(m,l),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){o.abortInternal(),_.onTimeout(f,m,o.response)},b.timeout),self.fetch(this.request).then(function(S){if(o.response=o.loader=S,!S.ok){var D=S.status,I=S.statusText;throw new n(I||"fetch, bad network response",D,S)}return f.loading.first=Math.max(self.performance.now(),f.loading.start),f.total=parseInt(S.headers.get("Content-Length")||"0"),d&&Object(M.isFiniteNumber)(b.highWaterMark)?o.loadProgressively(S,f,m,b.highWaterMark,d):E?S.arrayBuffer():S.text()}).then(function(S){var D=o.response;self.clearTimeout(o.requestTimeout),f.loading.end=Math.max(self.performance.now(),f.loading.first),f.loaded=f.total=S[y];var I={url:D.url,data:S};d&&!Object(M.isFiniteNumber)(b.highWaterMark)&&d(f,m,S,D),_.onSuccess(I,f,m,D)}).catch(function(S){if(self.clearTimeout(o.requestTimeout),f.aborted)return;var D=S.code||0;_.onError({code:D,text:S.message},m,S.details)})},v.getCacheAge=function(){var m=null;if(this.response){var b=this.response.headers.get("age");m=b?parseFloat(b):null}return m},v.loadProgressively=function(m,b,_,o,f){o===void 0&&(o=0);var l=new L.default,d=m.body.getReader(),E=function y(){return d.read().then(function(S){if(S.done)return l.dataLength&&f(b,_,l.flush(),m),Promise.resolve(new ArrayBuffer(0));var D=S.value,I=D.length;return b.loaded+=I,I<o||l.dataLength?(l.push(D),l.dataLength>=o&&f(b,_,l.flush(),m)):f(b,_,D,m),y()}).catch(function(){return Promise.reject()})};return E()},t}();function s(t,v){var p={method:"GET",mode:"cors",credentials:"same-origin",signal:v,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,v){return new self.Request(t.url,v)}var n=function(t){j(v,t);function v(p,m,b){var _;return _=t.call(this,p)||this,_.code=void 0,_.details=void 0,_.code=m,_.details=b,_}return v}(U(Error));W.default=c},"./src/utils/imsc1-ttml-parser.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"IMSC1_CODEC",function(){return g}),O.d(W,"parseIMSC1",function(){return i});var M=O("./src/utils/mp4-tools.ts"),w=O("./src/utils/vttparser.ts"),L=O("./src/utils/vttcue.ts"),j=O("./src/demux/id3.ts"),U=O("./src/utils/timescale-conversion.ts"),e=O("./src/utils/webvtt-parser.ts");function C(){return C=Object.assign||function(o){for(var f=1;f<arguments.length;f++){var l=arguments[f];for(var d in l)Object.prototype.hasOwnProperty.call(l,d)&&(o[d]=l[d])}return o},C.apply(this,arguments)}var g="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,u=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function i(o,f,l,d,E){var y=Object(M.findBox)(new Uint8Array(o),["mdat"]);if(y.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var S=y[0],D=Object(j.utf8ArrayToStr)(new Uint8Array(o,S.start,S.end-S.start)),I=Object(U.toTimescaleFromScale)(f,1,l);try{d(c(D,I))}catch(A){E(A)}}function c(o,f){var l=new DOMParser,d=l.parseFromString(o,"text/xml"),E=d.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},S=Object.keys(y).reduce(function(H,R){return H[R]=E.getAttribute("ttp:"+R)||y[R],H},{}),D=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,D);if(!R||!H.hasAttribute("begin"))return null;var K=m(H.getAttribute("begin"),S),V=m(H.getAttribute("dur"),S),oe=m(H.getAttribute("end"),S);if(K===null)throw p(H);if(oe===null){if(V===null)throw p(H);oe=K+V}var Q=new L.default(K-f,oe-f,R);Q.id=Object(e.generateCueId)(Q.startTime,Q.endTime,Q.text);var pe=A[H.getAttribute("region")],ce=I[H.getAttribute("style")];Q.position=10,Q.size=80;var ee=t(pe,ce),ne=ee.textAlign;if(ne){var me=a[ne];me&&(Q.lineAlign=me),Q.align=ne}return C(Q,ee),Q}).filter(function(H){return H!==null})}function s(o,f,l){var d=o.getElementsByTagName(f)[0];return d?[].slice.call(d.querySelectorAll(l)):[]}function r(o){return o.reduce(function(f,l){var d=l.getAttribute("xml:id");return d&&(f[d]=l),f},{})}function n(o,f){return[].slice.call(o.childNodes).reduce(function(l,d,E){var y;return d.nodeName==="br"&&E?l+`
`:(y=d.childNodes)!==null&&y!==void 0&&y.length?n(d,f):f?l+d.textContent.trim().replace(/\s+/g," "):l+d.textContent},"")}function t(o,f){var l="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(E,y){var S=v(f,l,y)||v(o,l,y);return S&&(E[y]=S),E},{})}function v(o,f,l){return o.hasAttributeNS(f,l)?o.getAttributeNS(f,l):null}function p(o){return new Error("Could not parse ttml timestamp "+o)}function m(o,f){if(!o)return null;var l=Object(w.parseTimeStamp)(o);return l===null&&(h.test(o)?l=b(o,f):u.test(o)&&(l=_(o,f))),l}function b(o,f){var l=h.exec(o),d=(l[4]|0)+(l[5]|0)/f.subFrameRate;return(l[1]|0)*3600+(l[2]|0)*60+(l[3]|0)+d/f.frameRate}function _(o,f){var l=u.exec(o),d=Number(l[1]),E=l[2];switch(E){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/f.frameRate;case"t":return d/f.tickRate}return d}},"./src/utils/logger.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"enableLogs",function(){return e}),O.d(W,"logger",function(){return C});var M=function(){},w={trace:M,debug:M,log:M,warn:M,info:M,error:M},L=w;function j(g){var h=self.console[g];return h?h.bind(self.console,"["+g+"] >"):M}function U(g){for(var h=arguments.length,u=new Array(h>1?h-1:0),a=1;a<h;a++)u[a-1]=arguments[a];u.forEach(function(i){L[i]=g[i]?g[i].bind(g):j(i)})}function e(g){if(self.console&&g===!0||typeof g=="object"){U(g,"debug","log","info","warn","error");try{L.log()}catch(h){L=w}}else L=w}var C=L},"./src/utils/mediakeys-helper.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"KeySystems",function(){return M}),O.d(W,"requestMediaKeySystemAccess",function(){return w});var M;(function(L){L.WIDEVINE="com.widevine.alpha",L.PLAYREADY="com.microsoft.playready"})(M||(M={}));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(ie,W,O){"use strict";O.r(W),O.d(W,"getMediaSource",function(){return M});function M(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"bin2str",function(){return U}),O.d(W,"readUint16",function(){return e}),O.d(W,"readUint32",function(){return C}),O.d(W,"writeUint32",function(){return g}),O.d(W,"findBox",function(){return h}),O.d(W,"parseSegmentIndex",function(){return u}),O.d(W,"parseInitSegment",function(){return a}),O.d(W,"getStartDTS",function(){return i}),O.d(W,"getDuration",function(){return c}),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 M=O("./src/utils/typed-array.ts"),w=O("./src/loader/fragment.ts"),L=Math.pow(2,32)-1,j=[].push;function U(v){return String.fromCharCode.apply(null,v)}function e(v,p){"data"in v&&(p+=v.start,v=v.data);var m=v[p]<<8|v[p+1];return m<0?65536+m:m}function C(v,p){"data"in v&&(p+=v.start,v=v.data);var m=v[p]<<24|v[p+1]<<16|v[p+2]<<8|v[p+3];return m<0?4294967296+m:m}function g(v,p,m){"data"in v&&(p+=v.start,v=v.data),v[p]=m>>24,v[p+1]=m>>16&255,v[p+2]=m>>8&255,v[p+3]=m&255}function h(v,p){var m=[];if(!p.length)return m;var b,_,o;"data"in v?(b=v.data,_=v.start,o=v.end):(b=v,_=0,o=b.byteLength);for(var f=_;f<o;){var l=C(b,f),d=U(b.subarray(f+4,f+8)),E=l>1?f+l:o;if(d===p[0])if(p.length===1)m.push({data:b,start:f+8,end:E});else{var y=h({data:b,start:f+8,end:E},p.slice(1));y.length&&j.apply(m,y)}f=E}return m}function u(v){var p=h(v,["moov"]),m=p[0],b=m?m.end:null,_=h(v,["sidx"]);if(!_||!_[0])return null;var o=[],f=_[0],l=f.data[0],d=l===0?8:16,E=C(f,d);d+=4;var y=0,S=0;l===0?d+=8:d+=16,d+=2;var D=f.end+S,I=e(f,d);d+=2;for(var A=0;A<I;A++){var P=d,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 V=C(f,P);P+=4,o.push({referenceSize:R,subsegmentDuration:V,info:{duration:V/E,start:D,end:D+R-1}}),D+=R,P+=4,d=P}return{earliestPresentationTime:y,timescale:E,version:l,referencesCount:I,references:o,moovEndOffset:b}}function a(v){for(var p=[],m=h(v,["moov","trak"]),b=0;b<m.length;b++){var _=m[b],o=h(_,["tkhd"])[0];if(o){var f=o.data[o.start],l=f===0?12:20,d=C(o,l),E=h(_,["mdia","mdhd"])[0];if(E){f=E.data[E.start],l=f===0?12:20;var y=C(E,l),S=h(_,["mdia","hdlr"])[0];if(S){var D=U(S.data.subarray(S.start+8,S.start+12)),I={soun:w.ElementaryStreamTypes.AUDIO,vide:w.ElementaryStreamTypes.VIDEO}[D];if(I){var A=h(_,["mdia","minf","stbl","stsd"])[0],P=void 0;A&&(P=U(A.data.subarray(A.start+12,A.start+16))),p[d]={timescale:y,type:I},p[I]={timescale:y,id:d,codec:P}}}}}}var H=h(v,["moov","mvex","trex"]);return H.forEach(function(R){var K=C(R,4),V=p[K];V&&(V.default={duration:C(R,12),flags:C(R,20)})}),p}function i(v,p){return h(p,["moof","traf"]).reduce(function(m,b){var _=h(b,["tfdt"])[0],o=_.data[_.start],f=h(b,["tfhd"]).reduce(function(l,d){var E=C(d,4),y=v[E];if(y){var S=C(_,4);o===1&&(S*=Math.pow(2,32),S+=C(_,8));var D=y.timescale||9e4,I=S/D;if(isFinite(I)&&(l===null||I<l))return I}return l},null);return f!==null&&isFinite(f)&&(m===null||f<m)?f:m},null)||0}function c(v,p){for(var m=0,b=0,_=0,o=h(v,["moof","traf"]),f=0;f<o.length;f++){var l=o[f],d=h(l,["tfhd"])[0],E=C(d,4),y=p[E];if(!y)continue;var S=y.default,D=C(d,0)|(S==null?void 0:S.flags),I=S==null?void 0:S.duration;D&8&&(D&2?I=C(d,12):I=C(d,8));for(var A=y.timescale||9e4,P=h(l,["trun"]),H=0;H<P.length;H++){if(I){var R=C(P[H],4);m=I*R}else m=s(P[H]);y.type===w.ElementaryStreamTypes.VIDEO?b+=m/A:y.type===w.ElementaryStreamTypes.AUDIO&&(_+=m/A)}}if(b===0&&_===0){var K=u(v);if(K!=null&&K.references)return K.references.reduce(function(V,oe){return V+oe.info.duration||0},0)}return b||_}function s(v){var p=C(v,0),m=8;p&1&&(m+=4),p&4&&(m+=4);for(var b=0,_=C(v,4),o=0;o<_;o++){if(p&256){var f=C(v,m);b+=f,m+=4}p&512&&(m+=4),p&1024&&(m+=4),p&2048&&(m+=4)}return b}function r(v,p,m){h(p,["moof","traf"]).forEach(function(b){h(b,["tfhd"]).forEach(function(_){var o=C(_,4),f=v[o];if(!f)return;var l=f.timescale||9e4;h(b,["tfdt"]).forEach(function(d){var E=d.data[d.start],y=C(d,4);if(E===0)g(d,4,y-m*l);else{y*=Math.pow(2,32),y+=C(d,8),y-=m*l,y=Math.max(y,0);var S=Math.floor(y/(L+1)),D=Math.floor(y%(L+1));g(d,4,S),g(d,8,D)}})})})}function n(v){var p={valid:null,remainder:null},m=h(v,["moof"]);if(m){if(m.length<2)return p.remainder=v,p}else return p;var b=m[m.length-1];return p.valid=Object(M.sliceUint8)(v,0,b.start-8),p.remainder=Object(M.sliceUint8)(v,b.start-8),p}function t(v,p){var m=new Uint8Array(v.length+p.length);return m.set(v),m.set(p,v.length),m}},"./src/utils/output-filter.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"default",function(){return M});var M=function(){function w(j,U){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=j,this.trackName=U}var L=w.prototype;return L.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},L.newCue=function(U,e,C){(this.startTime===null||this.startTime>U)&&(this.startTime=U),this.endTime=e,this.screen=C,this.timelineController.createCaptionsTrack(this.trackName)},L.reset=function(){this.cueRanges=[]},w}()},"./src/utils/texttrack-utils.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"sendAddTrackEvent",function(){return w}),O.d(W,"addCueToTrack",function(){return L}),O.d(W,"clearCurrentCues",function(){return j}),O.d(W,"removeCuesInRange",function(){return U}),O.d(W,"getCuesInRange",function(){return C});var M=O("./src/utils/logger.ts");function w(g,h){var u;try{u=new Event("addtrack")}catch(a){u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,h.dispatchEvent(u)}function L(g,h){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(h.id))try{if(g.addCue(h),!g.cues.getCueById(h.id))throw new Error("addCue is failed for: "+h)}catch(i){M.logger.debug("[texttrack-utils]: "+i);var a=new self.TextTrackCue(h.startTime,h.endTime,h.text);a.id=h.id,g.addCue(a)}u==="disabled"&&(g.mode=u)}function j(g){var h=g.mode;if(h==="disabled"&&(g.mode="hidden"),g.cues)for(var u=g.cues.length;u--;)g.removeCue(g.cues[u]);h==="disabled"&&(g.mode=h)}function U(g,h,u){var a=g.mode;if(a==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var i=C(g.cues,h,u),c=0;c<i.length;c++)g.removeCue(i[c]);a==="disabled"&&(g.mode=a)}function e(g,h){if(h<g[0].startTime)return 0;var u=g.length-1;if(h>g[u].endTime)return-1;for(var a=0,i=u;a<=i;){var c=Math.floor((i+a)/2);if(h<g[c].startTime)i=c-1;else if(h>g[c].startTime&&a<u)a=c+1;else return c}return g[a].startTime-h<h-g[i].startTime?a:i}function C(g,h,u){var a=[],i=e(g,h);if(i>-1)for(var c=i,s=g.length;c<s;c++){var r=g[c];if(r.startTime>=h&&r.endTime<=u)a.push(r);else if(r.startTime>u)return a}return a}},"./src/utils/time-ranges.ts":function(ie,W,O){"use strict";O.r(W);var M={toString:function(L){for(var j="",U=L.length,e=0;e<U;e++)j+="["+L.start(e).toFixed(3)+","+L.end(e).toFixed(3)+"]";return j}};W.default=M},"./src/utils/timescale-conversion.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"toTimescaleFromBase",function(){return w}),O.d(W,"toTimescaleFromScale",function(){return L}),O.d(W,"toMsFromMpegTsClock",function(){return j}),O.d(W,"toMpegTsClockFromTimescale",function(){return U});var M=9e4;function w(e,C,g,h){g===void 0&&(g=1),h===void 0&&(h=!1);var u=e*C*g;return h?Math.round(u):u}function L(e,C,g,h){return g===void 0&&(g=1),h===void 0&&(h=!1),w(e,C,1/g,h)}function j(e,C){return C===void 0&&(C=!1),w(e,1e3,1/M,C)}function U(e,C){return C===void 0&&(C=1),w(e,M,1/C)}},"./src/utils/typed-array.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"sliceUint8",function(){return M});function M(w,L,j){return Uint8Array.prototype.slice?w.slice(L,j):new Uint8Array(Array.prototype.slice.call(w,L,j))}},"./src/utils/vttcue.ts":function(ie,W,O){"use strict";O.r(W),W.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var M=["","lr","rl"],w=["start","middle","end","left","right"];function L(g,h){if(typeof h!="string")return!1;if(!Array.isArray(g))return!1;var u=h.toLowerCase();return~g.indexOf(u)?u:!1}function j(g){return L(M,g)}function U(g){return L(w,g)}function e(g){for(var h=arguments.length,u=new Array(h>1?h-1:0),a=1;a<h;a++)u[a-1]=arguments[a];for(var i=1;i<arguments.length;i++){var c=arguments[i];for(var s in c)g[s]=c[s]}return g}function C(g,h,u){var a=this,i={enumerable:!0};a.hasBeenReset=!1;var c="",s=!1,r=g,n=h,t=u,v=null,p="",m=!0,b="auto",_="start",o=50,f="middle",l=50,d="middle";Object.defineProperty(a,"id",e({},i,{get:function(){return c},set:function(y){c=""+y}})),Object.defineProperty(a,"pauseOnExit",e({},i,{get:function(){return s},set:function(y){s=!!y}})),Object.defineProperty(a,"startTime",e({},i,{get:function(){return r},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");r=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",e({},i,{get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");n=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",e({},i,{get:function(){return t},set:function(y){t=""+y,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",e({},i,{get:function(){return v},set:function(y){v=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",e({},i,{get:function(){return p},set:function(y){var S=j(y);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(y){m=!!y,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",e({},i,{get:function(){return b},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");b=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",e({},i,{get:function(){return _},set:function(y){var S=U(y);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 o},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");o=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",e({},i,{get:function(){return f},set:function(y){var S=U(y);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 l},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");l=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",e({},i,{get:function(){return d},set:function(y){var S=U(y);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");d=S,this.hasBeenReset=!0}})),a.displayState=void 0}return C.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},C}()},"./src/utils/vttparser.ts":function(ie,W,O){"use strict";O.r(W),O.d(W,"parseTimeStamp",function(){return L}),O.d(W,"fixLineBreaks",function(){return h}),O.d(W,"VTTParser",function(){return u});var M=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 L(a){function i(s,r,n,t){return(s|0)*3600+(r|0)*60+(n|0)+parseFloat(t||0)}var c=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return c?parseFloat(c[2])>59?i(c[2],c[3],0,c[4]):i(c[1],c[2],c[3],c[4]):null}var j=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 U(a,i,c,s){var r=s?a.split(s):[a];for(var n in r){if(typeof r[n]!="string")continue;var t=r[n].split(c);if(t.length!==2)continue;var v=t[0],p=t[1];i(v,p)}}var e=new M.default(0,0,""),C=e.align==="middle"?"middle":"center";function g(a,i,c){var s=a;function r(){var v=L(a);if(v===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),v}function n(v,p){var m=new j;U(v,function(o,f){var l;switch(o){case"region":for(var d=c.length-1;d>=0;d--)if(c[d].id===f){m.set(o,c[d].region);break}break;case"vertical":m.alt(o,f,["rl","lr"]);break;case"line":l=f.split(","),m.integer(o,l[0]),m.percent(o,l[0])&&m.set("snapToLines",!1),m.alt(o,l[0],["auto"]),l.length===2&&m.alt("lineAlign",l[1],["start",C,"end"]);break;case"position":l=f.split(","),m.percent(o,l[0]),l.length===2&&m.alt("positionAlign",l[1],["start",C,"end","line-left","line-right","auto"]);break;case"size":m.percent(o,f);break;case"align":m.alt(o,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 h(a){return a.replace(/<br(?: \/)?>/gi,`
`)}var u=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,o=0;for(_=h(_);o<_.length&&_[o]!=="\r"&&_[o]!==`
`;)++o;var f=_.substr(0,o);return _[o]==="\r"&&++o,_[o]===`
`&&++o,r.buffer=_.substr(o),f}function t(_){U(_,function(o,f){},/:/)}try{var v="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;v=n();var p=v.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:v=n();switch(r.state){case"HEADER":/:/.test(v)?t(v):v||(r.state="ID");continue;case"NOTE":v||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){r.state="NOTE";break}if(!v)continue;if(r.cue=new M.default(0,0,""),r.state="CUE",v.indexOf("-->")===-1){r.cue.id=v;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{g(v,r.cue,r.regionList)}catch(_){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var b=v.indexOf("-->")!==-1;if(!v||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+=v}continue;case"BADCUE":v||(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(ie,W,O){"use strict";O.r(W),O.d(W,"generateCueId",function(){return u}),O.d(W,"parseWebVTT",function(){return i});var M=O("./src/polyfills/number.ts"),w=O("./src/utils/vttparser.ts"),L=O("./src/demux/id3.ts"),j=O("./src/utils/timescale-conversion.ts"),U=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},g=function(s){var r=parseInt(s.substr(-3)),n=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),v=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(M.isFiniteNumber)(r)||!Object(M.isFiniteNumber)(n)||!Object(M.isFiniteNumber)(t)||!Object(M.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return r+=1e3*n,r+=60*1e3*t,r+=60*60*1e3*v,r},h=function(s){for(var r=5381,n=s.length;n;)r=r*33^s.charCodeAt(--n);return(r>>>0).toString()};function u(c,s,r){return h(c.toString())+h(s.toString())+h(r)}var a=function(s,r,n){var t=s[r],v=s[t.prevCC];if(!v||!v.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(p=v)!==null&&p!==void 0&&p.new;){var p;s.ccOffset+=t.start-v.start,t.new=!1,t=v,v=s[t.prevCC]}s.presentationOffset=n};function i(c,s,r,n,t,v,p,m){var b=new w.VTTParser,_=Object(L.utf8ArrayToStr)(new Uint8Array(c)).trim().replace(e,`
`).split(`
`),o=[],f=Object(j.toMpegTsClockFromTimescale)(s,r),l="00:00.000",d=0,E=0,y,S=!0,D=!1;b.oncue=function(I){var A=n[t],P=n.ccOffset,H=(d-f)/9e4;if(A!=null&&A.new&&(E!==void 0?P=n.ccOffset=A.start:a(n,t,H)),H&&(P=H-n.presentationOffset),D){var R=I.endTime-I.startTime,K=Object(U.normalizePts)((I.startTime+P-E)*9e4,v*9e4)/9e4;I.startTime=K,I.endTime=K+R}var V=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(V)),I.id||(I.id=u(I.startTime,I.endTime,V)),I.endTime>0&&o.push(I)},b.onparsingerror=function(I){y=I},b.onflush=function(){if(y){m(y);return}p(o)},_.forEach(function(I){if(S)if(C(I,"X-TIMESTAMP-MAP=")){S=!1,D=!0,I.substr(16).split(",").forEach(function(A){C(A,"LOCAL:")?l=A.substr(6):C(A,"MPEGTS:")&&(d=parseInt(A.substr(7)))});try{E=g(l)/1e3}catch(A){D=!1,y=A}return}else I===""&&(S=!1);b.parse(I+`
`)}),b.flush()}},"./src/utils/xhr-loader.ts":function(ie,W,O){"use strict";O.r(W);var M=O("./src/utils/logger.ts"),w=O("./src/loader/load-stats.ts"),L=/^age:\s*[\d.]+\s*$/m,j=function(){function U(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=U.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},e.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(g,h,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=h,this.callbacks=u,this.retryDelay=h.retryDelay,this.loadInternal()},e.loadInternal=function(){var g=this.config,h=this.context;if(!g)return;var u=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var i=this.xhrSetup;try{if(i)try{i(u,h.url)}catch(r){u.open("GET",h.url,!0),i(u,h.url)}u.readyState||u.open("GET",h.url,!0);var c=this.context.headers;if(c)for(var s in c)u.setRequestHeader(s,c[s])}catch(r){this.callbacks.onError({code:u.status,text:r.message},h,u);return}h.rangeEnd&&u.setRequestHeader("Range","bytes="+h.rangeStart+"-"+(h.rangeEnd-1)),u.onreadystatechange=this.readystatechange.bind(this),u.onprogress=this.loadprogress.bind(this),u.responseType=h.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),u.send()},e.readystatechange=function(){var g=this.context,h=this.loader,u=this.stats;if(!g||!h)return;var a=h.readyState,i=this.config;if(u.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start)),a===4){h.onreadystatechange=null,h.onprogress=null;var c=h.status;if(c>=200&&c<300){u.loading.end=Math.max(self.performance.now(),u.loading.first);var s,r;if(g.responseType==="arraybuffer"?(s=h.response,r=s.byteLength):(s=h.responseText,r=s.length),u.loaded=u.total=r,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(u,g,s,h),!this.callbacks)return;var t={url:h.responseURL,data:s};this.callbacks.onSuccess(t,u,g,h)}else u.retry>=i.maxRetry||c>=400&&c<499?(M.logger.error(c+" while loading "+g.url),this.callbacks.onError({code:c,text:h.statusText},g,h)):(M.logger.warn(c+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,i.maxRetryDelay),u.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout)},e.loadtimeout=function(){M.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(g){var h=this.stats;h.loaded=g.loaded,g.lengthComputable&&(h.total=g.total)},e.getCacheAge=function(){var g=null;if(this.loader&&L.test(this.loader.getAllResponseHeaders())){var h=this.loader.getResponseHeader("age");g=h?parseFloat(h):null}return g},U}();W.default=j}}).default})},vHTk:function(qe,ve,N){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="}}]);