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__Problemset__index.e5face...

440 lines
1.4 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[237,5,7,8,9,16],{"+NIl":function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(Y,N){"use strict";function z(h,o){h.cmdState.push(o)}function I(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function M(h){var o=h.cmdState.pop();o&&o.closeBracket()}function G(h){for(var o=h.cmdState,p=o.length-1;p>=0;p--){var l=o[p];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function K(h,o,p){return function(){this.name=h,this.bracketNo=0,this.style=o,this.styles=p,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=K("importmodule","tag",["string","builtin"]),n.documentclass=K("documentclass","tag",["","atom"]),n.usepackage=K("usepackage","tag",["atom"]),n.begin=K("begin","tag",["atom"]),n.end=K("end","tag",["atom"]),n.label=K("label","tag",["atom"]),n.ref=K("ref","tag",["atom"]),n.eqref=K("eqref","tag",["atom"]),n.cite=K("cite","tag",["atom"]),n.bibitem=K("bibitem","tag",["atom"]),n.Bibitem=K("Bibitem","tag",["atom"]),n.RBibitem=K("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(h,o){h.f=o}function x(h,o){var p;if(h.match(/^\\[a-zA-Z@]+/)){var l=h.current().slice(1);return p=n.hasOwnProperty(l)?n[l]:n.DEFAULT,p=new p,z(o,p),L(o,b),p.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return L(o,function(s,i){return f(s,i,"\\]")}),"keyword";if(h.match("\\("))return L(o,function(s,i){return f(s,i,"\\)")}),"keyword";if(h.match("$$"))return L(o,function(s,i){return f(s,i,"$$")}),"keyword";if(h.match("$"))return L(o,function(s,i){return f(s,i,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(p=I(o),p)p.closeBracket(u),L(o,b);else return"error";return"bracket"}else return u=="{"||u=="["?(p=n.DEFAULT,p=new p,z(o,p),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),p=G(o),p.name=="begin"&&(p.argument=h.current()),p.styleIdentifier())}function f(h,o,p){if(h.eatSpace())return null;if(p&&h.match(p))return L(o,x),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=h.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(h.skipToEnd(),"comment"):"error"}function b(h,o){var p=h.peek(),l;return p=="{"||p=="["?(l=I(o),l.openBracket(p),h.eat(p),L(o,x),"bracket"):/[ \t\r]/.test(p)?(h.eat(p),null):(L(o,x),M(o),x(h,o))}return{startState:function(){var h=N.inMathMode?function(o,p){return f(o,p)}:x;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,o){return o.f(h,o)},blankLine:function(h){h.f=x,h.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(it,Ee,U){},"+vTd":function(it,Ee,U){it.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(it,Ee,U){it.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(it,Ee,U){"use strict";U.d(Ee,"f",function(){return N}),U.d(Ee,"g",function(){return z}),U.d(Ee,"h",function(){return I}),U.d(Ee,"e",function(){return G}),U.d(Ee,"b",function(){return K}),U.d(Ee,"c",function(){return n}),U.d(Ee,"d",function(){return L}),U.d(Ee,"a",function(){return x});class ie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}emit(f){this.listeners.forEach(b=>{b(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const Y=new ie;function N(f){G(f)||Y.onUnexpectedError(f);return}function z(f){G(f)||Y.onUnexpectedExternalError(f);return}function I(f){if(f instanceof Error){let{name:b,message:h}=f;const o=f.stacktrace||f.stack;return{$isError:!0,name:b,message:h,stack:o}}return f}const M="Canceled";function G(f){return f instanceof Error&&f.name===M&&f.message===M}function K(){const f=new Error(M);return f.name=f.message,f}function n(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function L(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class x extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"19Vz":function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(K,n,L){var x=L&&L!=ie.Init;if(n&&!x)K.on("blur",I),K.on("change",M),K.on("swapDoc",M),ie.on(K.getInputField(),"compositionupdate",K.state.placeholderCompose=function(){z(K)}),M(K);else if(!n&&x){K.off("blur",I),K.off("change",M),K.off("swapDoc",M),ie.off(K.getInputField(),"compositionupdate",K.state.placeholderCompose),Y(K);var f=K.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}n&&!K.hasFocus()&&I(K)});function Y(K){K.state.placeholder&&(K.state.placeholder.parentNode.removeChild(K.state.placeholder),K.state.placeholder=null)}function N(K){Y(K);var n=K.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=K.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var L=K.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),n.appendChild(L),K.display.lineSpace.insertBefore(n,K.display.lineSpace.firstChild)}function z(K){setTimeout(function(){var n=!1,L=K.getInputField();L.nodeName=="TEXTAREA"?n=!L.value:K.lineCount()==1&&(n=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),n?N(K):Y(K)},20)}function I(K){G(K)&&N(K)}function M(K){var n=K.getWrapperElement(),L=G(K);n.className=n.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?N(K):Y(K)}function G(K){return K.lineCount()===1&&K.getLine(0)===""}})},"1eCo":function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){"use strict";var Y={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(z,I){var M=z.indentUnit,G={},K=I.htmlMode?Y:N;for(var n in K)G[n]=K[n];for(var n in I)G[n]=I[n];var L,x;function f(c,C){function E(W){return C.tokenize=W,W(c,C)}var w=c.next();if(w=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?E(o("atom","]]>")):null:c.match("--")?E(o("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),E(p(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),C.tokenize=o("meta","?>"),"meta"):(L=c.eat("/")?"closeTag":"openTag",C.tokenize=b,"tag bracket");if(w=="&"){var B;return c.eat("#")?c.eat("x")?B=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):B=c.eatWhile(/[\d]/)&&c.eat(";"):B=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),B?"atom":"error"}else return c.eatWhile(/[^&<]/),null}f.isInText=!0;function b(c,C){var E=c.next();if(E==">"||E=="/"&&c.eat(">"))return C.tokenize=f,L=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return L="equals",null;if(E=="<"){C.tokenize=f,C.state=i,C.tagName=C.tagStart=null;var w=C.tokenize(c,C);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=h(E),C.stringStartCol=c.column(),C.tokenize(c,C)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(c){var C=function(E,w){for(;!E.eol();)if(E.next()==c){w.tokenize=b;break}return"string"};return C.isInAttribute=!0,C}function o(c,C){return function(E,w){for(;!E.eol();){if(E.match(C)){w.tokenize=f;break}E.next()}return c}}function p(c){return function(C,E){for(var w;(w=C.next())!=null;){if(w=="<")return E.tokenize=p(c+1),E.tokenize(C,E);if(w==">")if(c==1){E.tokenize=f;break}else return E.tokenize=p(c-1),E.tokenize(C,E)}return"meta"}}function l(c,C,E){this.prev=c.context,this.tagName=C,this.indent=c.indented,this.startOfLine=E,(G.doNotIndent.hasOwnProperty(C)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function u(c){c.context&&(c.context=c.context.prev)}function s(c,C){for(var E;;){if(!c.context)return;if(E=c.context.tagName,!G.contextGrabbers.hasOwnProperty(E)||!G.contextGrabbers[E].hasOwnProperty(C))return;u(c)}}function i(c,C,E){return c=="openTag"?(E.tagStart=C.column(),D):c=="closeTag"?A:i}function D(c,C,E){return c=="word"?(E.tagName=C.current(),x="tag",O):G.allowMissingTagName&&c=="endTag"?(x="tag bracket",O(c,C,E)):(x="error",D)}function A(c,C,E){if(c=="word"){var w=C.current();return E.context&&E.context.tagName!=w&&G.implicitlyClosed.hasOwnProperty(E.context.tagName)&&u(E),E.context&&E.context.tagName==w||G.matchClosing===!1?(x="tag",S):(x="tag error",R)}else return G.allowMissingTagName&&c=="endTag"?(x="tag bracket",S(c,C,E)):(x="error",R)}function S(c,C,E){return c!="endTag"?(x="error",S):(u(E),i)}function R(c,C,E){return x="error",S(c,C,E)}function O(c,C,E){if(c=="word")return x="attribute",g;if(c=="endTag"||c=="selfcloseTag"){var w=E.tagName,B=E.tagStart;return E.tagName=E.tagStart=null,c=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(w)?s(E,w):(s(E,w),E.context=new l(E,w,B==E.indented)),i}return x="error",O}function g(c,C,E){return c=="equals"?_:(G.allowMissing||(x="error"),O(c,C,E))}function _(c,C,E){return c=="string"?d:c=="word"&&G.allowUnquoted?(x="string",O):(x="error",O(c,C,E))}function d(c,C,E){return c=="string"?d:O(c,C,E)}return{startState:function(c){var C={tokenize:f,state:i,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(C.baseIndent=c),C},token:function(c,C){if(!C.tagName&&c.sol()&&(C.indented=c.indentation()),c.eatSpace())return null;L=null;var E=C.tokenize(c,C);return(E||L)&&E!="comment"&&(x=null,C.state=C.state(L||E,c,C),x&&(E=x=="error"?E+" error":x)),E},indent:function(c,C,E){var w=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+M;if(w&&w.noIndent)return ie.Pass;if(c.tokenize!=b&&c.tokenize!=f)return E?E.match(/^(\s*)/)[0].length:0;if(c.tagName)return G.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+M*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var B=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(B&&B[1])for(;w;)if(w.tagName==B[2]){w=w.prev;break}else if(G.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(B)for(;w;){var W=G.contextGrabbers[w.tagName];if(W&&W.hasOwnProperty(B[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+M:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(c){c.state==_&&(c.state=O)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var C=[],E=c.context;E;E=E.prev)E.tagName&&C.push(E.tagName);return C.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1vnw":function(it,Ee,U){it.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return Y});class ie{constructor(N){this.element=N,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class Y{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 N=this._first;for(;N!==ie.Undefined;){const z=N.next;N.prev=ie.Undefined,N.next=ie.Undefined,N=z}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,z){const I=new ie(N);if(this._first===ie.Undefined)this._first=I,this._last=I;else if(z){const G=this._last;this._last=I,I.prev=G,G.next=I}else{const G=this._first;this._first=I,I.next=G,G.prev=I}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(I))}}shift(){if(this._first===ie.Undefined)return;{const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last===ie.Undefined)return;{const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==ie.Undefined&&N.next!==ie.Undefined){const z=N.prev;z.next=N.next,N.next.prev=z}else N.prev===ie.Undefined&&N.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):N.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):N.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==ie.Undefined;)yield N.element,N=N.next}}},"3/fG":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return Y});function ie(N,z){let I;return z.length===0?I=N:I=N.replace(/\{(\d+)\}/g,function(M,G){const K=G[0];return typeof z[K]!="undefined"?z[K]:M}),I}function Y(N,z,...I){return ie(z,I)}},"55Ip":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return s});var ie=U("Ty5D"),Y=U("dI71"),N=U("q1tI"),z=U.n(N),I=U("YS25"),M=U("17x9"),G=U.n(M),K=U("wx14"),n=U("zLVn"),L=U("9R94"),x=function(_){Object(Y.a)(d,_);function d(){for(var C,E=arguments.length,w=new Array(E),B=0;B<E;B++)w[B]=arguments[B];return C=_.call.apply(_,[this].concat(w))||this,C.history=Object(I.a)(C.props),C}var c=d.prototype;return c.render=function(){return z.a.createElement(ie.c,{history:this.history,children:this.props.children})},d}(z.a.Component),f=function(_){Object(Y.a)(d,_);function d(){for(var C,E=arguments.length,w=new Array(E),B=0;B<E;B++)w[B]=arguments[B];return C=_.call.apply(_,[this].concat(w))||this,C.history=Object(I.b)(C.props),C}var c=d.prototype;return c.render=function(){return z.a.createElement(ie.c,{history:this.history,children:this.props.children})},d}(z.a.Component),b=function(d,c){return typeof d=="function"?d(c):d},h=function(d,c){return typeof d=="string"?Object(I.c)(d,null,null,c):d},o=function(d){return d},p=z.a.forwardRef;typeof p=="undefined"&&(p=o);function l(_){return!!(_.metaKey||_.altKey||_.ctrlKey||_.shiftKey)}var u=p(function(_,d){var c=_.innerRef,C=_.navigate,E=_.onClick,w=Object(n.a)(_,["innerRef","navigate","onClick"]),B=w.target,W=Object(K.a)({},w,{onClick:function(k){try{E&&E(k)}catch(m){throw k.preventDefault(),m}!k.defaultPrevented&&k.button===0&&(!B||B==="_self")&&!l(k)&&(k.preventDefault(),C())}});return o!==p?W.ref=d||c:W.ref=c,z.a.createElement("a",W)}),s=p(function(_,d){var c=_.component,C=c===void 0?u:c,E=_.replace,w=_.to,B=_.innerRef,W=Object(n.a)(_,["component","replace","to","innerRef"]);return z.a.createElement(ie.e.Consumer,null,function(T){T||Object(L.a)(!1);var k=T.history,m=h(b(w,T.location),T.location),y=m?k.createHref(m):"",H=Object(K.a)({},W,{href:y,navigate:function(){var te=b(w,T.location),ae=E?k.replace:k.push;ae(te)}});return o!==p?H.ref=d||B:H.innerRef=B,z.a.createElement(C,H)})});if(!1)var i,D;var A=function(d){return d},S=z.a.forwardRef;typeof S=="undefined"&&(S=A);function R(){for(var _=arguments.length,d=new Array(_),c=0;c<_;c++)d[c]=arguments[c];return d.filter(function(C){return C}).join(" ")}var O=S(function(_,d){var c=_["aria-current"],C=c===void 0?"page":c,E=_.activeClassName,w=E===void 0?"active":E,B=_.activeStyle,W=_.className,T=_.exact,k=_.isActive,m=_.location,y=_.sensitive,H=_.strict,Q=_.style,te=_.to,ae=_.innerRef,Te=Object(n.a)(_,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return z.a.createElement(ie.e.Consumer,null,function(_e){_e||Object(L.a)(!1);var ge=m||_e.location,ve=h(b(te,ge),ge),Oe=ve.pathname,he=Oe&&Oe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),V=he?Object(ie.f)(ge.pathname,{path:he,exact:T,sensitive:y,strict:H}):null,P=!!(k?k(V,ge):V),j=P?R(W,w):W,$=P?Object(K.a)({},Q,{},B):Q,J=Object(K.a)({"aria-current":P&&C||null,className:j,style:$,to:ve},Te);return A!==S?J.ref=d||ae:J.innerRef=ae,z.a.createElement(s,J)})});if(!1)var g},"5VLF":function(it,Ee,U){"use strict";var ie,Y;function N(z,I,M){var G=function(K,n){return z.js_beautify(K,n)};return G.js=z.js_beautify,G.css=I.css_beautify,G.html=M.html_beautify,G.js_beautify=z.js_beautify,G.css_beautify=I.css_beautify,G.html_beautify=M.html_beautify,G}!(ie=[U("6UM0"),U("TXwP"),U("psGv")],Y=function(z,I,M){return N(z,I,M)}.apply(Ee,ie),Y!==void 0&&(it.exports=Y))},"5Y4S":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return N});var ie=U("MNsG");const Y=ie.b.performance&&typeof ie.b.performance.now=="function";class N{constructor(z){this._highResolution=Y&&z,this._startTime=this._now(),this._stopTime=-1}static create(z=!0){return new N(z)}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(it,Ee,U){"use strict";U.d(Ee,"a",function(){return S});var ie=U("wx14"),Y=U("rePB"),N=U("VTBJ"),z=U("1OyB"),I=U("vuIU"),M=U("Ji7U"),G=U("LK+K"),K=U("q1tI"),n=U.n(K),L=U("TSYQ"),x=U.n(L),f=function(O){var g,_="".concat(O.rootPrefixCls,"-item"),d=x()(_,"".concat(_,"-").concat(O.page),(g={},Object(Y.a)(g,"".concat(_,"-active"),O.active),Object(Y.a)(g,O.className,!!O.className),Object(Y.a)(g,"".concat(_,"-disabled"),!O.page),g)),c=function(){O.onClick(O.page)},C=function(w){O.onKeyPress(w,O.onClick,O.page)};return n.a.createElement("li",{title:O.showTitle?O.page:null,className:d,onClick:c,onKeyPress:C,tabIndex:"0"},O.itemRender(O.page,"page",n.a.createElement("a",{rel:"nofollow"},O.page)))},b=f,h={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(R){Object(M.a)(g,R);var O=Object(G.a)(g);function g(){var _;Object(z.a)(this,g);for(var d=arguments.length,c=new Array(d),C=0;C<d;C++)c[C]=arguments[C];return _=O.call.apply(O,[this].concat(c)),_.state={goInputText:""},_.buildOptionText=function(E){return"".concat(E," ").concat(_.props.locale.items_per_page)},_.changeSize=function(E){_.props.changeSize(Number(E))},_.handleChange=function(E){_.setState({goInputText:E.target.value})},_.handleBlur=function(E){var w=_.props,B=w.goButton,W=w.quickGo,T=w.rootPrefixCls,k=_.state.goInputText;if(B||k==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(T,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(T,"-next"))>=0))return;_.setState({goInputText:""}),W(_.getValidValue())},_.go=function(E){var w=_.state.goInputText;if(w==="")return;(E.keyCode===h.ENTER||E.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(I.a)(g,[{key:"getValidValue",value:function(){var d=this.state,c=d.goInputText,C=d.current;return!c||isNaN(c)?C:Number(c)}},{key:"getPageSizeOptions",value:function(){var d=this.props,c=d.pageSize,C=d.pageSizeOptions;return C.some(function(E){return E.toString()===c.toString()})?C:C.concat([c.toString()]).sort(function(E,w){var B=isNaN(Number(E))?0:Number(E),W=isNaN(Number(w))?0:Number(w);return B-W})}},{key:"render",value:function(){var d=this,c=this.props,C=c.pageSize,E=c.locale,w=c.rootPrefixCls,B=c.changeSize,W=c.quickGo,T=c.goButton,k=c.selectComponentClass,m=c.buildOptionText,y=c.selectPrefixCls,H=c.disabled,Q=this.state.goInputText,te="".concat(w,"-options"),ae=k,Te=null,_e=null,ge=null;if(!B&&!W)return null;var ve=this.getPageSizeOptions();if(B&&ae){var Oe=ve.map(function(he,V){return n.a.createElement(ae.Option,{key:V,value:he.toString()},(m||d.buildOptionText)(he))});Te=n.a.createElement(ae,{disabled:H,prefixCls:y,showSearch:!1,className:"".concat(te,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||ve[0]).toString(),onChange:this.changeSize,getPopupContainer:function(V){return V.parentNode}},Oe)}return W&&(T&&(ge=typeof T=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(te,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},T)),_e=n.a.createElement("div",{className:"".concat(te,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:H,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,ge)),n.a.createElement("li",{className:"".concat(te)},Te,_e)}}]),g}(n.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var p=o,l=U("N2Kk");function u(){}function s(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function i(R,O,g){return g}function D(R,O,g){var _=typeof R=="undefined"?O.pageSize:R;return Math.floor((g.total-1)/_)+1}var A=function(R){Object(M.a)(g,R);var O=Object(G.a)(g);function g(_){var d;Object(z.a)(this,g),d=O.call(this,_),d.getJumpPrevPage=function(){return Math.max(1,d.state.current-(d.props.showLessItems?3:5))},d.getJumpNextPage=function(){return Math.min(D(void 0,d.state,d.props),d.state.current+(d.props.showLessItems?3:5))},d.getItemIcon=function(B,W){var T=d.props.prefixCls,k=B||n.a.createElement("button",{type:"button","aria-label":W,className:"".concat(T,"-item-link")});return typeof B=="function"&&(k=n.a.createElement(B,Object(N.a)({},d.props))),k},d.savePaginationNode=function(B){d.paginationNode=B},d.isValid=function(B){return s(B)&&B!==d.state.current},d.shouldDisplayQuickJumper=function(){var B=d.props,W=B.showQuickJumper,T=B.pageSize,k=B.total;return k<=T?!1:W},d.handleKeyDown=function(B){(B.keyCode===h.ARROW_UP||B.keyCode===h.ARROW_DOWN)&&B.preventDefault()},d.handleKeyUp=function(B){var W=d.getValidValue(B),T=d.state.currentInputValue;W!==T&&d.setState({currentInputValue:W}),B.keyCode===h.ENTER?d.handleChange(W):B.keyCode===h.ARROW_UP?d.handleChange(W-1):B.keyCode===h.ARROW_DOWN&&d.handleChange(W+1)},d.changePageSize=function(B){var W=d.state.current,T=D(B,d.state,d.props);W=W>T?T:W,T===0&&(W=d.state.current),typeof B=="number"&&("pageSize"in d.props||d.setState({pageSize:B}),"current"in d.props||d.setState({current:W,currentInputValue:W})),d.props.onShowSizeChange(W,B),"onChange"in d.props&&d.props.onChange&&d.props.onChange(W,B)},d.handleChange=function(B){var W=d.props.disabled,T=B;if(d.isValid(T)&&!W){var k=D(void 0,d.state,d.props);T>k?T=k:T<1&&(T=1),"current"in d.props||d.setState({current:T,currentInputValue:T});var m=d.state.pageSize;return d.props.onChange(T,m),T}return d.state.current},d.prev=function(){d.hasPrev()&&d.handleChange(d.state.current-1)},d.next=function(){d.hasNext()&&d.handleChange(d.state.current+1)},d.jumpPrev=function(){d.handleChange(d.getJumpPrevPage())},d.jumpNext=function(){d.handleChange(d.getJumpNextPage())},d.hasPrev=function(){return d.state.current>1},d.hasNext=function(){return d.state.current<D(void 0,d.state,d.props)},d.runIfEnter=function(B,W){if(B.key==="Enter"||B.charCode===13){for(var T=arguments.length,k=new Array(T>2?T-2:0),m=2;m<T;m++)k[m-2]=arguments[m];W.apply(void 0,k)}},d.runIfEnterPrev=function(B){d.runIfEnter(B,d.prev)},d.runIfEnterNext=function(B){d.runIfEnter(B,d.next)},d.runIfEnterJumpPrev=function(B){d.runIfEnter(B,d.jumpPrev)},d.runIfEnterJumpNext=function(B){d.runIfEnter(B,d.jumpNext)},d.handleGoTO=function(B){(B.keyCode===h.ENTER||B.type==="click")&&d.handleChange(d.state.currentInputValue)};var c=_.onChange!==u,C="current"in _;C&&!c&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var E=_.defaultCurrent;"current"in _&&(E=_.current);var w=_.defaultPageSize;return"pageSize"in _&&(w=_.pageSize),E=Math.min(E,D(w,void 0,_)),d.state={current:E,currentInputValue:E,pageSize:w},d}return Object(I.a)(g,[{key:"componentDidUpdate",value:function(d,c){var C=this.props.prefixCls;if(c.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(C,"-item-").concat(c.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(d){var c=d.target.value,C=D(void 0,this.state,this.props),E=this.state.currentInputValue,w;return c===""?w=c:isNaN(Number(c))?w=E:c>=C?w=C:w=Number(c),w}},{key:"getShowSizeChanger",value:function(){var d=this.props,c=d.showSizeChanger,C=d.total,E=d.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:C>E}},{key:"renderPrev",value:function(d){var c=this.props,C=c.prevIcon,E=c.itemRender,w=E(d,"prev",this.getItemIcon(C,"prev page")),B=!this.hasPrev();return Object(K.isValidElement)(w)?Object(K.cloneElement)(w,{disabled:B}):w}},{key:"renderNext",value:function(d){var c=this.props,C=c.nextIcon,E=c.itemRender,w=E(d,"next",this.getItemIcon(C,"next page")),B=!this.hasNext();return Object(K.isValidElement)(w)?Object(K.cloneElement)(w,{disabled:B}):w}},{key:"render",value:function(){var d=this,c=this.props,C=c.prefixCls,E=c.className,w=c.style,B=c.disabled,W=c.hideOnSinglePage,T=c.total,k=c.locale,m=c.showQuickJumper,y=c.showLessItems,H=c.showTitle,Q=c.showTotal,te=c.simple,ae=c.itemRender,Te=c.showPrevNextJumpers,_e=c.jumpPrevIcon,ge=c.jumpNextIcon,ve=c.selectComponentClass,Oe=c.selectPrefixCls,he=c.pageSizeOptions,V=this.state,P=V.current,j=V.pageSize,$=V.currentInputValue;if(W===!0&&T<=j)return null;var J=D(void 0,this.state,this.props),X=[],ye=null,Re=null,Ke=null,pe=null,we=null,ke=m&&m.goButton,Ue=y?1:2,Qe=P-1>0?P-1:0,nt=P+1<J?P+1:J,ot=Object.keys(this.props).reduce(function(oe,ce){return(ce.substr(0,5)==="data-"||ce.substr(0,5)==="aria-"||ce==="role")&&(oe[ce]=d.props[ce]),oe},{});if(te)return ke&&(typeof ke=="boolean"?we=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},k.jump_to_confirm):we=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ke),we=n.a.createElement("li",{title:H?"".concat(k.jump_to).concat(P,"/").concat(J):null,className:"".concat(C,"-simple-pager")},we)),n.a.createElement("ul",Object(ie.a)({className:x()(C,"".concat(C,"-simple"),Object(Y.a)({},"".concat(C,"-disabled"),B),E),style:w,ref:this.savePaginationNode},ot),n.a.createElement("li",{title:H?k.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:x()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Qe)),n.a.createElement("li",{title:H?"".concat(P,"/").concat(J):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:$,disabled:B,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),J),n.a.createElement("li",{title:H?k.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:x()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(nt)),we);if(J<=3+Ue*2){var qe={locale:k,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:ae};J||X.push(n.a.createElement(b,Object(ie.a)({},qe,{key:"noPager",page:J,className:"".concat(C,"-disabled")})));for(var ft=1;ft<=J;ft+=1){var lt=P===ft;X.push(n.a.createElement(b,Object(ie.a)({},qe,{key:ft,page:ft,active:lt})))}}else{var pt=y?k.prev_3:k.prev_5,Ye=y?k.next_3:k.next_5;Te&&(ye=n.a.createElement("li",{title:H?pt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:x()("".concat(C,"-jump-prev"),Object(Y.a)({},"".concat(C,"-jump-prev-custom-icon"),!!_e))},ae(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(_e,"prev page"))),Re=n.a.createElement("li",{title:H?Ye:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:x()("".concat(C,"-jump-next"),Object(Y.a)({},"".concat(C,"-jump-next-custom-icon"),!!ge))},ae(this.getJumpNextPage(),"jump-next",this.getItemIcon(ge,"next page")))),pe=n.a.createElement(b,{locale:k,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:J,page:J,active:!1,showTitle:H,itemRender:ae}),Ke=n.a.createElement(b,{locale:k,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:ae});var Tt=Math.max(1,P-Ue),bt=Math.min(P+Ue,J);P-1<=Ue&&(bt=1+Ue*2),J-P<=Ue&&(Tt=J-Ue*2);for(var me=Tt;me<=bt;me+=1){var ne=P===me;X.push(n.a.createElement(b,{locale:k,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:me,page:me,active:ne,showTitle:H,itemRender:ae}))}P-1>=Ue*2&&P!==1+2&&(X[0]=Object(K.cloneElement)(X[0],{className:"".concat(C,"-item-after-jump-prev")}),X.unshift(ye)),J-P>=Ue*2&&P!==J-2&&(X[X.length-1]=Object(K.cloneElement)(X[X.length-1],{className:"".concat(C,"-item-before-jump-next")}),X.push(Re)),Tt!==1&&X.unshift(Ke),bt!==J&&X.push(pe)}var q=null;Q&&(q=n.a.createElement("li",{className:"".concat(C,"-total-text")},Q(T,[T===0?0:(P-1)*j+1,P*j>T?T:P*j])));var se=!this.hasPrev()||!J,ue=!this.hasNext()||!J;return n.a.createElement("ul",Object(ie.a)({className:x()(C,E,Object(Y.a)({},"".concat(C,"-disabled"),B)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},ot),q,n.a.createElement("li",{title:H?k.prev_page:null,onClick:this.prev,tabIndex:se?null:0,onKeyPress:this.runIfEnterPrev,className:x()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),se)),"aria-disabled":se},this.renderPrev(Qe)),X,n.a.createElement("li",{title:H?k.next_page:null,onClick:this.next,tabIndex:ue?null:0,onKeyPress:this.runIfEnterNext,className:x()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),ue)),"aria-disabled":ue},this.renderNext(nt)),n.a.createElement(p,{disabled:B,locale:k,rootPrefixCls:C,selectComponentClass:ve,selectPrefixCls:Oe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:P,pageSize:j,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ke}))}}],[{key:"getDerivedStateFromProps",value:function(d,c){var C={};if("current"in d&&(C.current=d.current,d.current!==c.current&&(C.currentInputValue=C.current)),"pageSize"in d&&d.pageSize!==c.pageSize){var E=c.current,w=D(d.pageSize,c,d);E=E>w?w:E,"current"in d||(C.current=E,C.currentInputValue=E),C.pageSize=d.pageSize}return C}}]),g}(n.a.Component);A.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:u,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:u,locale:l.a,style:{},itemRender:i,totalBoundaryShowSizeChanger:50};var S=A},"6UM0":function(it,Ee,U){var ie,Y;(function(){var N;(function(){"use strict";var I=[function(n,L,x){var f=x(1).Beautifier,b=x(5).Options;function h(o,p){var l=new f(o,p);return l.beautify()}n.exports=h,n.exports.defaultOptions=function(){return new b}},function(n,L,x){var f=x(2).Output,b=x(3).Token,h=x(4),o=x(5).Options,p=x(7).Tokenizer,l=x(7).line_starters,u=x(7).positionable_operators,s=x(7).TOKEN;function i(y,H){return H.indexOf(y)!==-1}function D(y){return y.replace(/^\s+/g,"")}function A(y){for(var H={},Q=0;Q<y.length;Q++)H[y[Q].replace(/-/g,"_")]=y[Q];return H}function S(y,H){return y&&y.type===s.RESERVED&&y.text===H}function R(y,H){return y&&y.type===s.RESERVED&&i(y.text,H)}var O=["case","return","do","if","throw","else","await","break","continue","async"],g=["before-newline","after-newline","preserve-newline"],_=A(g),d=[_.before_newline,_.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(y,H){if(H.multiline_frame||H.mode===c.ForInitializer||H.mode===c.Conditional)return;y.remove_indent(H.start_line_index)}function E(y){y=y.replace(h.allLineBreaks,`
`);for(var H=[],Q=y.indexOf(`
`);Q!==-1;)H.push(y.substring(0,Q)),y=y.substring(Q+1),Q=y.indexOf(`
`);return y.length&&H.push(y),H}function w(y){return y===c.ArrayLiteral}function B(y){return i(y,[c.Expression,c.ForInitializer,c.Conditional])}function W(y,H){for(var Q=0;Q<y.length;Q++){var te=y[Q].trim();if(te.charAt(0)!==H)return!1}return!0}function T(y,H){for(var Q=0,te=y.length,ae;Q<te;Q++)if(ae=y[Q],ae&&ae.indexOf(H)!==0)return!1;return!0}function k(y,H){H=H||{},this._source_text=y||"",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 o(H)}k.prototype.create_flags=function(y,H){var Q=0;y&&(Q=y.indentation_level,!this._output.just_added_newline()&&y.line_indent_level>Q&&(Q=y.line_indent_level));var te={mode:H,parent:y,last_token:y?y.last_token:new b(s.START_BLOCK,""),last_word:y?y.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Q,alignment:0,line_indent_level:y?y.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return te},k.prototype._reset=function(y){var H=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var Q=new p(y,this._options);return this._tokens=Q.tokenize(),y},k.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,H=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=`
`,H&&h.lineBreak.test(H||"")&&(Q=H.match(h.lineBreak)[0]));for(var te=this._tokens.next();te;)this.handle_token(te),this._last_last_text=this._flags.last_token.text,this._flags.last_token=te,te=this._tokens.next();return y=this._output.get_code(Q),y},k.prototype.handle_token=function(y,H){y.type===s.START_EXPR?this.handle_start_expr(y):y.type===s.END_EXPR?this.handle_end_expr(y):y.type===s.START_BLOCK?this.handle_start_block(y):y.type===s.END_BLOCK?this.handle_end_block(y):y.type===s.WORD?this.handle_word(y):y.type===s.RESERVED?this.handle_word(y):y.type===s.SEMICOLON?this.handle_semicolon(y):y.type===s.STRING?this.handle_string(y):y.type===s.EQUALS?this.handle_equals(y):y.type===s.OPERATOR?this.handle_operator(y):y.type===s.COMMA?this.handle_comma(y):y.type===s.BLOCK_COMMENT?this.handle_block_comment(y,H):y.type===s.COMMENT?this.handle_comment(y,H):y.type===s.DOT?this.handle_dot(y):y.type===s.EOF?this.handle_eof(y):y.type===s.UNKNOWN?this.handle_unknown(y,H):this.handle_unknown(y,H)},k.prototype.handle_whitespace_and_comments=function(y,H){var Q=y.newlines,te=this._options.keep_array_indentation&&w(this._flags.mode);if(y.comments_before)for(var ae=y.comments_before.next();ae;)this.handle_whitespace_and_comments(ae,H),this.handle_token(ae,H),ae=y.comments_before.next();if(te)for(var Te=0;Te<Q;Te+=1)this.print_newline(Te>0,H);else if(this._options.max_preserve_newlines&&Q>this._options.max_preserve_newlines&&(Q=this._options.max_preserve_newlines),this._options.preserve_newlines&&Q>1){this.print_newline(!1,H);for(var _e=1;_e<Q;_e+=1)this.print_newline(!0,H)}};var m=["async","break","continue","return","throw","yield"];k.prototype.allow_wrap_or_preserved_newline=function(y,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var Q=this._options.preserve_newlines&&y.newlines||H,te=i(this._flags.last_token.text,u)||i(y.text,u);if(te){var ae=i(this._flags.last_token.text,u)&&i(this._options.operator_position,d)||i(y.text,u);Q=Q&&ae}if(Q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,m))return;this._output.set_wrap_point()}},k.prototype.print_newline=function(y,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Q=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&S(Q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(y)&&(this._flags.multiline_frame=!0)},k.prototype.print_token_line_indentation=function(y){this._output.just_added_newline()&&(this._options.keep_array_indentation&&y.newlines&&(y.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(y.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))},k.prototype.print_token=function(y){if(this._output.raw){this._output.add_raw_token(y);return}if(this._options.comma_first&&y.previous&&y.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(y),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(y),this._output.non_breaking_space=!0,this._output.add_token(y.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},k.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},k.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))},k.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},k.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},k.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},k.prototype.start_of_statement=function(y){var H=!1;return H=H||R(this._flags.last_token,["var","let","const"])&&y.type===s.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&R(this._flags.last_token,m)&&!y.newlines,H=H||S(this._flags.last_token,"else")&&!(S(y,"if")&&!y.comments_before),H=H||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),H=H||this._flags.last_token.type===s.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==s.WORD&&y.type!==s.RESERVED,H=H||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),H?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,R(y,["do","for","if","while"])),!0):!1},k.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var H=c.Expression;if(y.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=c.ArrayLiteral,w(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),i(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=c.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=c.Conditional):i(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(i(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var te=this._tokens.peek(-4);R(Q,["async","function"])||Q.text==="*"&&R(te,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(te.text==="{"||te.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(y);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&i(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},k.prototype.handle_end_expr=function(y){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.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(y),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},k.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var H=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):Q&&(i(Q.text,[":",","])&&i(H.type,[s.STRING,s.WORD,s.RESERVED])||i(H.text,["get","set","..."])&&i(Q.type,[s.WORD,s.RESERVED]))?i(this._last_last_text,["class","interface"])&&!i(Q.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):i(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var te=!H.comments_before&&H.text==="}",ae=te&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Te=0,_e=null;this._flags.inline_frame=!0;do if(Te+=1,_e=this._tokens.peek(Te-1),_e.newlines){this._flags.inline_frame=!1;break}while(_e.type!==s.EOF&&!(_e.type===s.END_BLOCK&&_e.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ae||this._flags.last_token.type===s.EQUALS||R(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!te&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},k.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===c.Statement;)this.restore_mode();var H=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(w(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(y)},k.prototype.handle_word=function(y){if(y.type===s.RESERVED){if(i(y.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)y.type=s.WORD;else if(y.text==="import"&&i(this._tokens.peek().text,["(","."]))y.type=s.WORD;else if(i(y.text,["as","from"])&&!this._flags.import_block)y.type=s.WORD;else if(this._flags.mode===c.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(y.type=s.WORD)}}if(this.start_of_statement(y)?R(this._flags.last_token,["var","let","const"])&&y.type===s.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!B(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(S(y,"while")){this._output.space_before_token=!0,this.print_token(y),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&&S(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(y,["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(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y)),S(y,"function")){(i(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(i(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,m)?this._output.space_before_token=!0:S(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===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(B(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var Q="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":R(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===c.BlockStatement?Q="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&B(this._flags.mode)?Q="SPACE":this._flags.last_token.type===s.STRING?Q="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&i(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),R(y,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Q="SPACE":Q="NEWLINE"),R(y,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var te=this._output.current_line;te.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!R(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(y,"if")&&S(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(y,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===s.WORD||y.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===s.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(y,"from")&&(this._flags.import_block=!1))},k.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var H=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&S(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},k.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},k.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},k.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(B(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(y)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},k.prototype.handle_operator=function(y){var H=y.text==="*"&&(R(this._flags.last_token,["function","yield"])||i(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),Q=i(y.text,["-","+"])&&(i(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||i(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var te=!H;this.handle_whitespace_and_comments(y,te)}if(y.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===s.OPERATOR&&i(this._options.operator_position,d)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.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 ae=!0,Te=!0,_e=!1;if(y.text===":"?this._flags.ternary_depth===0?ae=!1:(this._flags.ternary_depth-=1,_e=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!H&&this._options.preserve_newlines&&i(y.text,u)){var ge=y.text===":",ve=ge&&_e,Oe=ge&&!_e;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!Oe,this.print_token(y),(!ge||ve)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!ge||ve?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case _.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(y),ae=!(this._output.just_added_newline()||Oe),this._output.space_before_token=ae,this.print_token(y),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(y),ae=!1;var he=this._tokens.peek();Te=he&&i(he.type,[s.WORD,s.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),ae=this._flags.last_token.type===s.START_BLOCK,Te=!1;else if(i(y.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),ae=!1,Te=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var V=R(this._flags.last_token,O)&&y.newlines;V&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(V,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(ae=!0),this._flags.last_token.type===s.RESERVED?ae=!0:this._flags.last_token.type===s.END_EXPR?ae=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ae=i(y.text,["--","-","++","+"])&&i(this._flags.last_token.text,["--","-","++","+"]),i(y.text,["+","-"])&&i(this._flags.last_token.text,["--","++"])&&(Te=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ae,this.print_token(y),this._output.space_before_token=Te},k.prototype.handle_block_comment=function(y,H){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,H),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,H)},k.prototype.print_block_commment=function(y,H){var Q=E(y.text),te,ae=!1,Te=!1,_e=y.whitespace_before,ge=_e.length;if(this.print_newline(!1,H),this.print_token_line_indentation(y),this._output.add_token(Q[0]),this.print_newline(!1,H),Q.length>1){for(Q=Q.slice(1),ae=W(Q,"*"),Te=T(Q,_e),ae&&(this._flags.alignment=1),te=0;te<Q.length;te++)ae?(this.print_token_line_indentation(y),this._output.add_token(D(Q[te]))):Te&&Q[te]?(this.print_token_line_indentation(y),this._output.add_token(Q[te].substring(ge))):(this._output.current_line.set_indent(-1),this._output.add_token(Q[te])),this.print_newline(!1,H);this._flags.alignment=0}},k.prototype.handle_comment=function(y,H){y.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(y),this.print_newline(!1,H)},k.prototype.handle_dot=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(y,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(y)},k.prototype.handle_unknown=function(y,H){this.print_token(y),y.text[y.text.length-1]===`
`&&this.print_newline(!1,H)},k.prototype.handle_eof=function(y){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y)},n.exports.Beautifier=k},function(n){function L(b){this.__parent=b,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=[]}L.prototype.clone_empty=function(){var b=new L(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},L.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},L.prototype.has_match=function(b){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(b))return!0;return!1},L.prototype.set_indent=function(b,h){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(b){this.__items.push(b);var h=b.lastIndexOf(`
`);h!==-1?this.__character_count=b.length-h:this.__character_count+=b.length},L.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function x(b,h){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),h=h||"",b.indent_level>0&&(h=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}x.prototype.get_indent_size=function(b,h){var o=this.__base_string_length;return h=h||0,b<0&&(o=0),o+=b*this.__indent_size,o+=h,o},x.prototype.get_indent_string=function(b,h){var o=this.__base_string;return h=h||0,b<0&&(b=0,o=""),h+=b*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},x.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var b=this.__cache.length,h=0,o="";this.__indent_size&&b>=this.__indent_size&&(h=Math.floor(b/this.__indent_size),b-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),b&&(o+=new Array(b+1).join(" ")),this.__cache.push(o)};function f(b,h){this.__indent_cache=new x(b,h),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(b,h){return this.__indent_cache.get_indent_string(b,h)},f.prototype.get_indent_size=function(b,h){return this.__indent_cache.get_indent_size(b,h)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(b){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return b!==`
`&&(o=o.replace(/[\n]/g,b)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(b,h){return b=b||0,h=h||0,this.next_line.set_indent(b,h),this.__lines.length>1?(this.current_line.set_indent(b,h),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(b){for(var h=0;h<b.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(b){for(var h=this.__lines.length;b<h;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(b,h){for(var o=this.__lines.length-2;o>=0;){var p=this.__lines[o];if(p.is_empty())break;if(p.item(0).indexOf(b)!==0&&p.item(-1)!==h){this.__lines.splice(o+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=f},function(n){function L(x,f,b,h){this.type=x,this.text=f,this.comments_before=null,this.newlines=b||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=L},function(n,L){var x="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",b="\\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",h="\\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",o="(?:\\\\u[0-9a-fA-F]{4}|["+x+b+"])",p="(?:\\\\u[0-9a-fA-F]{4}|["+f+b+h+"])*";L.identifier=new RegExp(o+p,"g"),L.identifierStart=new RegExp(o),L.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+b+h+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;L.newline=/[\n\r\u2028\u2029]/,L.lineBreak=new RegExp(`\r
|`+L.newline.source),L.allLineBreaks=new RegExp(L.lineBreak.source,"g")},function(n,L,x){var f=x(6).Options,b=["before-newline","after-newline","preserve-newline"];function h(o){f.call(this,o,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="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 l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<l.length;u++)l[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[u];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",b),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}h.prototype=new f,n.exports.Options=h},function(n){function L(b,h){this.raw_options=x(b,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(b,h){var o=this.raw_options[b],p=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(p=o.concat()):typeof o=="string"&&(p=o.split(/[^a-zA-Z0-9_\/\-]+/)),p},L.prototype._get_boolean=function(b,h){var o=this.raw_options[b],p=o===void 0?!!h:!!o;return p},L.prototype._get_characters=function(b,h){var o=this.raw_options[b],p=h||"";return typeof o=="string"&&(p=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},L.prototype._get_number=function(b,h){var o=this.raw_options[b];h=parseInt(h,10),isNaN(h)&&(h=0);var p=parseInt(o,10);return isNaN(p)&&(p=h),p},L.prototype._get_selection=function(b,h,o){var p=this._get_selection_list(b,h,o);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[b]+"'");return p[0]},L.prototype._get_selection_list=function(b,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var p=this._get_array(b,o);if(!this._is_valid_selection(p,h))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[b]+"'");return p},L.prototype._is_valid_selection=function(b,h){return b.length&&h.length&&!b.some(function(o){return h.indexOf(o)===-1})};function x(b,h){var o={};b=f(b);var p;for(p in b)p!==h&&(o[p]=b[p]);if(h&&b[h])for(p in b[h])o[p]=b[h][p];return o}function f(b){var h={},o;for(o in b){var p=o.replace(/-/g,"_");h[p]=b[o]}return h}n.exports.Options=L,n.exports.normalizeOpts=f,n.exports.mergeOpts=x},function(n,L,x){var f=x(8).InputScanner,b=x(9).Tokenizer,h=x(9).TOKEN,o=x(13).Directives,p=x(4),l=x(12).Pattern,u=x(14).TemplatablePattern;function s(W,T){return T.indexOf(W)!==-1}var i={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:h.START,RAW:h.RAW,EOF:h.EOF},D=new o(/\/\*/,/\*\//),A=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,R=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),g="\\?\\.(?!\\d) "+g,g=g.replace(/ /g,"|");var _=new RegExp(g),d="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=d.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+c.join("|")+")$"),E,w=function(W,T){b.call(this,W,T),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var k=new l(this._input),m=new u(this._input).read_options(this._options);this.__patterns={template:m,identifier:m.starting_with(p.identifier).matching(p.identifierMatch),number:k.matching(A),punct:k.matching(_),comment:k.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:k.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:k.matching(/<!--/),html_comment_end:k.matching(/-->/),include:k.starting_with(/#include/).until_after(p.lineBreak),shebang:k.starting_with(/#!/).until_after(p.lineBreak),xml:k.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:m.until(/['\\\n\r\u2028\u2029]/),double_quote:m.until(/["\\\n\r\u2028\u2029]/),template_text:m.until(/[`\\$]/),template_expression:m.until(/[`}\\]/)}};w.prototype=new b,w.prototype._is_comment=function(W){return W.type===i.COMMENT||W.type===i.BLOCK_COMMENT||W.type===i.UNKNOWN},w.prototype._is_opening=function(W){return W.type===i.START_BLOCK||W.type===i.START_EXPR},w.prototype._is_closing=function(W,T){return(W.type===i.END_BLOCK||W.type===i.END_EXPR)&&T&&(W.text==="]"&&T.text==="["||W.text===")"&&T.text==="("||W.text==="}"&&T.text==="{")},w.prototype._reset=function(){E=!1},w.prototype._get_next_token=function(W,T){var k=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(i.EOF,""):(k=k||this._read_non_javascript(m),k=k||this._read_string(m),k=k||this._read_word(W),k=k||this._read_singles(m),k=k||this._read_comment(m),k=k||this._read_regexp(m,W),k=k||this._read_xml(m,W),k=k||this._read_punctuation(),k=k||this._create_token(i.UNKNOWN,this._input.next()),k)},w.prototype._read_word=function(W){var T;if(T=this.__patterns.identifier.read(),T!=="")return T=T.replace(p.allLineBreaks,`
`),!(W.type===i.DOT||W.type===i.RESERVED&&(W.text==="set"||W.text==="get"))&&C.test(T)?(T==="in"||T==="of")&&(W.type===i.WORD||W.type===i.STRING)?this._create_token(i.OPERATOR,T):this._create_token(i.RESERVED,T):this._create_token(i.WORD,T);if(T=this.__patterns.number.read(),T!=="")return this._create_token(i.WORD,T)},w.prototype._read_singles=function(W){var T=null;return W==="("||W==="["?T=this._create_token(i.START_EXPR,W):W===")"||W==="]"?T=this._create_token(i.END_EXPR,W):W==="{"?T=this._create_token(i.START_BLOCK,W):W==="}"?T=this._create_token(i.END_BLOCK,W):W===";"?T=this._create_token(i.SEMICOLON,W):W==="."&&R.test(this._input.peek(1))?T=this._create_token(i.DOT,W):W===","&&(T=this._create_token(i.COMMA,W)),T&&this._input.next(),T},w.prototype._read_punctuation=function(){var W=this.__patterns.punct.read();if(W!=="")return W==="="?this._create_token(i.EQUALS,W):W==="?."?this._create_token(i.DOT,W):this._create_token(i.OPERATOR,W)},w.prototype._read_non_javascript=function(W){var T="";if(W==="#"){if(this._is_first_token()&&(T=this.__patterns.shebang.read(),T))return this._create_token(i.UNKNOWN,T.trim()+`
`);if(T=this.__patterns.include.read(),T)return this._create_token(i.UNKNOWN,T.trim()+`
`);W=this._input.next();var k="#";if(this._input.hasNext()&&this._input.testChar(S)){do W=this._input.next(),k+=W;while(this._input.hasNext()&&W!=="#"&&W!=="=");return W==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(k+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(k+="{}",this._input.next(),this._input.next())),this._create_token(i.WORD,k)}this._input.back()}else if(W==="<"&&this._is_first_token()){if(T=this.__patterns.html_comment_start.read(),T){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)T+=this._input.next();return E=!0,this._create_token(i.COMMENT,T)}}else if(E&&W==="-"&&(T=this.__patterns.html_comment_end.read(),T))return E=!1,this._create_token(i.COMMENT,T);return null},w.prototype._read_comment=function(W){var T=null;if(W==="/"){var k="";if(this._input.peek(1)==="*"){k=this.__patterns.block_comment.read();var m=D.get_directives(k);m&&m.ignore==="start"&&(k+=D.readIgnored(this._input)),k=k.replace(p.allLineBreaks,`
`),T=this._create_token(i.BLOCK_COMMENT,k),T.directives=m}else this._input.peek(1)==="/"&&(k=this.__patterns.comment.read(),T=this._create_token(i.COMMENT,k))}return T},w.prototype._read_string=function(W){if(W==="`"||W==="'"||W==='"'){var T=this._input.next();return this.has_char_escapes=!1,W==="`"?T+=this._read_string_recursive("`",!0,"${"):T+=this._read_string_recursive(W),this.has_char_escapes&&this._options.unescape_strings&&(T=B(T)),this._input.peek()===W&&(T+=this._input.next()),T=T.replace(p.allLineBreaks,`
`),this._create_token(i.STRING,T)}return null},w.prototype._allow_regexp_or_xml=function(W){return W.type===i.RESERVED&&s(W.text,["return","case","throw","else","do","typeof","yield"])||W.type===i.END_EXPR&&W.text===")"&&W.opened.previous.type===i.RESERVED&&s(W.opened.previous.text,["if","while","for"])||s(W.type,[i.COMMENT,i.START_EXPR,i.START_BLOCK,i.START,i.END_BLOCK,i.OPERATOR,i.EQUALS,i.EOF,i.SEMICOLON,i.COMMA])},w.prototype._read_regexp=function(W,T){if(W==="/"&&this._allow_regexp_or_xml(T)){for(var k=this._input.next(),m=!1,y=!1;this._input.hasNext()&&(m||y||this._input.peek()!==W)&&!this._input.testChar(p.newline);)k+=this._input.peek(),m?m=!1:(m=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===W&&(k+=this._input.next(),k+=this._input.read(p.identifier)),this._create_token(i.STRING,k)}return null},w.prototype._read_xml=function(W,T){if(this._options.e4x&&W==="<"&&this._allow_regexp_or_xml(T)){var k="",m=this.__patterns.xml.read_match();if(m){for(var y=m[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=y.indexOf("{")===0,Q=0;m;){var te=!!m[1],ae=m[2],Te=!!m[m.length-1]||ae.slice(0,8)==="![CDATA[";if(!Te&&(ae===y||H&&ae.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(te?--Q:++Q),k+=m[0],Q<=0)break;m=this.__patterns.xml.read_match()}return m||(k+=this._input.match(/[\s\S]*/g)[0]),k=k.replace(p.allLineBreaks,`
`),this._create_token(i.STRING,k)}}return null};function B(W){for(var T="",k=0,m=new f(W),y=null;m.hasNext();)if(y=m.match(/([\s]|[^\\]|\\\\)+/g),y&&(T+=y[0]),m.peek()==="\\"){if(m.next(),m.peek()==="x")y=m.match(/x([0-9A-Fa-f]{2})/g);else if(m.peek()==="u")y=m.match(/u([0-9A-Fa-f]{4})/g);else{T+="\\",m.hasNext()&&(T+=m.next());continue}if(!y)return W;if(k=parseInt(y[1],16),k>126&&k<=255&&y[0].indexOf("x")===0)return W;if(k>=0&&k<32){T+="\\"+y[0];continue}else k===34||k===39||k===92?T+="\\"+String.fromCharCode(k):T+=String.fromCharCode(k)}return T}w.prototype._read_string_recursive=function(W,T,k){var m,y;W==="'"?y=this.__patterns.single_quote:W==='"'?y=this.__patterns.double_quote:W==="`"?y=this.__patterns.template_text:W==="}"&&(y=this.__patterns.template_expression);for(var H=y.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===W||!T&&p.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(m=this._input.peek(),m==="x"||m==="u"?this.has_char_escapes=!0:m==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Q+=this._input.next()):k&&(k==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),k===Q&&(W==="`"?Q+=this._read_string_recursive("}",T,"`"):Q+=this._read_string_recursive("`",T,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=y.read(),H+=Q}return H},n.exports.Tokenizer=w,n.exports.TOKEN=i,n.exports.positionable_operators=O.slice(),n.exports.line_starters=d.slice()},function(n){var L=RegExp.prototype.hasOwnProperty("sticky");function x(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},x.prototype.peek=function(f){var b=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(b=this.__input.charAt(f)),b},x.prototype.__match=function(f,b){f.lastIndex=b;var h=f.exec(this.__input);return h&&!(L&&f.sticky)&&(h.index!==b&&(h=null)),h},x.prototype.test=function(f,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(f,b):!1},x.prototype.testChar=function(f,b){var h=this.peek(b);return f.lastIndex=0,h!==null&&f.test(h)},x.prototype.match=function(f){var b=this.__match(f,this.__position);return b?this.__position+=b[0].length:b=null,b},x.prototype.read=function(f,b,h){var o="",p;return f&&(p=this.match(f),p&&(o+=p[0])),b&&(p||!f)&&(o+=this.readUntil(b,h)),o},x.prototype.readUntil=function(f,b){var h="",o=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(o=p.index,b&&(o+=p[0].length)):o=this.__input_length,h=this.__input.substring(this.__position,o),this.__position=o,h},x.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},x.prototype.get_regexp=function(f,b){var h=null,o="g";return b&&L&&(o="y"),typeof f=="string"&&f!==""?h=new RegExp(f,o):f&&(h=new RegExp(f.source,o)),h},x.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(f){var b=this.__position,h=this.readUntilAfter(f);return this.__position=b,h},x.prototype.lookBack=function(f){var b=this.__position-1;return b>=f.length&&this.__input.substring(b-f.length,b).toLowerCase()===f},n.exports.InputScanner=x},function(n,L,x){var f=x(8).InputScanner,b=x(3).Token,h=x(10).TokenStream,o=x(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(u,s){this._input=new f(u),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,s=new b(p.START,""),i=null,D=[],A=new h;s.type!==p.EOF;){for(u=this._get_next_token(s,i);this._is_comment(u);)A.add(u),u=this._get_next_token(s,i);A.isEmpty()||(u.comments_before=A,A=new h),u.parent=i,this._is_opening(u)?(D.push(i),i=u):i&&this._is_closing(u,i)&&(u.opened=i,i.closed=u,i=D.pop(),u.parent=i),u.previous=s,s.next=u,this.__tokens.add(u),s=u}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(u,s){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(p.RAW,i):this._create_token(p.EOF,"")},l.prototype._is_comment=function(u){return!1},l.prototype._is_opening=function(u){return!1},l.prototype._is_closing=function(u,s){return!1},l.prototype._create_token=function(u,s){var i=new b(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return i},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=l,n.exports.TOKEN=p},function(n){function L(x){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=x}L.prototype.restart=function(){this.__position=0},L.prototype.isEmpty=function(){return this.__tokens_length===0},L.prototype.hasNext=function(){return this.__position<this.__tokens_length},L.prototype.next=function(){var x=null;return this.hasNext()&&(x=this.__tokens[this.__position],this.__position+=1),x},L.prototype.peek=function(x){var f=null;return x=x||0,x+=this.__position,x>=0&&x<this.__tokens_length&&(f=this.__tokens[x]),f},L.prototype.add=function(x){this.__parent_token&&(x.parent=this.__parent_token),this.__tokens.push(x),this.__tokens_length+=1},n.exports.TokenStream=L},function(n,L,x){var f=x(12).Pattern;function b(h,o){f.call(this,h,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}b.prototype=new f,b.prototype.__set_whitespace_patterns=function(h,o){h+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+h+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},b.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var h=this._input.read(this._match_pattern);if(h===" ")this.whitespace_before_token=" ";else if(h){var o=this.__split(this._newline_regexp,h);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return h},b.prototype.matching=function(h,o){var p=this._create();return p.__set_whitespace_patterns(h,o),p._update(),p},b.prototype._create=function(){return new b(this._input,this)},b.prototype.__split=function(h,o){h.lastIndex=0;for(var p=0,l=[],u=h.exec(o);u;)l.push(o.substring(p,u.index)),p=u.index+u[0].length,u=h.exec(o);return p<o.length?l.push(o.substring(p,o.length)):l.push(""),l},n.exports.WhitespacePattern=b},function(n){function L(x,f){this._input=x,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}L.prototype.read=function(){var x=this._input.read(this._starting_pattern);return(!this._starting_pattern||x)&&(x+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),x},L.prototype.read_match=function(){return this._input.match(this._match_pattern)},L.prototype.until_after=function(x){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(x),f._update(),f},L.prototype.until=function(x){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(x),f._update(),f},L.prototype.starting_with=function(x){var f=this._create();return f._starting_pattern=this._input.get_regexp(x,!0),f._update(),f},L.prototype.matching=function(x){var f=this._create();return f._match_pattern=this._input.get_regexp(x,!0),f._update(),f},L.prototype._create=function(){return new L(this._input,this)},L.prototype._update=function(){},n.exports.Pattern=L},function(n){function L(x,f){x=typeof x=="string"?x:x.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+f,"g")}L.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(x);b;)f[b[1]]=b[2],b=this.__directive_pattern.exec(x);return f},L.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=L},function(n,L,x){var f=x(12).Pattern,b={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function h(o,p){f.call(this,o,p),this.__template_pattern=null,this._disabled=Object.assign({},b),this._excluded=Object.assign({},b),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var l=new f(o);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}h.prototype=new f,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(o){var p=this._create();return p._disabled[o]=!0,p._update(),p},h.prototype.read_options=function(o){var p=this._create();for(var l in b)p._disabled[l]=o.templating.indexOf(l)===-1;return p._update(),p},h.prototype.exclude=function(o){var p=this._create();return p._excluded[o]=!0,p._update(),p},h.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),o+=p,p=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},h.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},h.prototype._read_template=function(){var o="",p=this._input.peek();if(p==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(o=o||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=h}],M={};function G(n){var L=M[n];if(L!==void 0)return L.exports;var x=M[n]={exports:{}};return I[n](x,x.exports,G),x.exports}var K=G(0);N=K})();var z=N;!(ie=[],Y=function(){return{js_beautify:z}}.apply(Ee,ie),Y!==void 0&&(it.exports=Y))})()},"746U":function(it,Ee,U){"use strict";U.d(Ee,"f",function(){return ie}),U.d(Ee,"l",function(){return Y}),U.d(Ee,"k",function(){return N}),U.d(Ee,"j",function(){return z}),U.d(Ee,"g",function(){return I}),U.d(Ee,"m",function(){return M}),U.d(Ee,"h",function(){return G}),U.d(Ee,"n",function(){return K}),U.d(Ee,"c",function(){return n}),U.d(Ee,"a",function(){return L}),U.d(Ee,"i",function(){return x}),U.d(Ee,"o",function(){return f}),U.d(Ee,"e",function(){return o}),U.d(Ee,"d",function(){return p}),U.d(Ee,"p",function(){return l}),U.d(Ee,"b",function(){return u});function ie(s){return Array.isArray(s)}function Y(s){return typeof s=="string"}function N(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function z(s){return typeof s=="number"&&!isNaN(s)}function I(s){return s===!0||s===!1}function M(s){return typeof s=="undefined"}function G(s){return!K(s)}function K(s){return M(s)||s===null}function n(s,i){if(!s)throw new Error(i?`Unexpected type, expected '${i}'`:"Unexpected type")}function L(s){if(K(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function x(s){return typeof s=="function"}function f(s,i){const D=Math.min(s.length,i.length);for(let A=0;A<D;A++)b(s[A],i[A])}function b(s,i){if(Y(i)){if(typeof s!==i)throw new Error(`argument does not match constraint: typeof ${i}`)}else if(x(i)){try{if(s instanceof i)return}catch(D){}if(!K(s)&&s.constructor===i)return;if(i.length===1&&i.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function h(s){let i=[],D=Object.getPrototypeOf(s);for(;Object.prototype!==D;)i=i.concat(Object.getOwnPropertyNames(D)),D=Object.getPrototypeOf(D);return i}function o(s){const i=[];for(const D of h(s))typeof s[D]=="function"&&i.push(D);return i}function p(s,i){const D=S=>function(){const R=Array.prototype.slice.call(arguments,0);return i(S,R)};let A={};for(const S of s)A[S]=D(S);return A}function l(s){return s===null?void 0:s}function u(s,i="Unreachable"){throw new Error(i)}},"7Cbv":function(it,Ee,U){"use strict";var ie=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function N(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(Y)}var z=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function I(b){return typeof b=="string"&&z.test(b)}for(var M=I,G=[],K=0;K<256;++K)G.push((K+256).toString(16).substr(1));function n(b){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(G[b[h+0]]+G[b[h+1]]+G[b[h+2]]+G[b[h+3]]+"-"+G[b[h+4]]+G[b[h+5]]+"-"+G[b[h+6]]+G[b[h+7]]+"-"+G[b[h+8]]+G[b[h+9]]+"-"+G[b[h+10]]+G[b[h+11]]+G[b[h+12]]+G[b[h+13]]+G[b[h+14]]+G[b[h+15]]).toLowerCase();if(!M(o))throw TypeError("Stringified UUID is invalid");return o}var L=n;function x(b,h,o){b=b||{};var p=b.random||(b.rng||N)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,h){o=o||0;for(var l=0;l<16;++l)h[o+l]=p[l];return h}return L(p)}var f=Ee.a=x},"7ahc":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return D});var ie=U("k1fw"),Y=U("0Owb"),N=U("+L6B"),z=U("2/Rp"),I=U("y8nQ"),M=U("Vl3Y"),G=U("tJVT"),K=U("OaEy"),n=U("2fM7"),L=U("q1tI"),x=U.n(L),f=U("VrN/"),b=U.n(f),h=U("p77/"),o=U.n(h),p=U("c5Ni"),l=U.n(p),u=n.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},i={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ee.b=function(A){var S=A.callback,R=A.onCancel,O=Object(L.useState)("python"),g=Object(G.a)(O,2),_=g[0],d=g[1];function c(E){d(i[E][1])}function C(E){S(E)}return x.a.createElement(M.a,Object(Y.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),x.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},x.a.createElement(n.a,{onChange:c},Object.keys(i).map(function(E){return x.a.createElement(u,{key:E,value:E},i[E][0])}))),x.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},x.a.createElement(D,{mode:_})),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement(z.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function D(A){var S=A.value,R=A.onChange,O=A.mode,g=A.options,_=g===void 0?{}:g,d=Object(L.useRef)(),c=Object(L.useState)(),C=Object(G.a)(c,2),E=C[0],w=C[1];return Object(L.useEffect)(function(){if(E){function B(W){var T=W.getValue();R&&R(T)}return E.on("change",B),function(){E.off("change",B)}}},[E,R]),Object(L.useEffect)(function(){E&&E.setOption("mode",O)},[E,O]),Object(L.useEffect)(function(){E&&((S!==E.getValue()||S==="")&&setTimeout(function(){E.setValue(S||" ")},300))},[E,S]),Object(L.useEffect)(function(){if(d.current&&!E){var B=b.a.fromTextArea(d.current,Object(ie.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));w(B)}},[d.current,E]),x.a.createElement("div",{className:"my-codemirror-container"},x.a.createElement("textarea",{ref:d}))}},"815F":function(it,Ee,U){"use strict";U.d(Ee,"e",function(){return G}),U.d(Ee,"c",function(){return n}),U.d(Ee,"d",function(){return L}),U.d(Ee,"a",function(){return f}),U.d(Ee,"f",function(){return b}),U.d(Ee,"b",function(){return h});var ie=U("KQm4"),Y=U("VTBJ"),N=U("Ff2n"),z=U("Zm9Q"),I=U("Kwbf"),M=U("OZM5");function G(o,p){return o!=null?o:p}function K(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=new Map;function l(u){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(u||[]).forEach(function(i){var D=i.key,A=i.children;Object(I.a)(D!=null,"Tree node must have a certain key: [".concat(s).concat(D,"]"));var S=String(D);Object(I.a)(!p.has(S)||D===null||D===void 0,"Same 'key' exist in the Tree: ".concat(S)),p.set(S,!0),l(A,"".concat(s).concat(S," > "))})}l(o)}function n(o){function p(l){var u=Object(z.a)(l);return u.map(function(s){if(!Object(M.i)(s))return Object(I.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var i=s.key,D=s.props,A=D.children,S=Object(N.a)(D,["children"]),R=Object(Y.a)({key:i},S),O=p(A);return O.length&&(R.children=O),R}).filter(function(s){return s})}return p(o)}function L(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(p===!0?[]:p),u=[];function s(i){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i.map(function(A,S){var R=Object(M.h)(D?D.pos:"0",S),O=G(A.key,R),g=Object(Y.a)(Object(Y.a)({},A),{},{parent:D,pos:R,children:null,data:A,isStart:[].concat(Object(ie.a)(D?D.isStart:[]),[S===0]),isEnd:[].concat(Object(ie.a)(D?D.isEnd:[]),[S===i.length-1])});return u.push(g),p===!0||l.has(O)?g.children=s(A.children||[],g):g.children=[],g})}return s(o),u}function x(o,p,l){var u;l?typeof l=="string"?u=function(D){return D[l]}:typeof l=="function"&&(u=function(D){return l(D)}):u=function(D,A){return G(D.key,A)};function s(i,D,A){var S=i?i.children:o,R=i?Object(M.h)(A.pos,D):"0";if(i){var O=u(i,R),g={node:i,index:D,pos:R,key:O,parentPos:A.node?A.pos:null,level:A.level+1};p(g)}S&&S.forEach(function(_,d){s(_,d,{node:i,pos:R,level:A?A.level+1:-1})})}s(null)}function f(o){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=p.initWrapper,u=p.processEntity,s=p.onProcessFinished,i=arguments.length>2?arguments[2]:void 0,D={},A={},S={posEntities:D,keyEntities:A};return l&&(S=l(S)||S),x(o,function(R){var O=R.node,g=R.index,_=R.pos,d=R.key,c=R.parentPos,C=R.level,E={node:O,index:g,key:d,pos:_,level:C},w=G(d,_);D[_]=E,A[w]=E,E.parent=D[c],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),u&&u(E,S)},i),s&&s(S),S}function b(o,p){var l=p.expandedKeys,u=p.selectedKeys,s=p.loadedKeys,i=p.loadingKeys,D=p.checkedKeys,A=p.halfCheckedKeys,S=p.dragOverNodeKey,R=p.dropPosition,O=p.keyEntities,g=O[o],_={eventKey:o,expanded:l.indexOf(o)!==-1,selected:u.indexOf(o)!==-1,loaded:s.indexOf(o)!==-1,loading:i.indexOf(o)!==-1,checked:D.indexOf(o)!==-1,halfChecked:A.indexOf(o)!==-1,pos:String(g?g.pos:""),dragOver:S===o&&R===0,dragOverGapTop:S===o&&R===-1,dragOverGapBottom:S===o&&R===1};return _}function h(o){var p=o.data,l=o.expanded,u=o.selected,s=o.checked,i=o.loaded,D=o.loading,A=o.halfChecked,S=o.dragOver,R=o.dragOverGapTop,O=o.dragOverGapBottom,g=o.pos,_=o.active,d=Object(Y.a)(Object(Y.a)({},p),{},{expanded:l,selected:u,checked:s,loaded:i,loading:D,halfChecked:A,dragOver:S,dragOverGapTop:R,dragOverGapBottom:O,pos:g,active:_});return"props"in d||Object.defineProperty(d,"props",{get:function(){return Object(I.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),d}},"8EBN":function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){"use strict";ie.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Y=0;Y<ie.modeInfo.length;Y++){var N=ie.modeInfo[Y];N.mimes&&(N.mime=N.mimes[0])}ie.findModeByMIME=function(z){z=z.toLowerCase();for(var I=0;I<ie.modeInfo.length;I++){var M=ie.modeInfo[I];if(M.mime==z)return M;if(M.mimes){for(var G=0;G<M.mimes.length;G++)if(M.mimes[G]==z)return M}}if(/\+xml$/.test(z))return ie.findModeByMIME("application/xml");if(/\+json$/.test(z))return ie.findModeByMIME("application/json")},ie.findModeByExtension=function(z){z=z.toLowerCase();for(var I=0;I<ie.modeInfo.length;I++){var M=ie.modeInfo[I];if(M.ext){for(var G=0;G<M.ext.length;G++)if(M.ext[G]==z)return M}}},ie.findModeByFileName=function(z){for(var I=0;I<ie.modeInfo.length;I++){var M=ie.modeInfo[I];if(M.file&&M.file.test(z))return M}var G=z.lastIndexOf("."),K=G>-1&&z.substring(G+1,z.length);if(K)return ie.findModeByExtension(K)},ie.findModeByName=function(z){z=z.toLowerCase();for(var I=0;I<ie.modeInfo.length;I++){var M=ie.modeInfo[I];if(M.name.toLowerCase()==z)return M;if(M.alias){for(var G=0;G<M.alias.length;G++)if(M.alias[G].toLowerCase()==z)return M}}}})},"8HAY":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return I}),U.d(Ee,"b",function(){return M}),U.d(Ee,"d",function(){return G}),U.d(Ee,"e",function(){return K}),U.d(Ee,"c",function(){return n});var ie=U("MI8n"),Y=U("pmY6"),N=U("3/fG"),z=function(L,x,f,b){function h(o){return o instanceof f?o:new f(function(p){p(o)})}return new(f||(f=Promise))(function(o,p){function l(i){try{s(b.next(i))}catch(D){p(D)}}function u(i){try{s(b.throw(i))}catch(D){p(D)}}function s(i){i.done?o(i.value):h(i.value).then(l,u)}s((b=b.apply(L,x||[])).next())})};class I extends Y.a{constructor(L,x="",f="",b=!0,h){super();this._onDidChange=this._register(new ie.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=L,this._label=x,this._cssClass=f,this._enabled=b,this._actionCallback=h}get id(){return this._id}get label(){return this._label}set label(L){this._setLabel(L)}_setLabel(L){this._label!==L&&(this._label=L,this._onDidChange.fire({label:L}))}get tooltip(){return this._tooltip||""}set tooltip(L){this._setTooltip(L)}_setTooltip(L){this._tooltip!==L&&(this._tooltip=L,this._onDidChange.fire({tooltip:L}))}get class(){return this._cssClass}set class(L){this._setClass(L)}_setClass(L){this._cssClass!==L&&(this._cssClass=L,this._onDidChange.fire({class:L}))}get enabled(){return this._enabled}set enabled(L){this._setEnabled(L)}_setEnabled(L){this._enabled!==L&&(this._enabled=L,this._onDidChange.fire({enabled:L}))}get checked(){return this._checked}set checked(L){this._setChecked(L)}_setChecked(L){this._checked!==L&&(this._checked=L,this._onDidChange.fire({checked:L}))}run(L,x){return z(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(L))})}}class M extends Y.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(L,x){return z(this,void 0,void 0,function*(){if(!L.enabled)return;this._onBeforeRun.fire({action:L});let f;try{yield this.runAction(L,x)}catch(b){f=b}this._onDidRun.fire({action:L,error:f})})}runAction(L,x){return z(this,void 0,void 0,function*(){yield L.run(x)})}}class G extends I{constructor(L){super(G.ID,L,L?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class K{constructor(L,x,f,b){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=L,this.label=x,this.class=b,this._actions=f}get actions(){return this._actions}dispose(){}run(){return z(this,void 0,void 0,function*(){})}}class n extends I{constructor(){super(n.ID,N.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(it,Ee,U){it.exports={button:"button___1wy9m"}},"9Bee":function(it,Ee,U){"use strict";var ie=U("DYRE"),Y=U("zeV3"),N=U("+L6B"),z=U("2/Rp"),I=U("k1fw"),M=U("9og8"),G=U("tJVT"),K=U("WmNS"),n=U.n(K),L=U("q1tI"),x=U.n(L),f=U("vg9a"),b=U("DlQD"),h=U.n(b),o=U("rUJ1");function p(me,ne){var q=me.match(/^(\s+)(?:```)/);if(q===null)return ne;var se=q[1];return ne.split(`
`).map(function(ue){var oe=ue.match(/^\s+/);if(oe===null)return ue;var ce=Object(G.a)(oe,1),be=ce[0];return be.length>=se.length?ue.slice(se.length):ue}).join(`
`)}var l=[],u=["<ul>"],s=new h.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function D(){l.length=0,u=["<ul>"]}var A={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(me,ne,q,se){if(ne>=me.length||me[ne].level<=q)return ne;var ue=me[ne];se.push("<li><a href='#"+ue.anchor+"'>"+ue.text+"</a>"),ne++;var oe=[];return ne=S(me,ne,ue.level,oe),oe.length>0&&(se.push("<ul>"),oe.forEach(function(ce){se.push(ce)}),se.push("</ul>")),se.push("</li>"),ne=S(me,ne,q,se),ne}function R(){return S(l,0,0,u),u.push("</ul>"),u.join("")}var O={heading:function(ne){var q=i.exec(ne);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},fences:function(ne){var q=this.rules.block.fences.exec(ne);if(q){var se=q[0],ue=p(se,q[3]||""),oe=q[2]?q[2].trim():q[2];if(["latex","katex","math"].indexOf(oe)>=0){var ce=d(),be=ue;ue=ce,c[ce]={type:"block",expression:be}}return{type:"code",raw:se,lang:oe,text:ue}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,d=function(){return"__special_katext_id_".concat(_++,"__")},c={};function C(){return c}function E(){_=0,c={}}function w(me){return me=me.replace(g,function(ne,q){var se=d();return c[se]={type:"inline",expression:q},se}),me}var B=s.listitem;s.listitem=function(me){return B(w(me))};var W=s.paragraph;s.paragraph=function(me){return W(w(me))};var T=s.tablecell;s.tablecell=function(me,ne){return T(w(me),ne)},s.code=function(me,ne,q){var se=(ne||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?"<p class='editormd-tex'>".concat(me,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ne,'">').concat(q?me:Object(o.escape)(me,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(q?me:Object(o.escape)(me,!0))+"</code></pre>"},s.heading=function(me,ne,q){var se=this.options.headerPrefix+q.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:se,level:ne,text:me}),"<h"+ne+' id="'+se+'">'+me+"</h"+ne+">"},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:O,renderer:s});var k=h.a,m=U("SJMd"),y=U("ulZh"),H=U.n(y),Q=U("m3rI"),te=U("Oy/b"),ae=U("p5ED"),Te=U("ErOA"),_e=U("STEk");/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ge=function(me,ne){return(ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(q,se){q.__proto__=se}||function(q,se){for(var ue in se)Object.prototype.hasOwnProperty.call(se,ue)&&(q[ue]=se[ue])})(me,ne)};function ve(me,ne){if(typeof ne!="function"&&ne!==null)throw new TypeError("Class extends value "+String(ne)+" is not a constructor or null");function q(){this.constructor=me}ge(me,ne),me.prototype=ne===null?Object.create(ne):(q.prototype=ne.prototype,new q)}function Oe(me,ne,q,se){return new(q||(q=Promise))(function(ue,oe){function ce(Pe){try{Se(se.next(Pe))}catch(We){oe(We)}}function be(Pe){try{Se(se.throw(Pe))}catch(We){oe(We)}}function Se(Pe){var We;Pe.done?ue(Pe.value):(We=Pe.value,We instanceof q?We:new q(function(et){et(We)})).then(ce,be)}Se((se=se.apply(me,ne||[])).next())})}function he(me,ne){var q,se,ue,oe,ce={label:0,sent:function(){if(1&ue[0])throw ue[1];return ue[1]},trys:[],ops:[]};return oe={next:be(0),throw:be(1),return:be(2)},typeof Symbol=="function"&&(oe[Symbol.iterator]=function(){return this}),oe;function be(Se){return function(Pe){return function(We){if(q)throw new TypeError("Generator is already executing.");for(;ce;)try{if(q=1,se&&(ue=2&We[0]?se.return:We[0]?se.throw||((ue=se.return)&&ue.call(se),0):se.next)&&!(ue=ue.call(se,We[1])).done)return ue;switch(se=0,ue&&(We=[2&We[0],ue.value]),We[0]){case 0:case 1:ue=We;break;case 4:return ce.label++,{value:We[1],done:!1};case 5:ce.label++,se=We[1],We=[0];continue;case 7:We=ce.ops.pop(),ce.trys.pop();continue;default:if(!(ue=ce.trys,(ue=ue.length>0&&ue[ue.length-1])||We[0]!==6&&We[0]!==2)){ce=0;continue}if(We[0]===3&&(!ue||We[1]>ue[0]&&We[1]<ue[3])){ce.label=We[1];break}if(We[0]===6&&ce.label<ue[1]){ce.label=ue[1],ue=We;break}if(ue&&ce.label<ue[2]){ce.label=ue[2],ce.ops.push(We);break}ue[2]&&ce.ops.pop(),ce.trys.pop();continue}We=ne.call(me,ce)}catch(et){We=[6,et],se=0}finally{q=ue=0}if(5&We[0])throw We[1];return{value:We[0]?We[1]:void 0,done:!0}}([Se,Pe])}}}var V=function(){function me(){}return me.addKey=function(ne){me.key=ne},Object.defineProperty(me,"isLicensed",{get:function(){return!!me.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(me.key)},enumerable:!1,configurable:!0}),me}(),P=function(){function me(){}return me.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},me.setAttributes=function(ne,q){for(var se=0,ue=q;se<ue.length;se++){var oe=ue[se],ce=oe[0],be=oe[1];ne.setAttribute(ce,be)}},me.createRect=function(ne,q,se){var ue=document.createElementNS("http://www.w3.org/2000/svg","rect");return ue.setAttribute("width",ne.toString()),ue.setAttribute("height",q.toString()),se&&me.setAttributes(ue,se),ue},me.createLine=function(ne,q,se,ue,oe){var ce=document.createElementNS("http://www.w3.org/2000/svg","line");return ce.setAttribute("x1",ne.toString()),ce.setAttribute("y1",q.toString()),ce.setAttribute("x2",se.toString()),ce.setAttribute("y2",ue.toString()),oe&&me.setAttributes(ce,oe),ce},me.createPolygon=function(ne,q){var se=document.createElementNS("http://www.w3.org/2000/svg","polygon");return se.setAttribute("points",ne),q&&me.setAttributes(se,q),se},me.createCircle=function(ne,q){var se=document.createElementNS("http://www.w3.org/2000/svg","circle");return se.setAttribute("cx",(ne/2).toString()),se.setAttribute("cy",(ne/2).toString()),se.setAttribute("r",ne.toString()),q&&me.setAttributes(se,q),se},me.createEllipse=function(ne,q,se){var ue=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ue.setAttribute("cx",(ne/2).toString()),ue.setAttribute("cy",(q/2).toString()),ue.setAttribute("rx",(ne/2).toString()),ue.setAttribute("ry",(q/2).toString()),se&&me.setAttributes(ue,se),ue},me.createGroup=function(ne){var q=document.createElementNS("http://www.w3.org/2000/svg","g");return ne&&me.setAttributes(q,ne),q},me.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},me.createMarker=function(ne,q,se,ue,oe,ce,be){var Se=document.createElementNS("http://www.w3.org/2000/svg","marker");return me.setAttributes(Se,[["id",ne],["orient",q],["markerWidth",se.toString()],["markerHeight",ue.toString()],["refX",oe.toString()],["refY",ce.toString()]]),Se.appendChild(be),Se},me.createText=function(ne){var q=document.createElementNS("http://www.w3.org/2000/svg","text");return q.setAttribute("x","0"),q.setAttribute("y","0"),ne&&me.setAttributes(q,ne),q},me.createTSpan=function(ne,q){var se=document.createElementNS("http://www.w3.org/2000/svg","tspan");return se.textContent=ne,q&&me.setAttributes(se,q),se},me.createImage=function(ne){var q=document.createElementNS("http://www.w3.org/2000/svg","image");return ne&&me.setAttributes(q,ne),q},me.createPoint=function(ne,q){var se=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return se.x=ne,se.y=q,se},me.createPath=function(ne,q){var se=document.createElementNS("http://www.w3.org/2000/svg","path");return se.setAttribute("d",ne),q&&me.setAttributes(se,q),se},me.createElement=function(ne,q){var se=document.createElementNS("http://www.w3.org/2000/svg",ne);return q&&me.setAttributes(se,q),se},me.getHollowRectanglePath=function(ne,q,se,ue,oe,ce,be,Se){return"M"+ne+","+q+"V"+(q+ue)+"H"+(ne+se)+"V"+q+"H"+oe+"V"+ce+"H"+(oe+be)+"V"+(ce+Se)+"H"+oe+"V"+q+"Z"},me}(),j=function(){function me(ne){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ne+"_"}return Object.defineProperty(me.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(me.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(me.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),me.prototype.addClass=function(ne){return this.styleSheet===void 0&&this.addStyleSheet(),ne.name=""+this.classNamePrefix+ne.localName,this.classes.push(ne),this.styleSheet.sheet.insertRule("."+ne.name+" {"+ne.style+"}",this.styleSheet.sheet.cssRules.length),ne},me.prototype.addRule=function(ne){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ne),this.styleSheet.sheet.insertRule(ne.selector+" {"+ne.style+"}",this.styleSheet.sheet.cssRules.length)},me.prototype.addStyleSheet=function(){var ne;this.styleSheet=document.createElement("style"),((ne=this.styleSheetRoot)!==null&&ne!==void 0?ne:document.head).appendChild(this.styleSheet),this.addRule(new $("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new $("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new $("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new J("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new J("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},me.prototype.removeStyleSheet=function(){var ne;this.styleSheet&&(((ne=this.styleSheetRoot)!==null&&ne!==void 0?ne:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},me}(),$=function(me,ne){this.selector=me,this.style=ne},J=function(me,ne){this.localName=me,this.style=ne},X=function(){function me(){this.blocks=[],this.display=""}return me.prototype.addButtonBlock=function(ne){ne.className=this.blockClassName,ne.buttonClassName=this.buttonClassName,ne.buttonColorsClassName=this.buttonColorsClassName,ne.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ne)},me.prototype.addElementBlock=function(ne){ne.className===void 0&&(ne.className=this.blockClassName),this.blocks.push(ne)},me.prototype.getUI=function(){var ne=document.createElement("div");return ne.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ne.style.display=this.display,this.blocks.forEach(function(q){return ne.appendChild(q.getUI())}),ne},me}(),ye=function(){function me(){}return me.prototype.getUI=function(){var ne=document.createElement("div");if(ne.className=this.className,this.minWidth!==void 0&&(ne.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ne.style.justifyContent="flex-start";break;case"center":ne.style.justifyContent="center";break;case"end":ne.style.justifyContent="flex-end"}return ne.style.whiteSpace="nowrap",ne},me}(),Re=function(me){function ne(){var q=me!==null&&me.apply(this,arguments)||this;return q.buttons=[],q}return ve(ne,me),ne.prototype.addButton=function(q){q.className=this.buttonClassName,q.colorsClassName=this.buttonColorsClassName,q.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(q)},ne.prototype.getUI=function(){var q=me.prototype.getUI.call(this);return this.buttons.forEach(function(se){return q.appendChild(se.getUI())}),q},ne}(ye),Ke=function(){function me(ne,q){this._isActive=!1,this._isHidden=!1,this._icon=ne,this.title=q,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(me.prototype,"icon",{get:function(){return this._icon},set:function(ne){this._icon=ne,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"isActive",{get:function(){return this._isActive},set:function(ne){this._isActive=ne,this.adjustClassName()},enumerable:!1,configurable:!0}),me.prototype.getUI=function(){var ne=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 ne.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},me.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,"")))},me.prototype.hide=function(){this._isHidden=!0},me}(),pe=function(me){function ne(){var q=me!==null&&me.apply(this,arguments)||this;return q.elements=[],q}return ve(ne,me),ne.prototype.addElement=function(q){this.elements.push(q)},ne.prototype.getUI=function(){var q=me.prototype.getUI.call(this);return this.elements.forEach(function(se){return q.appendChild(se)}),q},ne}(ye),we=function(){function me(ne,q){this.horizontal=ne,this.vertical=q}return Object.defineProperty(me.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),me.prototype.getVerticalLength=function(ne){return ne/this.ratio},me.prototype.getHorizontalLength=function(ne){return ne*this.ratio},me}(),ke=function(){function me(){}return me.getIcon=function(ne,q){if(ne>0&&q>0){var se=new we(ne,q),ue=se.ratio>=1?20:se.getHorizontalLength(20),oe=se.ratio<1?20:se.getVerticalLength(20),ce=document.createElementNS("http://www.w3.org/2000/svg","svg");ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ce);var be=P.createDefs();ce.appendChild(be);var Se=P.createElement("clipPath",[["id","text-bg-clip"]]);be.appendChild(Se);var Pe=P.createPath(P.getHollowRectanglePath((24-ue)/2,(24-oe)/2,ue,oe,(24-ue)/2+2,(24-oe)/2+2,ue-4,oe-4));ce.appendChild(Pe);var We=P.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(P.createTSpan(ne+":"+q)),ce.appendChild(We);var et=We.getBBox();P.setAttributes(We,[["x",((24-et.width)/2).toString()],["y",((24-et.height)/2-et.y).toString()]]);var yt=P.createPath(P.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(et.width))/2,(24-Math.ceil(et.height))/2,Math.ceil(et.width),Math.ceil(et.height)));return Se.appendChild(yt),P.setAttributes(Pe,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ce),ce.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>'},me}(),Ue=function(me){function ne(q,se,ue){var oe=me.call(this,q,se)||this;return oe.isDropdownOpen=!1,oe.onClick=oe.dropdownButtonClicked,oe.dropdownButtons=ue,oe}return ve(ne,me),ne.prototype.setupDropdown=function(){var q=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(se){se.className=q.className,se.colorsClassName=q.colorsClassName,q.dropdownBlock.appendChild(se.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ne.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ne.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ne.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ne.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ne.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ne}(Ke),Qe=function(){function me(ne,q){this.GRIP_SIZE=10,this.color=ne,this.fillColor=q,this.visual=P.createGroup(),this.visual.appendChild(P.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(P.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return me.prototype.ownsTarget=function(ne){return ne===this.visual||ne===this.visual.childNodes[0]||ne===this.visual.childNodes[1]},me.prototype.setCenter=function(ne,q){this.visual.childNodes.forEach(function(se){return P.setAttributes(se,[["cx",ne.toString()],["cy",q.toString()]])})},me}(),nt=function(){function me(ne,q,se,ue){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ne,this.canvasHeight=q,this.margin=se,this.container=ue,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(me.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ne){this._aspectRatio=ne,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ne){this._isGridVisible=ne,this.gridContainer&&P.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ne){this._zoomFactor=ne,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),me.prototype.open=function(){var ne=this;this.cropShadeElement=P.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=P.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var q=0;q<this.numberOfGridLines;q++)this.horizontalGridLines.push(P.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(P.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(se){return ne.gridContainer.appendChild(se)}),this.verticalGridLines.forEach(function(se){return ne.gridContainer.appendChild(se)}),this.cropRectElement=P.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Qe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Qe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Qe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Qe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},me.prototype.setCropRectangle=function(ne){this.cropRect=ne;var q=Object.assign({},this.cropRect);this.zoomFactor!==1&&(q.width=this.cropRect.width*this.zoomFactor,q.height=this.cropRect.height*this.zoomFactor,q.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-q.width/2,q.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-q.height/2),P.setAttributes(this.cropRectElement,[["x",q.x.toString()],["y",q.y.toString()],["width",q.width.toString()],["height",q.height.toString()]]);var se=q.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(oe,ce){var be=q.y+se*(ce+1);P.setAttributes(oe,[["x1",""+q.x],["y1",""+be],["x2",""+(q.x+q.width)],["y2",""+be]])});var ue=q.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(oe,ce){var be=q.x+ue*(ce+1);P.setAttributes(oe,[["x1",""+be],["y1",""+q.y],["x2",""+be],["y2",""+(q.y+q.height)]])}),P.setAttributes(this.cropShadeElement,[["d",P.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,q.x,q.y,q.width,q.height)]]),this.topLeftGrip.setCenter(q.x,q.y),this.topRightGrip.setCenter(q.x+q.width,q.y),this.bottomLeftGrip.setCenter(q.x,q.y+q.height),this.bottomRightGrip.setCenter(q.x+q.width,q.y+q.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},me.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)},me.prototype.clientToLocalCoordinates=function(ne,q){var se=this.container.getBoundingClientRect();return{x:ne-se.left+this.margin,y:q-se.top+this.margin}},me.prototype.onPointerDown=function(ne){this.container.setPointerCapture(ne.pointerId),this.previousPoint=this.clientToLocalCoordinates(ne.clientX,ne.clientY),this.cropRectElement===ne.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ne.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ne.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ne.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ne.target)&&(this.activeGrip=this.bottomRightGrip)},me.prototype.onPointerMove=function(ne){if(this.isMoving)this.move(this.clientToLocalCoordinates(ne.clientX,ne.clientY));else if(this.activeGrip){var q=this.clientToLocalCoordinates(ne.clientX,ne.clientY);this.resize(q)}ne.preventDefault()},me.prototype.onPointerUp=function(ne){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ne.pointerId)},me.prototype.move=function(ne){var q=ne.x-this.previousPoint.x,se=ne.y-this.previousPoint.y;this.zoomFactor!==1&&(q=-q/this.zoomFactor,se=-se/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+q),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+se),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ne},me.prototype.resize=function(ne){var q=Object.assign({},this.cropRect),se=ne.x-this.previousPoint.x,ue=ne.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:q.x+se<this.margin&&(se=this.margin-q.x),q.x+=se,q.width=this.cropRect.x+this.cropRect.width-q.x;break;case this.bottomRightGrip:case this.topRightGrip:q.width+se>this.canvasWidth*this.zoomFactor&&(se=this.canvasWidth*this.zoomFactor-q.width),q.width+=se}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(q.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(se),q.height=this.aspectRatio.getVerticalLength(q.width)):(q.y+=ue,q.height=this.cropRect.y+this.cropRect.height-q.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?q.height=this.aspectRatio.getVerticalLength(q.width):q.height+=ue}q.width<10&&(q.x=this.cropRect.x,q.width=10),q.height<10&&(q.y=this.cropRect.y,q.height=10),this.previousPoint=ne,q.x>=this.margin&&q.y>=this.margin&&q.x-this.margin+q.width<=this.canvasWidth&&q.y-this.margin+q.height<=this.canvasHeight&&(this.cropRect=q,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},me.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ne=this.cropRect.x+this.cropRect.width/2,q=this.cropRect.y+this.cropRect.height/2,se=this.aspectRatio.getHorizontalLength(this.cropRect.height),ue=this.aspectRatio.getVerticalLength(this.cropRect.width);se/this.canvasWidth<ue/this.canvasHeight?this.cropRect.width=se:this.cropRect.height=ue,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=ne-this.cropRect.width/2,this.cropRect.y=q-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)}},me.prototype.getRescaledRect=function(ne,q,se,ue,oe,ce){var be=se/ne,Se=ue/q;return{x:(oe.x-ce)*be+ce,y:(oe.y-ce)*Se+ce,width:oe.width*be,height:oe.height*Se}},me.prototype.scaleCanvas=function(ne,q){var se=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ne,q,this.cropRect,this.margin);this.canvasWidth=ne,this.canvasHeight=q,this.onCropChange&&this.onCropChange(se),this.setCropRectangle(se)},me}(),ot=function(){function me(ne){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ne,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(me.prototype,"angle",{get:function(){return this._angle},set:function(ne){this._angle=ne,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),me.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},me.prototype.onPointerDown=function(ne){this.controlContainer.setPointerCapture(ne.pointerId),this.isDragging=!0,this.previousPoint={x:ne.clientX,y:ne.clientY}},me.prototype.onPointerMove=function(ne){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ne.clientX-this.previousPoint.x)/5),this.previousPoint.x=ne.clientX)},me.prototype.onPointerUp=function(ne){this.isDragging&&this.onAngleChange&&this.onAngleChange((ne.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ne.pointerId)},me.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ne=this.angleLabelText.getBBox();P.setAttributes(this.angleLabelElement,[["x",((this.width-ne.width)/2).toString()],["y",(this.height/2).toString()]])}},me.prototype.positionScaleShape=function(){if(this.scaleShape){var ne=this.scaleShape.transform.baseVal.getItem(0);ne.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ne,0)}},me.prototype.getVisual=function(){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg");ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),ne.setAttribute("width",this.width+"px"),ne.setAttribute("height",this.height+"px"),ne.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ne.style.flexShrink="0",document.body.appendChild(ne);for(var q="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,se=1;se<=this.width/5+10;se++){var ue=se%5==0?this.height/3:this.height/6;q+="h4v"+-ue+"h1v"+ue}q+="v1H0Z",this.scaleShape=P.createPath(q);var oe=P.createTransform();this.scaleShape.transform.baseVal.appendItem(oe),ne.appendChild(this.scaleShape),this.angleLabelElement=P.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=P.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ce=P.createTSpan("");return ce.innerHTML="&deg;",this.angleLabelElement.appendChild(ce),ne.appendChild(this.angleLabelElement),document.body.removeChild(ne),ne},me}(),qe=function(){function me(){this.naturalSize=!1,this.imageType="image/png"}return me.prototype.rasterize=function(ne,q,se,ue,oe,ce,be){var Se=this;return new Promise(function(Pe){var We=document.createElement("canvas");We.width=ne.width.baseVal.value-2*ue,We.height=ne.height.baseVal.value-2*ue;var et=1,yt=1;Se.naturalSize===!0?(et=q.naturalWidth/(ne.width.baseVal.value-2*ue)/ce,yt=q.naturalHeight/(ne.height.baseVal.value-2*ue)/be,We.width=q.naturalWidth/ce,We.height=q.naturalHeight/be):Se.width!==void 0&&Se.height!==void 0&&(et=Se.width/se.width,yt=Se.height/se.height,We.width*=et,We.height*=yt);var Rt=We.getContext("2d");Rt.translate(We.width/2,We.height/2),Rt.rotate(oe*Math.PI/180),Rt.scale(ce,be),Rt.translate(-We.width/2,-We.height/2),Rt.drawImage(q,0,0,We.width,We.height);var kt=document.createElement("canvas");kt.width=se.width*et,kt.height=se.height*yt,kt.getContext("2d").putImageData(Rt.getImageData((se.x-ue)*et,(se.y-ue)*yt,se.width*et,se.height*yt),0,0),Pe(kt.toDataURL(Se.imageType,Se.imageQuality))})},me}(),ft=function(){function me(ne){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=me.instanceCounter++,this.styles=new j(this.instanceNo),this.target=ne,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(me.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ne){this._zoomToCropEnabled=ne,ne?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ne){this._isGridVisible=ne,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ne){this._gridLines=ne,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ne){this._rotationAngle=ne,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"aspectRatio",{get:function(){var ne;return(ne=this._aspectRatio)!==null&&ne!==void 0?ne:this.aspectRatios[0]},set:function(ne){this._aspectRatio=ne},enumerable:!1,configurable:!0}),me.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},me.prototype.show=function(){this.showUI(),this.open()},me.prototype.close=function(ne){ne===void 0&&(ne=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ne||this.closeEventListeners.forEach(function(q){return q()}),this._isOpen=!1)},me.prototype.addRenderEventListener=function(ne){this.renderEventListeners.push(ne)},me.prototype.removeRenderEventListener=function(ne){this.renderEventListeners.indexOf(ne)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ne),1)},me.prototype.addCloseEventListener=function(ne){this.closeEventListeners.push(ne)},me.prototype.removeCloseEventListener=function(ne){this.closeEventListeners.indexOf(ne)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ne),1)},me.prototype.setupResizeObserver=function(){var ne=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ne.resize(ne.target.clientWidth,ne.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))},me.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ne=1*this.target.clientWidth/this.target.clientHeight,q=this.contentDiv.clientWidth/ne>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ne:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,se=q+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ne;this.resize(q,se)}},me.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},me.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",P.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},me.prototype.resize=function(ne,q){this.imageWidth=Math.round(ne),this.imageHeight=Math.round(q),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()},me.prototype.setEditingTarget=function(){var ne=document.createElement("canvas");ne.width=this.target.naturalWidth,ne.height=this.target.naturalHeight,ne.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var q=ne.toDataURL();P.setAttributes(this.editingTarget,[["href",q]]),this.setEditingTargetSize()},me.prototype.setTopLeft=function(){var ne=this.target.getBoundingClientRect(),q=this.editorCanvas.getBoundingClientRect();this.left=ne.left-q.left-this.CANVAS_MARGIN,this.top=ne.top-q.top-this.CANVAS_MARGIN},me.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=P.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=P.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=P.createGroup(),this.editingTargetRotationScaleContainer=P.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ne=P.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ne);var q=P.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(q),this.editingTargetContainer=P.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)},me.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},me.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=P.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new nt(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()},me.prototype.zoomToCrop=function(){if(this.cropRect){var ne=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,q=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=ne+"px "+q+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ne+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-q+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},me.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)},me.prototype.cropRectChanged=function(ne){this.cropRect=ne,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},me.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},me.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"},me.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},me.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 ne=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,q=this.target.offsetTop>ne+this.CANVAS_MARGIN?this.target.offsetTop-(ne+this.CANVAS_MARGIN):0;this.coverDiv.style.top=q+"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},me.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},me.prototype.addTopToolbar=function(){var ne=this;this.topToolbar=new X,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 q=new Re;q.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(q);var se=[];this.aspectRatios.forEach(function(yt){var Rt=new Ke(ke.getIcon(yt.horizontal,yt.vertical),yt.horizontal===0&&yt.vertical===0?"FREE":yt.horizontal+":"+yt.vertical);Rt.onClick=function(){return ne.ratioButtonClicked(yt)},se.push(Rt)}),this.aspectRatioButton=new Ue(ke.getIcon(0,0),"Aspect ratio",se),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,q.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ue=new Ke('<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");ue.isActive=this.isGridVisible,ue.onClick=function(){ne.isGridVisible=!ne.isGridVisible,ue.isActive=ne.isGridVisible},q.addButton(ue);var oe=new Ke('<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(oe.isActive=this.zoomToCropEnabled,oe.onClick=function(){ne.zoomToCropEnabled=!ne.zoomToCropEnabled,oe.isActive=ne.zoomToCropEnabled},q.addButton(oe),!V.isLicensed){var ce=new pe;this.topToolbar.addElementBlock(ce);var be=document.createElement("div");be.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Se=document.createElement("a");Se.style.color="currentColor",Se.href="https://markerjs.com/products/cropro",Se.target="_blank",Se.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',be.appendChild(Se),ce.addElement(be)}var Pe=new Re;Pe.minWidth=3*this.toolbarHeight+"px",Pe.contentAlign="end",this.topToolbar.addButtonBlock(Pe);var We=new Ke('<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");We.onClick=this.startRenderAndClose,Pe.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var et=new Ke('<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");et.onClick=this.close,Pe.addButton(et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},me.prototype.addBottomToolbar=function(){var ne=this;this.bottomToolbar=new X,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 q=new Re;q.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(q);var se=new Ke('<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");se.onClick=this.rotateLeftButtonClicked,q.addButton(se);var ue=new Ke('<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");ue.onClick=this.rotateRightButtonClicked,q.addButton(ue);var oe=new pe;oe.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(oe),this.straightener=new ot("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(Pe){ne.rotateBy(Pe),ne.straightener.angle=ne.rotationAngle},oe.addElement(this.straightener.getUI());var ce=new Re;ce.minWidth=2*this.toolbarHeight+"px",ce.contentAlign="end",this.bottomToolbar.addButtonBlock(ce);var be=new Ke('<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");be.onClick=this.flipHorizontallyButtonClicked,ce.addButton(be);var Se=new Ke('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");Se.onClick=this.flipVerticallyButtonClicked,ce.addButton(Se)},me.prototype.ratioButtonClicked=function(ne){this.aspectRatio=ne,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},me.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ke.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},me.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new we(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},me.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},me.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},me.prototype.restoreState=function(ne){if(ne){var q=this.cropLayer.getRescaledRect(ne.width,ne.height,this.imageWidth,this.imageHeight,ne.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(q),this.cropRectChanged(q),this.flippedHorizontally=ne.flippedHorizontally,this.flippedVertically=ne.flippedVertically,this.applyFlip(),this.rotationAngle=ne.rotationAngle,this.applyRotation()}},me.prototype.clientToLocalCoordinates=function(ne,q){var se=this.cropImage.getBoundingClientRect();return{x:ne-se.left,y:q-se.top}},me.prototype.onWindowResize=function(){this.positionUI()},me.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ne=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ne+"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()},me.prototype.rotateLeftButtonClicked=function(){var ne=this.rotationAngle-90;this.rotationAngle%90!=0&&(ne+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ne)},me.prototype.rotateRightButtonClicked=function(){var ne=this.rotationAngle+90;this.rotationAngle%90!=0&&(ne-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ne)},me.prototype.rotateTo=function(ne){ne=(ne=ne>180?ne-360:ne)<=-180?ne+360:ne,this.rotationAngle=ne,this.applyRotation()},me.prototype.rotateBy=function(ne){this.rotateTo((this.rotationAngle+ne)%360)},me.prototype.applyRotation=function(){var ne=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var q=this.editingTargetRotationContainer.transform.baseVal.getItem(0);q.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(q,0);var se=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/se.width,this.imageHeight/se.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ne},me.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},me.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},me.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},me.prototype.startRenderAndClose=function(){return Oe(this,void 0,void 0,function(){var ne,q;return he(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return ne=se.sent(),q=this.getState(),this.renderEventListeners.forEach(function(ue){return ue(ne,q)}),this.close(!0),[2]}})})},me.prototype.render=function(){return Oe(this,void 0,void 0,function(){var ne;return he(this,function(q){switch(q.label){case 0:return(ne=new qe).naturalSize=this.renderAtNaturalSize,ne.imageType=this.renderImageType,ne.imageQuality=this.renderImageQuality,ne.width=this.renderWidth,ne.height=this.renderHeight,this.unzoomFromCrop(),P.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ne.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 q.sent(),[4,ne.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,q.sent()]}})})},me.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new J("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new J("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new J("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var ne=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new J("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*ne)+`px;
height: `+(this.toolbarHeight-2*ne)+`px;
padding: `+ne+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new J("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new J("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new $("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new $("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new J("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new J("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new J("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new J("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*ne)+`px;
padding: `+ne+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new J("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},me.instanceCounter=0,me}(),lt=U("8hTe"),pt=U.n(lt),Ye=/<pre[^>]*>/g;function Tt(me){var ne=document.createElement("div");return ne.innerHTML=me,ne.childNodes.length===0?"":ne.childNodes[0].nodeValue}var bt=Ee.a=function(me){var ne=me.value,q=ne===void 0?"":ne,se=me.edit,ue=se===void 0?!1:se,oe=me.className,ce=me.showTextOnly,be=me.showLines,Se=me.replaces,Pe=me.zoomImg,We=me.hasMask,et=me.style,yt=et===void 0?{}:et,Rt=me.stylesPrev,kt=Rt===void 0?{}:Rt,mn=String(q),zt=Object(L.useRef)(),Mt=Object(L.useRef)(),Qn=Object(L.useState)(""),un=Object(G.a)(Qn,2),hr=un[0],or=un[1],bn=Object(L.useState)("office"),xr=Object(G.a)(bn,2),br=xr[0],Ar=xr[1],Br=function(){var Rn=new ft(Mt.current);Rn.displayMode="popup",Rn.addRenderEventListener(function(){var jn=Object(M.a)(n.a.mark(function cn(on){var Dn;return n.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:return zt.current.style.display="none",Tr.next=3,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on}});case 3:Dn=Tr.sent,Dn!=null&&Dn.id&&Se(Mt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Dn==null?void 0:Dn.id,"?type=").concat(Dn.content_type));case 5:case"end":return Tr.stop()}},cn)}));return function(cn){return jn.apply(this,arguments)}}()),Rn.show()},Ht=function(){var Rn=new _e.a(Mt.current);Rn.settings.displayMode="popup",Rn.addEventListener("render",function(){var jn=Object(M.a)(n.a.mark(function cn(on){var Dn;return n.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:if(zt.current.style.display="none",!Mt.current){Tr.next=6;break}return Tr.next=4,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on.dataUrl}});case 4:Dn=Tr.sent,Dn!=null&&Dn.id&&Se(Mt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Dn==null?void 0:Dn.id,"?type=").concat(Dn.content_type));case 6:case"end":return Tr.stop()}},cn)}));return function(cn){return jn.apply(this,arguments)}}()),Rn.show(),window.markerArea=Rn},an=Object(L.useMemo)(function(){zt.current&&(zt.current.style.zIndex=-1);try{var wt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Rn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,jn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;mn=mn.replace(wt,"("+Q.a.API_SERVER+"/api/attachments/").replace(Rn,'"'+Q.a.API_SERVER+"/api/attachments/").replace(jn,'"'+Q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(ei){}var cn=k(mn),on=C();if(mn.match(/\[TOC\]/)&&(cn=cn.replace("<p>[TOC]</p>",R()),D()),cn=cn.replace(/(__special_katext_id_\d+__)/g,function(ei,Tr){var ct=on[Tr],Qt=ct.type,ji=ct.expression;return Object(te.renderToString)(Tt(ji)||"",{displayMode:Qt==="block",throwOnError:!1,output:"html"})}),cn=cn.replace(/▁/g,"\u2581\u2581\u2581"),E(),ce){var Dn=document.createElement("div");return Dn.innerHTML=cn,Dn.innerText}return setTimeout(function(){return Ir()},500),cn},[mn]),Cn=Object(L.useRef)();A.WebkitLineClamp=be,be&&(yt=Object(I.a)(Object(I.a)({},yt),A));function qn(wt){var Rn=wt.target;if(Rn.tagName.toUpperCase()==="IMG"){if(Pe){var jn=Rn.getAttribute("src");or(jn),Ar("image")}}else if(Rn.tagName.toUpperCase()==="A"){var cn=Rn.getAttribute("href");if(cn.indexOf("office")>-1)wt.preventDefault(),or(cn),Ar("office");else if(cn.indexOf("application/pdf")>-1)wt.preventDefault(),or(cn),Ar("pdf");else if(cn.indexOf("text/html")>-1)wt.preventDefault(),or(cn),Ar("html");else if(cn.startsWith("#")){wt.preventDefault();var on=document.getElementById(cn.replace("#",""));on&&on.scrollIntoView(!0)}}}var Ir=function(){var Rn,jn=(Rn=Cn.current)===null||Rn===void 0?void 0:Rn.querySelectorAll("video");jn==null||jn.forEach(function(cn){if(cn.oncontextmenu=function(){return!1},cn.src.indexOf(".m3u8")>-1&&!cn.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var on=new H.a;on.loadSource(cn.src),on.attachMedia(cn)}}})};Object(L.useEffect)(function(){if(Cn.current&&an&&(an.match(Ye)&&window.PR.prettyPrint()),Cn.current)return Cn.current.addEventListener("click",qn),function(){Cn.current.removeEventListener("click",qn),E(),D()}},[an,Cn.current,qn]);var gn=function(Rn){if(!ue)return;Rn.target.nodeName==="IMG"?(zt.current.style.zIndex=1,zt.current.style.display="flex",zt.current.style.width=Rn.target.clientWidth+"px",zt.current.style.height=Rn.target.clientHeight+"px",zt.current.style.top=Rn.target.offsetTop+"px",zt.current.style.left=Rn.target.offsetLeft+"px",Mt.current.src=Rn.target.getAttribute("src")):zt.current.style.display="none"};return x.a.createElement("div",{style:{position:"relative"}},x.a.createElement("div",{ref:Cn,style:Object(I.a)({},yt),className:"".concat(oe||""," markdown-body ").concat(pt.a.mdBody),onMouseOver:gn,dangerouslySetInnerHTML:{__html:an}}),x.a.createElement("div",{ref:zt,className:pt.a.button},x.a.createElement(Y.a,null,x.a.createElement(z.a,{onClick:function(){return Br()}},"\u88C1\u526A"),x.a.createElement(z.a,{onClick:function(){return Ht()}},"\u7F16\u8F91"))),x.a.createElement("img",{ref:Mt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),x.a.createElement(ae.a,{close:!0,data:hr,type:hr!=null&&hr.length?br:"",style:Object(I.a)({},kt),onClose:function(){return or("")}}))}},"9VGf":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return N});var ie=U("q1tI"),Y=U.n(ie);function N(z,I){var M=Object(ie.useRef)();Object(ie.useEffect)(function(){M.current=z}),Object(ie.useEffect)(function(){function G(){M.current()}if(I!==null){var K=setInterval(G,I);return function(){return clearInterval(K)}}},[I])}},"A60/":function(it,Ee,U){it.exports={wrap:"wrap___37dvp",right20:"right20___2yZBe",right180:"right180___14fSn",basket:"basket___32ZdA",count:"count___2ydNT",iconWrap:"iconWrap___2cEp5",icon:"icon___3fYs3",name:"name___7IPYm"}},BU3w:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return M});var ie=U("MNnm"),Y="rc-util-key";function N(G){if(G.attachTo)return G.attachTo;var K=document.querySelector("head");return K||document.body}function z(G){var K,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ie.a)())return null;var L=document.createElement("style");if((K=n.csp)===null||K===void 0?void 0:K.nonce){var x;L.nonce=(x=n.csp)===null||x===void 0?void 0:x.nonce}L.innerHTML=G;var f=N(n),b=f.firstChild;return n.prepend&&f.prepend?f.prepend(L):n.prepend&&b?f.insertBefore(L,b):f.appendChild(L),L}var I=new Map;function M(G,K){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=N(n);if(!I.has(L)){var x=z("",n),f=x.parentNode;I.set(L,f),f.removeChild(x)}var b=Array.from(I.get(L).children).find(function(u){return u.tagName==="STYLE"&&u[Y]===K});if(b){var h,o;if(((h=n.csp)===null||h===void 0?void 0:h.nonce)&&b.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var p;b.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}return b.innerHTML!==G&&(b.innerHTML=G),b}var l=z(G,n);return l[Y]=K,l}},Bd2K:function(it,Ee,U){(function(ie){ie(U("VrN/"),U("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(n,L,x){if(x!=ie.Init&&x&&n.removeKeyMap("autoCloseTags"),!L)return;var f={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(f["'/'"]=function(b){return M(b)}),(typeof L!="object"||L.whenOpening!==!1)&&(f["'>'"]=function(b){return z(b)}),n.addKeyMap(f)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function z(n){if(n.getOption("disableInput"))return ie.Pass;for(var L=n.listSelections(),x=[],f=n.getOption("autoCloseTags"),b=0;b<L.length;b++){if(!L[b].empty())return ie.Pass;var h=L[b].head,o=n.getTokenAt(h),p=ie.innerMode(n.getMode(),o.state),l=p.state,u=p.mode.xmlCurrentTag&&p.mode.xmlCurrentTag(l),s=u&&u.name;if(!s)return ie.Pass;var i=p.mode.configuration=="html",D=typeof f=="object"&&f.dontCloseTags||i&&Y,A=typeof f=="object"&&f.indentTags||i&&N;o.end>h.ch&&(s=s.slice(0,s.length-o.end+h.ch));var S=s.toLowerCase();if(!s||o.type=="string"&&(o.end!=h.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&u.close||o.string.indexOf("/")==h.ch-o.start-1||D&&G(D,S)>-1||K(n,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(l)||[],s,h,!0))return ie.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&G(R,s)>-1){x[b]={text:"/>",newPos:ie.Pos(h.line,h.ch+2)};continue}var O=A&&G(A,S)>-1;x[b]={indent:O,text:">"+(O?`
`:"")+"</"+s+">",newPos:O?ie.Pos(h.line+1,0):ie.Pos(h.line,h.ch+1)}}for(var g=typeof f=="object"&&f.dontIndentOnAutoClose,b=L.length-1;b>=0;b--){var _=x[b];n.replaceRange(_.text,L[b].head,L[b].anchor,"+insert");var d=n.listSelections().slice(0);d[b]={head:_.newPos,anchor:_.newPos},n.setSelections(d),!g&&_.indent&&(n.indentLine(_.newPos.line,null,!0),n.indentLine(_.newPos.line+1,null,!0))}}function I(n,L){for(var x=n.listSelections(),f=[],b=L?"/":"</",h=n.getOption("autoCloseTags"),o=typeof h=="object"&&h.dontIndentOnSlash,p=0;p<x.length;p++){if(!x[p].empty())return ie.Pass;var l=x[p].head,u=n.getTokenAt(l),s=ie.innerMode(n.getMode(),u.state),i=s.state;if(L&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=l.ch-1))return ie.Pass;var D,A=s.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(A&&s.mode.name=="javascript")D=b+"script";else if(A&&s.mode.name=="css")D=b+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i);if(!S||S.length&&K(n,S,S[S.length-1],l))return ie.Pass;D=b+S[S.length-1]}n.getLine(l.line).charAt(u.end)!=">"&&(D+=">"),f[p]=D}if(n.replaceSelections(f),x=n.listSelections(),!o)for(var p=0;p<x.length;p++)(p==x.length-1||x[p].head.line<x[p+1].head.line)&&n.indentLine(x[p].head.line)}function M(n){return n.getOption("disableInput")?ie.Pass:I(n,!0)}ie.commands.closeTag=function(n){return I(n)};function G(n,L){if(n.indexOf)return n.indexOf(L);for(var x=0,f=n.length;x<f;++x)if(n[x]==L)return x;return-1}function K(n,L,x,f,b){if(!ie.scanForClosingTag)return!1;var h=Math.min(n.lastLine()+1,f.line+500),o=ie.scanForClosingTag(n,f,null,h);if(!o||o.tag!=x)return!1;for(var p=b?1:0,l=L.length-1;l>=0&&L[l]==x;l--)++p;f=o.to;for(var l=1;l<p;l++){var u=ie.scanForClosingTag(n,f,null,h);if(!u||u.tag!=x)return!1;f=u.to}return!0}})},BdwD:function(it,Ee,U){"use strict";var ie=U("+L6B"),Y=U("2/Rp"),N=U("0Owb"),z=U("k1fw"),I=U("q1tI"),M=U.n(I),G=U("FOrL"),K=U.n(G),n=function(x){var f=x.buttonProps,b=f===void 0?{}:f,h=x.styles,o=h===void 0?{}:h,p=x.imgStyles,l=p===void 0?{}:p,u=x.customText,s=x.ButtonText,i=x.ButtonClick,D=x.Buttonclass,A=x.ButtonTwo;return M.a.createElement("section",{className:"tc animated fadeIn",style:Object(z.a)(Object(z.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),o)},M.a.createElement("img",{src:K.a,style:Object(z.a)(Object(z.a)({},{width:"200px",height:"150px"}),l)}),M.a.createElement("p",{className:"mt10 font14"},u||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),s&&M.a.createElement(Y.a,Object(N.a)({className:D,onClick:i},b),s),A&&A)};Ee.a=n},BjJ7:function(it,Ee,U){"use strict";U.d(Ee,"d",function(){return Y}),U.d(Ee,"c",function(){return N}),U.d(Ee,"e",function(){return z}),U.d(Ee,"b",function(){return I}),U.d(Ee,"a",function(){return G});var ie=U("m3rI");function Y(K){var n=!0;if(K.length>0){for(var L=0;L<K.length;L++)if(K[L].compile_success==0||!K[L].compile_success){n=!1;break}}else n=!1;return n}function N(K){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],x=0;x<K.length;x++){var f=K[x],b=n?"".concat(n,"/").concat(f.name):"".concat(f.name);L.push({title:f.name,isLeaf:!(f.type==="tree"),key:b})}return L}function z(K,n,L){for(var x=0;x<K.length;x++){var f=K[x];if(f.key===n){f.children=L;break}f.children&&z(f.children,n,L)}return K}function I(K,n,L){var x;return function(){var f=this,b=arguments,h=function(){x=null,L||K.apply(f,b)},o=L&&!x;clearTimeout(x),x=setTimeout(h,n),o&&K.apply(f,b)}}var M=!0,G=ie.a.API_SERVER},"C+DQ":function(it,Ee,U){},"C/vA":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return ie});function ie(Y){const N=this;let z=!1,I;return function(){return z||(z=!0,I=Y.apply(N,arguments)),I}}},"Cg/j":function(it,Ee,U){"use strict";U.d(Ee,"b",function(){return ie}),U.d(Ee,"a",function(){return Y}),U.d(Ee,"c",function(){return z}),U.d(Ee,"d",function(){return I});var ie;(function(M){M.serviceIds=new Map,M.DI_TARGET="$di$target",M.DI_DEPENDENCIES="$di$dependencies";function G(K){return K[M.DI_DEPENDENCIES]||[]}M.getServiceDependencies=G})(ie||(ie={}));const Y=z("instantiationService");function N(M,G,K,n){G[ie.DI_TARGET]===G?G[ie.DI_DEPENDENCIES].push({id:M,index:K,optional:n}):(G[ie.DI_DEPENDENCIES]=[{id:M,index:K,optional:n}],G[ie.DI_TARGET]=G)}function z(M){if(ie.serviceIds.has(M))return ie.serviceIds.get(M);const G=function(K,n,L){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");N(G,K,L,!1)};return G.toString=()=>M,ie.serviceIds.set(M,G),G}function I(M){return function(G,K,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");N(M,G,n,!0)}}},DlQD:function(it,Ee,U){(function(ie,Y){it.exports=Y()})(this,function(){"use strict";function ie(q,se){for(var ue=0;ue<se.length;ue++){var oe=se[ue];oe.enumerable=oe.enumerable||!1,oe.configurable=!0,"value"in oe&&(oe.writable=!0),Object.defineProperty(q,oe.key,oe)}}function Y(q,se,ue){return se&&ie(q.prototype,se),ue&&ie(q,ue),q}function N(q,se){if(!q)return;if(typeof q=="string")return z(q,se);var ue=Object.prototype.toString.call(q).slice(8,-1);if(ue==="Object"&&q.constructor&&(ue=q.constructor.name),ue==="Map"||ue==="Set")return Array.from(q);if(ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ue))return z(q,se)}function z(q,se){(se==null||se>q.length)&&(se=q.length);for(var ue=0,oe=new Array(se);ue<se;ue++)oe[ue]=q[ue];return oe}function I(q,se){var ue;if(typeof Symbol=="undefined"||q[Symbol.iterator]==null){if(Array.isArray(q)||(ue=N(q))||se&&q&&typeof q.length=="number"){ue&&(q=ue);var oe=0;return function(){return oe>=q.length?{done:!0}:{done:!1,value:q[oe++]}}}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 ue=q[Symbol.iterator](),ue.next.bind(ue)}function M(q,se){return se={exports:{}},q(se,se.exports),se.exports}var G=M(function(q){function se(){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 ue(oe){q.exports.defaults=oe}q.exports={defaults:se(),getDefaults:se,changeDefaults:ue}}),K=G.defaults,n=G.getDefaults,L=G.changeDefaults,x=/[&<>"']/,f=/[&<>"']/g,b=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(se){return o[se]};function l(q,se){if(se){if(x.test(q))return q.replace(f,p)}else if(b.test(q))return q.replace(h,p);return q}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(q){return q.replace(u,function(se,ue){return ue=ue.toLowerCase(),ue==="colon"?":":ue.charAt(0)==="#"?ue.charAt(1)==="x"?String.fromCharCode(parseInt(ue.substring(2),16)):String.fromCharCode(+ue.substring(1)):""})}var i=/(^|[^\[])\^/g;function D(q,se){q=q.source||q,se=se||"";var ue={replace:function(ce,be){return be=be.source||be,be=be.replace(i,"$1"),q=q.replace(ce,be),ue},getRegex:function(){return new RegExp(q,se)}};return ue}var A=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(q,se,ue){if(q){var oe;try{oe=decodeURIComponent(s(ue)).replace(A,"").toLowerCase()}catch(ce){return null}if(oe.indexOf("javascript:")===0||oe.indexOf("vbscript:")===0||oe.indexOf("data:")===0)return null}se&&!S.test(ue)&&(ue=c(se,ue));try{ue=encodeURI(ue).replace(/%25/g,"%")}catch(ce){return null}return ue}var O={},g=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(q,se){O[" "+q]||(g.test(q)?O[" "+q]=q+"/":O[" "+q]=B(q,"/",!0)),q=O[" "+q];var ue=q.indexOf(":")===-1;return se.substring(0,2)==="//"?ue?se:q.replace(_,"$1")+se:se.charAt(0)==="/"?ue?se:q.replace(d,"$1")+se:q+se}var C={exec:function(){}};function E(q){for(var se=1,ue,oe;se<arguments.length;se++){ue=arguments[se];for(oe in ue)Object.prototype.hasOwnProperty.call(ue,oe)&&(q[oe]=ue[oe])}return q}function w(q,se){var ue=q.replace(/\|/g,function(be,Se,Pe){for(var We=!1,et=Se;--et>=0&&Pe[et]==="\\";)We=!We;return We?"|":" |"}),oe=ue.split(/ \|/),ce=0;if(oe.length>se)oe.splice(se);else for(;oe.length<se;)oe.push("");for(;ce<oe.length;ce++)oe[ce]=oe[ce].trim().replace(/\\\|/g,"|");return oe}function B(q,se,ue){var oe=q.length;if(oe===0)return"";for(var ce=0;ce<oe;){var be=q.charAt(oe-ce-1);if(be===se&&!ue)ce++;else if(be!==se&&ue)ce++;else break}return q.substr(0,oe-ce)}function W(q,se){if(q.indexOf(se[1])===-1)return-1;for(var ue=q.length,oe=0,ce=0;ce<ue;ce++)if(q[ce]==="\\")ce++;else if(q[ce]===se[0])oe++;else if(q[ce]===se[1]&&(oe--,oe<0))return ce;return-1}function T(q){q&&q.sanitize&&!q.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 k={escape:l,unescape:s,edit:D,cleanUrl:R,resolveUrl:c,noopTest:C,merge:E,splitCells:w,rtrim:B,findClosingBracket:W,checkSanitizeDeprecation:T},m=G.defaults,y=k.rtrim,H=k.splitCells,Q=k.escape,te=k.findClosingBracket;function ae(q,se,ue){var oe=se.href,ce=se.title?Q(se.title):null,be=q[1].replace(/\\([\[\]])/g,"$1");return q[0].charAt(0)!=="!"?{type:"link",raw:ue,href:oe,title:ce,text:be}:{type:"image",raw:ue,href:oe,title:ce,text:Q(be)}}function Te(q,se){var ue=q.match(/^(\s+)(?:```)/);if(ue===null)return se;var oe=ue[1];return se.split(`
`).map(function(ce){var be=ce.match(/^\s+/);if(be===null)return ce;var Se=be[0];return Se.length>=oe.length?ce.slice(oe.length):ce}).join(`
`)}var _e=function(){function q(ue){this.options=ue||m}var se=q.prototype;return se.space=function(oe){var ce=this.rules.block.newline.exec(oe);if(ce)return ce[0].length>1?{type:"space",raw:ce[0]}:{raw:`
`}},se.code=function(oe,ce){var be=this.rules.block.code.exec(oe);if(be){var Se=ce[ce.length-1];if(Se&&Se.type==="paragraph")return{raw:be[0],text:be[0].trimRight()};var Pe=be[0].replace(/^ {4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?Pe:y(Pe,`
`)}}},se.fences=function(oe){var ce=this.rules.block.fences.exec(oe);if(ce){var be=ce[0],Se=Te(be,ce[3]||"");return{type:"code",raw:be,lang:ce[2]?ce[2].trim():ce[2],text:Se}}},se.heading=function(oe){var ce=this.rules.block.heading.exec(oe);if(ce)return{type:"heading",raw:ce[0],depth:ce[1].length,text:ce[2]}},se.nptable=function(oe){var ce=this.rules.block.nptable.exec(oe);if(ce){var be={type:"table",header:H(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(`
`):[],raw:ce[0]};if(be.header.length===be.align.length){var Se=be.align.length,Pe;for(Pe=0;Pe<Se;Pe++)/^ *-+: *$/.test(be.align[Pe])?be.align[Pe]="right":/^ *:-+: *$/.test(be.align[Pe])?be.align[Pe]="center":/^ *:-+ *$/.test(be.align[Pe])?be.align[Pe]="left":be.align[Pe]=null;for(Se=be.cells.length,Pe=0;Pe<Se;Pe++)be.cells[Pe]=H(be.cells[Pe],be.header.length);return be}}},se.hr=function(oe){var ce=this.rules.block.hr.exec(oe);if(ce)return{type:"hr",raw:ce[0]}},se.blockquote=function(oe){var ce=this.rules.block.blockquote.exec(oe);if(ce){var be=ce[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ce[0],text:be}}},se.list=function(oe){var ce=this.rules.block.list.exec(oe);if(ce){for(var be=ce[0],Se=ce[2],Pe=Se.length>1,We=Se[Se.length-1]===")",et={type:"list",raw:be,ordered:Pe,start:Pe?+Se.slice(0,-1):"",loose:!1,items:[]},yt=ce[0].match(this.rules.block.item),Rt=!1,kt,mn,zt,Mt,Qn,un,hr,or=yt.length,bn=0;bn<or;bn++)kt=yt[bn],be=kt,mn=kt.length,kt=kt.replace(/^ *([*+-]|\d+[.)]) */,""),~kt.indexOf(`
`)&&(mn-=kt.length,kt=this.options.pedantic?kt.replace(/^ {1,4}/gm,""):kt.replace(new RegExp("^ {1,"+mn+"}","gm"),"")),bn!==or-1&&(zt=this.rules.block.bullet.exec(yt[bn+1])[0],(Pe?zt.length===1||!We&&zt[zt.length-1]===")":zt.length>1||this.options.smartLists&&zt!==Se)&&(Mt=yt.slice(bn+1).join(`
`),et.raw=et.raw.substring(0,et.raw.length-Mt.length),bn=or-1)),Qn=Rt||/\n\n(?!\s*$)/.test(kt),bn!==or-1&&(Rt=kt.charAt(kt.length-1)===`
`,Qn||(Qn=Rt)),Qn&&(et.loose=!0),un=/^\[[ xX]\] /.test(kt),hr=void 0,un&&(hr=kt[1]!==" ",kt=kt.replace(/^\[[ xX]\] +/,"")),et.items.push({type:"list_item",raw:be,task:un,checked:hr,loose:Qn,text:kt});return et}},se.html=function(oe){var ce=this.rules.block.html.exec(oe);if(ce)return{type:this.options.sanitize?"paragraph":"html",raw:ce[0],pre:!this.options.sanitizer&&(ce[1]==="pre"||ce[1]==="script"||ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):Q(ce[0]):ce[0]}},se.def=function(oe){var ce=this.rules.block.def.exec(oe);if(ce){ce[3]&&(ce[3]=ce[3].substring(1,ce[3].length-1));var be=ce[1].toLowerCase().replace(/\s+/g," ");return{tag:be,raw:ce[0],href:ce[2],title:ce[3]}}},se.table=function(oe){var ce=this.rules.block.table.exec(oe);if(ce){var be={type:"table",header:H(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(`
`):[]};if(be.header.length===be.align.length){be.raw=ce[0];var Se=be.align.length,Pe;for(Pe=0;Pe<Se;Pe++)/^ *-+: *$/.test(be.align[Pe])?be.align[Pe]="right":/^ *:-+: *$/.test(be.align[Pe])?be.align[Pe]="center":/^ *:-+ *$/.test(be.align[Pe])?be.align[Pe]="left":be.align[Pe]=null;for(Se=be.cells.length,Pe=0;Pe<Se;Pe++)be.cells[Pe]=H(be.cells[Pe].replace(/^ *\| *| *\| *$/g,""),be.header.length);return be}}},se.lheading=function(oe){var ce=this.rules.block.lheading.exec(oe);if(ce)return{type:"heading",raw:ce[0],depth:ce[2].charAt(0)==="="?1:2,text:ce[1]}},se.paragraph=function(oe){var ce=this.rules.block.paragraph.exec(oe);if(ce)return{type:"paragraph",raw:ce[0],text:ce[1].charAt(ce[1].length-1)===`
`?ce[1].slice(0,-1):ce[1]}},se.text=function(oe,ce){var be=this.rules.block.text.exec(oe);if(be){var Se=ce[ce.length-1];return Se&&Se.type==="text"?{raw:be[0],text:be[0]}:{type:"text",raw:be[0],text:be[0]}}},se.escape=function(oe){var ce=this.rules.inline.escape.exec(oe);if(ce)return{type:"escape",raw:ce[0],text:Q(ce[1])}},se.tag=function(oe,ce,be){var Se=this.rules.inline.tag.exec(oe);if(Se)return!ce&&/^<a /i.test(Se[0])?ce=!0:ce&&/^<\/a>/i.test(Se[0])&&(ce=!1),!be&&/^<(pre|code|kbd|script)(\s|>)/i.test(Se[0])?be=!0:be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Se[0])&&(be=!1),{type:this.options.sanitize?"text":"html",raw:Se[0],inLink:ce,inRawBlock:be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Se[0]):Q(Se[0]):Se[0]}},se.link=function(oe){var ce=this.rules.inline.link.exec(oe);if(ce){var be=te(ce[2],"()");if(be>-1){var Se=ce[0].indexOf("!")===0?5:4,Pe=Se+ce[1].length+be;ce[2]=ce[2].substring(0,be),ce[0]=ce[0].substring(0,Pe).trim(),ce[3]=""}var We=ce[2],et="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(We);yt?(We=yt[1],et=yt[3]):et=""}else et=ce[3]?ce[3].slice(1,-1):"";We=We.trim().replace(/^<([\s\S]*)>$/,"$1");var Rt=ae(ce,{href:We&&We.replace(this.rules.inline._escapes,"$1"),title:et&&et.replace(this.rules.inline._escapes,"$1")},ce[0]);return Rt}},se.reflink=function(oe,ce){var be;if((be=this.rules.inline.reflink.exec(oe))||(be=this.rules.inline.nolink.exec(oe))){var Se=(be[2]||be[1]).replace(/\s+/g," ");if(Se=ce[Se.toLowerCase()],!Se||!Se.href){var Pe=be[0].charAt(0);return{type:"text",raw:Pe,text:Pe}}var We=ae(be,Se,be[0]);return We}},se.strong=function(oe,ce,be){be===void 0&&(be="");var Se=this.rules.inline.strong.start.exec(oe);if(Se&&(!Se[1]||Se[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){ce=ce.slice(-1*oe.length);var Pe=Se[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Pe.lastIndex=0;for(var We;(Se=Pe.exec(ce))!=null;)if(We=this.rules.inline.strong.middle.exec(ce.slice(0,Se.index+3)),We)return{type:"strong",raw:oe.slice(0,We[0].length),text:oe.slice(2,We[0].length-2)}}},se.em=function(oe,ce,be){be===void 0&&(be="");var Se=this.rules.inline.em.start.exec(oe);if(Se&&(!Se[1]||Se[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){ce=ce.slice(-1*oe.length);var Pe=Se[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Pe.lastIndex=0;for(var We;(Se=Pe.exec(ce))!=null;)if(We=this.rules.inline.em.middle.exec(ce.slice(0,Se.index+2)),We)return{type:"em",raw:oe.slice(0,We[0].length),text:oe.slice(1,We[0].length-1)}}},se.codespan=function(oe){var ce=this.rules.inline.code.exec(oe);if(ce){var be=ce[2].replace(/\n/g," "),Se=/[^ ]/.test(be),Pe=be.startsWith(" ")&&be.endsWith(" ");return Se&&Pe&&(be=be.substring(1,be.length-1)),be=Q(be,!0),{type:"codespan",raw:ce[0],text:be}}},se.br=function(oe){var ce=this.rules.inline.br.exec(oe);if(ce)return{type:"br",raw:ce[0]}},se.del=function(oe){var ce=this.rules.inline.del.exec(oe);if(ce)return{type:"del",raw:ce[0],text:ce[1]}},se.autolink=function(oe,ce){var be=this.rules.inline.autolink.exec(oe);if(be){var Se,Pe;return be[2]==="@"?(Se=Q(this.options.mangle?ce(be[1]):be[1]),Pe="mailto:"+Se):(Se=Q(be[1]),Pe=Se),{type:"link",raw:be[0],text:Se,href:Pe,tokens:[{type:"text",raw:Se,text:Se}]}}},se.url=function(oe,ce){var be;if(be=this.rules.inline.url.exec(oe)){var Se,Pe;if(be[2]==="@")Se=Q(this.options.mangle?ce(be[0]):be[0]),Pe="mailto:"+Se;else{var We;do We=be[0],be[0]=this.rules.inline._backpedal.exec(be[0])[0];while(We!==be[0]);Se=Q(be[0]),be[1]==="www."?Pe="http://"+Se:Pe=Se}return{type:"link",raw:be[0],text:Se,href:Pe,tokens:[{type:"text",raw:Se,text:Se}]}}},se.inlineText=function(oe,ce,be){var Se=this.rules.inline.text.exec(oe);if(Se){var Pe;return ce?Pe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Se[0]):Q(Se[0]):Se[0]:Pe=Q(this.options.smartypants?be(Se[0]):Se[0]),{type:"text",raw:Se[0],text:Pe}}},q}(),ge=k.noopTest,ve=k.edit,Oe=k.merge,he={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:ge,table:ge,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=ve(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=ve(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=ve(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=/<!--(?!-?>)[\s\S]*?-->/,he.html=ve(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=ve(he._paragraph).replace("hr",he.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",he._tag).getRegex(),he.blockquote=ve(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Oe({},he),he.gfm=Oe({},he.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*|$)"}),he.gfm.nptable=ve(he.gfm.nptable).replace("hr",he.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",he._tag).getRegex(),he.gfm.table=ve(he.gfm.table).replace("hr",he.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",he._tag).getRegex(),he.pedantic=Oe({},he.normal,{html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._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:ge,paragraph:ve(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var V={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ge,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:ge,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};V._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",V.punctuation=ve(V.punctuation).replace(/punctuation/g,V._punctuation).getRegex(),V._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",V._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",V.em.start=ve(V.em.start).replace(/punctuation/g,V._punctuation).getRegex(),V.em.middle=ve(V.em.middle).replace(/punctuation/g,V._punctuation).replace(/overlapSkip/g,V._overlapSkip).getRegex(),V.em.endAst=ve(V.em.endAst,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.em.endUnd=ve(V.em.endUnd,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.strong.start=ve(V.strong.start).replace(/punctuation/g,V._punctuation).getRegex(),V.strong.middle=ve(V.strong.middle).replace(/punctuation/g,V._punctuation).replace(/blockSkip/g,V._blockSkip).getRegex(),V.strong.endAst=ve(V.strong.endAst,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.strong.endUnd=ve(V.strong.endUnd,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.blockSkip=ve(V._blockSkip,"g").getRegex(),V.overlapSkip=ve(V._overlapSkip,"g").getRegex(),V._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,V._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,V._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])?)+(?![-_])/,V.autolink=ve(V.autolink).replace("scheme",V._scheme).replace("email",V._email).getRegex(),V._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,V.tag=ve(V.tag).replace("comment",he._comment).replace("attribute",V._attribute).getRegex(),V._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,V._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,V.link=ve(V.link).replace("label",V._label).replace("href",V._href).replace("title",V._title).getRegex(),V.reflink=ve(V.reflink).replace("label",V._label).getRegex(),V.reflinkSearch=ve(V.reflinkSearch,"g").replace("reflink",V.reflink).replace("nolink",V.nolink).getRegex(),V.normal=Oe({},V),V.pedantic=Oe({},V.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:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",V._label).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V._label).getRegex()}),V.gfm=Oe({},V.normal,{escape:ve(V.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),V.gfm.url=ve(V.gfm.url,"i").replace("email",V.gfm._extended_email).getRegex(),V.breaks=Oe({},V.gfm,{br:ve(V.br).replace("{2,}","*").getRegex(),text:ve(V.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var P={block:he,inline:V},j=G.defaults,$=P.block,J=P.inline;function X(q){return q.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ye(q){var se="",ue,oe,ce=q.length;for(ue=0;ue<ce;ue++)oe=q.charCodeAt(ue),Math.random()>.5&&(oe="x"+oe.toString(16)),se+="&#"+oe+";";return se}var Re=function(){function q(ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=ue||j,this.options.tokenizer=this.options.tokenizer||new _e,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var oe={block:$.normal,inline:J.normal};this.options.pedantic?(oe.block=$.pedantic,oe.inline=J.pedantic):this.options.gfm&&(oe.block=$.gfm,this.options.breaks?oe.inline=J.breaks:oe.inline=J.gfm),this.tokenizer.rules=oe}q.lex=function(oe,ce){var be=new q(ce);return be.lex(oe)};var se=q.prototype;return se.lex=function(oe){return oe=oe.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(oe,this.tokens,!0),this.inline(this.tokens),this.tokens},se.blockTokens=function(oe,ce,be){ce===void 0&&(ce=[]),be===void 0&&(be=!0),oe=oe.replace(/^ +$/gm,"");for(var Se,Pe,We,et;oe;){if(Se=this.tokenizer.space(oe)){oe=oe.substring(Se.raw.length),Se.type&&ce.push(Se);continue}if(Se=this.tokenizer.code(oe,ce)){oe=oe.substring(Se.raw.length),Se.type?ce.push(Se):(et=ce[ce.length-1],et.raw+=`
`+Se.raw,et.text+=`
`+Se.text);continue}if(Se=this.tokenizer.fences(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.heading(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.nptable(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.hr(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.blockquote(oe)){oe=oe.substring(Se.raw.length),Se.tokens=this.blockTokens(Se.text,[],be),ce.push(Se);continue}if(Se=this.tokenizer.list(oe)){for(oe=oe.substring(Se.raw.length),We=Se.items.length,Pe=0;Pe<We;Pe++)Se.items[Pe].tokens=this.blockTokens(Se.items[Pe].text,[],!1);ce.push(Se);continue}if(Se=this.tokenizer.html(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(be&&(Se=this.tokenizer.def(oe))){oe=oe.substring(Se.raw.length),this.tokens.links[Se.tag]||(this.tokens.links[Se.tag]={href:Se.href,title:Se.title});continue}if(Se=this.tokenizer.table(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.lheading(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(be&&(Se=this.tokenizer.paragraph(oe))){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.text(oe,ce)){oe=oe.substring(Se.raw.length),Se.type?ce.push(Se):(et=ce[ce.length-1],et.raw+=`
`+Se.raw,et.text+=`
`+Se.text);continue}if(oe){var yt="Infinite loop on byte: "+oe.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return ce},se.inline=function(oe){var ce,be,Se,Pe,We,et,yt=oe.length;for(ce=0;ce<yt;ce++){et=oe[ce];switch(et.type){case"paragraph":case"text":case"heading":{et.tokens=[],this.inlineTokens(et.text,et.tokens);break}case"table":{for(et.tokens={header:[],cells:[]},Pe=et.header.length,be=0;be<Pe;be++)et.tokens.header[be]=[],this.inlineTokens(et.header[be],et.tokens.header[be]);for(Pe=et.cells.length,be=0;be<Pe;be++)for(We=et.cells[be],et.tokens.cells[be]=[],Se=0;Se<We.length;Se++)et.tokens.cells[be][Se]=[],this.inlineTokens(We[Se],et.tokens.cells[be][Se]);break}case"blockquote":{this.inline(et.tokens);break}case"list":{for(Pe=et.items.length,be=0;be<Pe;be++)this.inline(et.items[be].tokens);break}}}return oe},se.inlineTokens=function(oe,ce,be,Se,Pe){ce===void 0&&(ce=[]),be===void 0&&(be=!1),Se===void 0&&(Se=!1),Pe===void 0&&(Pe="");var We,et=oe,yt;if(this.tokens.links){var Rt=Object.keys(this.tokens.links);if(Rt.length>0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(et))!=null;)Rt.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(et=et.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+et.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(et))!=null;)et=et.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+et.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;oe;){if(We=this.tokenizer.escape(oe)){oe=oe.substring(We.raw.length),ce.push(We);continue}if(We=this.tokenizer.tag(oe,be,Se)){oe=oe.substring(We.raw.length),be=We.inLink,Se=We.inRawBlock,ce.push(We);continue}if(We=this.tokenizer.link(oe)){oe=oe.substring(We.raw.length),We.type==="link"&&(We.tokens=this.inlineTokens(We.text,[],!0,Se)),ce.push(We);continue}if(We=this.tokenizer.reflink(oe,this.tokens.links)){oe=oe.substring(We.raw.length),We.type==="link"&&(We.tokens=this.inlineTokens(We.text,[],!0,Se)),ce.push(We);continue}if(We=this.tokenizer.strong(oe,et,Pe)){oe=oe.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],be,Se),ce.push(We);continue}if(We=this.tokenizer.em(oe,et,Pe)){oe=oe.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],be,Se),ce.push(We);continue}if(We=this.tokenizer.codespan(oe)){oe=oe.substring(We.raw.length),ce.push(We);continue}if(We=this.tokenizer.br(oe)){oe=oe.substring(We.raw.length),ce.push(We);continue}if(We=this.tokenizer.del(oe)){oe=oe.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],be,Se),ce.push(We);continue}if(We=this.tokenizer.autolink(oe,ye)){oe=oe.substring(We.raw.length),ce.push(We);continue}if(!be&&(We=this.tokenizer.url(oe,ye))){oe=oe.substring(We.raw.length),ce.push(We);continue}if(We=this.tokenizer.inlineText(oe,Se,X)){oe=oe.substring(We.raw.length),Pe=We.raw.slice(-1),ce.push(We);continue}if(oe){var kt="Infinite loop on byte: "+oe.charCodeAt(0);if(this.options.silent){console.error(kt);break}else throw new Error(kt)}}return ce},Y(q,null,[{key:"rules",get:function(){return{block:$,inline:J}}}]),q}(),Ke=G.defaults,pe=k.cleanUrl,we=k.escape,ke=function(){function q(ue){this.options=ue||Ke}var se=q.prototype;return se.code=function(oe,ce,be){var Se=(ce||"").match(/\S*/)[0];if(this.options.highlight){var Pe=this.options.highlight(oe,Se);Pe!=null&&Pe!==oe&&(be=!0,oe=Pe)}return Se?'<pre><code class="'+this.options.langPrefix+we(Se,!0)+'">'+(be?oe:we(oe,!0))+`</code></pre>
`:"<pre><code>"+(be?oe:we(oe,!0))+`</code></pre>
`},se.blockquote=function(oe){return`<blockquote>
`+oe+`</blockquote>
`},se.html=function(oe){return oe},se.heading=function(oe,ce,be,Se){return this.options.headerIds?"<h"+ce+' id="'+this.options.headerPrefix+Se.slug(be)+'">'+oe+"</h"+ce+`>
`:"<h"+ce+">"+oe+"</h"+ce+`>
`},se.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},se.list=function(oe,ce,be){var Se=ce?"ol":"ul",Pe=ce&&be!==1?' start="'+be+'"':"";return"<"+Se+Pe+`>
`+oe+"</"+Se+`>
`},se.listitem=function(oe){return"<li>"+oe+`</li>
`},se.checkbox=function(oe){return"<input "+(oe?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},se.paragraph=function(oe){return"<p>"+oe+`</p>
`},se.table=function(oe,ce){return ce&&(ce="<tbody>"+ce+"</tbody>"),`<table>
<thead>
`+oe+`</thead>
`+ce+`</table>
`},se.tablerow=function(oe){return`<tr>
`+oe+`</tr>
`},se.tablecell=function(oe,ce){var be=ce.header?"th":"td",Se=ce.align?"<"+be+' align="'+ce.align+'">':"<"+be+">";return Se+oe+"</"+be+`>
`},se.strong=function(oe){return"<strong>"+oe+"</strong>"},se.em=function(oe){return"<em>"+oe+"</em>"},se.codespan=function(oe){return"<code>"+oe+"</code>"},se.br=function(){return this.options.xhtml?"<br/>":"<br>"},se.del=function(oe){return"<del>"+oe+"</del>"},se.link=function(oe,ce,be){if(oe=pe(this.options.sanitize,this.options.baseUrl,oe),oe===null)return be;var Se='<a href="'+we(oe)+'"';return ce&&(Se+=' title="'+ce+'"'),Se+=">"+be+"</a>",Se},se.image=function(oe,ce,be){if(oe=pe(this.options.sanitize,this.options.baseUrl,oe),oe===null)return be;var Se='<img src="'+oe+'" alt="'+be+'"';return ce&&(Se+=' title="'+ce+'"'),Se+=this.options.xhtml?"/>":">",Se},se.text=function(oe){return oe},q}(),Ue=function(){function q(){}var se=q.prototype;return se.strong=function(oe){return oe},se.em=function(oe){return oe},se.codespan=function(oe){return oe},se.del=function(oe){return oe},se.html=function(oe){return oe},se.text=function(oe){return oe},se.link=function(oe,ce,be){return""+be},se.image=function(oe,ce,be){return""+be},se.br=function(){return""},q}(),Qe=function(){function q(){this.seen={}}var se=q.prototype;return se.slug=function(oe){var ce=oe.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ce)){var be=ce;do this.seen[be]++,ce=be+"-"+this.seen[be];while(this.seen.hasOwnProperty(ce))}return this.seen[ce]=0,ce},q}(),nt=G.defaults,ot=k.unescape,qe=function(){function q(ue){this.options=ue||nt,this.options.renderer=this.options.renderer||new ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new Qe}q.parse=function(oe,ce){var be=new q(ce);return be.parse(oe)};var se=q.prototype;return se.parse=function(oe,ce){ce===void 0&&(ce=!0);var be="",Se,Pe,We,et,yt,Rt,kt,mn,zt,Mt,Qn,un,hr,or,bn,xr,br,Ar,Br=oe.length;for(Se=0;Se<Br;Se++){Mt=oe[Se];switch(Mt.type){case"space":continue;case"hr":{be+=this.renderer.hr();continue}case"heading":{be+=this.renderer.heading(this.parseInline(Mt.tokens),Mt.depth,ot(this.parseInline(Mt.tokens,this.textRenderer)),this.slugger);continue}case"code":{be+=this.renderer.code(Mt.text,Mt.lang,Mt.escaped);continue}case"table":{for(mn="",kt="",et=Mt.header.length,Pe=0;Pe<et;Pe++)kt+=this.renderer.tablecell(this.parseInline(Mt.tokens.header[Pe]),{header:!0,align:Mt.align[Pe]});for(mn+=this.renderer.tablerow(kt),zt="",et=Mt.cells.length,Pe=0;Pe<et;Pe++){for(Rt=Mt.tokens.cells[Pe],kt="",yt=Rt.length,We=0;We<yt;We++)kt+=this.renderer.tablecell(this.parseInline(Rt[We]),{header:!1,align:Mt.align[We]});zt+=this.renderer.tablerow(kt)}be+=this.renderer.table(mn,zt);continue}case"blockquote":{zt=this.parse(Mt.tokens),be+=this.renderer.blockquote(zt);continue}case"list":{for(Qn=Mt.ordered,un=Mt.start,hr=Mt.loose,et=Mt.items.length,zt="",Pe=0;Pe<et;Pe++)bn=Mt.items[Pe],xr=bn.checked,br=bn.task,or="",bn.task&&(Ar=this.renderer.checkbox(xr),hr?bn.tokens.length>0&&bn.tokens[0].type==="text"?(bn.tokens[0].text=Ar+" "+bn.tokens[0].text,bn.tokens[0].tokens&&bn.tokens[0].tokens.length>0&&bn.tokens[0].tokens[0].type==="text"&&(bn.tokens[0].tokens[0].text=Ar+" "+bn.tokens[0].tokens[0].text)):bn.tokens.unshift({type:"text",text:Ar}):or+=Ar),or+=this.parse(bn.tokens,hr),zt+=this.renderer.listitem(or,br,xr);be+=this.renderer.list(zt,Qn,un);continue}case"html":{be+=this.renderer.html(Mt.text);continue}case"paragraph":{be+=this.renderer.paragraph(this.parseInline(Mt.tokens));continue}case"text":{for(zt=Mt.tokens?this.parseInline(Mt.tokens):Mt.text;Se+1<Br&&oe[Se+1].type==="text";)Mt=oe[++Se],zt+=`
`+(Mt.tokens?this.parseInline(Mt.tokens):Mt.text);be+=ce?this.renderer.paragraph(zt):zt;continue}default:{var Ht='Token with "'+Mt.type+'" type was not found.';if(this.options.silent){console.error(Ht);return}else throw new Error(Ht)}}}return be},se.parseInline=function(oe,ce){ce=ce||this.renderer;var be="",Se,Pe,We=oe.length;for(Se=0;Se<We;Se++){Pe=oe[Se];switch(Pe.type){case"escape":{be+=ce.text(Pe.text);break}case"html":{be+=ce.html(Pe.text);break}case"link":{be+=ce.link(Pe.href,Pe.title,this.parseInline(Pe.tokens,ce));break}case"image":{be+=ce.image(Pe.href,Pe.title,Pe.text);break}case"strong":{be+=ce.strong(this.parseInline(Pe.tokens,ce));break}case"em":{be+=ce.em(this.parseInline(Pe.tokens,ce));break}case"codespan":{be+=ce.codespan(Pe.text);break}case"br":{be+=ce.br();break}case"del":{be+=ce.del(this.parseInline(Pe.tokens,ce));break}case"text":{be+=ce.text(Pe.text);break}default:{var et='Token with "'+Pe.type+'" type was not found.';if(this.options.silent){console.error(et);return}else throw new Error(et)}}}return be},q}(),ft=k.merge,lt=k.checkSanitizeDeprecation,pt=k.escape,Ye=G.getDefaults,Tt=G.changeDefaults,bt=G.defaults;function me(q,se,ue){if(typeof q=="undefined"||q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(q)+", string expected");if(typeof se=="function"&&(ue=se,se=null),se=ft({},me.defaults,se||{}),lt(se),ue){var oe=se.highlight,ce;try{ce=Re.lex(q,se)}catch(We){return ue(We)}var be=function(et){var yt;if(!et)try{yt=qe.parse(ce,se)}catch(Rt){et=Rt}return se.highlight=oe,et?ue(et):ue(null,yt)};if(!oe||oe.length<3)return be();if(delete se.highlight,!ce.length)return be();var Se=0;me.walkTokens(ce,function(We){We.type==="code"&&(Se++,setTimeout(function(){oe(We.text,We.lang,function(et,yt){if(et)return be(et);yt!=null&&yt!==We.text&&(We.text=yt,We.escaped=!0),Se--,Se===0&&be()})},0))}),Se===0&&be();return}try{var Pe=Re.lex(q,se);return se.walkTokens&&me.walkTokens(Pe,se.walkTokens),qe.parse(Pe,se)}catch(We){if(We.message+=`
Please report this to https://github.com/markedjs/marked.`,se.silent)return"<p>An error occurred:</p><pre>"+pt(We.message+"",!0)+"</pre>";throw We}}me.options=me.setOptions=function(q){return ft(me.defaults,q),Tt(me.defaults),me},me.getDefaults=Ye,me.defaults=bt,me.use=function(q){var se=ft({},q);if(q.renderer&&function(){var oe=me.defaults.renderer||new ke,ce=function(Pe){var We=oe[Pe];oe[Pe]=function(){for(var et=arguments.length,yt=new Array(et),Rt=0;Rt<et;Rt++)yt[Rt]=arguments[Rt];var kt=q.renderer[Pe].apply(oe,yt);return kt===!1&&(kt=We.apply(oe,yt)),kt}};for(var be in q.renderer)ce(be);se.renderer=oe}(),q.tokenizer&&function(){var oe=me.defaults.tokenizer||new _e,ce=function(Pe){var We=oe[Pe];oe[Pe]=function(){for(var et=arguments.length,yt=new Array(et),Rt=0;Rt<et;Rt++)yt[Rt]=arguments[Rt];var kt=q.tokenizer[Pe].apply(oe,yt);return kt===!1&&(kt=We.apply(oe,yt)),kt}};for(var be in q.tokenizer)ce(be);se.tokenizer=oe}(),q.walkTokens){var ue=me.defaults.walkTokens;se.walkTokens=function(oe){q.walkTokens(oe),ue&&ue(oe)}}me.setOptions(se)},me.walkTokens=function(q,se){for(var ue=I(q),oe;!(oe=ue()).done;){var ce=oe.value;se(ce);switch(ce.type){case"table":{for(var be=I(ce.tokens.header),Se;!(Se=be()).done;){var Pe=Se.value;me.walkTokens(Pe,se)}for(var We=I(ce.tokens.cells),et;!(et=We()).done;)for(var yt=et.value,Rt=I(yt),kt;!(kt=Rt()).done;){var mn=kt.value;me.walkTokens(mn,se)}break}case"list":{me.walkTokens(ce.items,se);break}default:ce.tokens&&me.walkTokens(ce.tokens,se)}}},me.Parser=qe,me.parser=qe.parse,me.Renderer=ke,me.TextRenderer=Ue,me.Lexer=Re,me.lexer=Re.lex,me.Tokenizer=_e,me.Slugger=Qe,me.parse=me;var ne=me;return ne})},EJTS:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return A});var ie=U("qVdP"),Y=U("jsC+"),N=U("lUTK"),z=U("BvKs"),I=U("sRBo"),M=U("kaz8"),G=U("oBTY"),K=U("7Kak"),n=U("9yH6"),L=U("tJVT"),x=U("q1tI"),f=U.n(x),b=U("9Bee"),h=U("+vTd"),o=U.n(h),p=U("xKgJ"),l=U("Is5a"),u=U.n(l),s=["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"],i=["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"],D=function(R){var O,g=R.data,_=R.selectIds,d=R.onSelectCheckBox,c=d===void 0?function(){}:d,C=R.showCheckbox,E=C===void 0?!0:C,w=Object(x.useState)(!1),B=Object(L.a)(w,2),W=B[0],T=B[1],k=function(){if(g.item_type==="JUDGMENT")return f.a.createElement("div",{className:o.a.judgmentContent},g.choices.map(function(Te,_e){return f.a.createElement(n.a,{key:_e,disabled:!0},Te.choice_text)}));if(g.item_type==="PROGRAM"){var te;return f.a.createElement("div",{className:o.a.programContent},f.a.createElement(b.a,{value:(te=g.program_attr)===null||te===void 0?void 0:te.description}))}if(g.item_type==="COMBINATION"){var ae;return f.a.createElement("div",{className:o.a.combinationContent},g==null||((ae=g.sub_item_banks)===null||ae===void 0)?void 0:ae.map(function(Te,_e){var ge,ve="(\u9898\u76EE".concat(_e+1,"-\u5355\u9009\u9898) ");return f.a.createElement(x.Fragment,null,f.a.createElement("div",{style:{marginTop:10,marginBottom:10}},f.a.createElement(b.a,{value:ve+Te.name})),Te.choices.map(function(Oe,he){return f.a.createElement("div",{key:he,className:o.a.otherContentItem},f.a.createElement("p",null,s[he]),f.a.createElement(b.a,{className:o.a.otehrContentHtml,value:Oe.choice_text}))}),f.a.createElement("div",{className:o.a.con},f.a.createElement("b",{className:"c-grey-333 font14"}," ","\u7B54\u6848\uFF1A",i==null?void 0:i[Te==null||((ge=Te.choices)===null||ge===void 0)?void 0:ge.findIndex(function(Oe){return Oe==null?void 0:Oe.is_answer})]," "),f.a.createElement("div",null,f.a.createElement("span",null,"\u89E3\u6790\uFF1A"),f.a.createElement(b.a,{className:o.a.parseAnswerHtml,value:Te.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return f.a.createElement("div",{className:o.a.otherContent},g.choices.map(function(Te,_e){return f.a.createElement("div",{key:_e,className:o.a.otherContentItem},f.a.createElement("p",null,s[_e]),f.a.createElement(b.a,{className:o.a.otehrContentHtml,value:Te.choice_text}))}))},m=function(){var te;return f.a.createElement("div",null,(te=g.standard_answer)===null||te===void 0?void 0:te.map(function(ae,Te){return f.a.createElement(b.a,{key:Te,className:o.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(ae.position,"\uFF09\uFF1A").concat(ae.answer_text.join("\u3001"))})}))},y=function(){var te,ae,Te,_e={SUBJECTIVE:(te=g.answer_texts)===null||te===void 0?void 0:te[0],JUDGMENT:(ae=g.choices)===null||ae===void 0||((Te=ae.find(function(j){return j.is_answer}))===null||Te===void 0)?void 0:Te.choice_text},ge=g.choices.map(function(j){return j.is_answer}).findIndex(function(j){return j}),ve=ge>-1?i[ge]:"",Oe="";g.choices.map(function(j,$){j.is_answer&&(Oe+=i[$])});var he=_e[g.item_type],V={SINGLE:f.a.createElement(b.a,{className:o.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ve||"\u65E0")}),MULTIPLE:f.a.createElement(b.a,{className:o.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Oe||"\u65E0")}),COMPLETION:m()},P=f.a.createElement(b.a,{className:o.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(he||"\u65E0")});return V[g.item_type]||P},H=function(te){var ae=Object(G.a)(_);te.target.checked?ae.push(g.id):ae=ae.filter(function(Te){return Te!==g.id}),c(ae)};return f.a.createElement("div",{className:o.a.itemWrap},f.a.createElement("div",{className:o.a.list},E&&f.a.createElement(M.a,{className:"mr10",onChange:H,checked:_.includes(g.id)}),f.a.createElement("div",{className:o.a.title},f.a.createElement(b.a,{key:1,showLines:1,showTextOnly:!0,className:o.a.topicTitleContent,value:g.name})),f.a.createElement("div",{className:o.a.line},f.a.createElement("b",{className:o.a.b1}),f.a.createElement("b",{className:o.a.b2})),f.a.createElement("div",{onClick:function(){return T(!W)},className:o.a.tr},W?"\u6536\u8D77":"\u5C55\u5F00",f.a.createElement("i",{style:{transform:W?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),f.a.createElement("aside",{style:W?{display:"block"}:{display:"none"},className:o.a.itemDetail},f.a.createElement("div",{style:{marginBottom:44}},f.a.createElement(b.a,{key:2,className:o.a.topicTitleContent,value:g.name}),f.a.createElement("div",{className:"".concat(o.a.row," mt15")},k()),f.a.createElement("div",{className:o.a.row},f.a.createElement("div",{className:o.a.updateTimeRow},f.a.createElement("div",{className:o.a.updateTimeWrap},g.item_type==="PROGRAM"&&f.a.createElement("p",{className:o.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(O=g.program_attr)===null||O===void 0?void 0:O.language))))),g.item_type!=="PROGRAM"&&g.item_type!=="COMBINATION"&&f.a.createElement("div",{className:o.a.answerWrapper},f.a.createElement("img",{src:u.a,alt:"",className:o.a.decoration}),f.a.createElement("div",{className:o.a.answer},y()),f.a.createElement("div",{className:o.a.parse},f.a.createElement("div",{className:o.a.parseText},"\u89E3\u6790\uFF1A"),f.a.createElement("div",{className:o.a.parseAnswer},g.analysis?f.a.createElement(b.a,{className:o.a.parseAnswerHtml,value:g.analysis}):"\u6682\u65E0\u89E3\u6790")))))},A=function(R){var O,g,_,d,c,C,E,w,B,W,T,k,m,y,H,Q,te=R.isProblemset,ae=R.data,Te=R.user,_e=R.activeTabsKey,ge=R.onPublicReview,ve=ge===void 0?function(){}:ge,Oe=R.onStartExperience,he=Oe===void 0?function(){}:Oe,V=R.onSetPrivate,P=V===void 0?function(){}:V,j=R.onCorrection,$=j===void 0?function(){}:j,J=R.onCollect,X=J===void 0?function(){}:J,ye=R.onSetPublic,Re=ye===void 0?function(){}:ye,Ke=R.onDelete,pe=Ke===void 0?function(){}:Ke,we=R.onCancel,ke=we===void 0?function(){}:we,Ue=R.onSelect,Qe=Ue===void 0?function(){}:Ue,nt=R.onMoveTo,ot=nt===void 0?function(){}:nt,qe=R.onSetShare,ft=qe===void 0?function(){}:qe,lt=R.onCancelShare,pt=lt===void 0?function(){}:lt,Ye=R.onPublish,Tt=Ye===void 0?function(){}:Ye,bt=R.onCancelPublish,me=bt===void 0?function(){}:bt,ne=ae.item_type==="PROGRAM"?"/problems/".concat((O=ae.program_attr)===null||O===void 0?void 0:O.identifier,"/edit"):"/problemset/edit/".concat(ae.id),q=_e==="0"&&!ae.public&&!ae.apply&&(ae.item_type==="PROGRAM"&&((g=ae.program_attr)===null||g===void 0?void 0:g.status)!==0||ae.item_type!=="PROGRAM"),se=f.a.createElement(z.a,{forceSubMenuRender:!0,className:o.a.menu},_e==="0"&&!ae.public&&f.a.createElement(z.a.Item,{key:"-1"},f.a.createElement("a",{className:o.a.actionLink,target:"_blank",href:ne},"\u7F16\u8F91")),(_e==="0"||_e==="3")&&ae.item_type==="PROGRAM"&&((_=ae.program_attr)===null||_===void 0?void 0:_.status)!==0&&!ae.public&&((d=ae.author)===null||d===void 0?void 0:d.login)===((c=Te.userInfo)===null||c===void 0?void 0:c.login)&&f.a.createElement(z.a.Item,{key:"0"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){var be;return me(ae==null||((be=ae.program_attr)===null||be===void 0)?void 0:be.identifier)}},"\u64A4\u9500\u53D1\u5E03")),_e==="0"&&f.a.createElement(z.a.Item,{key:"1"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return ot(ae.id)}},"\u79FB\u52A8\u5230")),_e==="0"&&!(ae!=null&&ae.is_share)&&f.a.createElement(z.a.Item,{key:"3"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return ft(ae.id)}},"\u5171\u4EAB")),(_e==="0"&&(ae==null?void 0:ae.is_share)||_e==="3"&&((C=ae.author)===null||C===void 0?void 0:C.login)===((E=Te.userInfo)===null||E===void 0?void 0:E.login))&&f.a.createElement(z.a.Item,{key:"3"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return pt(ae.id)}},"\u64A4\u9500\u5171\u4EAB")),q&&f.a.createElement(z.a.Item,{key:"4"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return Re(ae.id)}},"\u516C\u5F00")),_e==="0"&&!ae.public&&ae.apply&&(ae.item_type==="PROGRAM"&&ae.program_attr.status!==0||ae.item_type!=="PROGRAM")&&f.a.createElement(z.a.Item,{key:"5"},f.a.createElement("a",{className:o.a.reviewFlag,onClick:ve},"\u5BA1\u6838\u4E2D")),(_e==="0"||_e==="1")&&ae.public&&((w=ae.author)===null||w===void 0?void 0:w.login)===((B=Te.userInfo)===null||B===void 0?void 0:B.login)&&f.a.createElement(z.a.Item,{key:"6"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return P(ae.id)}},"\u64A4\u9500\u516C\u5F00")),_e==="2"&&f.a.createElement(z.a.Item,{key:"7"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return X(ae.id,ae.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(_e==="0"||_e==="3")&&ae.item_type==="PROGRAM"&&((W=ae.program_attr)===null||W===void 0?void 0:W.status)===0&&!ae.public&&((T=ae.author)===null||T===void 0?void 0:T.login)===((k=Te.userInfo)===null||k===void 0?void 0:k.login)&&f.a.createElement(z.a.Item,{key:"8"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){var be;return Tt(ae==null||((be=ae.program_attr)===null||be===void 0)?void 0:be.identifier)}},"\u53D1\u5E03")),(_e==="1"||_e==="3")&&!Object(p.o)()&&!Object(p.m)()&&((m=ae.author)===null||m===void 0?void 0:m.login)!==((y=Te.userInfo)===null||y===void 0?void 0:y.login)&&f.a.createElement(z.a.Item,{key:"9"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return X(ae.id,ae.is_collected)}},ae.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),_e!=="0"&&!Object(p.o)()&&!Object(p.m)()&&f.a.createElement(z.a.Item,{key:"10"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return $(ae.id)}},"\u7EA0\u9519")),(_e==="0"&&!ae.public||_e==="1"&&Object(p.o)()&&((H=ae.author)===null||H===void 0?void 0:H.login)!==((Q=Te.userInfo)===null||Q===void 0?void 0:Q.login))&&f.a.createElement(z.a.Item,{key:"11"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return pe(ae.id)}},"\u5220\u9664"))),ue=f.a.createElement(z.a,{forceSubMenuRender:!0,className:o.a.menu},f.a.createElement(z.a.Item,{key:"10"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return $(ae.id)}},"\u7EA0\u9519"))),oe=_e!=="0"&&!Object(p.o)()&&!Object(p.m)();return f.a.createElement(f.a.Fragment,null,te?f.a.createElement(f.a.Fragment,null,ae.item_type!=="SUBJECTIVE"&&ae.item_type!=="COMBINATION"&&f.a.createElement("span",{className:o.a.textBtn,style:{cursor:"pointer"},onClick:function(){return he(ae)}},"\u4F53\u9A8C"),f.a.createElement(Y.a,{overlay:se},f.a.createElement("span",{style:{cursor:"default"},onClick:function(be){return be.preventDefault()}},f.a.createElement("span",{className:o.a.textBtn},"\u66F4\u591A")))):oe?f.a.createElement(Y.a,{className:"ml40",overlay:ue},f.a.createElement("span",{style:{cursor:"default"},onClick:function(be){return be.preventDefault()}},f.a.createElement("span",null,"\u66F4\u591A"))):f.a.createElement("span",null))};Ee.b=D},ELLl:function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(o,p,l){l&&l!=ie.Init&&(o.removeKeyMap(I),o.state.closeBrackets=null),p&&(M(z(p,"pairs")),o.state.closeBrackets=p,o.addKeyMap(I))});function z(o,p){return p=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[p]!=null?o[p]:Y[p]}var I={Backspace:n,Enter:L};function M(o){for(var p=0;p<o.length;p++){var l=o.charAt(p),u="'"+l+"'";I[u]||(I[u]=G(l))}}M(Y.pairs+"`");function G(o){return function(p){return f(p,o)}}function K(o){var p=o.state.closeBrackets;if(!p||p.override)return p;var l=o.getModeAt(o.getCursor());return l.closeBrackets||p}function n(o){var p=K(o);if(!p||o.getOption("disableInput"))return ie.Pass;for(var l=z(p,"pairs"),u=o.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return ie.Pass;var i=b(o,u[s].head);if(!i||l.indexOf(i)%2!=0)return ie.Pass}for(var s=u.length-1;s>=0;s--){var D=u[s].head;o.replaceRange("",N(D.line,D.ch-1),N(D.line,D.ch+1),"+delete")}}function L(o){var p=K(o),l=p&&z(p,"explode");if(!l||o.getOption("disableInput"))return ie.Pass;for(var u=o.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return ie.Pass;var i=b(o,u[s].head);if(!i||l.indexOf(i)%2!=0)return ie.Pass}o.operation(function(){var D=o.lineSeparator()||`
`;o.replaceSelection(D+D,null),o.execCommand("goCharLeft"),u=o.listSelections();for(var A=0;A<u.length;A++){var S=u[A].head.line;o.indentLine(S,null,!0),o.indentLine(S+1,null,!0)}})}function x(o){var p=ie.cmpPos(o.anchor,o.head)>0;return{anchor:new N(o.anchor.line,o.anchor.ch+(p?-1:1)),head:new N(o.head.line,o.head.ch+(p?1:-1))}}function f(o,p){var l=K(o);if(!l||o.getOption("disableInput"))return ie.Pass;var u=z(l,"pairs"),s=u.indexOf(p);if(s==-1)return ie.Pass;for(var i=z(l,"closeBefore"),D=z(l,"triples"),A=u.charAt(s+1)==p,S=o.listSelections(),R=s%2==0,O,g=0;g<S.length;g++){var _=S[g],d=_.head,c,C=o.getRange(d,N(d.line,d.ch+1));if(R&&!_.empty())c="surround";else if((A||!R)&&C==p)A&&h(o,d)?c="both":D.indexOf(p)>=0&&o.getRange(d,N(d.line,d.ch+3))==p+p+p?c="skipThree":c="skip";else if(A&&d.ch>1&&D.indexOf(p)>=0&&o.getRange(N(d.line,d.ch-2),d)==p+p){if(d.ch>2&&/\bstring/.test(o.getTokenTypeAt(N(d.line,d.ch-2))))return ie.Pass;c="addFour"}else if(A){var E=d.ch==0?" ":o.getRange(N(d.line,d.ch-1),d);if(!ie.isWordChar(C)&&E!=p&&!ie.isWordChar(E))c="both";else return ie.Pass}else if(R&&(C.length===0||/\s/.test(C)||i.indexOf(C)>-1))c="both";else return ie.Pass;if(!O)O=c;else if(O!=c)return ie.Pass}var w=s%2?u.charAt(s-1):p,B=s%2?p:u.charAt(s+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var W=0;W<3;W++)o.execCommand("goCharRight");else if(O=="surround"){for(var T=o.getSelections(),W=0;W<T.length;W++)T[W]=w+T[W]+B;o.replaceSelections(T,"around"),T=o.listSelections().slice();for(var W=0;W<T.length;W++)T[W]=x(T[W]);o.setSelections(T)}else O=="both"?(o.replaceSelection(w+B,null),o.triggerElectric(w+B),o.execCommand("goCharLeft")):O=="addFour"&&(o.replaceSelection(w+w+w+w,"before"),o.execCommand("goCharRight"))})}function b(o,p){var l=o.getRange(N(p.line,p.ch-1),N(p.line,p.ch+1));return l.length==2?l:null}function h(o,p){var l=o.getTokenAt(N(p.line,p.ch+1));return/\bstring/.test(l.type)&&l.start==p.ch&&(p.ch==0||!/\bstring/.test(o.getTokenTypeAt(p)))}})},FOrL:function(it,Ee,U){it.exports=U.p+"static/nodata.a6b3f948.png"},FWmy:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return ie});function ie(Y,N){if(!Y)throw new Error(N?`Assertion failed (${N})`:"Assertion Failed")}},HmJG:function(it,Ee,U){},IPdS:function(it,Ee,U){it.exports={drawerWrap:"drawerWrap___nRvfD",title:"title___e_1lX",problemset:"problemset___1u9oP",content:"content___1WwQ5",delete:"delete___3Q7nc",deleteIcon:"deleteIcon___ObOyh",previewWrap:"previewWrap___25lTY",preview:"preview___3uiyE"}},Is5a:function(it,Ee){it.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(it,Ee){it.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JUtD:function(it,Ee,U){"use strict";U.r(Ee);var ie=U("14J3"),Y=U("BMrR"),N=U("DjyN"),z=U("NUBc"),I=U("qVdP"),M=U("jsC+"),G=U("T2oS"),K=U("W9HT"),n=U("+L6B"),L=U("2/Rp"),x=U("sPJy"),f=U("bE4q"),b=U("5Dmo"),h=U("3S7+"),o=U("lUTK"),p=U("BvKs"),l=U("sRBo"),u=U("kaz8"),s=U("miYZ"),i=U("tsqr"),D=U("7Kak"),A=U("9yH6"),S=U("2qtc"),R=U("kLXV"),O=U("oBTY"),g=U("k1fw"),_=U("9og8"),d=U("tJVT"),c=U("PpiC"),C=U("5NDa"),E=U("5rEg"),w=U("Znn+"),B=U("ZTPi"),W=U("WmNS"),T=U.n(W),k=U("q1tI"),m=U.n(k),y=U("9kvl"),H=U("55Ip"),Q=U("iris"),te=U("jcZT"),ae=U("BdwD"),Te=U("iNYN"),_e=U.n(Te),ge=function(st){var Pt=st.problemset,xt=st.globalSetting,Dt=st.loading,Zt=st.dispatch,yn=Object(c.a)(st,["problemset","globalSetting","loading","dispatch"]);return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Pt.actionTabs.key==="Problemset-PublicReview",title:"\u63D0\u793A",okText:"\u77E5\u9053\u5566",cancelText:"",width:"442px",onOk:function(){Zt({type:"problemset/setActionTabs",payload:{}})},onCancel:function(){Zt({type:"problemset/setActionTabs",payload:{}})}},m.a.createElement("div",{className:_e.a.modalContent},"\u516C\u5F00\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u7684\u5BA1\u6838"),m.a.createElement("div",{className:_e.a.modalContent},"\u6211\u4EEC\u5C06\u57281-2\u4E2A\u5DE5\u4F5C\u65E5\u5185\u5B8C\u6210\u5BA1\u6838"))},ve=Object(y.a)(function(Vt){var st=Vt.problemset,Pt=Vt.loading,xt=Vt.globalSetting;return{problemset:st,globalSetting:xt,loading:Pt.effects}})(ge),Oe=U("xlxt"),he=U.n(Oe),V=U("P/tu"),P=U("wd/R"),j=U.n(P),$=function(st){var Pt=st.problemset,xt=st.dispatch,Dt=Object(k.useState)([]),Zt=Object(d.a)(Dt,2),yn=Zt[0],Tn=Zt[1],en=function(){xt({type:"problemset/setActionTabs",payload:{}})};Object(k.useEffect)(function(){if(Pt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898"){var tn,hn;Tn([(tn=Pt.actionTabs)===null||tn===void 0||((hn=tn.params)===null||hn===void 0)?void 0:hn.group_id])}},[Pt.actionTabs.key]);var xn=function(){if(yn.length===0){i.b.warn("\u8BF7\u9009\u62E9\u6587\u4EF6\u5939");return}console.log(yn[0],22),Fn({},"/api/item_banks/export.xlsx?group_id=".concat(yn[0]),function(hn,ar){var Wn;if(((Wn=hn.target.response)===null||Wn===void 0?void 0:Wn.type)==="application/json"){var Bt=new FileReader;Bt.readAsText(hn.target.response,"utf-8"),Bt.addEventListener("loadend",function(){var sn=JSON.parse(Bt.result);i.b.warn((sn==null?void 0:sn.message)||"\u4E0B\u8F7D\u51FA\u9519, \u8BF7\u8054\u7CFB\u7BA1\u7406\u5458")});return}var _n=new Blob([hn.target.response],{type:"application/vnd.ms-excel;charset=utf-8"}),ir="item_bank_template_".concat(j()().format("YYYY-MM-DD HH:mm:ss"),".xlsx");if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(_n,ir);else{var kn=URL.createObjectURL(_n),Xt=document.createElement("a");Xt.href=kn,Xt.setAttribute("download",ir),document.body.appendChild(Xt),Xt.click(),window.URL.revokeObjectURL(Xt.href)}en()})},Fn=function(hn,ar,Wn,Bt){var _n=ar,ir=new window.XMLHttpRequest;return ir.withCredentials=!0,ir.addEventListener("load",function(kn){Wn(kn,ir)},!1),ir.addEventListener("error",function(kn){Bt&&Bt(kn)},!1),ir.responseType="blob",ir.open("GET",_n),ir.send(null),ir};return m.a.createElement(R.a,{centered:!0,title:"\u5BFC\u51FA\u8BD5\u9898",visible:Pt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898",width:718,destroyOnClose:!0,wrapClassName:he.a.customModal,onCancel:en,onOk:xn},m.a.createElement("aside",{className:he.a.exportModal},m.a.createElement(V.a,{value:yn,onChange:function(hn){return Tn(hn)}})))},J=Object(y.a)(function(Vt){var st=Vt.problemset;return{problemset:st}})($),X=U("i8i3"),ye=U.n(X),Re=U("WCUW"),Ke=U("Ty5D"),pe=function(st){var Pt,xt,Dt=st.problemset,Zt=st.dispatch,yn=st.onOk,Tn=Object(Ke.i)(),en=Object(k.useState)([]),xn=Object(d.a)(en,2),Fn=xn[0],tn=xn[1],hn=Object(k.useState)(1),ar=Object(d.a)(hn,2),Wn=ar[0],Bt=ar[1],_n=Object(k.useState)([]),ir=Object(d.a)(_n,2),kn=ir[0],Xt=ir[1],sn=Object(k.useState)([]),Sn=Object(d.a)(sn,2),Nt=Sn[0],Ut=Sn[1],jt=Object(k.useState)(!0),je=Object(d.a)(jt,2),Yt=je[0],fn=je[1],fr=Object(k.useState)(!1),pn=Object(d.a)(fr,2),Yr=pn[0],$r=pn[1],kr=Object(k.useState)(!1),An=Object(d.a)(kr,2),St=An[0],pr=An[1];Object(k.useEffect)(function(){if(Dt.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898"){var Ft,It;tr(),Xt([(Ft=Dt.actionTabs)===null||Ft===void 0||((It=Ft.params)===null||It===void 0)?void 0:It.group_id])}},[Dt.actionTabs.key]);var tr=function(){var Ft=Object(_.a)(T.a.mark(function It(){var Jt,Mn,wn;return T.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return fn(!0),sr.next=3,Object(Re.y)({type:0,page:1,per_page:10,order_by:"new"});case 3:Jt=sr.sent,Jt!=null&&Jt.item_banks_group&&(Mn={id:-1,item_banks_count:(Jt==null?void 0:Jt.no_group_count)||0,name:{name:"\u672A\u52A0\u5165\u5206\u7EC4"}},wn=[Mn].concat((Jt==null?void 0:Jt.item_banks_group)||[]),tn(wn)),fn(!1);case 6:case"end":return sr.stop()}},It)}));return function(){return Ft.apply(this,arguments)}}(),Hn=function(){Zt({type:"problemset/setActionTabs",payload:{}})},Qr=function(){var Ft=Object(_.a)(T.a.mark(function It(){var Jt;return T.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(!(kn.length===0)){wn.next=3;break}return i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u7684\u6587\u4EF6\u5939"),wn.abrupt("return");case 3:if(!(Wn===1)){wn.next=6;break}return Bt(2),wn.abrupt("return");case 6:return $r(!0),wn.next=9,Object(Re.l)({item_banks_group_ids:kn,clazz:"ItemBank",group_ids:Nt});case 9:Jt=wn.sent,(Jt==null?void 0:Jt.status)===0&&(yn(),Hn()),$r(!1);case 12:case"end":return wn.stop()}},It)}));return function(){return Ft.apply(this,arguments)}}(),Lt=function(It){Xt(It),pr(It.length===Fn.length)};return m.a.createElement(R.a,{centered:!0,afterClose:function(){Ut([]),Bt(1),pr(!1),tn([])},title:"\u5171\u4EAB\u8BD5\u9898".concat(Wn,"/2"),visible:Dt.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898",footer:null,width:718,destroyOnClose:!0,wrapClassName:ye.a.customModal,onCancel:Hn},m.a.createElement("aside",{className:ye.a.shareModal},m.a.createElement(K.a,{spinning:Yt},m.a.createElement("div",{className:ye.a.content},Wn===1&&m.a.createElement("div",{className:ye.a.group},m.a.createElement(V.a,{value:kn,onChange:function(It){return Xt(It)}})),Wn===2&&m.a.createElement("div",{className:ye.a.teachGroup},m.a.createElement("p",null,"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),m.a.createElement(u.a.Group,{value:Nt,onChange:function(It){return Ut(It)}},Dt==null||((Pt=Dt.teachGroupData)===null||Pt===void 0||((xt=Pt.groups)===null||xt===void 0))?void 0:xt.map(function(Ft){return m.a.createElement(u.a,{key:Ft.group_id,value:Ft.group_id},Ft==null?void 0:Ft.name)})))),m.a.createElement("div",{className:ye.a.footer},m.a.createElement(L.a,{onClick:Hn},"\u53D6\u6D88"),m.a.createElement(L.a,{loading:Yr,onClick:Qr,type:"primary"},Wn===1?"\u4E0B\u4E00\u6B65":"\u786E\u8BA4\u5171\u4EAB")))))},we=Object(y.a)(function(Vt){var st=Vt.problemset;return{problemset:st}})(pe),ke=function(st){var Pt=st.problemset,xt=st.globalSetting,Dt=st.loading,Zt=st.dispatch,yn=st.onReloadData,Tn=yn===void 0?function(){}:yn,en=Object(c.a)(st,["problemset","globalSetting","loading","dispatch","onReloadData"]),xn=Object(k.useRef)(!1),Fn=Object(k.useState)(!1),tn=Object(d.a)(Fn,2),hn=tn[0],ar=tn[1];Object(k.useEffect)(function(){Pt.actionTabs.key==="Problemset-SetPrivate"?window.localStorage.getItem("problemset-set-private-hint-flag")==="1"?Wn():ar(!0):ar(!1)},[Pt.actionTabs.key]);var Wn=function(){var Bt=Object(_.a)(T.a.mark(function _n(){var ir;return T.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return xn.current&&window.localStorage.setItem("problemset-set-private-hint-flag","1"),Xt.next=3,Zt({type:"problemset/setPrivate",payload:Pt.actionTabs.params});case 3:ir=Xt.sent,Zt({type:"problemset/setActionTabs",payload:{}}),xn.current=!1,ir.status===0&&Tn();case 7:case"end":return Xt.stop()}},_n)}));return function(){return Bt.apply(this,arguments)}}();return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:hn,title:"\u64A4\u9500\u516C\u5F00\u544A\u77E5",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Dt["problemset/setPrivate"],width:"442px",onOk:Wn,onCancel:function(){Zt({type:"problemset/setActionTabs",payload:{}}),xn.current=!1}},m.a.createElement("div",{className:_e.a.modalContentLeft},"\u672C\u9898\u5DF2\u516C\u5F00\uFF0C\u64A4\u9500\u516C\u5F00\u53EF\u80FD\u5BFC\u81F4\u90E8\u5206\u7528\u6237\u5BF9\u672C\u9898\u7684\u4F7F\u7528\u53D7\u635F\u3002"),m.a.createElement("div",{className:_e.a.modalContentLeft},"\u786E\u8BA4\u64A4\u9500\u516C\u5F00\u56DE\u5230\u81EA\u6709\u72B6\u6001\u5417\uFF1F"),m.a.createElement("div",null,m.a.createElement(u.a,{className:"mt10",defaultChecked:!1,onChange:function(_n){return xn.current=_n.target.checked}},"\u4E0D\u518D\u63D0\u793A")))},Ue=Object(y.a)(function(Vt){var st=Vt.problemset,Pt=Vt.loading,xt=Vt.globalSetting;return{problemset:st,globalSetting:xt,loading:Pt.effects}})(ke),Qe=function(st){var Pt=st.problemset,xt=st.globalSetting,Dt=st.loading,Zt=st.dispatch,yn=st.onReloadData,Tn=yn===void 0?function(){}:yn,en=Object(c.a)(st,["problemset","globalSetting","loading","dispatch","onReloadData"]),xn=function(){var Fn=Object(_.a)(T.a.mark(function tn(){var hn;return T.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:return Wn.next=2,Zt({type:"problemset/handleDelete",payload:Pt.actionTabs.params});case 2:hn=Wn.sent,Zt({type:"problemset/setActionTabs",payload:{}}),hn.status===0&&Tn();case 5:case"end":return Wn.stop()}},tn)}));return function(){return Fn.apply(this,arguments)}}();return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Pt.actionTabs.key==="Problemset-Delete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Dt["problemset/handleDelete"],width:"442px",onOk:xn,onCancel:function(){Zt({type:"problemset/setActionTabs",payload:{}})}},m.a.createElement("div",{className:_e.a.modalContent},"\u786E\u8BA4\u5220\u9664\u540E\uFF0C\u65E0\u6CD5\u64A4\u9500"),m.a.createElement("div",{className:_e.a.modalContent},"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"))},nt=Object(y.a)(function(Vt){var st=Vt.problemset,Pt=Vt.loading,xt=Vt.globalSetting;return{problemset:st,globalSetting:xt,loading:Pt.effects}})(Qe),ot=U("LvDl"),qe=U("9Bee"),ft=function(st){var Pt,xt=st.problemset,Dt=st.dispatch,Zt=Object(k.useState)({}),yn=Object(d.a)(Zt,2),Tn=yn[0],en=yn[1],xn=Object(k.useState)([]),Fn=Object(d.a)(xn,2),tn=Fn[0],hn=Fn[1],ar=Object(k.useState)(!1),Wn=Object(d.a)(ar,2),Bt=Wn[0],_n=Wn[1],ir=["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"];Object(k.useEffect)(function(){var Sn;if((xt==null||((Sn=xt.actionTabs)===null||Sn===void 0)?void 0:Sn.key)==="SINGLE"){var Nt,Ut=Object(ot.cloneDeep)(xt==null||((Nt=xt.actionTabs)===null||Nt===void 0)?void 0:Nt.params);en(Ut),hn(Ut.choices)}},[xt==null||((Pt=xt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var kn=function(){var Sn=Object(_.a)(T.a.mark(function Nt(){var Ut,jt;return T.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(tn.some(function(fn){return fn==null?void 0:fn.checked})){Yt.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Yt.abrupt("return");case 3:Bt&&(jt=Object(ot.cloneDeep)(xt==null||((Ut=xt.actionTabs)===null||Ut===void 0)?void 0:Ut.params),hn(jt.choices)),_n(!Bt);case 5:case"end":return Yt.stop()}},Nt)}));return function(){return Sn.apply(this,arguments)}}(),Xt=function(Nt,Ut){console.log(Nt.target.checked);var jt=tn.map(function(je,Yt){return Object(g.a)(Object(g.a)({},je),{},{checked:Yt===Ut?Nt.target.checked:!1})});hn(jt)},sn=function(){en({}),hn([]),_n(!1),Dt({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:xt.actionTabs.key==="SINGLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:Bt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:kn,onCancel:sn},m.a.createElement("div",null,m.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),m.a.createElement(qe.a,{value:Tn==null?void 0:Tn.name}),tn==null?void 0:tn.map(function(Sn,Nt){var Ut=Sn.is_answer,jt=Sn.checked,je=Sn.choice_text,Yt="";return Bt&&Ut&&(Yt=_e.a.green),Bt&&!Ut&&jt&&(Yt=_e.a.red),m.a.createElement("div",{key:Nt,style:{pointerEvents:Bt?"none":"auto"},className:"".concat(_e.a.row," ").concat(Yt)},m.a.createElement(A.a,{onChange:function(fr){return Xt(fr,Nt)},checked:jt}),m.a.createElement("span",null,ir[Nt],".\xA0"),m.a.createElement(qe.a,{className:_e.a.html,value:je}),Bt&&Ut&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Bt&&!Ut&&jt&&m.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),Bt&&m.a.createElement(k.Fragment,null,m.a.createElement("div",{className:_e.a.line}),m.a.createElement("div",{className:"c-grey-333 mb5"},m.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),ir[tn.findIndex(function(Sn){return Sn.is_answer})]),m.a.createElement("div",{className:"c-grey-333 mb10"},m.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Tn==null?void 0:Tn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},lt=Object(y.a)(function(Vt){var st=Vt.problemset;return{problemset:st}})(ft),pt=function(st){var Pt,xt=st.problemset,Dt=st.dispatch,Zt=Object(k.useState)({}),yn=Object(d.a)(Zt,2),Tn=yn[0],en=yn[1],xn=Object(k.useState)([]),Fn=Object(d.a)(xn,2),tn=Fn[0],hn=Fn[1],ar=Object(k.useState)(!1),Wn=Object(d.a)(ar,2),Bt=Wn[0],_n=Wn[1],ir=["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"];Object(k.useEffect)(function(){var Nt;if((xt==null||((Nt=xt.actionTabs)===null||Nt===void 0)?void 0:Nt.key)==="MULTIPLE"){var Ut,jt=Object(ot.cloneDeep)(xt==null||((Ut=xt.actionTabs)===null||Ut===void 0)?void 0:Ut.params);en(jt),hn(jt.choices)}},[xt==null||((Pt=xt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var kn=function(){var Nt=Object(_.a)(T.a.mark(function Ut(){var jt,je;return T.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:if(tn.some(function(fr){return fr==null?void 0:fr.checked})){fn.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),fn.abrupt("return");case 3:Bt&&(je=Object(ot.cloneDeep)(xt==null||((jt=xt.actionTabs)===null||jt===void 0)?void 0:jt.params),hn(je.choices)),_n(!Bt);case 5:case"end":return fn.stop()}},Ut)}));return function(){return Nt.apply(this,arguments)}}(),Xt=function(Ut,jt){console.log(Ut.target.checked);var je=tn.map(function(Yt,fn){return Object(g.a)(Object(g.a)({},Yt),{},{checked:fn===jt?Ut.target.checked:Yt.checked})});hn(je)},sn=function(){en({}),hn([]),_n(!1),Dt({type:"problemset/setActionTabs",payload:{}})},Sn=function(){var Ut="";return tn.forEach(function(jt,je){jt.is_answer&&(Ut=Ut+ir[je])}),Ut};return m.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:xt.actionTabs.key==="MULTIPLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:Bt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:kn,onCancel:sn},m.a.createElement("div",null,m.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),m.a.createElement(qe.a,{value:Tn==null?void 0:Tn.name}),tn==null?void 0:tn.map(function(Nt,Ut){var jt=Nt.is_answer,je=Nt.checked,Yt=Nt.choice_text,fn="";return Bt&&jt&&(fn=_e.a.green),Bt&&!jt&&je&&(fn=_e.a.red),m.a.createElement("div",{key:Ut,style:{pointerEvents:Bt?"none":"auto"},className:"".concat(_e.a.row," ").concat(fn)},m.a.createElement(u.a,{style:{padding:3},onChange:function(pn){return Xt(pn,Ut)},checked:je}),m.a.createElement("span",null,ir[Ut],".\xA0"),m.a.createElement(qe.a,{className:_e.a.html,value:Yt}),Bt&&jt&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),Bt&&!jt&&je&&m.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),Bt&&m.a.createElement(k.Fragment,null,m.a.createElement("div",{className:_e.a.line}),m.a.createElement("div",{className:"c-grey-333 mb5"},m.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),Sn()),m.a.createElement("div",{className:"c-grey-333 mb10"},m.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Tn==null?void 0:Tn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Ye=Object(y.a)(function(Vt){var st=Vt.problemset;return{problemset:st}})(pt),Tt=function(st){var Pt,xt,Dt=st.problemset,Zt=st.dispatch,yn=Object(k.useState)({}),Tn=Object(d.a)(yn,2),en=Tn[0],xn=Tn[1],Fn=Object(k.useState)([]),tn=Object(d.a)(Fn,2),hn=tn[0],ar=tn[1],Wn=Object(k.useState)(!1),Bt=Object(d.a)(Wn,2),_n=Bt[0],ir=Bt[1],kn=["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"];Object(k.useEffect)(function(){var Nt;if((Dt==null||((Nt=Dt.actionTabs)===null||Nt===void 0)?void 0:Nt.key)==="JUDGMENT"){var Ut,jt=Object(ot.cloneDeep)(Dt==null||((Ut=Dt.actionTabs)===null||Ut===void 0)?void 0:Ut.params);xn(jt),ar(jt.choices)}},[Dt==null||((Pt=Dt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var Xt=function(){var Nt=Object(_.a)(T.a.mark(function Ut(){var jt,je;return T.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:if(hn.some(function(fr){return fr==null?void 0:fr.checked})){fn.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),fn.abrupt("return");case 3:_n&&(je=Object(ot.cloneDeep)(Dt==null||((jt=Dt.actionTabs)===null||jt===void 0)?void 0:jt.params),ar(je.choices)),ir(!_n);case 5:case"end":return fn.stop()}},Ut)}));return function(){return Nt.apply(this,arguments)}}(),sn=function(Ut,jt){console.log(Ut.target.checked);var je=hn.map(function(Yt,fn){return Object(g.a)(Object(g.a)({},Yt),{},{checked:fn===jt?Ut.target.checked:!1})});ar(je)},Sn=function(){xn({}),ar([]),ir(!1),Zt({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Dt.actionTabs.key==="JUDGMENT",title:"\u8BD5\u9898\u4F53\u9A8C",okText:_n?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Xt,onCancel:Sn},m.a.createElement("div",null,m.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),m.a.createElement(qe.a,{value:en==null?void 0:en.name}),hn==null?void 0:hn.map(function(Nt,Ut){var jt=Nt.is_answer,je=Nt.checked,Yt=Nt.choice_text,fn="";return _n&&jt&&(fn=_e.a.green),_n&&!jt&&je&&(fn=_e.a.red),m.a.createElement("div",{key:Ut,style:{pointerEvents:_n?"none":"auto"},className:"".concat(_e.a.row," ").concat(fn)},m.a.createElement(A.a,{onChange:function(pn){return sn(pn,Ut)},checked:je}),m.a.createElement(qe.a,{className:_e.a.html,value:Yt}),_n&&jt&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),_n&&!jt&&je&&m.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),_n&&m.a.createElement(k.Fragment,null,m.a.createElement("div",{className:_e.a.line}),m.a.createElement("div",{className:"c-grey-333 mb5"},m.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(xt=hn.find(function(Nt){return Nt.is_answer}))===null||xt===void 0?void 0:xt.choice_text),m.a.createElement("div",{className:"c-grey-333 mb10"},m.a.createElement("b",null,"\u89E3\u6790:\xA0"),(en==null?void 0:en.analysis)||"\u6682\u65E0\u89E3\u6790"))))},bt=Object(y.a)(function(Vt){var st=Vt.problemset;return{problemset:st}})(Tt),me=function(st){var Pt,xt,Dt=st.problemset,Zt=st.dispatch,yn=Object(k.useState)({}),Tn=Object(d.a)(yn,2),en=Tn[0],xn=Tn[1],Fn=Object(k.useState)([]),tn=Object(d.a)(Fn,2),hn=tn[0],ar=tn[1],Wn=Object(k.useState)(!1),Bt=Object(d.a)(Wn,2),_n=Bt[0],ir=Bt[1],kn=["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"];Object(k.useEffect)(function(){var Nt;if((Dt==null||((Nt=Dt.actionTabs)===null||Nt===void 0)?void 0:Nt.key)==="COMPLETION"){var Ut,jt,je=Object(ot.cloneDeep)(Dt==null||((Ut=Dt.actionTabs)===null||Ut===void 0)?void 0:Ut.params);xn(je),ar(je==null||((jt=je.standard_answer)===null||jt===void 0)?void 0:jt.map(function(Yt){return{value:"",answer:(Yt==null?void 0:Yt.answer_text)||[]}}))}},[Dt==null||((Pt=Dt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var Xt=function(){var Nt=Object(_.a)(T.a.mark(function Ut(){var jt,je,Yt;return T.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:if(!hn.some(function(pn){return(pn==null?void 0:pn.value)===""})){fr.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),fr.abrupt("return");case 3:_n&&(Yt=Object(ot.cloneDeep)(Dt==null||((jt=Dt.actionTabs)===null||jt===void 0)?void 0:jt.params),ar(Yt==null||((je=Yt.standard_answer)===null||je===void 0)?void 0:je.map(function(pn){return{value:"",answer:(pn==null?void 0:pn.answer_text)||[]}}))),ir(!_n);case 5:case"end":return fr.stop()}},Ut)}));return function(){return Nt.apply(this,arguments)}}(),sn=function(Ut,jt){var je=hn.map(function(Yt,fn){return Object(g.a)(Object(g.a)({},Yt),{},{value:fn===jt?Ut.target.value:Yt.value})});ar(je)},Sn=function(){xn({}),ar([]),ir(!1),Zt({type:"problemset/setActionTabs",payload:{}})};return m.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Dt.actionTabs.key==="COMPLETION",title:"\u8BD5\u9898\u4F53\u9A8C",okText:_n?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Xt,onCancel:Sn},m.a.createElement("div",null,m.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u586B\u7A7A\u9898"),m.a.createElement(qe.a,{value:en==null?void 0:en.name}),hn==null?void 0:hn.map(function(Nt,Ut){var jt=Nt.value,je=Nt.answer,Yt="";return _n&&je!==null&&je!==void 0&&je.includes(jt)&&(Yt=_e.a.green),_n&&!(je!=null&&je.includes(jt))&&(Yt=_e.a.red),m.a.createElement("div",{key:Ut,style:{pointerEvents:_n?"none":"auto",marginTop:10},className:"".concat(_e.a.row," ").concat(Yt)},m.a.createElement("div",{style:{minWidth:80}},"\u586B\u7A7A",Ut+1,"\u7B54\u6848:"),m.a.createElement(E.a.TextArea,{className:_e.a.textArea,style:{width:610,marginRight:10},onChange:function(fr){return sn(fr,Ut)},value:jt}),_n&&(je==null?void 0:je.includes(jt))&&m.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),_n&&!(je!=null&&je.includes(jt))&&m.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),_n&&m.a.createElement(k.Fragment,null,m.a.createElement("div",{className:_e.a.line}),en==null||((xt=en.standard_answer)===null||xt===void 0)?void 0:xt.map(function(Nt,Ut){var jt;return m.a.createElement("div",{className:"c-grey-333 mb5"},m.a.createElement("b",null,"\u586B\u7A7A",Ut+1,"\u7B54\u6848:\xA0"),(Nt==null||((jt=Nt.answer_text)===null||jt===void 0)?void 0:jt.join("\u3001"))||"")}),m.a.createElement("div",{className:"c-grey-333 mb10"},m.a.createElement("b",null,"\u89E3\u6790:\xA0"),(en==null?void 0:en.analysis)||"\u6682\u65E0\u89E3\u6790"))))},ne=Object(y.a)(function(Vt){var st=Vt.problemset;return{problemset:st}})(me),q=U("SAoR"),se=U("tK3L"),ue=U.n(se),oe=U("bbsP"),ce=U("/wGt"),be=U("IPdS"),Se=U.n(be),Pe=[],We=function(st){Pe.forEach(function(Pt){if(st.target===Pt.element||et.isParent(st.target,Pt.element))return;Pt.callbacks.forEach(function(xt){return xt()})})};window.document.body?window.document.body.addEventListener("click",We):window.addEventListener("DOMContentLoaded",function(){window.document.body.addEventListener("click",We)});var et={isParent:function(st,Pt){for(var xt=st;xt&&xt.tagName&&xt.tagName.toLowerCase()!=="body";){if(xt===Pt)return!0;xt=xt.parentNode}return!1},init:function(st,Pt){var xt=Pe.filter(function(Dt){return Dt.element===st});return xt.length>0?xt[0].callbacks.push(Pt):Pe.push({element:st,callbacks:[Pt]}),{clear:function(){Pe=Pe.filter(function(Zt){return Zt.element!==st})}}}},yt=et,Rt=[{stateName:"single_questions_count",type:"SINGLE",typeName:"\u5355\u9009\u9898"},{stateName:"multiple_questions_count",type:"MULTIPLE",typeName:"\u591A\u9009\u9898"},{stateName:"judgement_questions_count",type:"JUDGMENT",typeName:"\u5224\u65AD\u9898"},{stateName:"completion_questions_count",type:"COMPLETION",typeName:"\u586B\u7A7A\u9898"},{stateName:"subjective_questions_count",type:"SUBJECTIVE",typeName:"\u7B80\u7B54\u9898"},{stateName:"program_questions_count",type:"PROGRAM",typeName:"\u7F16\u7A0B\u9898"},{stateName:"practical_questions_count",type:"PRACTICAL",typeName:"\u5B9E\u8BAD\u9898"},{stateName:"combination_questions_count",type:"COMBINATION",typeName:"\u7EC4\u5408\u9898"}],kt=function(st){var Pt=st.visible,xt=st.basketData,Dt=st.basketTotal,Zt=st.onClose,yn=Zt===void 0?function(){}:Zt,Tn=st.onDelete,en=Tn===void 0?function(){}:Tn,xn=Object(k.useRef)(),Fn=Object(k.useRef)();return Object(k.useEffect)(function(){return Fn.current?(Dt>=0&&!xn.current&&(xn.current=yt.init(Fn.current,function(){yn()})),function(){xn.current&&xn.current.clear()}):void 0},[Fn.current]),m.a.createElement(ce.a,{className:Se.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:Pt,forceRender:!0,onClose:yn},Dt>0?m.a.createElement("div",{style:{height:"100%"},ref:Fn},m.a.createElement("div",{className:Se.a.title},"\u8BD5\u9898\u7BEE"),Rt.map(function(tn){return xt[tn.stateName]>0&&m.a.createElement("div",{className:Se.a.problemset,key:tn.type},m.a.createElement("div",{className:Se.a.content},tn.typeName,"(",xt[tn.stateName],")"),m.a.createElement("div",{className:Se.a.delete,onClick:function(){return en(tn.type)}},m.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(Se.a.deleteIcon)})))}),m.a.createElement("div",{className:Se.a.previewWrap},m.a.createElement("div",{className:Se.a.preview,onClick:function(){return y.d.push("/problemset/preview")}},"\u8BD5\u5377\u9884\u89C8"))):m.a.createElement("div",{ref:Fn},m.a.createElement(ae.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},mn={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PROGRAM:"\u7F16\u7A0B\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",COMBINATION:"\u7EC4\u5408\u9898"},zt=function(st){var Pt,xt,Dt=st.problemset,Zt=st.globalSetting,yn=st.loading,Tn=st.dispatch,en=st.onReloadData,xn=en===void 0?function(){}:en,Fn=st.onReloadBasketData,tn=Fn===void 0?function(){}:Fn,hn=Object(c.a)(st,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),ar=function(){var Wn=Object(_.a)(T.a.mark(function Bt(){var _n;return T.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Tn({type:"problemset/basketDelete",payload:Dt.actionTabs.params});case 2:_n=kn.sent,Tn({type:"problemset/setActionTabs",payload:{}}),_n.status===0&&(xn(),tn());case 5:case"end":return kn.stop()}},Bt)}));return function(){return Wn.apply(this,arguments)}}();return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Dt.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:yn["problemset/handleDelete"],width:"442px",onOk:ar,onCancel:function(){Tn({type:"problemset/setActionTabs",payload:{}})}},m.a.createElement("div",{className:_e.a.modalContent},"\u662F\u5426\u5220\u9664\u8BD5\u9898\u7BEE\u4E2D",mn[(Pt=Dt.actionTabs)===null||Pt===void 0||((xt=Pt.params)===null||xt===void 0)?void 0:xt.type]))},Mt=Object(y.a)(function(Vt){var st=Vt.problemset,Pt=Vt.loading,xt=Vt.globalSetting;return{problemset:st,globalSetting:xt,loading:Pt.effects}})(zt),Qn=U("A60/"),un=U.n(Qn),hr=function(st){var Pt=st.count,xt=st.visibleBasket,Dt=st.onToggleVisible,Zt=Dt===void 0?function(){}:Dt;return m.a.createElement("div",{className:"".concat(xt?un.a.right180:un.a.right20," ").concat(un.a.wrap)},m.a.createElement(h.a,{title:"\u8BD5\u9898\u7BEE",placement:"left"},m.a.createElement("div",{className:un.a.basket,onClick:Zt},Pt>0&&m.a.createElement("div",{className:un.a.count},Pt),m.a.createElement("span",{className:un.a.iconWrap},m.a.createElement("i",{className:"".concat(un.a.icon," iconfont icon-shitilan")})),m.a.createElement("p",{className:un.a.name},"\u8BD5\u9898\u7BEE"))))},or=U("EJTS"),bn=U("LE3n"),xr=U("1vsH"),br=U("xKgJ"),Ar=U("/zsF"),Br=U("PArb"),Ht=U("jCWc"),an=U("kPKH"),Cn=U("y8nQ"),qn=U("Vl3Y"),Ir=U("nSDg"),gn=U.n(Ir),wt=U("HBuW"),Rn=U("NLgs"),jn=U("vkP9"),cn=E.a.Search,on={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},Dn={id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]},ei=function(st){var Pt,xt,Dt,Zt,yn=st.classroomList,Tn=st.loading,en=st.dispatch,xn=st.cb,Fn=st.shixunIds,tn=Fn===void 0?[]:Fn,hn=Object(Ke.i)(),ar=Object(Ke.h)(),Wn=yn.actionTabs,Bt=qn.a.useForm(),_n=Object(d.a)(Bt,1),ir=_n[0],kn=yn.shixunLists,Xt=Object(k.useState)([]),sn=Object(d.a)(Xt,2),Sn=sn[0],Nt=sn[1],Ut=Object(k.useState)([]),jt=Object(d.a)(Ut,2),je=jt[0],Yt=jt[1],fn=Object(k.useState)({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null}),fr=Object(d.a)(fn,2),pn=fr[0],Yr=fr[1];Object(k.useEffect)(function(){yn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&en({type:"classroomList/getShixunLists",payload:Object(g.a)({},pn)})},[yn.actionTabs.key]),Object(k.useEffect)(function(){return document.body.setAttribute("data-custom","height"),function(){document.body.removeAttribute("data-custom")}},[]),Object(k.useEffect)(function(){$r()},[hn]);var $r=function(){var St=Object(_.a)(T.a.mark(function pr(){var tr;return T.a.wrap(function(Qr){for(;;)switch(Qr.prev=Qr.next){case 0:return Qr.next=2,Object(wt.qb)({});case 2:tr=Qr.sent,Yt((tr==null?void 0:tr.disciplines)||[]);case 4:case"end":return Qr.stop()}},pr)}));return function(){return St.apply(this,arguments)}}(),kr=function(pr,tr,Hn){pn.tag_level=pr,pn.sub_discipline_id=tr,pn.discipline_id=Hn,Yr(Object(g.a)({},pn)),en({type:"classroomList/getShixunLists",payload:Object(g.a)({},pn)})},An=function(){en({type:"classroomList/setActionTabs",payload:{}}),Yr({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null})};return yn.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:m.a.createElement(ce.a,{placement:"bottom",height:"100%",closable:!0,onClose:An,visible:yn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:gn.a.drawer,footer:m.a.createElement("div",{className:"tc"},m.a.createElement(L.a,{size:"large",onClick:function(){An(),Nt([])},style:{marginRight:8}},"\u53D6\u6D88"),m.a.createElement(L.a,{size:"large",onClick:Object(_.a)(T.a.mark(function St(){var pr,tr,Hn;return T.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:pr=function(It){var Jt=Sn[It];if(tn.includes(Jt)){var Mn,wn;return i.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(kn==null||((Mn=kn.shixun_list)===null||Mn===void 0||((wn=Mn.find(function(Vn){return Vn.id===Jt}))===null||wn===void 0))?void 0:wn.title)),{v:void 0}}},tr=0;case 2:if(!(tr<(Sn==null?void 0:Sn.length))){Lt.next=9;break}if(Hn=pr(tr),!(typeof Hn=="object")){Lt.next=6;break}return Lt.abrupt("return",Hn.v);case 6:tr++,Lt.next=2;break;case 9:An(),xn(Sn),Nt([]);case 12:case"end":return Lt.stop()}},St)})),type:"primary"},"\u786E\u5B9A"))},m.a.createElement("section",{className:"tc"},m.a.createElement(jn.a,{onChange:function(pr){Yr(Object(g.a)(Object(g.a)(Object(g.a)({},pn),pr),{},{page:1})),en({type:"classroomList/getShixunLists",payload:Object(g.a)(Object(g.a)(Object(g.a)({},pn),pr),{},{page:1})})}})),m.a.createElement("section",{className:"edu-container"},m.a.createElement("ul",{className:gn.a.menu},m.a.createElement("li",null,on.name),on==null||((Pt=on.children)===null||Pt===void 0)?void 0:Pt.map(function(St,pr){return m.a.createElement("li",{className:pn[on.id]==St.id?gn.a.actived:"",key:St.id,onClick:function(){pn[on.id]=St.id,Yr(Object(g.a)({},pn)),en({type:"classroomList/getShixunLists",payload:Object(g.a)({},pn)})}},m.a.createElement("strong",null,St.name))})),m.a.createElement("ul",{className:gn.a.menuDirection},m.a.createElement("li",{className:gn.a.directionName},"\u65B9\u5411"),m.a.createElement("li",{className:pn.discipline_id?"":gn.a.actived,onClick:function(){kr(null,null,null)}},m.a.createElement("strong",null,"\u5168\u90E8")),je==null?void 0:je.map(function(St,pr){return m.a.createElement("li",{key:pr,className:pn.discipline_id==St.id?gn.a.actived:""},m.a.createElement("strong",{onClick:function(){kr(1,null,St.id)}},St.name),m.a.createElement("div",null,St.sub_disciplines.map(function(tr,Hn){return m.a.createElement("div",{key:Hn,className:"mt5"},m.a.createElement("div",{className:pn.sub_discipline_id==tr.id?"".concat(gn.a.actived2," ").concat(gn.a.subTag):gn.a.subTag,onClick:function(){kr(2,tr.id,St.id)}},tr.name),m.a.createElement("ul",{className:"mt5"},tr.tags&&tr.tags.map(function(Qr,Lt){return m.a.createElement("li",{key:Lt,className:pn.sub_discipline_id==Qr.id&&pn.tag_level===3?gn.a.actived2:"",onClick:function(){kr(3,Qr.id,St.id)}},Qr.name)})))})))})),m.a.createElement("ul",{className:gn.a.menu},m.a.createElement("li",null,Dn.name),Dn==null||((xt=Dn.children)===null||xt===void 0)?void 0:xt.map(function(St,pr){return m.a.createElement("li",{className:pn[Dn.id]==St.id?gn.a.actived:"",key:St.name,onClick:function(){pn[Dn.id]=St.id,Yr(Object(g.a)({},pn)),en({type:"classroomList/getShixunLists",payload:Object(g.a)({},pn)})}},m.a.createElement("strong",null,St.name))})),m.a.createElement(Y.a,null,m.a.createElement(an.a,{flex:"1"},m.a.createElement("div",{className:gn.a.menuCourse,style:{margin:"0px 15px"}},m.a.createElement("ul",null,m.a.createElement("li",null,"\u5DF2\u9009",m.a.createElement("span",{className:"c-blue"},Sn.length),"\u4E2A\u5B9E\u8BAD"),m.a.createElement("li",null,"\u5171",m.a.createElement("span",{className:"c-blue"},kn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),m.a.createElement("li",{className:"current",onClick:function(){var pr=Object(g.a)(Object(g.a)({},pn),{},{order:pn.order==="asc"?"desc":"asc"});Yr(pr),en({type:"classroomList/getShixunLists",payload:pr})}},"\u5B66\u4E60\u4EBA\u6570",m.a.createElement("p",{className:"edu-sorter current ".concat(pn.order)},pn.order==="asc"?m.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):m.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),m.a.createElement(an.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),kn==null||((Dt=kn.shixun_list)===null||Dt===void 0)?void 0:Dt.map(function(St,pr){return m.a.createElement("div",{className:gn.a.listItem,key:pr},m.a.createElement(u.a,{checked:Sn.includes(St.id),value:St.id,disabled:St==null?void 0:St.need_authorize,onChange:function(Hn){var Qr=Sn.indexOf(St.id);Sn.indexOf(St.id)>-1?Nt(Sn.filter(function(Lt){return Lt!==St.id})):Nt(Sn.concat(St.id))}}),m.a.createElement("div",{className:gn.a.info},m.a.createElement("div",{className:gn.a.title},m.a.createElement("div",{className:gn.a.titleLeft},m.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(St==null?void 0:St.identifier,"/challenges"),target:"_blank"},m.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:St.title}})),(St==null?void 0:St.need_authorize)&&m.a.createElement("span",{onClick:function(){Object(Rn.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(br.w)()&&(St==null?void 0:St.mark_status)===1&&m.a.createElement(h.a,{title:St==null?void 0:St.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(br.w)()&&(St==null?void 0:St.mark_status)===2&&m.a.createElement(h.a,{title:St==null?void 0:St.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(br.w)()&&(St==null?void 0:St.mark_status)===3&&m.a.createElement(h.a,{title:St==null?void 0:St.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),m.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},m.a.createElement("span",{className:gn.a.description,dangerouslySetInnerHTML:{__html:St.description}})),m.a.createElement("div",{className:" mt15"},St.challenge_names.map(function(tr,Hn){return m.a.createElement("span",{key:Hn,className:"mr30 font12"},"\u7B2C",Hn+1,"\u5173 ",tr," ")})),m.a.createElement(Br.a,{dashed:!0}),m.a.createElement("div",{className:"c-light-black mt20 font12"},m.a.createElement("span",null,St.author_name),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,St.author_school_name),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",St.level),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),m.a.createElement("span",null,St.study_count))))}),(kn==null||((Zt=kn.shixun_list)===null||Zt===void 0)?void 0:Zt.length)===0&&m.a.createElement(ae.a,null),m.a.createElement("p",null)),m.a.createElement("div",{className:"tc mt20"},m.a.createElement(z.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:10,showSizeChanger:!1,current:pn.page||1,showQuickJumper:!0,total:kn==null?void 0:kn.shixuns_count,onChange:function(pr){var tr=Object(g.a)(Object(g.a)({},pn),{},{page:pr});Yr(tr),en({type:"classroomList/getShixunLists",payload:tr})}})))},Tr=Object(y.a)(function(Vt){var st=Vt.classroomList,Pt=Vt.loading;return{classroomList:st,loading:Pt}})(ei),ct=U("mgmH"),Qt=U("ErOA"),ji=U("ORt/"),Xi=U.n(ji),ua=U("Ot1p"),Bi=function(st,Pt){var xt,Dt=st.data,Zt=qn.a.useForm(),yn=Object(d.a)(Zt,1),Tn=yn[0],en=Object(k.useState)({}),xn=Object(d.a)(en,2),Fn=xn[0],tn=xn[1];return Object(k.useEffect)(function(){Dt&&(tn(Dt),Tn.setFieldsValue(Object(g.a)({},Dt)))},[Dt]),Object(k.useImperativeHandle)(Pt,function(){return{form:Tn}}),m.a.createElement("div",{className:Xi.a.operating},m.a.createElement(qn.a,{form:Tn,scrollToFirstError:!0,onValuesChange:function(){tn(Object(g.a)({},Tn.getFieldsValue()))}},m.a.createElement(qn.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"},{max:30,message:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},m.a.createElement(E.a,{placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26",suffix:"".concat(((xt=Fn.name)===null||xt===void 0?void 0:xt.length)||0,"/30")})),m.a.createElement(qn.a.Item,{name:"languages",label:"\u7F16\u7A0B\u8BED\u8A00",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},m.a.createElement(u.a.Group,null,m.a.createElement(u.a,{value:"c"},"C"),m.a.createElement(u.a,{value:"c++"},"C++"),m.a.createElement(u.a,{value:"java"},"Java"),m.a.createElement(u.a,{value:"python"},"Python"))),m.a.createElement("div",{className:Xi.a.tip},"\u9009\u62E9\u652F\u6301\u4EE5\u4E0B\u7F16\u7A0B\u8BD5\u9898\u8FDB\u884C\u7F16\u8BD1\u7684\u8BED\u8A00"),m.a.createElement("div",{style:{margin:"20px 0 12px 0px"}},"\u8BF4\u660E"),m.a.createElement(qn.a.Item,{name:"description"},m.a.createElement(ua.a,{defaultValue:Fn.description||"",watch:!0}))))},ca=Object(k.forwardRef)(Bi),En=U("SVaM"),Ia=U("sesT"),_t=U.n(Ia),Fi=U("wNkr"),yi=U.n(Fi),ba=U("xTzM"),ea=U.n(ba),pi=B.a.TabPane,da=E.a.Search,Ea=E.a.TextArea,ur;(function(Vt){Vt.Mine="0",Vt.Public="1",Vt.Collection="2",Vt.TeachGroupShare="3"})(ur||(ur={}));var xa=function(st){var Pt,xt,Dt,Zt,yn,Tn,en,xn,Fn,tn,hn,ar,Wn=st.classroomList,Bt=st.problemset,_n=st.user,ir=st.globalSetting,kn=st.loading,Xt=st.dispatch,sn=st.match,Sn=st.shixunHomeworks,Nt=Object(c.a)(st,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Ut=Object(k.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:null,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((Pt=Nt.location)===null||Pt===void 0||((xt=Pt.query)===null||xt===void 0)?void 0:xt.id)||null,exam_id:(sn==null||((Dt=sn.params)===null||Dt===void 0)?void 0:Dt.id)||null,exercise_id:(sn==null||((Zt=sn.params)===null||Zt===void 0)?void 0:Zt.categoryId)||null}),jt=Object(d.a)(Ut,2),je=jt[0],Yt=jt[1],fn=Object(k.useState)(0),fr=Object(d.a)(fn,2),pn=fr[0],Yr=fr[1],$r=Object(k.useState)([]),kr=Object(d.a)($r,2),An=kr[0],St=kr[1],pr=Object(k.useState)(ur.Mine),tr=Object(d.a)(pr,2),Hn=tr[0],Qr=tr[1],Lt=Object(k.useState)(0),Ft=Object(d.a)(Lt,2),It=Ft[0],Jt=Ft[1],Mn=Object(k.useState)(-1),wn=Object(d.a)(Mn,2),Vn=wn[0],sr=wn[1],mi=Object(k.useState)([]),Gn=Object(d.a)(mi,2),Wi=Gn[0],lr=Gn[1],ii=Object(k.useState)(!1),Zr=Object(d.a)(ii,2),Ai=Zr[0],Pa=Zr[1],Lo=Object(k.useState)([]),ta=Object(d.a)(Lo,2),Mr=ta[0],lo=ta[1],uo=Object(k.useState)(0),ha=Object(d.a)(uo,2),fa=ha[0],$a=ha[1],co=Object(k.useState)(!1),ka=Object(d.a)(co,2),Ta=ka[0],ho=ka[1],fo=Object(k.useState)(!1),Ma=Object(d.a)(fo,2),po=Ma[0],Qa=Ma[1],pa=Object(k.useRef)(!1),Yi=Object(k.useRef)(""),ma=Object(k.useRef)(),Ae=Object(k.useRef)(),Me=Object(k.useRef)(),He=Object(k.useState)(),De=Object(d.a)(He,2),le=De[0],xe=De[1],fe=Object(k.useState)([]),Le=Object(d.a)(fe,2),Ce=Le[0],Fe=Le[1],Be=Object(k.useRef)(!1),Ge=(sn==null?void 0:sn.url)==="/problemset",Ze=sn==null||((yn=sn.url)===null||yn===void 0)?void 0:yn.includes("program_homework"),ut=Ze&&sn!==null&&sn!==void 0&&(Tn=sn.params)!==null&&Tn!==void 0&&Tn.categoryId&&sn!==null&&sn!==void 0&&(en=sn.url)!==null&&en!==void 0&&en.includes("edit")?sn==null||((xn=sn.params)===null||xn===void 0)?void 0:xn.categoryId:"",ht=ut?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",Ct=Object(k.useState)({}),dn=Object(d.a)(Ct,2),Kn=dn[0],On=dn[1],Nn=Object(k.useState)(!1),Bn=Object(d.a)(Nn,2),Un=Bn[0],Ln=Bn[1],zn=_n.userInfo||{},Xn=zn.admin,Or=zn.business,Yn=zn.is_shixun_marker,nn=zn.is_teacher,qt=zn.user_identity,In=Xn||Or||Yn||nn||qt!=="\u5B66\u751F",nr=Object(k.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),Kt=Object(d.a)(nr,2),rr=Kt[0],Rr=Kt[1],Zn=Sn.commonHomeWorkAddDefaultData,_r=Object(k.useState)([]),mr=Object(d.a)(_r,2),Nr=mr[0],Fr=mr[1],Lr=Object(k.useRef)(null),li=Object(k.useState)(!1),Ti=Object(d.a)(li,2),gi=Ti[0],Wr=Ti[1],wr=Object(k.useState)([]),gr=Object(d.a)(wr,2),ln=gr[0],vr=gr[1],Oi=Object(k.useState)(""),Hi=Object(d.a)(Oi,2),$i=Hi[0],yr=Hi[1],Mi=Object(k.useState)(!1),Ki=Object(d.a)(Mi,2),Er=Ki[0],cr=Ki[1],Pr=Object(k.useRef)(null),Na=[{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(k.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var Za=function(){var Je=Object(_.a)(T.a.mark(function $e(){var Ve,tt,rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(Re.q)({id:ut});case 2:Ve=gt.sent,Ve!=null&&Ve.name&&(rt={description:Ve.description,languages:Ve.languages,name:Ve.name},Pr.current.form.setFieldsValue(rt),On(Object(g.a)({},rt)),vr(Object(O.a)(Ve.data)),Fe((tt=Ve.data)===null||tt===void 0?void 0:tt.map(function(mt){return mt.id})));case 4:case"end":return gt.stop()}},$e)}));return function(){return Je.apply(this,arguments)}}();Object(k.useEffect)(function(){ut&&Za()},[ut]),Object(k.useEffect)(function(){var Je,$e=((Je=Nt.location.query)===null||Je===void 0?void 0:Je.group_id)||0;je.group_id=Number($e),Xt({type:"problemset/getDisciplines",payload:Object(g.a)(Object(g.a)({source:"question"},je),{},{group_type:Hn})}),Yt(je),zr(je).then(function(Ve){Ve!=null&&Ve.status||Fr(Ve==null?void 0:Ve.item_banks_group),Wr(!1)}),Ni(),ga()},[]),Object(k.useEffect)(function(){return Xt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Xt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){Xt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Xt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(k.useEffect)(function(){return Xt({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Xt({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(k.useEffect)(function(){return Xt({type:"globalSetting/headerFooterToggle",payload:Ge}),function(){Xt({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(k.useEffect)(function(){Object(xr.X)(Ze?ht:"\u8BD5\u9898\u5E93")},[Ze,ht]);var na=function($e,Ve){var tt=[];if(!$e){var rt,vt;Bt==null||((rt=Bt.disciplinesData)===null||rt===void 0||((vt=rt.disciplines)===null||vt===void 0))||vt.forEach(function(Ur){var Ri;Ur==null||((Ri=Ur.sub_disciplines)===null||Ri===void 0)||Ri.forEach(function(Vi){var Ra;Vi==null||((Ra=Vi.tag_disciplines)===null||Ra===void 0)||Ra.forEach(function(Di){Di.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&tt.push(Di)})})})}if($e&&!Ve){var gt,mt,$t,$n=Bt==null||((gt=Bt.disciplinesData)===null||gt===void 0||((mt=gt.disciplines)===null||mt===void 0))?void 0:mt.find(function(Ur){return Ur.id===$e});$n==null||(($t=$n.sub_disciplines)===null||$t===void 0)||$t.forEach(function(Ur){var Ri;Ur==null||((Ri=Ur.tag_disciplines)===null||Ri===void 0)||Ri.forEach(function(Vi){Vi.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&tt.push(Vi)})})}if($e&&Ve){var _i,Pn,ci,di,oi=Bt==null||((_i=Bt.disciplinesData)===null||_i===void 0||((Pn=_i.disciplines)===null||Pn===void 0))?void 0:Pn.find(function(Ur){return Ur.id===$e}),bi=oi==null||((ci=oi.sub_disciplines)===null||ci===void 0)?void 0:ci.find(function(Ur){return Ur.id===Ve});bi==null||((di=bi.tag_disciplines)===null||di===void 0)||di.forEach(function(Ur){Ur.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&tt.push(Ur)})}return tt},ga=function(){var Je=Object(_.a)(T.a.mark(function $e(){return T.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:Xt({type:"problemset/getTeachGroupData"});case 1:case"end":return tt.stop()}},$e)}));return function(){return Je.apply(this,arguments)}}();Object(k.useEffect)(function(){var Je=Bt.basketData||{},$e=Je.completion_questions_count,Ve=$e===void 0?0:$e,tt=Je.judgement_questions_count,rt=tt===void 0?0:tt,vt=Je.multiple_questions_count,gt=vt===void 0?0:vt,mt=Je.practical_questions_count,$t=mt===void 0?0:mt,$n=Je.program_questions_count,_i=$n===void 0?0:$n,Pn=Je.single_questions_count,ci=Pn===void 0?0:Pn,di=Je.subjective_questions_count,oi=di===void 0?0:di,bi=Je.combination_questions_count,Ur=bi===void 0?0:bi,Ri=Ve+rt+gt+$t+_i+ci+oi+Ur;$a(Ri)},[Bt.basketData]);var zr=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return tt=Object(g.a)({},Ve),tt.item_type=Ze?"PROGRAM":Ve.item_type,Wr(!0),tt.keyword=encodeURIComponent(Ve.keyword||""),gt.next=6,Xt({type:"problemset/getItemBanks",payload:tt});case 6:if(rt=gt.sent,!(rt&&rt.status!==403&&rt.status!==401&&rt.status!==500)){gt.next=18;break}return Yr(rt.items_count||0),St(rt.items||[]),lr(rt.tag_disciplines||[]),xe(rt.used_shixun_ids||[]),Ua(rt.items||[]),Ze||Fe([]),lo((rt==null?void 0:rt.navigation)||[]),Jt((rt==null?void 0:rt.added_num)||0),Wr(!1),gt.abrupt("return",rt);case 18:case"end":return gt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Ni=function(){Xt({type:"problemset/getBasketList",payload:{}})},Ua=function($e){var Ve=$e.every(function(tt){var rt;return((rt=tt.program_attr)===null||rt===void 0?void 0:rt.status)===0});pa.current=Ve},Io=function($e,Ve){if(je.discipline_id=$e||"",je.sub_discipline_id=Ve||"",je.tag_discipline_id="",je.page=1,je.per_page=20,delete je.id,sr($e===null?-1:null),Yt(je),zr(je),$e===null)return},Po=function($e){je.item_type=$e||"",je.page=1,je.per_page=20,Yt(je),zr(je)},mo=function($e){je.difficulty=$e||"",je.page=1,je.per_page=20,delete je.id,Yt(je),zr(je)},Ja=function($e){je.tag_discipline_id=$e,je.page=1,je.per_page=20,delete je.id,$e===-1&&(je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id=""),sr($e),Yt(je),zr(je)},qa=Object(k.useState)(!1),ra=Object(d.a)(qa,2),va=ra[0],go=ra[1],ja=function($e){Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:$e}}),je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id="",je.item_type=null,je.difficulty=null,je.type=$e,$e==="0"?je.group_id=0:je.group_id=null,$e==="3"&&Ze?je.only_published=!0:je.only_published=null,$e==="3"?go(!0):go(!1),je.page=1,je.per_page=20,delete je.id,sr(-1),Qr($e),Yt(je),zr(je)},ya=function($e,Ve){je.page=$e,je.per_page=Ve,Yt(je),zr(je)},ia=function($e){je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id="",je.item_type=null,je.difficulty=null,je.page=1,je.keyword=$e,delete je.id,$e?(Qa(!0),Object(En.a)({name:$e,copywriting:$e,position:Ze?"Practice":"ItemBank"})):Qa(!1),sr(-1),Yt(je),zr(je)},Cr=function(){je.per_page=20,Yt(je),zr(je)},wi=function($e){var Ve=$e.length===An.length&&je.page>1?je.page-1:je.page;je.page=Ve,je.per_page=20,Ni(),Yt(je),zr(je)},aa=function(){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},Qi=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve,tt){var rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:if(!tt){gt.next=6;break}return gt.next=3,Object(Re.n)({id:Ve});case 3:gt.t0=gt.sent,gt.next=9;break;case 6:return gt.next=8,Object(Re.G)({id:Ve});case 8:gt.t0=gt.sent;case 9:rt=gt.t0,(rt==null?void 0:rt.status)===0&&Cr();case 11:case"end":return gt.stop()}},$e)}));return function(Ve,tt){return Je.apply(this,arguments)}}(),wa=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:Ha(Ve);case 1:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),oa=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:Wa([Ve]);case 1:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Ba=function($e){Ae.current="",ma.current="",R.a.confirm({centered:!0,width:530,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BD5\u9898\u7EA0\u9519",content:m.a.createElement("div",{className:"font14"},m.a.createElement("div",null,"\u9519\u8BEF\u7C7B\u578B\uFF1A"),m.a.createElement(A.a.Group,{className:"mt10",onChange:function(tt){return ma.current=tt.target.value}},m.a.createElement(A.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),m.a.createElement(A.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),m.a.createElement(A.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),m.a.createElement(A.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),m.a.createElement(A.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),m.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),m.a.createElement(Ea,{className:"mt10",rows:4,defaultValue:Ae.current,onChange:function(tt){return Ae.current=tt.target.value}})),onOk:function(){return new Promise(function(){var tt=Object(_.a)(T.a.mark(function rt(vt,gt){var mt;return T.a.wrap(function($n){for(;;)switch($n.prev=$n.next){case 0:if(ma.current&&Ae.current){$n.next=3;break}return i.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),$n.abrupt("return",gt());case 3:return $n.next=5,Object(Re.o)({id:$e,clazz:ma.current,description:Ae.current});case 5:mt=$n.sent,mt.status===0&&i.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),vt();case 8:case"end":return $n.stop()}},rt)}));return function(rt,vt){return tt.apply(this,arguments)}}())}})},eo=function($e){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:$e}}})},Fa=function($e){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:$e}}})},to=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt,vt,gt;return T.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:if(tt=Ve.item_type,!(tt==="PROGRAM")){$t.next=12;break}return rt=Ve.program_attr.identifier,$t.next=5,Xt({type:"problemset/startExperience",payload:{id:rt}});case 5:if(vt=$t.sent,!(vt.status===0)){$t.next=10;break}return gt=vt.identifier,Object(xr.S)("/myproblems/".concat(gt)),$t.abrupt("return");case 10:return i.b.warn(vt.message),$t.abrupt("return");case 12:Xt({type:"problemset/setActionTabs",payload:{key:tt,params:Ve}});case 13:case"end":return $t.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Gi=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt,vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:if(!je.exam_id){mt.next=6;break}return mt.next=3,Object(Re.M)({item_id:Ve,id:je.exam_id});case 3:return tt=mt.sent,tt.status===0&&Cr(),mt.abrupt("return");case 6:if(!(je!=null&&je.exercise_id)){mt.next=12;break}return mt.next=9,Object(Qt.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:je==null?void 0:je.exercise_id,item_bank_ids:[Ve]}});case 9:return rt=mt.sent,rt.status===0&&Cr(),mt.abrupt("return");case 12:return mt.next=14,Xt({type:"problemset/cancel",payload:{id:Ve,item_bank:1}});case 14:vt=mt.sent,vt.status===0&&(Cr(),Ni());case 16:case"end":return mt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Zi=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(Ve),group_type:ur.Mine}}),je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id="",je.page=1,je.per_page=20,je.group_id=Math.abs(Ve),sr(-1),Yt(je),zr(je).then(function(vt){return Fr(vt==null?void 0:vt.item_banks_group)});case 10:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),no=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt,vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:if(!je.exam_id){mt.next=6;break}return mt.next=3,Object(Re.t)({exam_id:je.exam_id,item_bank_ids:[Ve]});case 3:return tt=mt.sent,tt.status===0&&Cr(),mt.abrupt("return");case 6:if(!(je!=null&&je.exercise_id)){mt.next=12;break}return mt.next=9,Object(Qt.a)("/api/exercises/".concat(je==null?void 0:je.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[Ve]}});case 9:return rt=mt.sent,rt.status===0&&Cr(),mt.abrupt("return");case 12:if(!(fa===200)){mt.next=15;break}return i.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),mt.abrupt("return");case 15:return mt.next=17,Xt({type:"problemset/select",payload:{item_bank_ids:[Ve]}});case 17:vt=mt.sent,vt.status===0&&(Cr(),Ni());case 19:case"end":return mt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),ro=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(Ve){rt.next=3;break}if(Ce!=null&&Ce.length){rt.next=3;break}return rt.abrupt("return",i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:Me.current=[0],R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u79FB\u52A8\u5230",maskClosable:!0,className:"custom-modal-divider",icon:null,content:m.a.createElement("div",{className:"font14 ".concat(ue.a.overflow),style:{maxHeight:500,overflow:"auto"}},m.a.createElement("p",{className:"c-grey-333"},"\u8BF7\u9009\u62E9\u9700\u8981\u79FB\u52A8\u5230\u7684\u6587\u4EF6\u5939"),m.a.createElement(V.a,{defaultValue:!0,value:Me.current,onChange:function(gt){return Me.current=gt}})),onOk:function(){var vt=Object(_.a)(T.a.mark(function mt(){var $t,$n;return T.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(Re.f)({ids:Ve?[Ve]:Ce,groups_ids:($t=Me.current)===null||$t===void 0?void 0:$t[0]});case 2:$n=Pn.sent,Me.current=[],($n==null?void 0:$n.status)===0&&Cr();case 5:case"end":return Pn.stop()}},mt)}));function gt(){return vt.apply(this,arguments)}return gt}()});case 5:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),ko=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(Re.D)({clazz:"ItemBank",id:Ve});case 2:tt=gt.sent,rt=(tt==null?void 0:tt.groups)||[],Me.current=[],R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A\u64A4\u9500",cancelText:"\u53D6\u6D88",title:"\u672C\u9898\u5DF2\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font14 ".concat(ue.a.overflow)},m.a.createElement("p",{className:"c-grey-999"},"\u9009\u4E2D\u5E76\u786E\u5B9A\uFF0C\u5373\u64A4\u9500\u672C\u9898\u5BF9\u9009\u4E2D\u6559\u7814\u56E2\u961F\u7684\u5206\u4EAB"),m.a.createElement(u.a.Group,{className:ue.a.checkbox,defaultValue:Me.current,onChange:function($t){return Me.current=$t}},rt==null?void 0:rt.map(function(mt){return m.a.createElement(u.a,{key:mt.group_id,value:mt.group_id},mt.name)}))),onOk:function(){var mt=Object(_.a)(T.a.mark(function $n(){return T.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.abrupt("return",new Promise(function(){var ci=Object(_.a)(T.a.mark(function di(oi,bi){var Ur,Ri,Vi;return T.a.wrap(function(Di){for(;;)switch(Di.prev=Di.next){case 0:if(Me.current.length){Di.next=3;break}return i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),Di.abrupt("return",bi());case 3:return Ri=rt==null||((Ur=rt.map(function(_o){return _o.group_id}))===null||Ur===void 0)?void 0:Ur.filter(function(_o){return!Me.current.includes(_o)}),Di.next=6,Object(Re.l)({ids:[Ve],clazz:"ItemBank",group_ids:Ri});case 6:return Vi=Di.sent,Me.current=[],(Vi==null?void 0:Vi.status)===0&&(i.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),Cr()),Di.abrupt("return",oi());case 10:case"end":return Di.stop()}},di)}));return function(di,oi){return ci.apply(this,arguments)}}()));case 1:case"end":return Pn.stop()}},$n)}));function $t(){return mt.apply(this,arguments)}return $t}()});case 6:case"end":return gt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Mo=function($e){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:$e}}})},io=function(){Xt({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:je}});return},No=function(){var $e={discipline_id:"&discipline_id=".concat(je.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(je.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(je.tag_discipline_id),difficulty:"&difficulty=".concat(je.difficulty),item_type:"&item_type=".concat(je.item_type),group_id:"&group_id=".concat(je.group_id||0)},Ve="/problemset/newitem?pages=".concat(je.page);Object.keys($e).forEach(function(tt){je[tt]&&(Ve=Ve+$e[tt])}),y.d===null||y.d===void 0||y.d.push(Ve)},Vr=function($e){var Ve=Ce;if(!(Ve!=null&&Ve.length))return i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(fa+Ve.length>200&&$e&&Ge){i.b.info("\u8BD5\u9898\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-fa,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat(Ve.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}$e?Hr(Ve):ai(Ve)},Hr=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt;return T.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:tt=Object(O.a)(Ve),An.forEach(function(gt){if(tt.includes(gt.id)){var mt;gt.item_type==="PROGRAM"&&((mt=gt.program_attr)===null||mt===void 0?void 0:mt.status)===0&&Object(ot.remove)(tt,function($t){return $t===gt.id})}}),R.a.confirm({width:530,title:"\u63D0\u793A",className:"custom-modal-divider ",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:m.a.createElement("div",null,"\u5F53\u524D\u5DF2\u9009\u62E9",Ve.length,"\u9053\u8BD5\u9898\uFF0C\u5DF2\u52A0\u5165\u8FC7\u7684\u8BD5\u9898\u6216\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u5C06\u4E0D\u4F1A\u91CD\u590D\u52A0\u5165"," "),onOk:function(){var gt=Object(_.a)(T.a.mark(function $t(){var $n;return T.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(!je.exam_id){Pn.next=6;break}return Pn.next=3,Object(Re.t)({exam_id:je.exam_id,item_bank_ids:tt});case 3:$n=Pn.sent,Pn.next=15;break;case 6:if(!(je!=null&&je.exercise_id)){Pn.next=12;break}return Pn.next=9,Object(Qt.a)("/api/exercises/".concat(je==null?void 0:je.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:tt}});case 9:$n=Pn.sent,Pn.next=15;break;case 12:return Pn.next=14,Xt({type:"problemset/select",payload:{item_bank_ids:tt}});case 14:$n=Pn.sent;case 15:$n.status===0&&(Cr(),Ni());case 16:case"end":return Pn.stop()}},$t)}));function mt(){return gt.apply(this,arguments)}return mt}()});case 3:case"end":return vt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),ai=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt;return T.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(!je.exam_id){vt.next=6;break}return vt.next=3,Object(Qt.a)("/api/examination_banks/".concat(je.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:Ve}});case 3:tt=vt.sent,vt.next=15;break;case 6:if(!(je!=null&&je.exercise_id)){vt.next=12;break}return vt.next=9,Object(Qt.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:je==null?void 0:je.exercise_id,item_bank_ids:Ve}});case 9:tt=vt.sent,vt.next=15;break;case 12:return vt.next=14,Xt({type:"problemset/unselectAll",payload:{item_ids:Ve}});case 14:tt=vt.sent;case 15:tt.status===0&&(Cr(),Ni());case 16:case"end":return vt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Kr=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt;return T.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(!(Ge&&fa===200)){vt.next=3;break}return i.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),vt.abrupt("return");case 3:if(!je.exam_id){vt.next=10;break}return vt.next=6,Object(Re.t)({exam_id:je.exam_id,shixun_ids:Ve});case 6:tt=vt.sent,tt.status===0&&Cr(),vt.next=14;break;case 10:return vt.next=12,Xt({type:"problemset/select",payload:{shixun_ids:Ve}});case 12:tt=vt.sent,tt.status===0&&(Ni(),Cr());case 14:case"end":return vt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Ca=function(){Xt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Wa=function($e){var Ve,tt,rt,vt;if(!((Ve=Bt.teachGroupData)!==null&&Ve!==void 0&&(tt=Ve.groups)!==null&&tt!==void 0&&tt.length))return i.b.info("\u60A8\u6682\u672A\u521B\u5EFA\u6216\u52A0\u5165\u4EFB\u4F55\u6559\u7814\u56E2\u961F\uFF0C\u8BF7\u524D\u5F80\u201C\u6211\u7684\u4E2A\u4EBA\u4E2D\u5FC3-\u6559\u7814\u56E2\u961F\u201D\u67E5\u770B");R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font14 ".concat(ue.a.overflow)},m.a.createElement(u.a.Group,{className:ue.a.checkbox,defaultValue:Me.current,onChange:function(mt){return Me.current=mt}},(rt=Bt.teachGroupData)===null||rt===void 0||((vt=rt.groups)===null||vt===void 0)?void 0:vt.map(function(gt){return m.a.createElement(u.a,{key:gt.group_id,value:gt.group_id},gt.name)}))),onOk:function(){return new Promise(function(){var mt=Object(_.a)(T.a.mark(function $t($n,_i){var Pn,ci;return T.a.wrap(function(oi){for(;;)switch(oi.prev=oi.next){case 0:if((Pn=Me.current)!==null&&Pn!==void 0&&Pn.length){oi.next=3;break}return i.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),oi.abrupt("return",_i());case 3:return oi.next=5,Object(Re.l)({ids:$e||Ce,clazz:"ItemBank",group_ids:Me.current});case 5:ci=oi.sent,(ci==null?void 0:ci.status)===0&&(i.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),Me.current=[],Fe([]),Cr(),$n());case 7:case"end":return oi.stop()}},$t)}));return function($t,$n){return mt.apply(this,arguments)}}())}})},Ci=function(){var $e=function(){var Ve=Object(_.a)(T.a.mark(function tt(){var rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return Pa(!0),gt.next=3,Object(Re.j)({ids:Ce});case 3:rt=gt.sent,Pa(!1),(rt==null?void 0:rt.status)===0&&R.a.info({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u5220\u9664\u7ED3\u679C",maskClosable:!1,keyboard:!1,icon:null,content:"\u672C\u6B21\u6210\u529F\u5220\u9664".concat(rt.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(rt.fail,"\u6761\u8BD5\u9898\u56E0\u4E3A\u516C\u5F00\u65E0\u6CD5\u5220\u9664\uFF0C\u8BF7\u64A4\u9500\u540E\u518D\u8FDB\u884C\u5220\u9664\u3002"),onOk:function(){wi(new Array(rt.success))}});case 6:case"end":return gt.stop()}},tt)}));return function(){return Ve.apply(this,arguments)}}();if(Ce!=null&&Ce.length){R.a.confirm({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u63D0\u793A",cancelText:"\u53D6\u6D88",icon:null,content:"\u672C\u6B21\u9009\u4E2D\u4E86".concat(Ce==null?void 0:Ce.length,"\u6761\u8BD5\u9898\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF0C\u5220\u9664\u540E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\uFF1F"),onOk:$e});return}i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},ao=function(){var $e,Ve;if(!(Ce!=null&&Ce.length))return i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(An!=null&&($e=An.filter(function(tt){return Ce.includes(tt.id)}))!==null&&$e!==void 0&&$e.every(function(tt){return tt.public}))return i.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(An!=null&&(Ve=An.filter(function(tt){return Ce.includes(tt.id)}))!==null&&Ve!==void 0&&Ve.find(function(tt){var rt;return tt.item_type==="PROGRAM"&&((rt=tt.program_attr)===null||rt===void 0?void 0:rt.status)===0}))return i.b.info("\u5DF2\u9009\u9898\u4E2D\u5B58\u5728\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898");window.localStorage.getItem("problemset-set-public-hint-flag")==="1"||_n.userInfo.professional_certification?Ha():R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u516C\u5F00\u89C4\u5219\u544A\u77E5",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font16 c-grey-333"},"\u516C\u5F00\u5E76\u7ECF\u5E73\u53F0\u5BA1\u6838\u540E\uFF0C\u8BE5\u9898\u5C06\u5728\u516C\u5171\u8BD5\u9898\u5E93\u53EF\u89C1\uFF0CEducoder\u6240\u6709\u7528\u6237\u5747\u53EF\u4F7F\u7528\u8BE5\u9898\u3002",m.a.createElement("br",null),"\u516C\u5F00\u540E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u4F46\u53EF\u4EE5\u64A4\u9500\uFF1B\u64A4\u9500\u516C\u5F00\u540E\u53EF\u4EE5\u4FEE\u6539\u3002",m.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u7533\u8BF7\u516C\u5F00\uFF1F",m.a.createElement("br",null),m.a.createElement(u.a,{className:"mt10",defaultChecked:!1,onChange:function(rt){return Be.current=rt.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Ha()}})},Ha=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return tt=Hn===ur.TeachGroupShare?1:2,gt.next=3,Object(Re.g)({ids:Ve?[Ve]:Ce,source:tt});case 3:rt=gt.sent,rt.status===0&&(Be.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),Be.current=!1,Fe([]),Cr());case 5:case"end":return gt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),vo=function($e){R.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{className:ue.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),m.a.createElement("div",{className:ue.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ve=Object(_.a)(T.a.mark(function rt(){var vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(Re.L)({identifier:$e});case 2:vt=mt.sent,(vt==null?void 0:vt.status)===0&&(i.b.success("\u53D1\u5E03\u6210\u529F"),Cr());case 4:case"end":return mt.stop()}},rt)}));function tt(){return Ve.apply(this,arguments)}return tt}()})},sa=function($e){R.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:m.a.createElement("p",{className:ue.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ve=Object(_.a)(T.a.mark(function rt(){var vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(Re.K)({identifier:$e});case 2:vt=mt.sent,(vt==null?void 0:vt.status)===0&&(i.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),Cr());case 4:case"end":return mt.stop()}},rt)}));function tt(){return Ve.apply(this,arguments)}return tt}()})},Ka=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Ve,group_type:ur.TeachGroupShare}}),je.page=1,je.group_id=Ve||null,delete je.id,Yt(Object(g.a)({},je)),zr(je);case 6:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Sa=function($e){je.sort_by=$e.type,je.sort_direction=$e.direction,je.page=1,je.per_page=20,Rr($e.name),Yt(je),zr(je)},yo=function(){je.page=1,Yt(je),zr(je)},Ga=function($e){je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id="",je.item_type=null,je.difficulty=null,je.page=1,je.per_page=20,je.group_id=$e,sr(-1),Yt(je),zr(je).then(function(Ve){return Fr(Ve==null?void 0:Ve.item_banks_group)})},dr=function(){if(!(Ce!=null&&Ce.length)){Xt({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:je}});return}R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5BFC\u51FA\u63D0\u793A",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font14 ".concat(ue.a.overflow)},"\u5DF2\u9009\u4E2D",Ce==null?void 0:Ce.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(ct.k)({ids:Ce})}})},er=function(){var Je=Object(_.a)(T.a.mark(function $e(){var Ve,tt,rt,vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(Re.i)({ids:Ce});case 2:Ve=mt.sent,tt=Ve.data||{},rt=tt.unpublish_program_question_count,vt=tt.total_item_banks,rt===0?R.a.error({title:"\u9519\u8BEF",content:m.a.createElement("span",null,"\u53D1\u5E03\u9519\u8BEF\uFF01\u8BF7\u9009\u62E9\u5C1A\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u8FDB\u884C\u53D1\u5E03"),centered:!0,okText:"\u786E\u8BA4"}):R.a.confirm({title:"\u63D0\u793A",content:m.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",vt,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",rt,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var $t=Object(_.a)(T.a.mark(function _i(){var Pn;return T.a.wrap(function(di){for(;;)switch(di.prev=di.next){case 0:return di.next=2,Object(Re.h)({ids:Ce});case 2:Pn=di.sent,Pn.status===0&&(i.b.success("\u53D1\u5E03\u6210\u529F"),Cr());case 4:case"end":return di.stop()}},_i)}));function $n(){return $t.apply(this,arguments)}return $n}()});case 5:case"end":return mt.stop()}},$e)}));return function(){return Je.apply(this,arguments)}}(),ti=m.a.createElement(p.a,null,In&&m.a.createElement(p.a.Item,{onClick:function(){return Vr(!0)}},"\u6279\u91CF\u52A0\u5165"),In&&m.a.createElement(p.a.Item,{onClick:function(){return Vr(!1)}},"\u6279\u91CF\u79FB\u51FA"),Hn===ur.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:function(){return ro()}},"\u79FB\u52A8\u5230"),Hn===ur.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:ao},"\u6279\u91CF\u516C\u5F00"),Hn===ur.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:function(){return Wa()}},"\u6279\u91CF\u5171\u4EAB"),Hn===ur.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:Ci},"\u6279\u91CF\u5220\u9664")),ui=function($e){if(Ze)if((ln==null?void 0:ln.length)<=0){var Ve=An.filter(function($t){return $e.includes($t.id)});vr(Object(O.a)(Ve)),Fe(Ve==null?void 0:Ve.map(function($t){return $t.id}))}else if($e.length>ln.length){var tt,rt=An.filter(function($t){return $e.includes($t.id)}),vt=ln.map(function($t){return $t.id}),gt=rt.filter(function($t){return!vt.includes($t.id)});vr([].concat(Object(O.a)(ln),Object(O.a)(gt))),Fe((tt=[].concat(Object(O.a)(ln),Object(O.a)(gt)))===null||tt===void 0?void 0:tt.map(function($t){return $t.id}))}else{var mt=ln.filter(function($t){return $e.includes($t.id)});vr(Object(O.a)(mt)),Fe(mt==null?void 0:mt.map(function($t){return $t.id}))}else Fe($e)},Ji=function($e){if(Ze)if($e){var Ve,tt=ln==null?void 0:ln.map(function(mt){return mt.id}),rt=An.filter(function(mt){return!tt.includes(mt.id)});vr([].concat(Object(O.a)(ln),Object(O.a)(rt))),Fe((Ve=[].concat(Object(O.a)(ln),Object(O.a)(rt)))===null||Ve===void 0?void 0:Ve.map(function(mt){return mt.id}))}else{var vt=An==null?void 0:An.map(function(mt){return mt.id}),gt=ln.filter(function(mt){return!vt.includes(mt.id)});vr(Object(O.a)(gt)),Fe(gt==null?void 0:gt.map(function(mt){return mt.id}))}else Fe($e?An==null?void 0:An.map(function(mt){return mt.id}):[])},zi=function(){var $e="/problemset/preview";if(je.exam_id&&($e="/paperlibrary/edit/".concat(je.exam_id)),je!=null&&je.exercise_id){var Ve;$e="/classrooms/".concat(sn==null||((Ve=sn.params)===null||Ve===void 0)?void 0:Ve.coursesId,"/exercise/").concat(je==null?void 0:je.exercise_id,"/edit")}y.d.push($e)},Aa=[{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"}],qi={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Jr=function($e,Ve){var tt,rt=Ve.id<0?"--":In?Ve[je.exercise_id?"added":"choosed"]?m.a.createElement("span",{key:1,className:ue.a.btnAdd,onClick:function(mt){mt.target.style.pointerEvents="none",Gi(Ve.id)}},Ge?"\u79FB\u51FA\u8BD5\u9898\u7BEE":m.a.createElement("span",null,m.a.createElement("b",{className:"iconfont icon-yichu ".concat(ue.a.cancelC)}),"\u79FB\u51FA")):Ve.item_type==="PROGRAM"&&((tt=Ve.program_attr)===null||tt===void 0?void 0:tt.status)===0?m.a.createElement(h.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},m.a.createElement("span",{className:ue.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}}," ",Ge?"\u52A0\u5165\u8BD5\u9898\u7BEE":m.a.createElement("span",{style:{padding:"0 3px"}},m.a.createElement("b",{className:"iconfont icon-jiaru ".concat(ue.a.addC)}),"\u52A0\u5165")," ")):m.a.createElement("span",{className:ue.a.btnAdd,onClick:function(){return no(Ve.id)}},Ge?"\u52A0\u5165\u8BD5\u9898\u7BEE":m.a.createElement("span",{style:{padding:"0 3px"}},m.a.createElement("b",{className:"iconfont icon-jiaru ".concat(ue.a.addC)}),"\u52A0\u5165")):m.a.createElement(m.a.Fragment,null),vt=m.a.createElement("span",{className:ue.a.actonBtn},Ve.id>0&&m.a.createElement(or.a,{isProblemset:Ge,user:_n,key:Ve.id,data:Ve,activeTabsKey:Hn,selectIds:Ce,onCollect:Qi,onSetPublic:wa,onStartExperience:to,onCorrection:Ba,onPublicReview:aa,onSetPrivate:eo,onDelete:Fa,onCancel:Gi,onSelect:no,onMoveTo:ro,onSetShare:oa,onCancelShare:ko,onPublish:vo,onCancelPublish:sa}),rt);return vt};Object(k.useEffect)(function(){if(Ze){var Je=sn.params,$e=Je.coursesId,Ve=Je.categoryId;Xt({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:Ve,coursesId:$e,type:5}})}},[Ze]);var Oa=function(){var Je=Object(_.a)(T.a.mark(function $e(){var Ve,tt,rt,vt,gt;return T.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return Pr.current.form.validateFields().catch(function($n){document.body.scrollIntoView()}),$t.next=3,Pr.current.form.validateFields();case 3:if(Ve=Pr.current.form.getFieldsValue(),console.log(Ve,"value"),!((ln==null?void 0:ln.length)<=0)){$t.next=8;break}return i.b.info("\u8BF7\u9009\u62E9\u7F16\u7A0B\u9898"),$t.abrupt("return");case 8:return Ln(!0),tt=sn.params,rt=tt.coursesId,vt=tt.categoryId,$t.next=12,Object(Qt.a)(ut?"/api/homework_commons/".concat(vt,"/update_hack.json"):"/api/courses/".concat(rt,"/homework_commons.json"),{method:ut?"put":"post",body:Object(g.a)(Object(g.a)({},Ve),{},{coursesId:rt,category:vt,type:5,hack_ids:ln==null?void 0:ln.map(function($n){return $n.id})})});case 12:gt=$t.sent,(gt==null?void 0:gt.status)===0&&y.d.push("/classrooms/".concat(sn.params.coursesId,"/program_homework/").concat(ut?vt:gt.homework_id,"/detail?tabs=1")),Ln(!1);case 15:case"end":return $t.stop()}},$e)}));return function(){return Je.apply(this,arguments)}}();return m.a.createElement("div",{className:ue.a.page},m.a.createElement("section",null,m.a.createElement("div",{className:ue.a.wrap},Zn.course_name&&Ze&&m.a.createElement("section",{className:"animated fadeIn"},m.a.createElement("aside",{className:"mt10"},Zn.category&&m.a.createElement(f.a,{separator:">"},m.a.createElement(f.a.Item,null,m.a.createElement(H.a,{to:"/classrooms/".concat(Zn.course_id,"/program_homework")},Zn.course_name)),m.a.createElement(f.a.Item,null,m.a.createElement(H.a,{to:"/classrooms/".concat(Zn.course_id,"/program_homework")},Zn.category.category_name)),m.a.createElement(f.a.Item,null,ht)))),m.a.createElement("div",{className:ue.a.title},Ze?ht:"\u8BD5\u9898\u5E93"),Ze&&m.a.createElement(ca,{data:Kn,ref:Pr}),m.a.createElement("div",{className:ue.a.headerWrapper},m.a.createElement("div",{className:ue.a.tabsWrap},m.a.createElement(B.a,{activeKey:Hn,onChange:ja,tabBarExtraContent:m.a.createElement("div",{className:ue.a.searchWrap},Hn===ur.Mine&&Ge&&m.a.createElement(L.a,{className:ue.a.addQuestionBtn,onClick:No},m.a.createElement("img",{src:_t.a,className:ue.a.pngIcon,alt:""}),"\u65B0\u589E\u8BD5\u9898"),m.a.createElement(da,{allowClear:!0,suffix:m.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(ue.a.searchIcon),onClick:function(){return ia(je.keyword)}}),className:ue.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",onChange:function($e){je.keyword=$e.target.value,Yt(Object(g.a)({},je))},onSearch:ia}))},m.a.createElement(pi,{tab:"\u516C\u5171",key:"1"}),((Fn=Bt.teachGroupData)===null||Fn===void 0||((tn=Fn.groups)===null||tn===void 0)?void 0:tn.length)&&m.a.createElement(pi,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(br.o)()&&!Object(br.m)()&&!Ze&&m.a.createElement(pi,{tab:"\u6536\u85CF\u5939",key:"2"}),m.a.createElement(pi,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),m.a.createElement(Q.a,{showSelectAll:!1,className:ue.a.select,disciplinesData:(hn=Bt.disciplinesData)===null||hn===void 0?void 0:hn.disciplines,knowledgeData:Wi,directionValue:je.discipline_id,subDisciplineValue:je.sub_discipline_id,typeValue:je.item_type,isprogram_homework:Ze,showKnowledge:!0,name:$i,setname:yr,difficultyValue:je.difficulty,showShixun:!Object(br.m)()&&!je.exercise_id&&Hn!==ur.TeachGroupShare&&Hn!==ur.Public,onShixunChange:Ca,onDirectionChange:Io,onTypeChange:Po,onDifficultyChange:mo,knowledgeValue:Vn,onKnowledgeChange:Ja,teachGroupData:(ar=Bt.teachGroupData)===null||ar===void 0?void 0:ar.groups,onTeachGroupChange:Ka,teachGroupValue:je.group_id,showTeachGroup:va})),m.a.createElement("div",{className:ue.a.treeWrapper,style:{display:Hn===ur.Mine?"block":"none"}},m.a.createElement("div",{className:ue.a.treeHeader},m.a.createElement(q.a,{data:Mr,onClick:Zi}),m.a.createElement(L.a,{type:"link",onClick:io,className:ue.a.exportBtn},m.a.createElement("img",{src:ea.a,alt:"",className:ue.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),m.a.createElement(K.a,{spinning:gi},m.a.createElement("div",{ref:Lr,className:ue.a.treeContent},m.a.createElement(bn.a,{isProblemset:Ge,reloadData:Cr,data:Nr,onShare:Wa,onOpen:Zi})))),m.a.createElement("div",{className:ue.a.contentWrap},m.a.createElement("div",{className:ue.a.batchWrap},m.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},!Ze&&m.a.createElement("div",{className:"font14"},m.a.createElement(M.a,{overlay:m.a.createElement(p.a,{selectedKeys:[rr]},Na==null?void 0:Na.map(function(Je,$e){return m.a.createElement(p.a.Item,{key:Je.name,onClick:function(){return Sa(Je)}},Je.name)}))},m.a.createElement("span",{style:{color:"#464F66"}},m.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),rr))),Ze&&m.a.createElement("div",null,m.a.createElement(u.a,{checked:(An==null?void 0:An.filter(function(Je){return ln==null?void 0:ln.map(function($e){return $e.id}).includes(Je.id)}).length)===An.length,onChange:function($e){return Ji($e.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",Ce==null?void 0:Ce.length,")"))),Ze&&m.a.createElement(R.a,{visible:Er,centered:!0,width:700,okText:"\u786E\u8BA4".concat(ut?"\u7F16\u8F91":"\u65B0\u5EFA"),onCancel:function(){return cr(!1)},cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:Oa,confirmLoading:Un,title:"\u67E5\u770B\u5DF2\u9009"},m.a.createElement("div",{className:"font14 c-light-primary mb10"},"\u5DF2\u9009",ln==null?void 0:ln.length,"\u4E2A"),m.a.createElement("div",{style:{height:400,overflow:"auto"}},ln==null?void 0:ln.map(function(Je,$e){var Ve,tt,rt,vt,gt,mt;return m.a.createElement("div",{key:$e,className:ue.a.sendModal},m.a.createElement("div",{className:ue.a.li},m.a.createElement("p",null,Je==null?void 0:Je.name),m.a.createElement("div",{className:ue.a.bottom},m.a.createElement("span",{className:"c-grey-333"},"\u7F16\u7A0B\u9898"),m.a.createElement("i",{className:ue.a.line}),m.a.createElement("span",{className:"c-grey-333"},Je.difficulty===1&&"\u7B80\u5355",Je.difficulty===2&&"\u9002\u4E2D",Je.difficulty===3&&"\u56F0\u96BE"),m.a.createElement("i",{className:ue.a.line}),m.a.createElement("span",null,"\u521B\u5EFA\u8005\xA0",m.a.createElement(h.a,{title:Je==null||((Ve=Je.author)===null||Ve===void 0)?void 0:Ve.name},m.a.createElement("span",{className:"c-grey-333"},(Je==null||((tt=Je.author)===null||tt===void 0||((rt=tt.name)===null||rt===void 0))?void 0:rt.length)>6?(Je==null||((vt=Je.author)===null||vt===void 0||((gt=vt.name)===null||gt===void 0))?void 0:gt.substr(0,3))+"...":Je==null||((mt=Je.author)===null||mt===void 0)?void 0:mt.name))),m.a.createElement("i",{className:ue.a.line}),m.a.createElement("span",{className:ue.a.des},"\u66F4\u65B0\xA0",m.a.createElement("span",{className:"c-grey-333"},Je==null?void 0:Je.updated_at)))),m.a.createElement("div",{className:ue.a.del,onClick:function(){ui(ln.filter(function($n){return $n.id!==Je.id}).map(function($n){return $n.id}))}},"\u5220\u9664"))})))),m.a.createElement("div",null,Hn===ur.Mine&&Ge&&m.a.createElement(L.a,{onClick:dr,type:"link",className:ue.a.exportBtn},m.a.createElement("img",{src:yi.a,className:ue.a.pngIcon}),m.a.createElement("span",null,"\u5BFC\u51FA\u8BD5\u9898")))),po?m.a.createElement("div",null,m.a.createElement(L.a,{style:{paddingLeft:0},onClick:function(){je.page=1,je.keyword=null,delete je.id,Yt(je),Qa(!1),zr(je)},type:"link"}," ",m.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),m.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",decodeURIComponent(je.keyword),"\u201D")):null,m.a.createElement("div",{className:ue.a.contentListWrap},pn!==0?m.a.createElement(K.a,{size:"large",spinning:kn["problemset/getItemBanks"]},An.map(function(Je,$e){var Ve,tt;return m.a.createElement("div",{className:ue.a.li},m.a.createElement("div",{className:ue.a.top},m.a.createElement(or.b,{key:Je.id,data:Je,selectIds:Ce,onSelectCheckBox:ui})),m.a.createElement("div",{className:ue.a.bottom},m.a.createElement("p",{className:"".concat(ue.a.actionLeftItem," ").concat(ue.a.questionTypeName)},(Ve=Aa.find(function(rt){return rt.type===Je.item_type}))===null||Ve===void 0?void 0:Ve.name),m.a.createElement("p",{className:ue.a.actionLeftItem},qi[Je.difficulty]),m.a.createElement("p",{className:ue.a.actionLeftItem},"\u521B\u5EFA\u8005",m.a.createElement("span",{className:"c-grey-333"},Je==null||((tt=Je.author)===null||tt===void 0)?void 0:tt.name)),m.a.createElement("p",{className:ue.a.actionLeftItem},"\u66F4\u65B0",m.a.createElement("span",{className:"c-grey-333"},Je==null?void 0:Je.updated_at)),m.a.createElement("p",{className:ue.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",m.a.createElement("span",{className:"c-grey-333"},Je==null?void 0:Je.quotes)),!Ze&&m.a.createElement("div",{className:ue.a.more},Jr({},Je))))})):m.a.createElement(K.a,{size:"large",spinning:kn["problemset/getItemBanks"]},m.a.createElement(ae.a,null))),pn!==0&&!Ze&&m.a.createElement(z.a,{showQuickJumper:!0,onChange:ya,defaultCurrent:1,pageSize:je==null?void 0:je.per_page,current:je.page||1,total:pn,showTotal:function($e){return m.a.createElement("span",{className:"mr10"},"\u5171",m.a.createElement("span",{className:"c-light-primary"},$e),"\u6761\u6570\u636E")}}),Ze&&m.a.createElement("div",{style:{height:20}})),Ge&&m.a.createElement(kt,{basketData:Bt.basketData,visible:Ta,basketTotal:fa,onClose:function(){return ho(!1)},onDelete:Mo}),!Object(br.m)()&&Ge&&m.a.createElement(hr,{visibleBasket:Ta,onToggleVisible:function(){return ho(!Ta)},count:fa})),m.a.createElement(ve,null),m.a.createElement(Ue,{onReloadData:Cr}),m.a.createElement(nt,{onReloadData:function(){return wi([null])}}),m.a.createElement(Mt,{onReloadData:Cr,onReloadBasketData:Ni}),Wn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?m.a.createElement(Tr,{shixunIds:le,cb:Kr}):null,m.a.createElement(lt,null),m.a.createElement(Ye,null),m.a.createElement(bt,null),m.a.createElement(ne,null),m.a.createElement(J,null),m.a.createElement(we,{onOk:yo}),m.a.createElement(te.a,{onOk:Ga})),Ge?m.a.createElement(k.Fragment,null,!!(Ce!=null&&Ce.length)&&m.a.createElement("div",{className:ue.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(u.a,{className:"font14",checked:An!=null&&An.length?Ce.length===(An==null?void 0:An.length):!1,onChange:function($e){return Ji($e.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",Ce==null?void 0:Ce.length,")"))),m.a.createElement("div",{className:ue.a.btns},In&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Vr(!0)}},m.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),In&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Vr(!1)}},m.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return ro()}},m.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:ao}," ",m.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Wa()}}," ",m.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:Ci}," ",m.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:er}," ",m.a.createElement("i",{className:"iconfont icon-fabu5"}),"\u6279\u91CF\u53D1\u5E03"),m.a.createElement("div",{onClick:function(){return Fe([])},style:{marginLeft:"auto"},className:ue.a.btn}," ",m.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):Ze?"":m.a.createElement("div",{className:ue.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(u.a,{className:"font14",checked:An!=null&&An.length?Ce.length===(An==null?void 0:An.length):!1,onChange:function($e){return Ji($e.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",Ce==null?void 0:Ce.length,")"))),m.a.createElement("div",{className:ue.a.btns},In&&!!(Ce!=null&&Ce.length)&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Vr(!0)}},m.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),In&&!!(Ce!=null&&Ce.length)&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Vr(!1)}},m.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),m.a.createElement("div",{className:"c-grey-333 font12 mr40",style:{marginLeft:"auto"}},"\u5DF2\u52A0\u5165:\xA0\xA0",It,"\u9898"),m.a.createElement("div",{onClick:zi,className:ue.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))),Ze&&m.a.createElement("div",{className:ue.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(z.a,{showQuickJumper:!0,onChange:ya,defaultCurrent:1,pageSize:je==null?void 0:je.per_page,current:je.page||1,hideOnSinglePage:!0,total:pn,showTotal:function($e){return m.a.createElement("span",{className:"mr10"},"\u5171",m.a.createElement("span",{className:"c-light-primary"},$e),"\u6761\u6570\u636E")}})),m.a.createElement("div",{className:ue.a.btns},m.a.createElement(Y.a,{align:"middle",style:{marginLeft:"auto"}},m.a.createElement(Y.a,{onClick:function(){if((ln==null?void 0:ln.length)<=0){i.b.info("\u5F53\u524D\u6682\u65E0\u6570\u636E");return}cr(!0)},align:"middle",className:"current"},m.a.createElement("i",{className:"iconfont icon-yixuan mr10 c-light-primary font20"}),m.a.createElement("span",null,"\u5DF2\u9009",m.a.createElement("span",{className:"c-light-primary"},Ce.length),"\u4E2A")),m.a.createElement(L.a,{className:"mr20 ml40",onClick:function(){if(ut){var $e;y.d.push("/classrooms/".concat(sn.params.coursesId,"/program_homework/").concat(sn==null||(($e=sn.params)===null||$e===void 0)?void 0:$e.categoryId,"/detail?tabs=1"));return}y.d.push("/classrooms/".concat(sn.params.coursesId,"/program_homework"))}},"\u53D6\u6D88"),m.a.createElement(L.a,{loading:Un,onClick:Oa,type:"primary"},"\u786E\u8BA4",ut?"\u7F16\u8F91":"\u65B0\u5EFA"))))))},Ya=Ee.default=Object(y.a)(function(Vt){var st=Vt.classroomList,Pt=Vt.problemset,xt=Vt.user,Dt=Vt.loading,Zt=Vt.globalSetting,yn=Vt.shixunHomeworks;return{classroomList:st,problemset:Pt,user:xt,globalSetting:Zt,loading:Dt.effects,shixunHomeworks:yn}})(xa)},JYp7:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return ie});var ie;(function(Y){function N(i){return i&&typeof i=="object"&&typeof i[Symbol.iterator]=="function"}Y.is=N;const z=Object.freeze([]);function I(){return z}Y.empty=I;function*M(i){yield i}Y.single=M;function G(i){return i||z}Y.from=G;function K(i){return!i||i[Symbol.iterator]().next().done===!0}Y.isEmpty=K;function n(i){return i[Symbol.iterator]().next().value}Y.first=n;function L(i,D){for(const A of i)if(D(A))return!0;return!1}Y.some=L;function x(i,D){for(const A of i)if(D(A))return A;return}Y.find=x;function*f(i,D){for(const A of i)D(A)&&(yield A)}Y.filter=f;function*b(i,D){let A=0;for(const S of i)yield D(S,A++)}Y.map=b;function*h(...i){for(const D of i)for(const A of D)yield A}Y.concat=h;function*o(i){for(const D of i)for(const A of D)yield A}Y.concatNested=o;function p(i,D,A){let S=A;for(const R of i)S=D(S,R);return S}Y.reduce=p;function*l(i,D,A=i.length){for(D<0&&(D+=i.length),A<0?A+=i.length:A>i.length&&(A=i.length);D<A;D++)yield i[D]}Y.slice=l;function u(i,D=Number.POSITIVE_INFINITY){const A=[];if(D===0)return[A,i];const S=i[Symbol.iterator]();for(let R=0;R<D;R++){const O=S.next();if(O.done)return[A,Y.empty()];A.push(O.value)}return[A,{[Symbol.iterator](){return S}}]}Y.consume=u;function s(i,D,A=(S,R)=>S===R){const S=i[Symbol.iterator](),R=D[Symbol.iterator]();for(;;){const O=S.next(),g=R.next();if(O.done!==g.done)return!1;if(O.done)return!0;if(!A(O.value,g.value))return!1}}Y.equals=s})(ie||(ie={}))},LE3n:function(it,Ee,U){"use strict";var ie=U("ozfa"),Y=U("MJZm"),N=U("k1fw"),z=U("+L6B"),I=U("2/Rp"),M=U("5NDa"),G=U("5rEg"),K=U("2qtc"),n=U("kLXV"),L=U("miYZ"),x=U("tsqr"),f=U("9og8"),b=U("tJVT"),h=U("WmNS"),o=U.n(h),p=U("q1tI"),l=U.n(p),u=U("1vnw"),s=U.n(u),i=U("ErOA"),D=U("Ix/O"),A=U.n(D),S=U("xTzM"),R=U.n(S),O=U("WCUW"),g=U("LvDl"),_=U.n(g),d=function(E){var w=E.isProblemset,B=E.name,W=E.id,T=E.itemBanksCount,k=E.onOpen,m=k===void 0?function(){}:k,y=E.onShare,H=y===void 0?function(){}:y,Q=E.onMove,te=Q===void 0?function(){}:Q,ae=E.onDeleteOk,Te=ae===void 0?function(){}:ae,_e=Object(p.useState)(!1),ge=Object(b.a)(_e,2),ve=ge[0],Oe=ge[1],he=Object(p.useState)(B),V=Object(b.a)(he,2),P=V[0],j=V[1],$=Object(p.useState)(B),J=Object(b.a)($,2),X=J[0],ye=J[1],Re=function(){var pe=Object(f.a)(o.a.mark(function we(ke){var Ue,Qe,nt;return o.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(Ue=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],X.trim()){qe.next=4;break}return x.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),qe.abrupt("return");case 4:if(!(X.charAt(0)===" ")){qe.next=7;break}return x.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),qe.abrupt("return");case 7:Qe=0;case 8:if(!(Qe<X.length)){qe.next=15;break}if(!Ue.includes(X.charAt(Qe))){qe.next=12;break}return x.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),qe.abrupt("return",!1);case 12:Qe++,qe.next=8;break;case 15:return qe.next=17,Object(i.a)("/api/item_banks_groups/".concat(Math.abs(ke),".json"),{method:"put",body:{name:X}});case 17:nt=qe.sent,nt.status===0&&(Oe(!1),j(X));case 19:case"end":return qe.stop()}},we)}));return function(ke){return pe.apply(this,arguments)}}(),Ke=function(we){n.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:l.a.createElement("div",null,l.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"),l.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 ke=Object(f.a)(o.a.mark(function Qe(){var nt;return o.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:return qe.next=2,Object(i.a)("/api/item_banks_groups/".concat(Math.abs(we),".json"),{method:"delete",body:{}});case 2:nt=qe.sent,nt.status===0&&Te(we);case 4:case"end":return qe.stop()}},Qe)}));function Ue(){return ke.apply(this,arguments)}return Ue}()})};return l.a.createElement("div",{className:s.a.list},ve?l.a.createElement(G.a,{style:{maxWidth:780},value:X,onChange:function(we){return ye(we.target.value)}}):l.a.createElement("div",{title:P,onClick:function(){return m(W)},className:s.a.name},P),w&&l.a.createElement("div",{className:s.a.btns},ve?l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{style:{height:16},onClick:function(){return Re(W)},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),l.a.createElement("div",{style:{height:16},onClick:function(){ye(P),Oe(!1)},className:"ml10"},l.a.createElement("i",{className:"iconfont icon-qingchu"}))):l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{onClick:function(){return te(W,"up")},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),l.a.createElement("div",{onClick:function(){return te(W,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},l.a.createElement("i",{className:"iconfont icon-shangyi3"}))),l.a.createElement(I.a,{className:"ml10",onClick:function(){if(!T){x.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}H(Math.abs(W))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),l.a.createElement(I.a,{className:"ml10",onClick:function(){return Oe(!0)},type:"link"},"\u91CD\u547D\u540D"),l.a.createElement(I.a,{onClick:function(){return Ke(W)},type:"link",danger:!0},"\u5220\u9664")))},c=function(E){var w=E.isProblemset,B=E.data,W=E.onOpen,T=W===void 0?function(){}:W,k=E.onShare,m=k===void 0?function(){}:k,y=E.reloadData,H=Object(p.useState)(),Q=Object(b.a)(H,2),te=Q[0],ae=Q[1];Object(p.useEffect)(function(){ae(B==null?void 0:B.map(function(P){return{title:l.a.createElement(d,{isProblemset:w,name:P.name,id:P.id,itemBanksCount:P.item_banks_count,onMove:_e,onOpen:T,onShare:m,onDeleteOk:ve}),key:P.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}}))},[B]);var Te=function P(j,$,J){for(var X=Object(g.cloneDeep)(j),ye=0;ye<X.length;ye++){if(X[ye].key===$){if(J==="up"){var Re=[X[ye],X[ye-1]];X[ye-1]=Re[0],X[ye]=Re[1]}else{var Ke=[X[ye+1],X[ye]];X[ye]=Ke[0],X[ye+1]=Ke[1]}break}X[ye].children&&(X[ye].children=P(X[ye].children,$,J))}return X},_e=function(){var P=Object(f.a)(o.a.mark(function j($,J){var X;return o.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:if(!(J==="up")){Re.next=6;break}return Re.next=3,Object(O.I)({id:Math.abs($)});case 3:Re.t0=Re.sent,Re.next=9;break;case 6:return Re.next=8,Object(O.H)({id:Math.abs($)});case 8:Re.t0=Re.sent;case 9:X=Re.t0,X.status===0&&ae(function(Ke){return Te(Ke,$,J)});case 11:case"end":return Re.stop()}},j)}));return function($,J){return P.apply(this,arguments)}}(),ge=function P(j,$){return j.filter(function(J){return J.key===$?!1:(J.children&&(J.children=P(J.children,$)),!0)})},ve=function(j){ae(function($){return ge($,j)}),y()},Oe=function P(j,$,J){return j.map(function(X){return X.key===$?Object(N.a)(Object(N.a)({},X),J):X.children?Object(N.a)(Object(N.a)({},X),{},{children:P(X.children,$,J)}):X})},he=function(){var P=Object(f.a)(o.a.mark(function j($){var J,X,ye,Re,Ke;return o.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return J=$.key,we.next=3,Object(O.B)({group_id:Math.abs(J)});case 3:X=we.sent,ye=X||{},Re=ye.item_banks_group,Ke=ye.item_banks_group_count,Ke>0?ae(function(ke){return Oe(ke,J,{children:Re.map(function(Ue){return{title:l.a.createElement(d,{isProblemset:w,name:Ue.name,id:Ue.id,itemBanksCount:Ue.item_banks_count,onMove:_e,onOpen:T,onShare:m,onDeleteOk:ve}),key:Ue.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}})})}):ae(function(ke){return Oe(ke,J,{isLeaf:!0})});case 6:case"end":return we.stop()}},j)}));return function($){return P.apply(this,arguments)}}(),V=function(j,$){var J=$.node,X=$.expanded;ae(function(ye){return Oe(ye,J.key,{icon:X?l.a.createElement("img",{src:R.a,className:s.a.folderIcon}):l.a.createElement("img",{src:A.a,className:s.a.folderIcon})})})};return(te==null?void 0:te.length)>0&&l.a.createElement(Y.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:te,loadData:he,onExpand:V,className:s.a.folderWrapper,selectable:!1})};Ee.a=c},LdHM:function(it,Ee,U){"use strict";U.d(Ee,"b",function(){return i}),U.d(Ee,"a",function(){return A});var ie=U("1OyB"),Y=U("vuIU"),N=U("Ji7U"),z=U("LK+K"),I=U("q1tI"),M=U("rePB"),G=U("Ff2n"),K=U("ODXe"),n=U("4IlW"),L=U("bX4T"),x=U("YrtM"),f=U("TSYQ"),b=U.n(f),h=U("+nKL"),o=U("8OUc"),p=function(H,Q){var te=H.prefixCls,ae=H.id,Te=H.flattenOptions,_e=H.childrenAsData,ge=H.values,ve=H.searchValue,Oe=H.multiple,he=H.defaultActiveFirstOption,V=H.height,P=H.itemHeight,j=H.notFoundContent,$=H.open,J=H.menuItemSelectedIcon,X=H.virtual,ye=H.onSelect,Re=H.onToggleOpen,Ke=H.onActiveValue,pe=H.onScroll,we=H.onMouseEnter,ke="".concat(te,"-item"),Ue=Object(x.a)(function(){return Te},[$,Te],function(ne,q){return q[0]&&ne[1]!==q[1]}),Qe=I.useRef(null),nt=function(q){q.preventDefault()},ot=function(q){Qe.current&&Qe.current.scrollTo({index:q})},qe=function(q){for(var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ue=Ue.length,oe=0;oe<ue;oe+=1){var ce=(q+oe*se+ue)%ue,be=Ue[ce],Se=be.group,Pe=be.data;if(!Se&&!Pe.disabled)return ce}return-1},ft=I.useState(function(){return qe(0)}),lt=Object(K.a)(ft,2),pt=lt[0],Ye=lt[1],Tt=function(q){Ye(q);var se=Ue[q];if(!se){Ke(null,-1);return}Ke(se.data.value,q)};I.useEffect(function(){Tt(he!==!1?qe(0):-1)},[Ue.length,ve]),I.useEffect(function(){var ne=setTimeout(function(){if(!Oe&&$&&ge.size===1){var q=Array.from(ge)[0],se=Ue.findIndex(function(ue){var oe=ue.data;return oe.value===q});Tt(se),ot(se)}});return function(){return clearTimeout(ne)}},[$]);var bt=function(q){q!==void 0&&ye(q,{selected:!ge.has(q)}),Oe||Re(!1)};if(I.useImperativeHandle(Q,function(){return{onKeyDown:function(q){var se=q.which;switch(se){case n.a.UP:case n.a.DOWN:{var ue=0;if(se===n.a.UP?ue=-1:se===n.a.DOWN&&(ue=1),ue!==0){var oe=qe(pt+ue,ue);ot(oe),Tt(oe)}break}case n.a.ENTER:{var ce=Ue[pt];ce&&!ce.data.disabled?bt(ce.data.value):bt(void 0),$&&q.preventDefault();break}case n.a.ESC:Re(!1)}},onKeyUp:function(){},scrollTo:function(q){ot(q)}}}),Ue.length===0)return I.createElement("div",{role:"listbox",id:"".concat(ae,"_list"),className:"".concat(ke,"-empty"),onMouseDown:nt},j);function me(ne){var q=Ue[ne];if(!q)return null;var se=q.data||{},ue=se.value,oe=se.label,ce=se.children,be=Object(L.a)(se,!0),Se=_e?ce:oe;return q?I.createElement("div",Object.assign({"aria-label":typeof Se=="string"?Se:null},be,{key:ne,role:"option",id:"".concat(ae,"_list_").concat(ne),"aria-selected":ge.has(ue)}),ue):null}return I.createElement(I.Fragment,null,I.createElement("div",{role:"listbox",id:"".concat(ae,"_list"),style:{height:0,width:0,overflow:"hidden"}},me(pt-1),me(pt),me(pt+1)),I.createElement(h.a,{itemKey:"key",ref:Qe,data:Ue,height:V,itemHeight:P,fullHeight:!1,onMouseDown:nt,onScroll:pe,virtual:X,onMouseEnter:we},function(ne,q){var se,ue=ne.group,oe=ne.groupOption,ce=ne.data,be=ce.label,Se=ce.key;if(ue)return I.createElement("div",{className:b()(ke,"".concat(ke,"-group"))},be!==void 0?be:Se);var Pe=ce.disabled,We=ce.value,et=ce.title,yt=ce.children,Rt=ce.style,kt=ce.className,mn=Object(G.a)(ce,["disabled","value","title","children","style","className"]),zt=ge.has(We),Mt="".concat(ke,"-option"),Qn=b()(ke,Mt,kt,(se={},Object(M.a)(se,"".concat(Mt,"-grouped"),oe),Object(M.a)(se,"".concat(Mt,"-active"),pt===q&&!Pe),Object(M.a)(se,"".concat(Mt,"-disabled"),Pe),Object(M.a)(se,"".concat(Mt,"-selected"),zt),se)),un=_e?yt:be,hr=!J||typeof J=="function"||zt;return I.createElement("div",Object.assign({},mn,{"aria-selected":zt,className:Qn,title:et,onMouseMove:function(){if(pt===q||Pe)return;Tt(q)},onClick:function(){Pe||bt(We)},style:Rt}),I.createElement("div",{className:"".concat(Mt,"-content")},un||We),I.isValidElement(J)||zt,hr&&I.createElement(o.a,{className:"".concat(ke,"-option-state"),customizeIcon:J,customizeIconProps:{isSelected:zt}},zt?"\u2713":null))}))},l=I.forwardRef(p);l.displayName="OptionList";var u=l,s=function(){return null};s.isSelectOption=!0;var i=s,D=function(){return null};D.isSelectOptGroup=!0;var A=D,S=U("VTBJ"),R=U("Zm9Q");function O(y){var H=y.key,Q=y.props,te=Q.children,ae=Q.value,Te=Object(G.a)(Q,["children","value"]);return Object(S.a)({key:H,value:ae!==void 0?ae:H,children:te},Te)}function g(y){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(y).map(function(Q,te){if(!I.isValidElement(Q)||!Q.type)return null;var ae=Q.type.isSelectOptGroup,Te=Q.key,_e=Q.props,ge=_e.children,ve=Object(G.a)(_e,["children"]);return H||!ae?O(Q):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Te===null?te:Te,"__"),label:Te},ve),{},{options:g(ge)})}).filter(function(Q){return Q})}var _=U("2Qr1"),d=U("qNPg"),c=U("U8pU"),C=U("Kwbf"),E=U("WKfj");function w(y){var H=y.mode,Q=y.options,te=y.children,ae=y.backfill,Te=y.allowClear,_e=y.placeholder,ge=y.getInputElement,ve=y.showSearch,Oe=y.onSearch,he=y.defaultOpen,V=y.autoFocus,P=y.labelInValue,j=y.value,$=y.inputValue,J=y.optionLabelProp,X=H==="multiple"||H==="tags",ye=ve!==void 0?ve:X||H==="combobox",Re=Q||g(te);if(Object(C.a)(H!=="tags"||Re.every(function(ke){return!ke.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var Ke=Re.some(function(ke){return ke.options?ke.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in ke?ke.value:ke.key)=="number"});Object(C.a)(!Ke,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(H!=="combobox"||!J,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(H==="combobox"||!ae,"`backfill` only works with `combobox` mode."),Object(C.a)(H==="combobox"||!ge,"`getInputElement` only work with `combobox` mode."),Object(C.b)(H!=="combobox"||!ge||!Te||!_e,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!ye&&H!=="combobox"&&H!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!he||V,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),j!=null){var pe=Object(E.d)(j);Object(C.a)(!P||pe.every(function(ke){return Object(c.a)(ke)==="object"&&("key"in ke||"value"in ke)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!X||Array.isArray(j),"`value` should be array when `mode` is `multiple` or `tags`")}if(te){var we=null;Object(R.a)(te).some(function(ke){if(!I.isValidElement(ke)||!ke.type)return!1;var Ue=ke.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var Qe=Object(R.a)(ke.props.children).every(function(nt){return!I.isValidElement(nt)||!ke.type||nt.type.isSelectOption?!0:(we=nt.type,!1)});return!Qe}return we=Ue,!0}),we&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(we.displayName||we.name||we,"`.")),Object(C.a)($===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=w,W=Object(d.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:g,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:B,fillOptionsWithMissingValue:_.a}),T=function(y){Object(N.a)(Q,y);var H=Object(z.a)(Q);function Q(){var te;return Object(ie.a)(this,Q),te=H.apply(this,arguments),te.selectRef=I.createRef(),te.focus=function(){te.selectRef.current.focus()},te.blur=function(){te.selectRef.current.blur()},te}return Object(Y.a)(Q,[{key:"render",value:function(){return I.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),Q}(I.Component);T.Option=i,T.OptGroup=A;var k=T,m=Ee.c=k},M8RZ:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return n});var ie=U("fWQN"),Y=U("mtLc"),N=U("yKVA"),z=U("879j"),I=U("q1tI"),M=U.n(I),G=U("i8i4"),K=U.n(G),n=function(L){Object(N.a)(f,L);var x=Object(z.a)(f);function f(b){var h;Object(ie.a)(this,f),h=x.call(this,b);var o=window.document;return h.node=o.createElement("div"),o.body.appendChild(h.node),h}return Object(Y.a)(f,[{key:"render",value:function(){var h=this.props.children;return Object(G.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(M.a.Component)},MI8n:function(it,Ee,U){"use strict";U.d(Ee,"c",function(){return I}),U.d(Ee,"b",function(){return n}),U.d(Ee,"e",function(){return L}),U.d(Ee,"a",function(){return x}),U.d(Ee,"d",function(){return f}),U.d(Ee,"f",function(){return b});var ie=U("/cxE"),Y=U("pmY6"),N=U("24hK"),z=U("5Y4S"),I;(function(h){h.None=()=>Y.a.None;function o(w){return(B,W=null,T)=>{let k=!1,m;return m=w(y=>k?void 0:(m?m.dispose():k=!0,B.call(W,y)),null,T),k&&m.dispose(),m}}h.once=o;function p(w,B){return A((W,T=null,k)=>w(m=>W.call(T,B(m)),null,k))}h.map=p;function l(w,B){return A((W,T=null,k)=>w(m=>{B(m),W.call(T,m)},null,k))}h.forEach=l;function u(w,B){return A((W,T=null,k)=>w(m=>B(m)&&W.call(T,m),null,k))}h.filter=u;function s(w){return w}h.signal=s;function i(...w){return(B,W=null,T)=>Object(Y.e)(...w.map(k=>k(m=>B.call(W,m),null,T)))}h.any=i;function D(w,B,W){let T=W;return p(w,k=>(T=B(T,k),T))}h.reduce=D;function A(w){let B;const W=new n({onFirstListenerAdd(){B=w(W.fire,W)},onLastListenerRemove(){B.dispose()}});return W.event}function S(w,B,W=100,T=!1,k){let m,y,H,Q=0;const te=new n({leakWarningThreshold:k,onFirstListenerAdd(){m=w(ae=>{Q++,y=B(y,ae),T&&!H&&(te.fire(y),y=void 0),clearTimeout(H),H=setTimeout(()=>{const Te=y;y=void 0,H=void 0,(!T||Q>1)&&te.fire(Te),Q=0},W)})},onLastListenerRemove(){m.dispose()}});return te.event}h.debounce=S;function R(w,B=(W,T)=>W===T){let W=!0,T;return u(w,k=>{const m=W||!B(k,T);return W=!1,T=k,m})}h.latch=R;function O(w,B){return[h.filter(w,B),h.filter(w,W=>!B(W))]}h.split=O;function g(w,B=!1,W=[]){let T=W.slice(),k=w(H=>{T?T.push(H):y.fire(H)});const m=()=>{T&&T.forEach(H=>y.fire(H)),T=null},y=new n({onFirstListenerAdd(){k||(k=w(H=>y.fire(H)))},onFirstListenerDidAdd(){T&&(B?setTimeout(m):m())},onLastListenerRemove(){k&&k.dispose(),k=null}});return y.event}h.buffer=g;class _{constructor(w){this.event=w}map(w){return new _(p(this.event,w))}forEach(w){return new _(l(this.event,w))}filter(w){return new _(u(this.event,w))}reduce(w,B){return new _(D(this.event,w,B))}latch(){return new _(R(this.event))}debounce(w,B=100,W=!1,T){return new _(S(this.event,w,B,W,T))}on(w,B,W){return this.event(w,B,W)}once(w,B,W){return o(this.event)(w,B,W)}}function d(w){return new _(w)}h.chain=d;function c(w,B,W=T=>T){const T=(...H)=>y.fire(W(...H)),k=()=>w.on(B,T),m=()=>w.removeListener(B,T),y=new n({onFirstListenerAdd:k,onLastListenerRemove:m});return y.event}h.fromNodeEventEmitter=c;function C(w,B,W=T=>T){const T=(...H)=>y.fire(W(...H)),k=()=>w.addEventListener(B,T),m=()=>w.removeEventListener(B,T),y=new n({onFirstListenerAdd:k,onLastListenerRemove:m});return y.event}h.fromDOMEventEmitter=C;function E(w){return new Promise(B=>o(w)(B))}h.toPromise=E})(I||(I={}));class M{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${M._idPool++}`}start(h){this._stopWatch=new z.a(!0),this._listenerCount=h}stop(){if(this._stopWatch){const h=this._stopWatch.elapsed();this._elapsedOverall+=h,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${h.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}M._idPool=0;let G=-1;class K{constructor(h,o=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let o=G;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||h<o)return;this._stacks||(this._stacks=new Map);const p=new Error().stack.split(`
`).slice(3).join(`
`),l=this._stacks.get(p)||0;if(this._stacks.set(p,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let u,s=0;for(const[i,D]of this._stacks)(!u||s<D)&&(u=i,s=D);console.warn(`[${this.name}] potential listener LEAK detected, having ${h} listeners already. MOST frequent listener (${s}):`),console.warn(u)}return()=>{const u=this._stacks.get(p)||0;this._stacks.set(p,u-1)}}}class n{constructor(h){var o;this._disposed=!1,this._options=h,this._leakageMon=G>0?new K(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new M(this._options._profName):void 0}get event(){return this._event||(this._event=(h,o,p)=>{var l;this._listeners||(this._listeners=new N.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(o?[h,o]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,o);const i=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),D=Object(Y.i)(()=>{if(i&&i(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const A=this._listeners&&!this._listeners.isEmpty();A||this._options.onLastListenerRemove(this)}});return p instanceof Y.b?p.add(D):Array.isArray(p)&&p.push(D),D}),this._event}fire(h){var o,p;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new N.a);for(let l of this._listeners)this._deliveryQueue.push([l,h]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,u]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,u):l[0].call(l[1],u)}catch(s){Object(ie.f)(s)}}(p=this._perfMon)===null||p===void 0||p.stop()}}dispose(){var h,o,p,l,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(l=(p=this._options)===null||p===void 0?void 0:p.onLastListenerRemove)===null||l===void 0||l.call(p),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class L extends n{constructor(h){super(h);this._isPaused=0,this._eventQueue=new N.a,this._mergeFn=h==null?void 0:h.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const h=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):super.fire(h))}}class x extends L{constructor(h){var o;super(h);this._delay=(o=h.delay)!==null&&o!==void 0?o:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class f{constructor(){this.buffers=[]}wrapEvent(h){return(o,p,l)=>h(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>o.call(p,u)):o.call(p,u)},void 0,l)}bufferEvents(h){const o=[];this.buffers.push(o);const p=h();return this.buffers.pop(),o.forEach(l=>l()),p}}class b{constructor(){this.listening=!1,this.inputEvent=I.None,this.inputEventListener=Y.a.None,this.emitter=new n({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(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(it,Ee,U){"use strict";(function(ie,Y){U.d(Ee,"b",function(){return p}),U.d(Ee,"i",function(){return i}),U.d(Ee,"f",function(){return D}),U.d(Ee,"d",function(){return A}),U.d(Ee,"g",function(){return S}),U.d(Ee,"h",function(){return R}),U.d(Ee,"c",function(){return O}),U.d(Ee,"k",function(){return g}),U.d(Ee,"j",function(){return _}),U.d(Ee,"a",function(){return d}),U.d(Ee,"e",function(){return E});var N;const z="en";let I=!1,M=!1,G=!1,K=!1,n=!1,L=!1,x=!1,f,b=z,h,o;const p=typeof self=="object"?self:typeof ie=="object"?ie:{};let l;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?l=p.vscode.process:typeof Y!="undefined"&&(l=Y);const u=typeof((N=l==null?void 0:l.versions)===null||N===void 0?void 0:N.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!u)o=navigator.userAgent,I=o.indexOf("Windows")>=0,M=o.indexOf("Macintosh")>=0,x=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=o.indexOf("Linux")>=0,L=!0,f=navigator.language,b=f;else if(typeof l=="object"){I=l.platform==="win32",M=l.platform==="darwin",G=l.platform==="linux",K=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,f=z,b=z;const w=l.env.VSCODE_NLS_CONFIG;if(w)try{const B=JSON.parse(w),W=B.availableLanguages["*"];f=B.locale,b=W||z,h=B._translationsConfigFile}catch(B){}n=!0}else console.error("Unable to resolve platform.");let s=0;M?s=1:I?s=3:G&&(s=2);const i=I,D=M,A=G,S=n,R=L,O=x,g=o,_=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let W=[];p.addEventListener("message",k=>{if(k.data&&k.data.vscodeSetImmediateId)for(let m=0,y=W.length;m<y;m++){const H=W[m];if(H.id===k.data.vscodeSetImmediateId){W.splice(m,1),H.callback();return}}});let T=0;return k=>{const m=++T;W.push({id:m,callback:k}),p.postMessage({vscodeSetImmediateId:m},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const B=Promise.resolve();return W=>B.then(W)}(),d=M||x?2:I?1:3;let c=!0,C=!1;function E(){if(!C){C=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2;const B=new Uint16Array(w.buffer);c=B[0]===(2<<8)+1}return c}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(it,Ee,U){"use strict";U.d(Ee,"C",function(){return ie}),U.d(Ee,"v",function(){return N}),U.d(Ee,"s",function(){return z}),U.d(Ee,"t",function(){return I}),U.d(Ee,"U",function(){return M}),U.d(Ee,"J",function(){return G}),U.d(Ee,"O",function(){return K}),U.d(Ee,"p",function(){return n}),U.d(Ee,"T",function(){return L}),U.d(Ee,"q",function(){return x}),U.d(Ee,"N",function(){return f}),U.d(Ee,"M",function(){return b}),U.d(Ee,"Q",function(){return h}),U.d(Ee,"u",function(){return o}),U.d(Ee,"x",function(){return p}),U.d(Ee,"I",function(){return l}),U.d(Ee,"f",function(){return u}),U.d(Ee,"h",function(){return s}),U.d(Ee,"g",function(){return i}),U.d(Ee,"i",function(){return D}),U.d(Ee,"G",function(){return A}),U.d(Ee,"H",function(){return S}),U.d(Ee,"r",function(){return R}),U.d(Ee,"R",function(){return O}),U.d(Ee,"d",function(){return g}),U.d(Ee,"e",function(){return _}),U.d(Ee,"E",function(){return d}),U.d(Ee,"F",function(){return c}),U.d(Ee,"j",function(){return C}),U.d(Ee,"z",function(){return E}),U.d(Ee,"K",function(){return B}),U.d(Ee,"L",function(){return W}),U.d(Ee,"m",function(){return k}),U.d(Ee,"k",function(){return y}),U.d(Ee,"A",function(){return Q}),U.d(Ee,"a",function(){return te}),U.d(Ee,"n",function(){return ae}),U.d(Ee,"l",function(){return Te}),U.d(Ee,"D",function(){return _e}),U.d(Ee,"B",function(){return ge}),U.d(Ee,"b",function(){return ve}),U.d(Ee,"S",function(){return Oe}),U.d(Ee,"o",function(){return he}),U.d(Ee,"P",function(){return V}),U.d(Ee,"w",function(){return P}),U.d(Ee,"c",function(){return j}),U.d(Ee,"y",function(){return X});function ie(pe){return!pe||typeof pe!="string"?!0:pe.trim().length===0}const Y=/{(\d+)}/g;function N(pe,...we){return we.length===0?pe:pe.replace(Y,function(ke,Ue){const Qe=parseInt(Ue,10);return isNaN(Qe)||Qe<0||Qe>=we.length?ke:we[Qe]})}function z(pe){return pe.replace(/[<>&]/g,function(we){switch(we){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return we}})}function I(pe){return pe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(pe,we=" "){const ke=G(pe,we);return K(ke,we)}function G(pe,we){if(!pe||!we)return pe;const ke=we.length;if(ke===0||pe.length===0)return pe;let Ue=0;for(;pe.indexOf(we,Ue)===Ue;)Ue=Ue+ke;return pe.substring(Ue)}function K(pe,we){if(!pe||!we)return pe;const ke=we.length,Ue=pe.length;if(ke===0||Ue===0)return pe;let Qe=Ue,nt=-1;for(;!(nt=pe.lastIndexOf(we,Qe-1),nt===-1||nt+ke!==Qe);){if(nt===0)return"";Qe=nt}return pe.substring(0,Qe)}function n(pe){return pe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function L(pe){return pe.replace(/\*/g,"")}function x(pe,we,ke={}){if(!pe)throw new Error("Cannot create regex from empty string");we||(pe=I(pe)),ke.wholeWord&&(/\B/.test(pe.charAt(0))||(pe="\\b"+pe),/\B/.test(pe.charAt(pe.length-1))||(pe=pe+"\\b"));let Ue="";return ke.global&&(Ue+="g"),ke.matchCase||(Ue+="i"),ke.multiline&&(Ue+="m"),ke.unicode&&(Ue+="u"),new RegExp(pe,Ue)}function f(pe){if(pe.source==="^"||pe.source==="^$"||pe.source==="$"||pe.source==="^\\s*$")return!1;const we=pe.exec("");return!!(we&&pe.lastIndex===0)}function b(pe){return(pe.global?"g":"")+(pe.ignoreCase?"i":"")+(pe.multiline?"m":"")+(pe.unicode?"u":"")}function h(pe){return pe.split(/\r\n|\r|\n/)}function o(pe){for(let we=0,ke=pe.length;we<ke;we++){const Ue=pe.charCodeAt(we);if(Ue!==32&&Ue!==9)return we}return-1}function p(pe,we=0,ke=pe.length){for(let Ue=we;Ue<ke;Ue++){const Qe=pe.charCodeAt(Ue);if(Qe!==32&&Qe!==9)return pe.substring(we,Ue)}return pe.substring(we,ke)}function l(pe,we=pe.length-1){for(let ke=we;ke>=0;ke--){const Ue=pe.charCodeAt(ke);if(Ue!==32&&Ue!==9)return ke}return-1}function u(pe,we){return pe<we?-1:pe>we?1:0}function s(pe,we,ke=0,Ue=pe.length,Qe=0,nt=we.length){for(;ke<Ue&&Qe<nt;ke++,Qe++){let ft=pe.charCodeAt(ke),lt=we.charCodeAt(Qe);if(ft<lt)return-1;if(ft>lt)return 1}const ot=Ue-ke,qe=nt-Qe;return ot<qe?-1:ot>qe?1:0}function i(pe,we){return D(pe,we,0,pe.length,0,we.length)}function D(pe,we,ke=0,Ue=pe.length,Qe=0,nt=we.length){for(;ke<Ue&&Qe<nt;ke++,Qe++){let ft=pe.charCodeAt(ke),lt=we.charCodeAt(Qe);if(ft===lt)continue;if(ft>=128||lt>=128)return s(pe.toLowerCase(),we.toLowerCase(),ke,Ue,Qe,nt);A(ft)&&(ft-=32),A(lt)&&(lt-=32);const pt=ft-lt;if(pt===0)continue;return pt}const ot=Ue-ke,qe=nt-Qe;return ot<qe?-1:ot>qe?1:0}function A(pe){return pe>=97&&pe<=122}function S(pe){return pe>=65&&pe<=90}function R(pe,we){return pe.length===we.length&&D(pe,we)===0}function O(pe,we){const ke=we.length;return we.length>pe.length?!1:D(pe,we,0,ke)===0}function g(pe,we){let ke,Ue=Math.min(pe.length,we.length);for(ke=0;ke<Ue;ke++)if(pe.charCodeAt(ke)!==we.charCodeAt(ke))return ke;return Ue}function _(pe,we){let ke,Ue=Math.min(pe.length,we.length);const Qe=pe.length-1,nt=we.length-1;for(ke=0;ke<Ue;ke++)if(pe.charCodeAt(Qe-ke)!==we.charCodeAt(nt-ke))return ke;return Ue}function d(pe){return 55296<=pe&&pe<=56319}function c(pe){return 56320<=pe&&pe<=57343}function C(pe,we){return(pe-55296<<10)+(we-56320)+65536}function E(pe,we,ke){const Ue=pe.charCodeAt(ke);if(d(Ue)&&ke+1<we){const Qe=pe.charCodeAt(ke+1);if(c(Qe))return C(Ue,Qe)}return Ue}function w(pe,we){const ke=pe.charCodeAt(we-1);if(c(ke)&&we>1){const Ue=pe.charCodeAt(we-2);if(d(Ue))return C(Ue,ke)}return ke}function B(pe,we){const ke=$.getInstance(),Ue=we,Qe=pe.length,nt=E(pe,Qe,we);we+=nt>=65536?2:1;let ot=ke.getGraphemeBreakType(nt);for(;we<Qe;){const qe=E(pe,Qe,we),ft=ke.getGraphemeBreakType(qe);if(j(ot,ft))break;we+=qe>=65536?2:1,ot=ft}return we-Ue}function W(pe,we){const ke=$.getInstance(),Ue=we,Qe=w(pe,we);we-=Qe>=65536?2:1;let nt=ke.getGraphemeBreakType(Qe);for(;we>0;){const ot=w(pe,we),qe=ke.getGraphemeBreakType(ot);if(j(qe,nt))break;we-=ot>=65536?2:1,nt=qe}return Ue-we}const T=/(?:[\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 k(pe){return T.test(pe)}const m=/(?:[\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 y(pe){return m.test(pe)}const H=/^[\t\n\r\x20-\x7E]*$/;function Q(pe){return H.test(pe)}const te=/[\u2028\u2029]/;function ae(pe){return te.test(pe)}function Te(pe){for(let we=0,ke=pe.length;we<ke;we++)if(_e(pe.charCodeAt(we)))return!0;return!1}function _e(pe){return pe=+pe,pe>=11904&&pe<=55215||pe>=63744&&pe<=64255||pe>=65281&&pe<=65374}function ge(pe){return pe>=127462&&pe<=127487||pe===8986||pe===8987||pe===9200||pe===9203||pe>=9728&&pe<=10175||pe===11088||pe===11093||pe>=127744&&pe<=128591||pe>=128640&&pe<=128764||pe>=128992&&pe<=129003||pe>=129280&&pe<=129535||pe>=129648&&pe<=129750}const ve=String.fromCharCode(65279);function Oe(pe){return!!(pe&&pe.length>0&&pe.charCodeAt(0)===65279)}function he(pe,we=!1){return pe?(we&&(pe=pe.replace(/\\./g,"")),pe.toLowerCase()!==pe):!1}function V(pe){const we=90-65+1;return pe=pe%(2*we),pe<we?String.fromCharCode(97+pe):String.fromCharCode(65+pe-we)}function P(pe){const we=$.getInstance();return we.getGraphemeBreakType(pe)}function j(pe,we){return pe===0?we!==5&&we!==7:pe===2&&we===3?!1:pe===4||pe===2||pe===3||(we===4||we===2||we===3)?!0:pe===8&&(we===8||we===9||we===11||we===12)||((pe===11||pe===9)&&(we===9||we===10)||((pe===12||pe===10)&&we===10||(we===5||we===13||(we===7||(pe===1||pe===13&&we===14)))))?!1:!(pe===6&&we===6)}class ${constructor(){this._data=J()}static getInstance(){return $._INSTANCE||($._INSTANCE=new $),$._INSTANCE}getGraphemeBreakType(pe){if(pe<32)return pe===10?3:pe===13?2:4;if(pe<127)return 0;const we=this._data,ke=we.length/3;let Ue=1;for(;Ue<=ke;)if(pe<we[3*Ue])Ue=2*Ue;else if(pe>we[3*Ue+1])Ue=2*Ue+1;else return we[3*Ue+2];return 0}}$._INSTANCE=null;function J(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function X(pe,we){if(pe===0)return 0;const ke=ye(pe,we);if(ke!==void 0)return ke;const Ue=w(we,pe);return pe-=Re(Ue),pe}function ye(pe,we){let ke=w(we,pe);for(pe-=Re(ke);Ke(ke)||ke===65039||ke===8419;){if(pe===0)return;ke=w(we,pe),pe-=Re(ke)}if(!ge(ke))return;if(pe>=0){const Ue=w(we,pe);Ue===8205&&(pe-=Re(Ue))}return pe}function Re(pe){return pe>=65536?2:1}function Ke(pe){return 127995<=pe&&pe<=127999}},NLgs:function(it,Ee,U){"use strict";U.d(Ee,"e",function(){return l}),U.d(Ee,"f",function(){return u}),U.d(Ee,"d",function(){return i}),U.d(Ee,"c",function(){return D}),U.d(Ee,"a",function(){return A}),U.d(Ee,"b",function(){return S});var ie=U("miYZ"),Y=U("tsqr"),N=U("9og8"),z=U("2qtc"),I=U("kLXV"),M=U("WmNS"),G=U.n(M),K=U("q1tI"),n=U.n(K),L=U("9kvl"),x=U("xKgJ"),f=U("1vsH"),b=U("RCxd"),h=U("yTi+"),o=U.n(h),p=U("m3rI"),l=function(O){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(u(O)&&s(g))},u=function(O){return Object(x.p)()?!0:(O({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},s=function(){var O,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,_=Object(L.c)()._store.getState(),d=_.user;return(O=d.userInfo)!==null&&O!==void 0&&O.profile_completed?!0:(I.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:g?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){L.d.push("/account/profile/edit")}}),!1)},i=function(){var O,g=Object(L.c)()._store.getState(),_=g.user;return(O=_.userInfo)!==null&&O!==void 0&&O.professional_certification?!0:(I.a.confirm({title:"\u63D0\u793A",centered:!0,content:n.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(f.S)("/account/certification")}}),!1)},D=function(){var O;if(Object(x.a)())return!0;var g=Object(L.c)()._store.getState(),_=g.user,d=g.globalSetting;return I.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc",style:{marginLeft:-38}},n.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),n.a.createElement("img",{src:p.a.IMG_SERVER+(d==null||((O=d.setting)===null||O===void 0)?void 0:O.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},A=function(O,g){var _;if(O)return!0;var d=Object(L.c)()._store.getState(),c=d.user,C=d.globalSetting;return I.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:n.a.createElement("div",null,n.a.createElement("p",null,g||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),n.a.createElement("div",{style:{marginLeft:"110px"}},n.a.createElement("img",{src:p.a.IMG_SERVER+(C==null||((_=C.setting)===null||_===void 0)?void 0:_.authority_qrcode_url),width:200}),n.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(f.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},S=function(O){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",_=Object(L.c)()._store.getState(),d=_.shixunsDetail.detail;return(d==null?void 0:d.public)===2||(d==null?void 0:d.public)===1||(d==null?void 0:d.shixun_status)===3?(I.a.info({centered:!0,icon:n.a.createElement(b.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc",style:{marginLeft:-38}},n.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},n.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(d==null?void 0:d.public)===2?"\u5DF2\u516C\u5F00":(d==null?void 0:d.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",g,"\u3002"),n.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),n.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:o.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(d==null?void 0:d.shixun_status)===2?(I.a.confirm({centered:!0,icon:n.a.createElement(b.a,null),title:"\u63D0\u793A",content:n.a.createElement("div",null,n.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",g,"\u3002"),n.a.createElement("br",null),n.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){I.a.confirm({width:440,centered:!0,icon:n.a.createElement(b.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var C=Object(N.a)(G.a.mark(function w(){var B;return G.a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,O({type:"shixunsDetail/cancelRelease",payload:{id:d==null?void 0:d.identifier}});case 2:B=T.sent,B.status!==401&&(Y.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),O({type:"shixunsDetail/getShixunsDetail",payload:{id:d==null?void 0:d.identifier}}),O({type:"practiceSetting/getCommonData",payload:{id:d==null?void 0:d.identifier}}));case 4:case"end":return T.stop()}},w)}));function E(){return C.apply(this,arguments)}return E}()})}}),!0):!1}},NvD2:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return M});var ie=U("Kwbf");function Y(G,K){var n=new Set;return G.forEach(function(L){K.has(L)||n.add(L)}),n}function N(G){var K=G||{},n=K.disabled,L=K.disableCheckbox,x=K.checkable;return!!(n||L)||x===!1}function z(G,K,n,L){for(var x=new Set(G),f=new Set,b=0;b<=n;b+=1){var h=K.get(b)||new Set;h.forEach(function(u){var s=u.key,i=u.node,D=u.children,A=D===void 0?[]:D;x.has(s)&&!L(i)&&A.filter(function(S){return!L(S.node)}).forEach(function(S){x.add(S.key)})})}for(var o=new Set,p=n;p>=0;p-=1){var l=K.get(p)||new Set;l.forEach(function(u){var s=u.parent,i=u.node;if(L(i)||!u.parent||o.has(u.parent.key))return;if(L(u.parent.node)){o.add(s.key);return}var D=!0,A=!1;(s.children||[]).filter(function(S){return!L(S.node)}).forEach(function(S){var R=S.key,O=x.has(R);D&&!O&&(D=!1),!A&&(O||f.has(R))&&(A=!0)}),D&&x.add(s.key),A&&f.add(s.key),o.add(s.key)})}return{checkedKeys:Array.from(x),halfCheckedKeys:Array.from(Y(f,x))}}function I(G,K,n,L,x){for(var f=new Set(G),b=new Set(K),h=0;h<=L;h+=1){var o=n.get(h)||new Set;o.forEach(function(s){var i=s.key,D=s.node,A=s.children,S=A===void 0?[]:A;!f.has(i)&&!b.has(i)&&!x(D)&&S.filter(function(R){return!x(R.node)}).forEach(function(R){f.delete(R.key)})})}b=new Set;for(var p=new Set,l=L;l>=0;l-=1){var u=n.get(l)||new Set;u.forEach(function(s){var i=s.parent,D=s.node;if(x(D)||!s.parent||p.has(s.parent.key))return;if(x(s.parent.node)){p.add(i.key);return}var A=!0,S=!1;(i.children||[]).filter(function(R){return!x(R.node)}).forEach(function(R){var O=R.key,g=f.has(O);A&&!g&&(A=!1),!S&&(g||b.has(O))&&(S=!0)}),A||f.delete(i.key),S&&b.add(i.key),p.add(i.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(Y(b,f))}}function M(G,K,n,L){var x=[],f;L?f=L:f=N;var b=new Set(G.filter(function(l){var u=!!n[l];return u||x.push(l),u})),h=new Map,o=0;Object.keys(n).forEach(function(l){var u=n[l],s=u.level,i=h.get(s);i||(i=new Set,h.set(s,i)),i.add(u),o=Math.max(o,s)}),Object(ie.a)(!x.length,"Tree missing follow keys: ".concat(x.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var p;return K===!0?p=z(b,h,o,f):p=I(b,K.halfCheckedKeys,h,o,f),p}},"ORt/":function(it,Ee,U){it.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(it,Ee,U){"use strict";U.d(Ee,"b",function(){return L}),U.d(Ee,"a",function(){return x}),U.d(Ee,"k",function(){return f}),U.d(Ee,"h",function(){return b}),U.d(Ee,"i",function(){return h}),U.d(Ee,"g",function(){return o}),U.d(Ee,"c",function(){return p}),U.d(Ee,"d",function(){return l}),U.d(Ee,"j",function(){return i}),U.d(Ee,"e",function(){return D}),U.d(Ee,"f",function(){return A});var ie=U("KQm4"),Y=U("U8pU"),N=U("Ff2n"),z=U("q1tI"),I=U.n(z),M=U("Kwbf"),G=U("WaYH"),K=.25,n=2;function L(S,R){var O=S.slice(),g=O.indexOf(R);return g>=0&&O.splice(g,1),O}function x(S,R){var O=S.slice();return O.indexOf(R)===-1&&O.push(R),O}function f(S){return S.split("-")}function b(S,R){return"".concat(S,"-").concat(R)}function h(S){return S&&S.type&&S.type.isTreeNode}function o(S,R){var O=[S],g=R[S];function _(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];d.forEach(function(c){var C=c.key,E=c.children;O.push(C),_(E)})}return _(g.children),O}function p(S,R){var O=S.clientY,g=R.selectHandle.getBoundingClientRect(),_=g.top,d=g.bottom,c=g.height,C=Math.max(c*K,n);return O<=_+C?-1:O>=d-C?1:0}function l(S,R){if(!S)return;var O=R.multiple;return O?S.slice():S.length?[S[0]]:S}var u=function(R){return R};function s(S,R){if(!S)return[];var O=R||{},g=O.processProps,_=g===void 0?u:g,d=Array.isArray(S)?S:[S];return d.map(function(c){var C=c.children,E=Object(N.a)(c,["children"]),w=s(C,R);return I.a.createElement(G.a,Object.assign({},_(E)),w)})}function i(S){if(!S)return null;var R;if(Array.isArray(S))R={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(Y.a)(S)==="object")R={checkedKeys:S.checked||void 0,halfCheckedKeys:S.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function D(S,R){var O=new Set;function g(_){if(O.has(_))return;var d=R[_];if(!d)return;O.add(_);var c=d.parent,C=d.node;if(C.disabled)return;c&&g(c.key)}return(S||[]).forEach(function(_){g(_)}),Object(ie.a)(O)}function A(S){var R={};return Object.keys(S).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(R[O]=S[O])}),R}},Ot1p:function(it,Ee,U){"use strict";var ie=U("2qtc"),Y=U("kLXV"),N=U("rAM+"),z=U("miYZ"),I=U("tsqr"),M=U("9og8"),G=U("tJVT"),K=U("jrin"),n=U("WmNS"),L=U.n(n),x=U("q1tI"),f=U.n(x),b=U("VrN/"),h=U.n(b),o=U("bdgK"),p=U("p77/"),l=U("Bd2K"),u=U("ELLl"),s=U("19Vz"),i=U("lZu9"),D=U("+NIl"),A=U("kSUc"),S=U("9Bee"),R=function(Pe){var We=Pe.value,et=We===void 0?"":We,yt=Pe.className,Rt=Pe.showTextOnly,kt=Pe.showLines,mn=Pe.style,zt=mn===void 0?{}:mn,Mt=Object(x.useMemo)(function(){return""},[et]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:Mt}}))},O=U("0Owb"),g=U("dejd"),_=U("C+DQ"),d=U("1vsH"),c=U("m3rI"),C=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function E(Pe){var We=Pe.onActionCallback,et=Pe.title,yt=Pe.icon,Rt=Pe.actionName,kt=Pe.className,mn=kt===void 0?"":kt,zt=Pe.children;function Mt(){We(Rt)}return f.a.createElement("a",{title:et,className:mn,onClick:Mt},f.a.createElement("i",{className:"md-iconfont ".concat(yt)}),zt)}var w=function(Pe){var We=Pe.watch,et=Pe.showNullButton,yt=Pe.onActionCallback,Rt=Pe.fullScreen,kt=Pe.insertTemp,mn=Pe.hidetoolBar,zt=Pe.uuid,Mt=Pe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(d.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(d.F)("_educoder_session"),"&key=").concat(zt,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Qn=[].concat(C,[{title:"".concat(We?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(We?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!mn&&Qn.map(function(un,hr){return f.a.createElement("li",{key:hr},un.actionName?f.a.createElement(E,Object(O.a)({},un,{onActionCallback:yt})):f.a.createElement("span",{className:"v-line"}))}),et?f.a.createElement("li",null,f.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:yt},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&f.a.createElement("li",null,f.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:yt},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(E,{icon:"".concat(Rt?"icon-shrink":"icon-enlarge"),title:Rt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:yt})))},B=U("M8RZ"),W=U("+L6B"),T=U("2/Rp"),k=U("y8nQ"),m=U("Vl3Y"),y=U("5NDa"),H=U("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},te=function(Pe){var We=Pe.callback,et=Pe.onCancel;function yt(Rt){We(Rt)}return f.a.createElement(m.a,Object(O.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:yt}),f.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(H.a,null)),f.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(H.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:et},"\u53D6\u6D88")))},ae=U("7ahc"),Te=U("HmJG"),_e=U("BjJ7"),ge=m.a.useForm,ve={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},he=function(Pe){var We=Pe.callback,et=Pe.onCancel,yt=ge(),Rt=Object(G.a)(yt,1),kt=Rt[0];function mn(Qn){We(Qn)}function zt(Qn,un){if(Qn.status===-1){I.b.error(Qn.message);return}kt.setFieldsValue({src:"/api/attachments/".concat(Qn.id),type:un.type})}function Mt(Qn){var un=Qn.target.files[0];P(un,zt)}return f.a.createElement(m.a,Object(O.a)({form:kt},Oe,{className:"upload-image-panel",onFinish:mn}),f.a.createElement(m.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(H.a,{style:ve})),f.a.createElement(V,{onFileChange:Mt}))),f.a.createElement(m.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(H.a,{style:{width:264}})),f.a.createElement(m.a.Item,{style:{textAlign:"right"}},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:et},"\u53D6\u6D88")))};function V(Pe){var We=Pe.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:We}))}function P(Pe,We){if(!Pe)throw new String("\u6CA1\u6709\u6587\u4EF6");var et=new FormData;et.append("editormd-image-file",Pe),et.append("file_param_name","editormd-image-file"),et.append("byxhr","true");var yt=new window.XMLHttpRequest;yt.withCredentials=!0,yt.addEventListener("load",function(Rt){We(JSON.parse(Rt.target.responseText),Pe)},!1),yt.addEventListener("error",function(Rt){console.error(Rt)},!1),yt.open("POST","".concat(_e.a,"/api/attachments.json")),yt.send(et)}var j=U("giR+"),$=U("fyUT"),J=U("7Kak"),X=U("9yH6"),ye=X.a.Group,Re={margin:"0 8px"},Ke=function(Pe){var We=Pe.callback,et=Pe.onCancel;function yt(Rt){We(Rt)}return f.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:yt},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:Re},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:Re},"\u884C\u6570"),f.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement($.a,null)),f.a.createElement("span",{style:Re},"\u5217\u6570"),f.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement($.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:Re},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(m.a.Item,{name:"align"},f.a.createElement(ye,null,f.a.createElement(X.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(X.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(X.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(X.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:et},"\u53D6\u6D88")))},pe=U("ErOA"),we=U("7Cbv"),ke="link",Ue="upload-image",Qe="code-block",nt="add-table",ot="------------",qe={default:ot,left:":".concat(ot),center:":".concat(ot,":"),right:"".concat(ot,":")},ft=U("9VGf"),lt,pt;function Ye(){}var Tt=0,bt=1e4,me="\u2581",ne=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function q(Pe){return/^\d+$/.test(Pe)?"".concat(Pe,"px"):Pe}var se=navigator.platform.toUpperCase().indexOf("MAC")>=0,ue=se?"Cmd":"Ctrl",oe=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ce=(lt={},Object(K.a)(lt,ue+"-B","bold"),Object(K.a)(lt,ue+"-I","italic"),lt),be=(pt={},Object(K.a)(pt,ke,"\u6DFB\u52A0\u94FE\u63A5"),Object(K.a)(pt,Qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(K.a)(pt,Ue,"\u6DFB\u52A0\u6587\u4EF6"),Object(K.a)(pt,nt,"\u6DFB\u52A0\u8868\u683C"),pt),Se=Ee.a=function(Pe){var We=Pe.defaultValue,et=We===void 0?"":We,yt=Pe.onChange,Rt=Pe.width,kt=Rt===void 0?"100%":Rt,mn=Pe.height,zt=mn===void 0?400:mn,Mt=Pe.miniToolbar,Qn=Mt===void 0?!1:Mt,un=Pe.isFocus,hr=un===void 0?!1:un,or=Pe.watch,bn=Pe.insertTemp,xr=Pe.mode,br=xr===void 0?"markdown":xr,Ar=Pe.id,Br=Ar===void 0?"markdown-editor-id":Ar,Ht=Pe.showResizeBar,an=Ht===void 0?!1:Ht,Cn=Pe.noStorage,qn=Cn===void 0?!1:Cn,Ir=Pe.showNullButton,gn=Ir===void 0?!1:Ir,wt=Pe.hidetoolBar,Rn=wt===void 0?!1:wt,jn=Pe.fullScreen,cn=jn===void 0?!1:jn,on=Pe.onBlur,Dn=Pe.onCMBeforeChange,ei=Pe.onFullScreen,Tr=Pe.className,ct=Tr===void 0?"":Tr,Qt=Pe.disablePaste,ji=Qt===void 0?!1:Qt,Xi=Pe.placeholder,ua=Xi===void 0?"":Xi,Bi=Pe.values,ca=Bi===void 0?"":Bi,En=Object(x.useState)(null),Ia=Object(G.a)(En,2),_t=Ia[0],Fi=Ia[1],yi=Object(x.useState)(et),ba=Object(G.a)(yi,2),ea=ba[0],pi=ba[1],da=Object(x.useState)(or),Ea=Object(G.a)(da,2),ur=Ea[0],xa=Ea[1],Ya=Object(x.useState)(cn),Vt=Object(G.a)(Ya,2),st=Vt[0],Pt=Vt[1],xt=Object(x.useState)(""),Dt=Object(G.a)(xt,2),Zt=Dt[0],yn=Dt[1],Tn=Object(x.useState)(0),en=Object(G.a)(Tn,2),xn=en[0],Fn=en[1],tn=Object(x.useState)(zt),hn=Object(G.a)(tn,2),ar=hn[0],Wn=hn[1],Bt=Object(x.useState)(!1),_n=Object(G.a)(Bt,2),ir=_n[0],kn=_n[1],Xt=Object(x.useRef)(Object(we.a)()),sn=Object(x.useRef)(!1),Sn=Object(x.useRef)(),Nt=Object(x.useRef)(),Ut=Object(x.useRef)(),jt=Object(x.useRef)(),je=Object(x.useRef)(),Yt=function(){var Lt=Object(M.a)(L.a.mark(function Ft(){var It,Jt;return L.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.next=2,Object(pe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:Jt=wn.sent,Jt!=null&&(It=Jt.attachments)!==null&&It!==void 0&&It.length&&(console.log("cm:",_t,Nt),Jt.attachments.map(function(Vn){Vn.content_type.indexOf("image")>-1?_t.replaceSelection("![,](/api/attachments/".concat(Vn.id,"?type=").concat(Vn.content_type,")")):Vn.content_type.indexOf("video")>-1?_t.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Vn.content_type.indexOf("pdf")>-1?_t.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(Vn.id,"?type=").concat(Vn.content_type,'&disposition=inline" target="_blank">').concat(Vn.name,"</a>")):_t.replaceSelection("[".concat(Vn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Vn.id,"?type=").concat(Vn.content_type,")"))}));case 4:case"end":return wn.stop()}},Ft)}));return function(){return Lt.apply(this,arguments)}}();Object(x.useEffect)(function(){pi(ca),_t==null||_t.setValue(ca)},[ca]),Object(x.useEffect)(function(){ei==null||ei(st)},[st]),Object(x.useEffect)(function(){if(Nt.current){var Lt=h.a.fromTextArea(Nt.current,{mode:br,lineNumbers:!Qn,lineWrapping:!0,value:et,autoCloseTags:!0,autoCloseBrackets:!0});hr&&Lt.focus();function Ft(It,Jt){if(ji){Jt.preventDefault();return}var Mn=Jt.clipboardData;if(Mn){var wn=Mn.types.toString(),Vn=Mn.items;if(wn==="Files"||Mn.types.indexOf("Files")>-1){if(Jt.preventDefault(),br=="stex")return;try{var sr,mi=Vn[1];((sr=Vn[0])===null||sr===void 0?void 0:sr.kind)==="file"&&(mi=Vn[0]);var Gn=mi.getAsFile(),Wi=Gn.name.split(".").pop();P(Gn,function(lr){if(lr.id){var ii,Zr,Ai;(Gn==null||((ii=Gn.type)===null||ii===void 0)?void 0:ii.indexOf("image"))>-1?Lt.replaceSelection("![,](/api/attachments/".concat(lr.id,"?type=").concat(lr.content_type,")")):(Gn==null||((Zr=Gn.type)===null||Zr===void 0)?void 0:Zr.indexOf("video"))>-1?Lt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,'"></video>')):(Gn==null||((Ai=Gn.type)===null||Ai===void 0)?void 0:Ai.indexOf("pdf"))>-1?Lt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,"?type=").concat(Gn.type,'&disposition=inline" target="_blank">').concat(Gn.name,"</a>")):oe.includes(Wi)?Lt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,'?type=office&disposition=inline" target="_blank">').concat(Gn.name,"</a>")):Lt.replaceSelection("[".concat(Gn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,"?type=").concat(lr.content_type,")"))}else(lr==null?void 0:lr.status)===401&&(document.location.href="/user/login")})}catch(lr){I.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Lt.on("paste",Ft),Lt.on("dragleave",function(It,Jt){Ut.current.classList.remove("mouse-hover-md")}),Lt.on("dragover",function(It,Jt){Ut.current.classList.add("mouse-hover-md")}),Lt.on("drop",function(It,Jt){Ut.current.classList.add("mouse-hover-md");var Mn;if(Mn=Jt.dataTransfer.files,Mn.length>0){Jt.preventDefault(),Jt.stopPropagation();for(var wn=function(mi){var Gn=Mn[mi],Wi=Gn.name.split(".").pop();P(Gn,function(lr){if(lr.id){var ii,Zr,Ai;(Gn==null||((ii=Gn.type)===null||ii===void 0)?void 0:ii.indexOf("image"))>-1?Lt.replaceSelection("![,](/api/attachments/".concat(lr.id,"?type=").concat(lr.content_type,")")):(Gn==null||((Zr=Gn.type)===null||Zr===void 0)?void 0:Zr.indexOf("video"))>-1?Lt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,'"></video>')):(Gn==null||((Ai=Gn.type)===null||Ai===void 0)?void 0:Ai.indexOf("pdf"))>-1?Lt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,"?type=").concat(Gn.type,'&disposition=inline" target="_blank">').concat(Gn.name,"</a>")):oe.includes(Wi)?Lt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,'?type=office&disposition=inline" target="_blank">').concat(Gn.name,"</a>")):Lt.replaceSelection("[".concat(Gn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,"?type=").concat(lr.content_type,")"))}else(lr==null?void 0:lr.status)===401&&(document.location.href="/user/login")})},Vn=0;Vn<Mn.length;Vn++)wn(Vn)}}),Fi(Lt),function(){Lt.off("paste",Ft)}}},[]);var fn=Object(x.useCallback)(function(){if(Ut.current)try{}catch(Lt){console.log(Lt,"---- to set md editor body height")}},[ar,Ut,st]);Object(x.useEffect)(function(){function Lt(){var It=new o.default(function(Jt){var Mn=Object(N.a)(Jt),wn;try{for(Mn.s();!(wn=Mn.n()).done;){var Vn=wn.value;(Vn.target.offsetHeight>0||Vn.target.offsetWidth>0)&&(fn(),_t.setSize("100%","100%"),_t.refresh())}}catch(sr){Mn.e(sr)}finally{Mn.f()}});return It.observe(Nt.current.parentElement),It}if(_t){var Ft=Lt();return function(){Ft.unobserve(Nt.current.parentElement)}}},[_t,fn]),Object(x.useEffect)(function(){if(_t){for(var Lt=[],Ft=function(){var Vn=Jt[It];Mn=Object(G.a)(Vn,2);var sr=Mn[0],mi=Mn[1],Gn=Object(K.a)({},sr,function(){fr(mi)});Lt.push(Gn),_t.addKeyMap(Gn)},It=0,Jt=Object.entries(ce);It<Jt.length;It++){var Mn;Ft()}return Sn.current=setInterval(function(){sn.current&&Yt()},4e3),function(){clearInterval(Sn.current);var wn=Object(N.a)(Lt),Vn;try{for(wn.s();!(Vn=wn.n()).done;){var sr=Vn.value;_t.removeKeyMap(sr)}}catch(mi){wn.e(mi)}finally{wn.f()}}}},[_t]),Object(x.useEffect)(function(){cn!==st&&Pt(cn)},[cn]),Object(ft.a)(function(){if(!qn&&xn>0){var Lt=new Date().getTime(),Ft=window.sessionStorage.getItem(Br);Lt>=xn+bt&&(!Ft||Ft!==ea)&&(window.sessionStorage.setItem(Br,ea),kn(!0))}},bt),Object(x.useEffect)(function(){xa(or)},[_t,or]),Object(x.useEffect)(function(){_t&&(hr&&_t.focus())},[_t,hr]),Object(x.useEffect)(function(){if(ur&&_t){var Lt=_t.getScrollerElement();function Ft(It){var Jt=It.target;if(je.current){var Mn=Jt.scrollTop/Jt.scrollHeight;je.current.scrollTop=je.current.scrollHeight*Mn}}return Lt.addEventListener("scroll",Ft),function(){Lt.removeEventListener("scroll",Ft)}}},[_t,ur]),Object(x.useEffect)(function(){if(_t&&Dn){function Lt(Ft,It){Dn(Ft,It)}return _t.on("beforeChange",Lt),function(){_t.off("beforeChange",Lt)}}},[_t,Dn]),Object(x.useEffect)(function(){if(_t&&on){function Lt(){on(_t.getValue())}return _t.on("blur",Lt),function(){_t.off("blur",Lt)}}},[_t,on]),Object(x.useEffect)(function(){if(_t){function Lt(Ft){var It=Ft.getValue();pi(It),Fn(new Date().getTime()),Ft.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),yt&&yt(It)}return _t.on("change",Lt),function(){_t.off("change",Lt)}}},[_t,yt]),Object(x.useEffect)(function(){_t&&(et==null?(_t.setValue(""),pi("")):et!==_t.getValue()&&(_t.setValue(et),pi(et),_t.setCursor(_t.lineCount(),0)))},[_t,et]);var fr=Object(x.useCallback)(function(Lt){var Ft=_t.getCursor(),It=_t.getSelection(),Jt=It.split(`
`);switch(Lt){case"bold":return _t.replaceSelection("**"+It+"**"),It===""&&_t.setCursor(Ft.line,Ft.ch+2),_t.focus();case"italic":return _t.replaceSelection("*"+It+"*"),It===""&&_t.setCursor(Ft.line,Ft.ch+1),_t.focus();case"code":return _t.replaceSelection("`"+It+"`"),It===""&&_t.setCursor(Ft.line,Ft.ch+1),_t.focus();case"inline-latex":return _t.replaceSelection("`$$"+It+"$$`"),It===""&&_t.setCursor(Ft.line,Ft.ch+3),_t.focus();case"latex":return _t.replaceSelection("```latex\n"+It+"\n```"),_t.setCursor(Ft.line+1,It.length+1),_t.focus();case"line-break":return _t.replaceSelection(`<br/>
`),_t.focus();case"list-ul":return It===""?_t.replaceSelection("- "+It):_t.replaceSelection(Jt.map(function(Mn){return Mn===""?"":"- ".concat(Mn)}).join(`
`)),_t.focus();case"list-ol":return It===""?_t.replaceSelection("1. "+It):_t.replaceSelection(Jt.map(function(Mn,wn){return Mn===""?"":"".concat(wn+1,". ").concat(Mn)}).join(`
`)),_t.focus();case"add-null-ch":return It===""&&_t.setCursor(Ft.line,Ft.ch+1),_t.replaceSelection(me),_t.focus();case"inster-template-1":return It===""&&_t.setCursor(Ft.line,Ft.ch),_t.replaceSelection(ne),_t.focus();case"eraser":return _t.setValue(""),_t.focus();case"trigger-watch":return xa(!ur),_t.focus();case"trigger-full-screen":return Pt(!st),_t.focus();case ke:yn(ke);return;case Qe:yn(Qe);return;case Ue:yn(Ue);return;case nt:yn(nt);return;default:throw new Error}},[_t,ur,st]),pn=Object(x.useCallback)(function(Lt){yn("");switch(Zt){case ke:var Ft=Lt.title,It=Lt.link;return _t.replaceSelection("[".concat(Ft,"](").concat(It,")")),_t.focus();case Qe:var Jt=Lt.language,Mn=Lt.content;return _t.replaceSelection(["```"+Jt,Mn,"```"].join(`
`)),_t.focus();case Ue:var wn=Lt.src,Vn=Lt.alt;return Vn?_t.replaceSelection("![ ".concat(Vn," ]( ").concat(wn,' "').concat(Vn,'" )')):_t.replaceSelection("![,](".concat(wn,")")),_t.focus();case nt:for(var sr=Lt.row,mi=Lt.col,Gn=Lt.align,Wi=`
`,lr=0;lr<sr;lr++){for(var ii=[],Zr=[],Ai=0;Ai<mi;Ai++)lr===1&&Zr.push(qe[Gn]),ii.push(" ");lr===1&&(Wi+="| ".concat(Zr.join(" | "),` |
`)),Wi+="| ".concat(ii.join(mi===1?"":" | "),` |
`)}return _t.replaceSelection(Wi+`
`),_t.focus();default:throw new Error}},[_t,Zt]),Yr=Object(x.useMemo)(function(){switch(Zt){case ke:return f.a.createElement(te,{callback:pn,onCancel:$r});case Qe:return f.a.createElement(ae.b,{callback:pn,onCancel:$r});case Ue:return f.a.createElement(he,{callback:pn,onCancel:$r});case nt:return f.a.createElement(Ke,{callback:pn,onCancel:$r});default:return null}},[Zt]);function $r(){yn("")}Object(x.useEffect)(function(){if(jt.current){var Lt=jt.current,Ft=!1,It=0;function Jt(Vn){Ft=!0,It=Vn.pageY}function Mn(){Ft=!1}function wn(Vn){if(Ft){var sr=Vn.pageY-It;sr<0&&(sr=0),sr>300&&(sr=300);var mi=zt+sr+"px";Wn(mi)}}return Lt.addEventListener("mousedown",Jt),document.addEventListener("mousemove",wn),document.addEventListener("mouseup",Mn),function(){Lt.removeEventListener("mousedown",Jt),document.removeEventListener("mousemove",wn),document.removeEventListener("mouseup",Mn)}}},[_t,jt]),Object(x.useEffect)(function(){Wn(zt)},[zt]);var kr=q(kt),An=q(ar),St={width:kr,height:An},pr=Object(x.useMemo)(function(){if(xn){var Lt=new Date(xn),Ft=Lt.getHours(),It=Lt.getMinutes(),Jt=Lt.getSeconds();return Ft=Ft<10?"0"+Ft:Ft,It=It<10?"0"+It:It,Jt=Jt<10?"0"+Jt:Jt,"".concat(Ft,":").concat(It,":").concat(Jt)}return 0},[xn]);function tr(){window.sessionStorage.removeItem(Br),kn(!1),Fn(0)}function Hn(){kn(!1),Fn(0),_t.setValue(window.sessionStorage.getItem(Br))}function Qr(Lt,Ft){var It=_t.getValue();It=It.replace(Lt,Ft),pi(It),_t==null||_t.setValue(It)}return f.a.createElement(x.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ut},f.a.createElement("div",{className:"markdown-editor-container ".concat(ct," ").concat(ur?"on-preview":""," ").concat(Qn?"mini":""," ").concat(st?"full-screen":""),style:St},f.a.createElement(w,{insertTemp:bn,watch:ur,fullScreen:st,showNullButton:gn,onActionCallback:fr,hidetoolBar:Rn,uuid:Xt.current,setOpenPhones:function(){sn.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:Nt,placeholder:ua})),ur?f.a.createElement("div",{ref:je,className:"preview-container"},br==="stex"&&f.a.createElement(R,{value:ea}),br!=="stex"&&f.a.createElement(S.a,{edit:!0,value:ea,replaces:Qr})):null))),an?f.a.createElement("a",{ref:jt,className:"editor-resize"}):null,f.a.createElement(B.a,null,be[Zt]?f.a.createElement(Y.a,{centered:!0,title:be[Zt],visible:!0,onCancel:$r,footer:null,className:"markdown-popup-form"},Yr):null))}},"P/tu":function(it,Ee,U){"use strict";var ie=U("ozfa"),Y=U("MJZm"),N=U("0Owb"),z=U("9og8"),I=U("tJVT"),M=U("PpiC"),G=U("WmNS"),K=U.n(G),n=U("q1tI"),L=U.n(n),x=U("WCUW"),f=U("spXi"),b=U.n(f),h=function(p){var l=p.value,u=p.onChange,s=p.defaultValue,i=p.disabled,D=Object(M.a)(p,["value","onChange","defaultValue","disabled"]),A=Object(n.useState)([]),S=Object(I.a)(A,2),R=S[0],O=S[1],g=Object(n.useState)("1"),_=Object(I.a)(g,2),d=_[0],c=_[1];Object(n.useEffect)(function(){C()},[]);var C=function(){var B=Object(z.a)(K.a.mark(function W(){var T,k;return K.a.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Object(x.A)({});case 2:T=y.sent,T!=null&&T.data&&(k=[{title:L.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:b.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:L.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:E(T.data||[])}],O(k),c("2"));case 4:case"end":return y.stop()}},W)}));return function(){return B.apply(this,arguments)}}(),E=function(W){function T(k){var m=k.children,y=Array.isArray(m)&&m.length>0,H=k==null?void 0:k.group_id;return{title:L.a.createElement("div",{title:k==null?void 0:k.name,className:b.a.name},k==null?void 0:k.name),value:H,key:H,icon:L.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:y?m==null?void 0:m.map(function(Q){return T(Q)}):[]}}return W==null?void 0:W.map(function(k){return T(k)})},w=s?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return L.a.createElement("div",{className:b.a.customTree},L.a.createElement(Y.a,Object(N.a)({key:d},w,{showIcon:!0,treeData:R,onSelect:u,disabled:i},D)))};Ee.a=h},Q0Vu:function(it,Ee,U){it.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(it,Ee,U){"use strict";var ie=U("Q9mQ"),Y=U("diRs"),N=U("q1tI"),z=U.n(N),I=U("+z73"),M=U.n(I),G=function(n){var L=n.data,x=L===void 0?[]:L,f=n.onClick,b=function(){return x.map(function(p,l){return z.a.createElement("div",{key:l,className:M.a.few},z.a.createElement("b",{title:p.name,style:{color:l===0?"#333333":"#999999"},onClick:function(){return f(p.id)}},p.name),l<x.length-1&&z.a.createElement("span",null,"/"))})},h=function(){var p=!0,l=x.slice(2,-2),u=z.a.createElement("div",{className:M.a.pWrap},l.map(function(s){return z.a.createElement("span",{title:s.name,onClick:function(){return f(s.id)},key:s.id},s.name)}));return x.map(function(s,i){var D=null;return i>1&&i<x.length-2?p&&(D=z.a.createElement(Y.a,{key:i,placement:"bottom",content:u},z.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),p=!1):D=z.a.createElement("div",{key:i,className:M.a.few},z.a.createElement("b",{title:s.name,style:{color:i===0?"#333333":"#999999"},onClick:function(){return f(s.id)}},s.name),i<x.length-1&&z.a.createElement("span",null,"/")),D})};return z.a.createElement("aside",{style:{overflowX:"auto"}},(x==null?void 0:x.length)>5?h():b())};Ee.a=G},SJMd:function(it,Ee){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var U,ie,Y,N=!1,z,I;window.PR_SHOULD_USE_CONTINUATION=!0;var M,G;(function(){var K=window,n=["break,continue,do,else,for,if,return,while"],L=[n,"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"],x=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[x,"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"],b=[x,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[x,"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"],o="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",p=[x,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="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",u=[n,"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"],s=[n,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],i=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],D=[f,h,b,p,l,u,s,i],A=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",R="kwd",O="com",g="typ",_="lit",d="pun",c="pln",C="tag",E="dec",w="src",B="atn",W="atv",T="nocode",k="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(ye){for(var Re=0,Ke=!1,pe=!1,we=0,ke=ye.length;we<ke;++we){var Ue=ye[we];if(Ue.ignoreCase)pe=!0;else if(/[a-z]/i.test(Ue.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ke=!0,pe=!1;break}}var Qe={b:8,t:9,n:10,v:11,f:12,r:13};function nt(pt){var Ye=pt.charCodeAt(0);if(Ye!==92)return Ye;var Tt=pt.charAt(1);return Ye=Qe[Tt],Ye||("0"<=Tt&&Tt<="7"?parseInt(pt.substring(1),8):Tt==="u"||Tt==="x"?parseInt(pt.substring(2),16):pt.charCodeAt(1))}function ot(pt){if(pt<32)return(pt<16?"\\x0":"\\x")+pt.toString(16);var Ye=String.fromCharCode(pt);return Ye==="\\"||Ye==="-"||Ye==="]"||Ye==="^"?"\\"+Ye:Ye}function qe(pt){var Ye=pt.substring(1,pt.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")),Tt=[],bt=Ye[0]==="^",me=["["];bt&&me.push("^");for(var ne=bt?1:0,q=Ye.length;ne<q;++ne){var se=Ye[ne];if(/\\[bdsw]/i.test(se))me.push(se);else{var ue=nt(se),oe;ne+2<q&&Ye[ne+1]==="-"?(oe=nt(Ye[ne+2]),ne+=2):oe=ue,Tt.push([ue,oe]),oe<65||ue>122||(oe<65||ue>90||Tt.push([Math.max(65,ue)|32,Math.min(oe,90)|32]),oe<97||ue>122||Tt.push([Math.max(97,ue)&~32,Math.min(oe,122)&~32]))}}Tt.sort(function(Pe,We){return Pe[0]-We[0]||We[1]-Pe[1]});for(var ce=[],be=[],ne=0;ne<Tt.length;++ne){var Se=Tt[ne];Se[0]<=be[1]+1?be[1]=Math.max(be[1],Se[1]):ce.push(be=Se)}for(var ne=0;ne<ce.length;++ne){var Se=ce[ne];me.push(ot(Se[0])),Se[1]>Se[0]&&(Se[1]+1>Se[0]&&me.push("-"),me.push(ot(Se[1])))}return me.push("]"),me.join("")}function ft(pt){for(var Ye=pt.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")),Tt=Ye.length,bt=[],me=0,ne=0;me<Tt;++me){var q=Ye[me];if(q==="(")++ne;else if(q.charAt(0)==="\\"){var se=+q.substring(1);se&&(se<=ne?bt[se]=-1:Ye[me]=ot(se))}}for(var me=1;me<bt.length;++me)bt[me]===-1&&(bt[me]=++Re);for(var me=0,ne=0;me<Tt;++me){var q=Ye[me];if(q==="(")++ne,bt[ne]||(Ye[me]="(?:");else if(q.charAt(0)==="\\"){var se=+q.substring(1);se&&se<=ne&&(Ye[me]="\\"+bt[se])}}for(var me=0;me<Tt;++me)Ye[me]==="^"&&Ye[me+1]!=="^"&&(Ye[me]="");if(pt.ignoreCase&&Ke)for(var me=0;me<Tt;++me){var q=Ye[me],ue=q.charAt(0);q.length>=2&&ue==="["?Ye[me]=qe(q):ue!=="\\"&&(Ye[me]=q.replace(/[a-zA-Z]/g,function(be){var Se=be.charCodeAt(0);return"["+String.fromCharCode(Se&~32,Se|32)+"]"}))}return Ye.join("")}for(var lt=[],we=0,ke=ye.length;we<ke;++we){var Ue=ye[we];if(Ue.global||Ue.multiline)throw new Error(""+Ue);lt.push("(?:"+ft(Ue)+")")}return new RegExp(lt.join("|"),pe?"gi":"g")}function y(ye,Re){var Ke=/(?:^|\s)nocode(?:\s|$)/,pe=[],we=0,ke=[],Ue=0;function Qe(nt){var ot=nt.nodeType;if(ot==1){if(Ke.test(nt.className))return;for(var qe=nt.firstChild;qe;qe=qe.nextSibling)Qe(qe);var ft=nt.nodeName.toLowerCase();(ft==="br"||ft==="li")&&(pe[Ue]=`
`,ke[Ue<<1]=we++,ke[Ue++<<1|1]=nt)}else if(ot==3||ot==4){var lt=nt.nodeValue;lt.length&&(Re?lt=lt.replace(/\r\n?/g,`
`):lt=lt.replace(/[ \t\r\n]+/g," "),pe[Ue]=lt,ke[Ue<<1]=we,we+=lt.length,ke[Ue++<<1|1]=nt)}}return Qe(ye),{sourceCode:pe.join("").replace(/\n$/,""),spans:ke}}function H(ye,Re,Ke,pe,we){if(!Ke)return;var ke={sourceNode:ye,pre:1,langExtension:null,numberLines:null,sourceCode:Ke,spans:null,basePos:Re,decorations:null};pe(ke),we.push.apply(we,ke.decorations)}var Q=/\S/;function te(ye){for(var Re=void 0,Ke=ye.firstChild;Ke;Ke=Ke.nextSibling){var pe=Ke.nodeType;Re=pe===1?Re?ye:Ke:pe===3&&Q.test(Ke.nodeValue)?ye:Re}return Re===ye?void 0:Re}function ae(ye,Re){var Ke={},pe;(function(){for(var Ue=ye.concat(Re),Qe=[],nt={},ot=0,qe=Ue.length;ot<qe;++ot){var ft=Ue[ot],lt=ft[3];if(lt)for(var pt=lt.length;--pt>=0;)Ke[lt.charAt(pt)]=ft;var Ye=ft[1],Tt=""+Ye;nt.hasOwnProperty(Tt)||(Qe.push(Ye),nt[Tt]=null)}Qe.push(/[\0-\uffff]/),pe=m(Qe)})();var we=Re.length,ke=function(Ue){for(var Qe=Ue.sourceCode,nt=Ue.basePos,ot=Ue.sourceNode,qe=[nt,c],ft=0,lt=Qe.match(pe)||[],pt={},Ye=0,Tt=lt.length;Ye<Tt;++Ye){var bt=lt[Ye],me=pt[bt],ne=void 0,q;if(typeof me=="string")q=!1;else{var se=Ke[bt.charAt(0)];if(se)ne=bt.match(se[1]),me=se[0];else{for(var ue=0;ue<we;++ue)if(se=Re[ue],ne=bt.match(se[1]),ne){me=se[0];break}ne||(me=c)}q=me.length>=5&&me.substring(0,5)==="lang-",q&&!(ne&&typeof ne[1]=="string")&&(q=!1,me=w),q||(pt[bt]=me)}var oe=ft;if(ft+=bt.length,!q)qe.push(nt+oe,me);else{var ce=ne[1],be=bt.indexOf(ce),Se=be+ce.length;ne[2]&&(Se=bt.length-ne[2].length,be=Se-ce.length);var Pe=me.substring(5);H(ot,nt+oe,bt.substring(0,be),ke,qe),H(ot,nt+oe+be,ce,V(Pe,ce),qe),H(ot,nt+oe+Se,bt.substring(Se),ke,qe)}}Ue.decorations=qe};return ke}function Te(ye){var Re=[],Ke=[];ye.tripleQuotedStrings?Re.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?Re.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&Ke.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var pe=ye.hashComments;pe&&(ye.cStyleComments?(pe>1?Re.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ke.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([O,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(Ke.push([O,/^\/\/[^\r\n]*/,null]),Ke.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var we=ye.regexLiterals;if(we){var ke=we>1?"":`
\r`,Ue=ke?".":"[\\S\\s]",Qe="/(?=[^/*"+ke+"])(?:[^/\\x5B\\x5C"+ke+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+ke+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";Ke.push(["lang-regex",RegExp("^"+k+"("+Qe+")")])}var nt=ye.types;nt&&Ke.push([g,nt]);var ot=(""+ye.keywords).replace(/^ | $/g,"");ot.length&&Ke.push([R,new RegExp("^(?:"+ot.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([c,/^\s+/,null,` \r
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(qe+="(?!s*/)"),Ke.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[g,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[d,new RegExp(qe),null]),ae(Re,Ke)}var _e=Te({keywords:D,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ge(ye,Re,Ke){for(var pe=/(?:^|\s)nocode(?:\s|$)/,we=/\r\n?|\n/,ke=ye.ownerDocument,Ue=ke.createElement("li");ye.firstChild;)Ue.appendChild(ye.firstChild);var Qe=[Ue];function nt(Ye){var Tt=Ye.nodeType;if(Tt==1&&!pe.test(Ye.className))if(Ye.nodeName==="br")ot(Ye),Ye.parentNode&&Ye.parentNode.removeChild(Ye);else for(var bt=Ye.firstChild;bt;bt=bt.nextSibling)nt(bt);else if((Tt==3||Tt==4)&&Ke){var me=Ye.nodeValue,ne=me.match(we);if(ne){var q=me.substring(0,ne.index);Ye.nodeValue=q;var se=me.substring(ne.index+ne[0].length);if(se){var ue=Ye.parentNode;ue.insertBefore(ke.createTextNode(se),Ye.nextSibling)}ot(Ye),q||Ye.parentNode.removeChild(Ye)}}}function ot(Ye){for(;!Ye.nextSibling;)if(Ye=Ye.parentNode,!Ye)return;function Tt(ne,q){var se=q?ne.cloneNode(!1):ne,ue=ne.parentNode;if(ue){var oe=Tt(ue,1),ce=ne.nextSibling;oe.appendChild(se);for(var be=ce;be;be=ce)ce=be.nextSibling,oe.appendChild(be)}return se}for(var bt=Tt(Ye.nextSibling,0),me;(me=bt.parentNode)&&me.nodeType===1;)bt=me;Qe.push(bt)}for(var qe=0;qe<Qe.length;++qe)nt(Qe[qe]);Re===(Re|0)&&Qe[0].setAttribute("value",Re);var ft=ke.createElement("ol");ft.className="linenums";for(var lt=Math.max(0,Re-1|0)||0,qe=0,pt=Qe.length;qe<pt;++qe)Ue=Qe[qe],Ue.className="L"+(qe+lt)%10,Ue.firstChild||Ue.appendChild(ke.createTextNode("\xA0")),ft.appendChild(Ue);ye.appendChild(ft)}function ve(ye){var Re=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Re=Re&&+Re[1]<=8;var Ke=/\n/g,pe=ye.sourceCode,we=pe.length,ke=0,Ue=ye.spans,Qe=Ue.length,nt=0,ot=ye.decorations,qe=ot.length,ft=0;ot[qe]=we;var lt,pt;for(pt=lt=0;pt<qe;)ot[pt]!==ot[pt+2]?(ot[lt++]=ot[pt++],ot[lt++]=ot[pt++]):pt+=2;for(qe=lt,pt=lt=0;pt<qe;){for(var Ye=ot[pt],Tt=ot[pt+1],bt=pt+2;bt+2<=qe&&ot[bt+1]===Tt;)bt+=2;ot[lt++]=Ye,ot[lt++]=Tt,pt=bt}qe=ot.length=lt;var me=ye.sourceNode,ne="";me&&(ne=me.style.display,me.style.display="none");try{for(var q=null;nt<Qe;){var se=Ue[nt],ue=Ue[nt+2]||we,oe=ot[ft+2]||we,bt=Math.min(ue,oe),ce=Ue[nt+1],be;if(ce.nodeType!==1&&(be=pe.substring(ke,bt))){Re&&(be=be.replace(Ke,"\r")),ce.nodeValue=be;var Se=ce.ownerDocument,Pe=Se.createElement("span");Pe.className=ot[ft+1];var We=ce.parentNode;We.replaceChild(Pe,ce),Pe.appendChild(ce),ke<ue&&(Ue[nt+1]=ce=Se.createTextNode(pe.substring(bt,ue)),We.insertBefore(ce,Pe.nextSibling))}ke=bt,ke>=ue&&(nt+=2),ke>=oe&&(ft+=2)}}finally{me&&(me.style.display=ne)}}var Oe={};function he(ye,Re){for(var Ke=Re.length;--Ke>=0;){var pe=Re[Ke];Oe.hasOwnProperty(pe)?K.console&&console.warn("cannot override language handler %s",pe):Oe[pe]=ye}}function V(ye,Re){return ye&&Oe.hasOwnProperty(ye)||(ye=/^\s*</.test(Re)?"default-markup":"default-code"),Oe[ye]}he(_e,["default-code"]),he(ae([],[[c,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["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"]),he(ae([[c,/^[\s]+/,null,` \r
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[d,/^[=<>\/]+/],["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"]),he(ae([],[[W,/^[\s\S]+/]]),["uq.val"]),he(Te({keywords:f,hashComments:!0,cStyleComments:!0,types:A}),["c","cc","cpp","cxx","cyc","m"]),he(Te({keywords:"null,true,false"}),["json"]),he(Te({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:A}),["cs"]),he(Te({keywords:b,cStyleComments:!0}),["java"]),he(Te({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(Te({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(Te({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(Te({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(Te({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(Te({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(ae([],[[S,/^[\s\S]+/]]),["regex"]);function P(ye){var Re=ye.langExtension;try{var Ke=y(ye.sourceNode,ye.pre),pe=Ke.sourceCode;ye.sourceCode=pe,ye.spans=Ke.spans,ye.basePos=0,V(Re,pe)(ye),ve(ye)}catch(we){K.console&&console.log(we&&we.stack||we)}}function j(ye,Re,Ke){var pe=Ke||!1,we=Re||null,ke=document.createElement("div");ke.innerHTML="<pre>"+ye+"</pre>",ke=ke.firstChild,pe&&ge(ke,pe,!0);var Ue={langExtension:we,numberLines:pe,sourceNode:ke,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return P(Ue),ke.innerHTML}function $(ye,Re){var Ke=Re||document.body,pe=Ke.ownerDocument||document;function we(se){return Ke.getElementsByTagName(se)}for(var ke=[we("pre"),we("code"),we("xmp")],Ue=[],Qe=0;Qe<ke.length;++Qe)for(var nt=0,ot=ke[Qe].length;nt<ot;++nt)Ue.push(ke[Qe][nt]);ke=null;var qe=Date;qe.now||(qe={now:function(){return+new Date}});var ft=0,lt=/\blang(?:uage)?-([\w.]+)(?!\S)/,pt=/\bprettyprint\b/,Ye=/\bprettyprinted\b/,Tt=/pre|xmp/i,bt=/^code$/i,me=/^(?:pre|code|xmp)$/i,ne={};function q(){for(var se=K.PR_SHOULD_USE_CONTINUATION?qe.now()+250:Infinity;ft<Ue.length&&qe.now()<se;ft++){for(var ue=Ue[ft],oe=ne,ce=ue;ce=ce.previousSibling;){var be=ce.nodeType,Se=(be===7||be===8)&&ce.nodeValue;if(Se?!/^\??prettify\b/.test(Se):be!==3||/\S/.test(ce.nodeValue))break;if(Se){oe={},Se.replace(/\b(\w+)=([\w:.%+-]+)/g,function(or,bn,xr){oe[bn]=xr});break}}var Pe=ue.className;if((oe!==ne||pt.test(Pe))&&!Ye.test(Pe)){for(var We=!1,et=ue.parentNode;et;et=et.parentNode){var yt=et.tagName;if(me.test(yt)&&et.className&&pt.test(et.className)){We=!0;break}}if(!We){ue.className+=" prettyprinted";var Rt=oe.lang;if(!Rt){Rt=Pe.match(lt);var kt;!Rt&&(kt=te(ue))&&bt.test(kt.tagName)&&(Rt=kt.className.match(lt)),Rt&&(Rt=Rt[1])}var mn;if(Tt.test(ue.tagName))mn=1;else{var zt=ue.currentStyle,Mt=pe.defaultView,Qn=zt?zt.whiteSpace:Mt&&Mt.getComputedStyle?Mt.getComputedStyle(ue,null).getPropertyValue("white-space"):0;mn=Qn&&Qn.substring(0,3)==="pre"}var un=oe.linenums;(un=un==="true"||+un)||(un=Pe.match(/\blinenums\b(?::(\d+))?/),un=un?un[1]&&un[1].length?+un[1]:!0:!1),un&&ge(ue,un,mn);var hr={langExtension:Rt,sourceNode:ue,numberLines:un,pre:mn,sourceCode:null,basePos:null,spans:null,decorations:null};P(hr)}}}ft<Ue.length?K.setTimeout(q,250):typeof ye=="function"&&ye()}q()}var J=K.PR={createSimpleLexer:ae,registerLangHandler:he,sourceDecorator:Te,PR_ATTRIB_NAME:B,PR_ATTRIB_VALUE:W,PR_COMMENT:O,PR_DECLARATION:E,PR_KEYWORD:R,PR_LITERAL:_,PR_NOCODE:T,PR_PLAIN:c,PR_PUNCTUATION:d,PR_SOURCE:w,PR_STRING:S,PR_TAG:C,PR_TYPE:g,prettyPrintOne:N?K.prettyPrintOne=j:M=j,prettyPrint:G=N?K.prettyPrint=$:G=$},X=K.define;typeof X=="function"&&X.amd&&X("google-code-prettify",[],function(){return J})})()},STEk:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return he});/*! *****************************************************************************
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 ie=function(V,P){return(ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,$){j.__proto__=$}||function(j,$){for(var J in $)Object.prototype.hasOwnProperty.call($,J)&&(j[J]=$[J])})(V,P)};function Y(V,P){function j(){this.constructor=V}ie(V,P),V.prototype=P===null?Object.create(P):(j.prototype=P.prototype,new j)}function N(V,P,j,$){return new(j||(j=Promise))(function(J,X){function ye(pe){try{Ke($.next(pe))}catch(we){X(we)}}function Re(pe){try{Ke($.throw(pe))}catch(we){X(we)}}function Ke(pe){var we;pe.done?J(pe.value):(we=pe.value,we instanceof j?we:new j(function(ke){ke(we)})).then(ye,Re)}Ke(($=$.apply(V,P||[])).next())})}function z(V,P){var j,$,J,X,ye={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return X={next:Re(0),throw:Re(1),return:Re(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function Re(Ke){return function(pe){return function(we){if(j)throw new TypeError("Generator is already executing.");for(;ye;)try{if(j=1,$&&(J=2&we[0]?$.return:we[0]?$.throw||((J=$.return)&&J.call($),0):$.next)&&!(J=J.call($,we[1])).done)return J;switch($=0,J&&(we=[2&we[0],J.value]),we[0]){case 0:case 1:J=we;break;case 4:return ye.label++,{value:we[1],done:!1};case 5:ye.label++,$=we[1],we=[0];continue;case 7:we=ye.ops.pop(),ye.trys.pop();continue;default:if(!(J=ye.trys,(J=J.length>0&&J[J.length-1])||we[0]!==6&&we[0]!==2)){ye=0;continue}if(we[0]===3&&(!J||we[1]>J[0]&&we[1]<J[3])){ye.label=we[1];break}if(we[0]===6&&ye.label<J[1]){ye.label=J[1],J=we;break}if(J&&ye.label<J[2]){ye.label=J[2],ye.ops.push(we);break}J[2]&&ye.ops.pop(),ye.trys.pop();continue}we=P.call(V,ye)}catch(ke){we=[6,ke],$=0}finally{j=J=0}if(5&we[0])throw we[1];return{value:we[0]?we[1]:void 0,done:!0}}([Ke,pe])}}}function I(){for(var V=0,P=0,j=arguments.length;P<j;P++)V+=arguments[P].length;var $=Array(V),J=0;for(P=0;P<j;P++)for(var X=arguments[P],ye=0,Re=X.length;ye<Re;ye++,J++)$[J]=X[ye];return $}var M=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(P,j){for(var $=0,J=j;$<J.length;$++){var X=J[$],ye=X[0],Re=X[1];P.setAttribute(ye,Re)}},V.createRect=function(P,j,$){var J=document.createElementNS("http://www.w3.org/2000/svg","rect");return J.setAttribute("width",P.toString()),J.setAttribute("height",j.toString()),$&&V.setAttributes(J,$),J},V.createLine=function(P,j,$,J,X){var ye=document.createElementNS("http://www.w3.org/2000/svg","line");return ye.setAttribute("x1",P.toString()),ye.setAttribute("y1",j.toString()),ye.setAttribute("x2",$.toString()),ye.setAttribute("y2",J.toString()),X&&V.setAttributes(ye,X),ye},V.createPolygon=function(P,j){var $=document.createElementNS("http://www.w3.org/2000/svg","polygon");return $.setAttribute("points",P),j&&V.setAttributes($,j),$},V.createCircle=function(P,j){var $=document.createElementNS("http://www.w3.org/2000/svg","circle");return $.setAttribute("cx",(P/2).toString()),$.setAttribute("cy",(P/2).toString()),$.setAttribute("r",P.toString()),j&&V.setAttributes($,j),$},V.createEllipse=function(P,j,$){var J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return J.setAttribute("cx",(P/2).toString()),J.setAttribute("cy",(j/2).toString()),J.setAttribute("rx",(P/2).toString()),J.setAttribute("ry",(j/2).toString()),$&&V.setAttributes(J,$),J},V.createGroup=function(P){var j=document.createElementNS("http://www.w3.org/2000/svg","g");return P&&V.setAttributes(j,P),j},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(P,j,$,J,X,ye,Re){var Ke=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(Ke,[["id",P],["orient",j],["markerWidth",$.toString()],["markerHeight",J.toString()],["refX",X.toString()],["refY",ye.toString()]]),Ke.appendChild(Re),Ke},V.createText=function(P){var j=document.createElementNS("http://www.w3.org/2000/svg","text");return j.setAttribute("x","0"),j.setAttribute("y","0"),P&&V.setAttributes(j,P),j},V.createTSpan=function(P,j){var $=document.createElementNS("http://www.w3.org/2000/svg","tspan");return $.textContent=P,j&&V.setAttributes($,j),$},V.createImage=function(P){var j=document.createElementNS("http://www.w3.org/2000/svg","image");return P&&V.setAttributes(j,P),j},V.createPoint=function(P,j){var $=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return $.x=P,$.y=j,$},V.createPath=function(P,j){var $=document.createElementNS("http://www.w3.org/2000/svg","path");return $.setAttribute("d",P),j&&V.setAttributes($,j),$},V}(),G=function(){function V(){}return V.addKey=function(P){V.key=P},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),K=function(){function V(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return V.prototype.rasterize=function(P,j,$){var J=this;return new Promise(function(X){var ye=$!==void 0?$:document.createElement("canvas");P===null&&(J.markersOnly=!0,J.naturalSize=!1);var Re=document.createElementNS("http://www.w3.org/2000/svg","svg");Re.setAttribute("xmlns","http://www.w3.org/2000/svg"),Re.setAttribute("width",j.width.baseVal.valueAsString),Re.setAttribute("height",j.height.baseVal.valueAsString),Re.setAttribute("viewBox","0 0 "+j.viewBox.baseVal.width.toString()+" "+j.viewBox.baseVal.height.toString()),Re.innerHTML=j.innerHTML,J.naturalSize===!0?(Re.width.baseVal.value=P.naturalWidth,Re.height.baseVal.value=P.naturalHeight):J.width!==void 0&&J.height!==void 0&&(Re.width.baseVal.value=J.width,Re.height.baseVal.value=J.height),ye.width=Re.width.baseVal.value,ye.height=Re.height.baseVal.value;var Ke=Re.outerHTML,pe=ye.getContext("2d");J.markersOnly!==!0&&pe.drawImage(P,0,0,ye.width,ye.height);var we=window.URL,ke=new Image(ye.width,ye.height);ke.setAttribute("crossOrigin","anonymous");var Ue=new Blob([Ke],{type:"image/svg+xml"}),Qe=we.createObjectURL(Ue);ke.onload=function(){pe.drawImage(ke,0,0),we.revokeObjectURL(Qe);var nt=ye.toDataURL(J.imageType,J.imageQuality);X(nt)},ke.src=Qe})},V}(),n=function(){},L=function(){function V(P){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+P+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.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(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(P){return this.styleSheet===void 0&&this.addStyleSheet(),P.name=""+this.classNamePrefix+P.localName,this.classes.push(P),this.styleSheet.sheet.insertRule("."+P.name+" {"+P.style+"}",this.styleSheet.sheet.cssRules.length),P},V.prototype.addRule=function(P){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(P),this.styleSheet.sheet.insertRule(P.selector+" {"+P.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var P;this.styleSheet=document.createElement("style"),((P=this.styleSheetRoot)!==null&&P!==void 0?P:document.head).appendChild(this.styleSheet),this.addRule(new x("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new x("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new x("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new f("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new f("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},V.prototype.removeStyleSheet=function(){var P;this.styleSheet&&(((P=this.styleSheetRoot)!==null&&P!==void 0?P:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),x=function(V,P){this.selector=V,this.style=P},f=function(V,P){this.localName=V,this.style=P},b=function(){function V(P,j,$,J,X){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=P,this.displayMode=j,this.markerItems=$,this.uiStyleSettings=J,this.styles=X,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return V.prototype.show=function(P){var j=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=P,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var $=document.createElement("div");$.className=this.toolbarBlockStyleClass.name,$.style.whiteSpace="nowrap",this.uiContainer.appendChild($),this.addActionButton($,'<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($,'<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($,'<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($,'<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($,'<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($,'<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($,'<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($,'<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(X){var ye=document.createElement("div");ye.className=""+j.toolbarButtonStyleClass.name,ye.setAttribute("data-type-name",X.typeName),ye.innerHTML=X.icon,ye.addEventListener("click",function(){j.markerToolbarButtonClicked(ye,X)}),j.buttons.push(ye),j.markerButtons.push(ye)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(J,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},V.prototype.addButtonClickListener=function(P){this.buttonClickListeners.push(P)},V.prototype.removeButtonClickListener=function(P){this.buttonClickListeners.indexOf(P)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(P),1)},V.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},V.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var P=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var j=0;j<this.markerButtons.length;j++)j<P||j===P&&this.markerButtons.length-1===P?this.markerButtonBlock.appendChild(this.markerButtons[j]):(j===P&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[j]))}},V.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")},V.prototype.resetButtonStyles=function(){var P=this;this.buttons.forEach(function(j){j.className=j.className.replace(P.uiStyleSettings.toolbarButtonStyleColorsClassName?P.uiStyleSettings.toolbarButtonStyleColorsClassName:P.toolbarButtonStyleColorsClass.name,"").trim(),j.className=j.className.replace(P.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?P.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:P.toolbarActiveButtonStyleColorsClass.name,"").trim(),j.className+=" "+(P.uiStyleSettings.toolbarButtonStyleColorsClassName?P.uiStyleSettings.toolbarButtonStyleColorsClassName:P.toolbarButtonStyleColorsClass.name)})},V.prototype.addActionButton=function(P,j,$){var J=this,X=document.createElement("div");switch(X.className=""+this.toolbarButtonStyleClass.name,X.innerHTML=j,X.setAttribute("data-action",$),X.addEventListener("click",function(){J.actionToolbarButtonClicked(X,$)}),$){case"select":X.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":X.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":X.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":X.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":X.style.fill=this.uiStyleSettings.closeButtonColor}P.appendChild(X),this.buttons.push(X)},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("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 f("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("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 f("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var P=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*P)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*P)+`px;
padding: `+P+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new x("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new x("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},V.prototype.markerToolbarButtonClicked=function(P,j){this.setActiveButton(P),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function($){return $("marker",j)}),this.markerButtonOverflowBlock.style.display="none"},V.prototype.actionToolbarButtonClicked=function(P,j){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function($){return $("action",j)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},V.prototype.setActiveButton=function(P){this.resetButtonStyles(),P.className=P.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),P.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},V.prototype.setActiveMarkerButton=function(P){var j=this.markerButtons.find(function($){return $.getAttribute("data-type-name")===P});j&&this.setActiveButton(j)},V.prototype.setCurrentMarker=function(P){var j=this;this.currentMarker=P,this.buttons.filter(function($){return/delete|notes/.test($.getAttribute("data-action"))}).forEach(function($){j.currentMarker===void 0?($.style.fillOpacity="0.4",$.style.pointerEvents="none"):($.style.fillOpacity="1",$.style.pointerEvents="all")})},V}(),h=function(){function V(P,j,$,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=P,this.displayMode=j,this.uiStyleSettings=$,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return V.prototype.addStyles=function(){var P;this.toolboxStyleClass=this.styles.addClass(new f("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 f("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var j=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("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 f("toolbox-panel-row_colors",`
background-color: `+((P=this.uiStyleSettings.toolboxBackgroundColor)!==null&&P!==void 0?P:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px;
padding: `+j+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new x("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new x("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},V.prototype.show=function(P){var j;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=P,this.uiContainer.className=this.toolboxStyleClass.name+" "+((j=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&j!==void 0?j:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},V.prototype.setPanelButtons=function(P){var j,$,J=this;this.panels=P,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((j=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&j!==void 0?j:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(($=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&$!==void 0?$:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(X){var ye;X.uiStyleSettings=J.uiStyleSettings;var Re=document.createElement("div");Re.className=J.toolboxButtonStyleClass.name+" "+((ye=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:J.toolboxButtonStyleColorsClass.name),Re.innerHTML=X.icon,Re.title=X.title,Re.addEventListener("click",function(){J.panelButtonClick(X)}),J.panelButtons.push(Re),J.buttonRow.appendChild(Re)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},V.prototype.panelButtonClick=function(P){var j=this,$=-1;if(P!==this.activePanel){$=this.panels.indexOf(P),this.panelRow.innerHTML="";var J=P.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=P}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){j.displayMode==="inline"?j.panelRow.style.display="none":j.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(X,ye){var Re,Ke;X.className=j.toolboxButtonStyleClass.name+" "+(ye===$?""+((Re=j.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Re!==void 0?Re:j.toolboxActiveButtonStyleColorsClass.name):""+((Ke=j.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:j.toolboxButtonStyleColorsClass.name))})},V}(),o=function(V,P){this.title=V,this.icon=P},p=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'<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 ye.colors=[],ye.addTransparent=!1,ye.colorBoxes=[],ye.colors=$,ye.currentColor=J,ye.setCurrentColor=ye.setCurrentColor.bind(ye),ye.getColorBox=ye.getColorBox.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.overflow="hidden",$.style.whiteSpace="nowrap",this.colors.forEach(function(J){var X=j.getColorBox(J);$.appendChild(X),j.colorBoxes.push(X)}),$},P.prototype.getColorBox=function(j){var $=this,J=this.uiStyleSettings.toolbarHeight/4,X=this.uiStyleSettings.toolbarHeight-J,ye=document.createElement("div");ye.style.display="inline-block",ye.style.boxSizing="content-box",ye.style.width=X-2+"px",ye.style.height=X-2+"px",ye.style.padding="1px",ye.style.marginRight="2px",ye.style.marginBottom="2px",ye.style.borderWidth="2px",ye.style.borderStyle="solid",ye.style.borderRadius=(X+2)/2+"px",ye.style.borderColor=j===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ye.addEventListener("click",function(){$.setCurrentColor(j,ye)});var Re=document.createElement("div");return Re.style.display="inline-block",Re.style.width=X-2+"px",Re.style.height=X-2+"px",Re.style.backgroundColor=j,Re.style.borderRadius=X/2+"px",j==="transparent"&&(Re.style.fill=this.uiStyleSettings.toolboxAccentColor,Re.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>`),ye.appendChild(Re),ye},P.prototype.setCurrentColor=function(j,$){var J=this;this.currentColor=j,this.colorBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(j)},P}(o),l=function(){function V(P,j,$){this._state="new",this._isSelected=!1,this._container=P,this._overlayContainer=j,this.globalSettings=$,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(V.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(P){return!1},Object.defineProperty(V.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),V.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},V.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},V.prototype.pointerDown=function(P,j){},V.prototype.dblClick=function(P,j){},V.prototype.manipulate=function(P){},V.prototype.pointerUp=function(P){this.stateChanged()},V.prototype.dispose=function(){},V.prototype.addMarkerVisualToContainer=function(P){this.container.childNodes.length>0?this.container.insertBefore(P,this.container.childNodes[0]):this.container.appendChild(P)},V.prototype.getState=function(){return{typeName:V.typeName,state:this.state,notes:this.notes}},V.prototype.restoreState=function(P){this._state=P.state,this.notes=P.notes},V.prototype.scale=function(P,j){},V.prototype.colorChanged=function(P){this.onColorChanged&&this.onColorChanged(P),this.stateChanged()},V.prototype.fillColorChanged=function(P){this.onFillColorChanged&&this.onFillColorChanged(P),this.stateChanged()},V.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var P=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),P.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(P)&&this.onStateChanged(this)}},V.typeName="MarkerBase",V}(),u=function(){function V(){this.findGripByVisual=this.findGripByVisual.bind(this)}return V.prototype.findGripByVisual=function(P){return this.topLeft.ownsTarget(P)?this.topLeft:this.topCenter.ownsTarget(P)?this.topCenter:this.topRight.ownsTarget(P)?this.topRight:this.centerLeft.ownsTarget(P)?this.centerLeft:this.centerRight.ownsTarget(P)?this.centerRight:this.bottomLeft.ownsTarget(P)?this.bottomLeft:this.bottomCenter.ownsTarget(P)?this.bottomCenter:this.bottomRight.ownsTarget(P)?this.bottomRight:void 0},V}(),s=function(){function V(){this.GRIP_SIZE=10,this.visual=M.createGroup(),this.visual.appendChild(M.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(M.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(P){return P===this.visual||P===this.visual.childNodes[0]||P===this.visual.childNodes[1]},V}(),i=function(){function V(){}return V.toITransformMatrix=function(P){return{a:P.a,b:P.b,c:P.c,d:P.d,e:P.e,f:P.f}},V.toSVGMatrix=function(P,j){return P.a=j.a,P.b=j.b,P.c=j.c,P.d=j.d,P.e=j.e,P.f=j.f,P},V}(),D=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.left=0,X.top=0,X.width=0,X.height=0,X.defaultSize={x:50,y:20},X.offsetX=0,X.offsetY=0,X.rotationAngle=0,X.CB_DISTANCE=10,X._suppressMarkerCreateEvent=!1,X.container.transform.baseVal.appendItem(M.createTransform()),X.setupControlBox(),X}return Y(P,V),Object.defineProperty(P.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"visual",{get:function(){return this._visual},set:function(j){this._visual=j;var $=M.createTransform();this._visual.transform.baseVal.appendItem($)},enumerable:!1,configurable:!0}),P.prototype.ownsTarget=function(j){return!!V.prototype.ownsTarget.call(this,j)||!!(this.controlGrips.findGripByVisual(j)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(j))},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="new"&&(this.left=j.x,this.top=j.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(j);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual($),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget($)){this.activeGrip=this.rotatorGrip;var X=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=X.x-this.width/2,this.top=X.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ye=this.container.transform.baseVal.getItem(0);ye.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ye,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},P.prototype.pointerUp=function(j){var $=this.state;V.prototype.pointerUp.call(this,j),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(j),this._state="select",$==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},P.prototype.moveVisual=function(j){this.visual.style.transform="translate("+j.x+"px, "+j.y+"px)"},P.prototype.manipulate=function(j){var $=this.unrotatePoint(j);this.state==="creating"?this.resize(j):this.state==="move"?(this.left=this.manipulationStartLeft+($.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+($.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize($):this.state==="rotate"&&this.rotate(j)},P.prototype.resize=function(j){var $=this.manipulationStartLeft,J=this.manipulationStartWidth,X=this.manipulationStartTop,ye=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:$=this.manipulationStartLeft+j.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-$;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+j.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:X=this.manipulationStartTop+j.y-this.manipulationStartY,ye=this.manipulationStartHeight+this.manipulationStartTop-X;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ye=this.manipulationStartHeight+j.y-this.manipulationStartY}J>=0?(this.left=$,this.width=J):(this.left=$+J,this.width=-J),ye>=0?(this.top=X,this.height=ye):(this.top=X+ye,this.height=-ye),this.setSize()},P.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},P.prototype.rotate=function(j){if(Math.abs(j.x-this.centerX)>.1){var $=Math.sign(j.x-this.centerX);this.rotationAngle=180*Math.atan((j.y-this.centerY)/(j.x-this.centerX))/Math.PI+90*$,this.applyRotation()}},P.prototype.applyRotation=function(){var j=this.container.transform.baseVal.getItem(0);j.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(j,0)},P.prototype.rotatePoint=function(j){if(this.rotationAngle===0)return j;var $=this.container.getCTM(),J=M.createPoint(j.x,j.y);return{x:(J=J.matrixTransform($)).x,y:J.y}},P.prototype.unrotatePoint=function(j){if(this.rotationAngle===0)return j;var $=this.container.getCTM();$=$.inverse();var J=M.createPoint(j.x,j.y);return{x:(J=J.matrixTransform($)).x,y:J.y}},P.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},P.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},P.prototype.setupControlBox=function(){this.controlBox=M.createGroup();var j=M.createTransform();j.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(j),this.container.appendChild(this.controlBox),this.controlRect=M.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=M.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 u,this.addControlGrips(),this.controlBox.style.display="none"},P.prototype.adjustControlBox=function(){var j=this.controlBox.transform.baseVal.getItem(0);j.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(j,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},P.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},P.prototype.createGrip=function(){var j=new s;return j.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(j.visual),j},P.prototype.positionGrips=function(){var j=this.controlGrips.topLeft.GRIP_SIZE,$=-j/2,J=$,X=(this.width+this.CB_DISTANCE)/2-j/2,ye=(this.height+this.CB_DISTANCE)/2-j/2,Re=this.height+this.CB_DISTANCE-j/2,Ke=this.width+this.CB_DISTANCE-j/2;this.positionGrip(this.controlGrips.topLeft.visual,$,J),this.positionGrip(this.controlGrips.topCenter.visual,X,J),this.positionGrip(this.controlGrips.topRight.visual,Ke,J),this.positionGrip(this.controlGrips.centerLeft.visual,$,ye),this.positionGrip(this.controlGrips.centerRight.visual,Ke,ye),this.positionGrip(this.controlGrips.bottomLeft.visual,$,Re),this.positionGrip(this.controlGrips.bottomCenter.visual,X,Re),this.positionGrip(this.controlGrips.bottomRight.visual,Ke,Re),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,X,J-3*this.CB_DISTANCE)},P.prototype.positionGrip=function(j,$,J){var X=j.transform.baseVal.getItem(0);X.setTranslate($,J),j.transform.baseVal.replaceItem(X,0)},P.prototype.hideControlBox=function(){this.controlBox.style.display="none"},P.prototype.showControlBox=function(){this.controlBox.style.display=""},P.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:i.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:i.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},V.prototype.getState.call(this))},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.left=$.left,this.top=$.top,this.width=$.width,this.height=$.height,this.rotationAngle=$.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(i.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,$.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(i.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,$.containerTransformMatrix))},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$);var J=this.rotatePoint({x:this.left,y:this.top}),X=this.unrotatePoint({x:J.x*j,y:J.y*$});this.left=X.x,this.top=X.y,this.width=this.width*j,this.height=this.height*$,this.adjustControlBox()},P}(l),A=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.createVisual=X.createVisual.bind(X),X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual)},P.prototype.createVisual=function(){this.visual=M.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="new"&&(this.createVisual(),this.moveVisual(j),this._state="creating")},P.prototype.manipulate=function(j){V.prototype.manipulate.call(this,j)},P.prototype.resize=function(j){V.prototype.resize.call(this,j),this.setSize()},P.prototype.setSize=function(){V.prototype.setSize.call(this),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},P.prototype.pointerUp=function(j){V.prototype.pointerUp.call(this,j),this.setSize()},P.prototype.setStrokeColor=function(j){this.strokeColor=j,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(j),this.stateChanged()},P.prototype.setFillColor=function(j){this.fillColor=j,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},P.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},P.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},P.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this))},P.prototype.restoreState=function(j){var $=j;this.fillColor=$.fillColor,this.strokeColor=$.strokeColor,this.strokeWidth=$.strokeWidth,this.strokeDasharray=$.strokeDasharray,this.opacity=$.opacity,this.createVisual(),V.prototype.restoreState.call(this,j),this.setSize()},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.setSize()},P.title="Rectangle marker",P}(D),S=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ye.widths=[],ye.widthBoxes=[],ye.widths=$,ye.currentWidth=J,ye.setCurrentWidth=ye.setCurrentWidth.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.display="flex",$.style.overflow="hidden",$.style.flexGrow="2",this.widths.forEach(function(J){var X=document.createElement("div");X.style.display="flex",X.style.flexGrow="2",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=J===j.currentWidth?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentWidth(J,X)}),$.appendChild(X);var ye=document.createElement("div");ye.innerText=J.toString(),ye.style.marginRight="5px",X.appendChild(ye);var Re=document.createElement("div");Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.display="flex",Re.style.alignItems="center";var Ke=document.createElement("hr");Ke.style.minWidth="20px",Ke.style.border="0px",Ke.style.borderTop=J+"px solid "+j.uiStyleSettings.toolboxColor,Ke.style.flexGrow="2",Re.appendChild(Ke),X.appendChild(Re),j.widthBoxes.push(X)}),$},P.prototype.setCurrentWidth=function(j,$){var J=this;this.currentWidth=j,this.widthBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},P}(o),R=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'<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 ye.styles=[],ye.styleBoxes=[],ye.styles=$,ye.currentStyle=J,ye.setCurrentStyle=ye.setCurrentStyle.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.display="flex",$.style.overflow="hidden",$.style.flexGrow="2",this.styles.forEach(function(J){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/j.styles.length-5+"%",X.style.borderColor=J===j.currentStyle?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentStyle(J,X)}),$.appendChild(X);var ye=document.createElement("div");ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.overflow="hidden";var Re=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+j.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(J!==""?'stroke-dasharray="'+J+'"':"")+` />
</svg>`;ye.innerHTML=Re,X.appendChild(ye),j.styleBoxes.push(X)}),$},P.prototype.setCurrentStyle=function(j,$){var J=this;this.currentStyle=j,this.styleBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},P}(o),O=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new p("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new R("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Y(P,V),Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.typeName="FrameMarker",P.title="Frame marker",P.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',P}(A),g=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},_=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.x1=0,X.y1=0,X.x2=0,X.y2=0,X.defaultLength=50,X.manipulationStartX=0,X.manipulationStartY=0,X.manipulationStartX1=0,X.manipulationStartY1=0,X.manipulationStartX2=0,X.manipulationStartY2=0,X.setupControlBox(),X}return Y(P,V),P.prototype.ownsTarget=function(j){return!!V.prototype.ownsTarget.call(this,j)||!(!this.grip1.ownsTarget(j)&&!this.grip2.ownsTarget(j))},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.manipulationStartX=j.x,this.manipulationStartY=j.y,this.state==="new"&&(this.x1=j.x,this.y1=j.y,this.x2=j.x,this.y2=j.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($)?this.activeGrip=this.grip1:this.grip2.ownsTarget($)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},P.prototype.pointerUp=function(j){var $=this.state;V.prototype.pointerUp.call(this,j),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(j),this._state="select",$==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},P.prototype.adjustVisual=function(){},P.prototype.manipulate=function(j){this.state==="creating"?this.resize(j):this.state==="move"?(this.x1=this.manipulationStartX1+j.x-this.manipulationStartX,this.y1=this.manipulationStartY1+j.y-this.manipulationStartY,this.x2=this.manipulationStartX2+j.x-this.manipulationStartX,this.y2=this.manipulationStartY2+j.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(j)},P.prototype.resize=function(j){switch(this.activeGrip){case this.grip1:this.x1=j.x,this.y1=j.y;break;case this.grip2:case void 0:this.x2=j.x,this.y2=j.y}this.adjustVisual(),this.adjustControlBox()},P.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},P.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},P.prototype.setupControlBox=function(){this.controlBox=M.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},P.prototype.adjustControlBox=function(){this.positionGrips()},P.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},P.prototype.createGrip=function(){var j=new s;return j.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(j.visual),j},P.prototype.positionGrips=function(){var j=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-j/2,this.y1-j/2),this.positionGrip(this.grip2.visual,this.x2-j/2,this.y2-j/2)},P.prototype.positionGrip=function(j,$,J){var X=j.transform.baseVal.getItem(0);X.setTranslate($,J),j.transform.baseVal.replaceItem(X,0)},P.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},V.prototype.getState.call(this))},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.x1=$.x1,this.y1=$.y1,this.x2=$.x2,this.y2=$.y2},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.x1=this.x1*j,this.y1=this.y1*$,this.x2=this.x2*j,this.y2=this.y2*$,this.adjustVisual(),this.adjustControlBox()},P}(l),d=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new p("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new R("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.selectorLine&&j!==this.visibleLine)},P.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorLine=M.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=M.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},P.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),M.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},P.prototype.setStrokeColor=function(j){this.strokeColor=j,this.adjustVisual(),this.colorChanged(j)},P.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.adjustVisual()},P.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.adjustVisual(),this.stateChanged()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.strokeColor=$.strokeColor,this.strokeWidth=$.strokeWidth,this.strokeDasharray=$.strokeDasharray,this.createVisual(),this.adjustVisual()},P.typeName="LineMarker",P.title="Line marker",P.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',P}(_),c=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'<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 ye.fonts=[],ye.fontBoxes=[],ye.fonts=$,ye.currentFont=J,ye.setCurrentFont=ye.setCurrentFont.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.overflow="hidden",$.style.flexGrow="2",this.fonts.forEach(function(J){var X=document.createElement("div");X.style.display="inline-block",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/j.fonts.length-5+"%",X.style.borderColor=J===j.currentFont?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentFont(J,X)}),$.appendChild(X);var ye=document.createElement("div");ye.style.display="flex",ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.fontFamily=J,ye.style.overflow="hidden";var Re=document.createElement("div");Re.style.whiteSpace="nowrap",Re.style.overflow="hidden",Re.style.textOverflow="ellipsis",Re.innerHTML="The quick brown fox jumps over the lazy dog",ye.appendChild(Re),X.appendChild(ye),j.fontBoxes.push(X)}),$},P.prototype.setCurrentFont=function(j,$){var J=this;this.currentFont=j,this.fontBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},P}(o),C=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.color="transparent",X.padding=5,X.DEFAULT_TEXT="your text here",X.text=X.DEFAULT_TEXT,X.isMoved=!1,X.color=J.defaultColor,X.fontFamily=J.defaultFontFamily,X.defaultSize={x:100,y:30},X.setColor=X.setColor.bind(X),X.setFont=X.setFont.bind(X),X.renderText=X.renderText.bind(X),X.sizeText=X.sizeText.bind(X),X.textEditDivClicked=X.textEditDivClicked.bind(X),X.showTextEditor=X.showTextEditor.bind(X),X.setSize=X.setSize.bind(X),X.positionTextEditor=X.positionTextEditor.bind(X),X.colorPanel=new p("Color",J.defaultColorSet,J.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.fontFamilyPanel=new c("Font",J.defaultFontFamilies,J.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X}return Y(P,V),P.prototype.ownsTarget=function(j){if(V.prototype.ownsTarget.call(this,j)||j===this.visual||j===this.textElement||j===this.bgRectangle)return!0;var $=!1;return this.textElement.childNodes.forEach(function(J){J===j&&($=!0)}),$},P.prototype.createVisual=function(){this.visual=M.createGroup(),this.bgRectangle=M.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=M.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.isMoved=!1,this.pointerDownPoint=j,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(j),this._state="creating")},P.prototype.renderText=function(){var j=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($){j.textElement.appendChild(M.createTSpan($.trim()===""?" ":$.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},P.prototype.getTextScale=function(){var j=this.textElement.getBBox(),$=1;if(j.width>0&&j.height>0){var J=(1*this.width-this.width*this.padding*2/100)/j.width,X=(1*this.height-this.height*this.padding*2/100)/j.height;$=Math.min(J,X)}return $},P.prototype.getTextPosition=function(j){var $=this.textElement.getBBox(),J=0,X=0;return $.width>0&&$.height>0&&(J=(this.width-$.width*j)/2,X=this.height/2-$.height*j/2),{x:J,y:X}},P.prototype.sizeText=function(){var j=this.textElement.getBBox(),$=this.getTextScale(),J=this.getTextPosition($);J.y-=j.y*$,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+$+", "+$+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale($,$))},P.prototype.manipulate=function(j){V.prototype.manipulate.call(this,j),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(j.x-this.pointerDownPoint.x)>5||Math.abs(j.y-this.pointerDownPoint.y)>5)},P.prototype.resize=function(j){V.prototype.resize.call(this,j),this.isMoved=!0,this.setSize(),this.sizeText()},P.prototype.setSize=function(){V.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},P.prototype.pointerUp=function(j){var $=this.state;$==="creating"&&(this._suppressMarkerCreateEvent=!0),V.prototype.pointerUp.call(this,j),this.setSize(),($==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},P.prototype.showTextEditor=function(){var j=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($){$.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var $=Number.parseFloat(j.textEditor.style.fontSize);j.textEditor.clientWidth>=Number.parseInt(j.textEditor.style.maxWidth)&&$>.9;)$-=.1,j.textEditor.style.fontSize=Math.max($,.9)+"em"}),this.textEditor.addEventListener("keyup",function($){$.cancelBubble=!0}),this.textEditor.addEventListener("paste",function($){if($.clipboardData){var J=$.clipboardData.getData("text"),X=window.getSelection();if(!X.rangeCount)return!1;X.deleteFromDocument(),X.getRangeAt(0).insertNode(document.createTextNode(J)),$.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){j.textEditDivClicked(j.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},P.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var j=this.getTextScale(),$=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),X={x:J.width*j,y:J.height*j};$.x-=X.x/2,$.y-=X.y/2,this.textEditor.style.top=$.y+"px",this.textEditor.style.left=$.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-$.x+"px",this.textEditor.style.fontSize=Math.max(16*j,12)+"px",this.textElement.style.display="none"}},P.prototype.textEditDivClicked=function(j){this.text=j.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},P.prototype.select=function(){V.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},P.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),V.prototype.deselect.call(this)},P.prototype.dblClick=function(j,$){V.prototype.dblClick.call(this,j,$),this.showTextEditor()},P.prototype.setColor=function(j){this.textElement&&M.setAttributes(this.textElement,[["fill",j]]),this.color=j,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(j)},P.prototype.setFont=function(j){this.textElement&&M.setAttributes(this.textElement,[["font-family",j]]),this.fontFamily=j,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},P.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},P.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){var $=j;this.color=$.color,this.fontFamily=$.fontFamily,this.padding=$.padding,this.text=$.text,this.createVisual(),V.prototype.restoreState.call(this,j),this.setSize()},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.setSize(),this.sizeText(),this.positionTextEditor()},P.typeName="TextMarker",P.title="Text marker",P.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',P}(D),E=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.color="transparent",X.lineWidth=3,X.drawing=!1,X.pixelRatio=1,X.color=J.defaultColor,X.lineWidth=J.defaultStrokeWidth,X.pixelRatio=J.freehandPixelRatio,X.setColor=X.setColor.bind(X),X.addCanvas=X.addCanvas.bind(X),X.finishCreation=X.finishCreation.bind(X),X.setLineWidth=X.setLineWidth.bind(X),X.colorPanel=new p("Color",J.defaultColorSet,J.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.lineWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.lineWidthPanel.onWidthChanged=X.setLineWidth,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.drawingImage)},P.prototype.createVisual=function(){this.visual=M.createGroup(),this.drawingImage=M.createImage(),this.visual.appendChild(this.drawingImage);var j=M.createTransform();this.visual.transform.baseVal.appendItem(j),this.addMarkerVisualToContainer(this.visual)},P.prototype.pointerDown=function(j,$){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(j.x,j.y),this.drawing=!0):V.prototype.pointerDown.call(this,j,$)},P.prototype.manipulate=function(j){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(j.x,j.y),this.canvasContext.stroke()):V.prototype.manipulate.call(this,j)},P.prototype.resize=function(j){V.prototype.resize.call(this,j),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},P.prototype.pointerUp=function(j){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):V.prototype.pointerUp.call(this,j)},P.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},P.prototype.select=function(){this.state==="creating"&&this.finishCreation(),V.prototype.select.call(this)},P.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),V.prototype.deselect.call(this)},P.prototype.finishCreation=function(){for(var j=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),$=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=$[0],X=$[1],ye=$[2],Re=$[3],Ke=!1,pe=0;pe<this.canvasElement.height;pe++)for(var we=0;we<this.canvasElement.width;we++)j.data[pe*this.canvasElement.width*4+4*we+3]>0&&(Ke=!0,pe<X&&(X=pe),we<J&&(J=we),pe>Re&&(Re=pe),we>ye&&(ye=we));if(Ke){this.left=J/this.pixelRatio,this.top=X/this.pixelRatio,this.width=(ye-J)/this.pixelRatio,this.height=(Re-X)/this.pixelRatio;var ke=document.createElement("canvas");ke.width=ye-J,ke.height=Re-X,ke.getContext("2d").putImageData(this.canvasContext.getImageData(J,X,ye-J,Re-X),0,0),this.drawingImgUrl=ke.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},P.prototype.setDrawingImage=function(){M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},P.prototype.setColor=function(j){this.color=j,this.colorChanged(j)},P.prototype.setLineWidth=function(j){this.lineWidth=j},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({drawingImgUrl:this.drawingImgUrl},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){this.createVisual(),V.prototype.restoreState.call(this,j),this.drawingImgUrl=j.drawingImgUrl,this.setDrawingImage()},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.setDrawingImage()},P.typeName="FreehandMarker",P.title="Freehand marker",P.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',P}(D),w=function(V){function P(j,$,J){var X=V.call(this,j,J||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return X.typeBoxes=[],X.currentType=$,X.setCurrentType=X.setCurrentType.bind(X),X}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");$.style.display="flex",$.style.overflow="hidden",$.style.flexGrow="2";for(var J=function(Re){var Ke="both";switch(Re){case 0:Ke="both";break;case 1:Ke="start";break;case 2:Ke="end";break;case 3:Ke="none"}var pe=document.createElement("div");if(pe.style.display="flex",pe.style.flexGrow="2",pe.style.alignItems="center",pe.style.justifyContent="space-between",pe.style.padding="5px",pe.style.borderWidth="2px",pe.style.borderStyle="solid",pe.style.borderColor=Ke===X.currentType?X.uiStyleSettings.toolboxAccentColor:"transparent",pe.addEventListener("click",function(){j.setCurrentType(Ke,pe)}),$.appendChild(pe),Ke==="both"||Ke==="start"){var we=document.createElement("div");we.style.display="flex",we.style.alignItems="center",we.style.minHeight="20px",we.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="`+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,we.style.marginLeft="5px",pe.appendChild(we)}var ke=document.createElement("div");ke.style.display="flex",ke.style.alignItems="center",ke.style.minHeight="20px",ke.style.flexGrow="2";var Ue=document.createElement("hr");if(Ue.style.minWidth="20px",Ue.style.border="0px",Ue.style.borderTop="3px solid "+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee"),Ue.style.flexGrow="2",ke.appendChild(Ue),pe.appendChild(ke),Ke==="both"||Ke==="end"){var Qe=document.createElement("div");Qe.style.display="flex",Qe.style.alignItems="center",Qe.style.minHeight="20px",Qe.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="`+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Qe.style.marginRight="5px",pe.appendChild(Qe)}X.typeBoxes.push(pe)},X=this,ye=0;ye<4;ye++)J(ye);return $},P.prototype.setCurrentType=function(j,$){var J=this;this.currentType=j,this.typeBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},P}(o),B=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.arrowType="end",X.arrowBaseHeight=10,X.arrowBaseWidth=10,X.getArrowPoints=X.getArrowPoints.bind(X),X.setArrowType=X.setArrowType.bind(X),X.arrowTypePanel=new w("Arrow type","end"),X.arrowTypePanel.onArrowTypeChanged=X.setArrowType,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.arrow1&&j!==this.arrow2)},P.prototype.getArrowPoints=function(j,$){var J=this.arrowBaseWidth+2*this.strokeWidth,X=this.arrowBaseHeight+2*this.strokeWidth;return j-J/2+","+($+X/2)+" "+j+","+($-X/2)+" "+(j+J/2)+","+($+X/2)},P.prototype.createTips=function(){this.arrow1=M.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=M.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow2)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="creating"&&this.createTips()},P.prototype.adjustVisual=function(){if(V.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",M.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),M.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var j=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),$=this.arrow1.transform.baseVal.getItem(0);$.setRotate(j,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem($,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(j+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},P.prototype.setArrowType=function(j){this.arrowType=j,this.adjustVisual(),this.stateChanged()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({arrowType:this.arrowType},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.arrowType=$.arrowType,this.createTips(),this.adjustVisual()},P.typeName="ArrowMarker",P.title="Arrow marker",P.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',P}(d),W=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.fillColor=J.defaultFillColor,X.strokeWidth=0,X.fillPanel=new p("Color",J.defaultColorSet,J.defaultFillColor),X.fillPanel.onColorChanged=X.setFillColor,X}return Y(P,V),Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.typeName="CoverMarker",P.title="Cover marker",P.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',P}(A),T=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'<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 ye.opacities=[],ye.opacityBoxes=[],ye.opacities=$,ye.currentOpacity=J,ye.setCurrentOpacity=ye.setCurrentOpacity.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.display="flex",$.style.overflow="hidden",$.style.flexGrow="2",$.style.justifyContent="space-between",this.opacities.forEach(function(J){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="center",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=J===j.currentOpacity?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentOpacity(J,X)}),$.appendChild(X);var ye=document.createElement("div");ye.innerText=100*J+"%",X.appendChild(ye),j.opacityBoxes.push(X)}),$},P.prototype.setCurrentOpacity=function(j,$){var J=this;this.currentOpacity=j,this.opacityBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},P}(o),k=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.setOpacity=X.setOpacity.bind(X),X.fillColor=J.defaultHighlightColor,X.strokeWidth=0,X.opacity=J.defaultHighlightOpacity,X.fillPanel=new p("Color",J.defaultColorSet,X.fillColor),X.fillPanel.onColorChanged=X.setFillColor,X.opacityPanel=new T("Opacity",J.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return Y(P,V),P.prototype.setOpacity=function(j){this.opacity=j,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.typeName="HighlightMarker",P.title="Highlight marker",P.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',P}(W),m='<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>',y=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.bgColor="transparent",X.tipPosition={x:0,y:0},X.tipBase1Position={x:0,y:0},X.tipBase2Position={x:0,y:0},X.tipMoving=!1,X.color=J.defaultStrokeColor,X.bgColor=J.defaultFillColor,X.fontFamily=J.defaultFontFamily,X.defaultSize={x:100,y:30},X.setBgColor=X.setBgColor.bind(X),X.getTipPoints=X.getTipPoints.bind(X),X.positionTip=X.positionTip.bind(X),X.setTipPoints=X.setTipPoints.bind(X),X.colorPanel=new p("Text color",J.defaultColorSet,X.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>'),X.colorPanel.onColorChanged=X.setColor,X.bgColorPanel=new p("Fill color",J.defaultColorSet,X.bgColor,m),X.bgColorPanel.onColorChanged=X.setBgColor,X.fontFamilyPanel=new c("Font",J.defaultFontFamilies,J.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X.tipGrip=new s,X.tipGrip.visual.transform.baseVal.appendItem(M.createTransform()),X.controlBox.appendChild(X.tipGrip.visual),X}return Y(P,V),P.prototype.ownsTarget=function(j){return V.prototype.ownsTarget.call(this,j)||this.tipGrip.ownsTarget(j)||this.tip===j},P.prototype.createTip=function(){M.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=M.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},P.prototype.pointerDown=function(j,$){this.state==="new"&&V.prototype.pointerDown.call(this,j,$),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget($)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):V.prototype.pointerDown.call(this,j,$)},P.prototype.pointerUp=function(j){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,V.prototype.pointerUp.call(this,j);else{var $=this.state==="creating";V.prototype.pointerUp.call(this,j),this.setTipPoints($),this.positionTip()}},P.prototype.manipulate=function(j){if(this.tipMoving){var $=this.unrotatePoint(j);this.tipPosition={x:$.x-this.manipulationStartLeft,y:$.y-this.manipulationStartTop},this.positionTip()}else V.prototype.manipulate.call(this,j)},P.prototype.setBgColor=function(j){this.bgRectangle&&this.tip&&(M.setAttributes(this.bgRectangle,[["fill",j]]),M.setAttributes(this.tip,[["fill",j]])),this.bgColor=j,this.fillColorChanged(j)},P.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},P.prototype.setTipPoints=function(j){j===void 0&&(j=!1);var $=Math.min(this.height/2,15),J=this.height/5;j&&(this.tipPosition={x:$+J/2,y:this.height+20});var X=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?X<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(J=this.width/5,$=Math.min(this.width/2,15),this.tipBase1Position={x:$,y:0},this.tipBase2Position={x:$+J,y:0}):(this.tipBase1Position={x:0,y:$},this.tipBase2Position={x:0,y:$+J}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?X<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(J=this.width/5,$=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-$-J,y:0},this.tipBase2Position={x:this.width-$,y:0}):(this.tipBase1Position={x:this.width,y:$},this.tipBase2Position={x:this.width,y:$+J}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?X<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(J=this.width/5,$=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-$-J,y:this.height},this.tipBase2Position={x:this.width-$,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-$-J},this.tipBase2Position={x:this.width,y:this.height-$}):X<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(J=this.width/5,$=Math.min(this.width/2,15),this.tipBase1Position={x:$,y:this.height},this.tipBase2Position={x:$+J,y:this.height}):(this.tipBase1Position={x:0,y:this.height-$},this.tipBase2Position={x:0,y:this.height-$-J})},P.prototype.resize=function(j){V.prototype.resize.call(this,j),this.positionTip()},P.prototype.positionTip=function(){M.setAttributes(this.tip,[["points",this.getTipPoints()]]);var j=this.tipGrip.visual.transform.baseVal.getItem(0);j.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(j,0)},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),P.prototype.select=function(){this.positionTip(),V.prototype.select.call(this)},P.prototype.getState=function(){var j=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){var $=j;this.bgColor=$.bgColor,this.tipPosition=$.tipPosition,V.prototype.restoreState.call(this,j),this.createTip(),this.setTipPoints()},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.tipPosition={x:this.tipPosition.x*j,y:this.tipPosition.y*$},this.positionTip()},P.typeName="CalloutMarker",P.title="Callout marker",P.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',P}(C),H=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.fillColor=J.defaultFillColor,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.setOpacity=X.setOpacity.bind(X),X.createVisual=X.createVisual.bind(X),X.strokePanel=new p("Line color",I(J.defaultColorSet,["transparent"]),J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.fillPanel=new p("Fill color",I(J.defaultColorSet,["transparent"]),X.fillColor,m),X.fillPanel.onColorChanged=X.setFillColor,X.strokeWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new R("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X.opacityPanel=new T("Opacity",J.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual)},P.prototype.createVisual=function(){this.visual=M.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="new"&&(this.createVisual(),this.moveVisual(j),this._state="creating")},P.prototype.manipulate=function(j){V.prototype.manipulate.call(this,j)},P.prototype.resize=function(j){V.prototype.resize.call(this,j),this.setSize()},P.prototype.setSize=function(){V.prototype.setSize.call(this),M.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},P.prototype.pointerUp=function(j){V.prototype.pointerUp.call(this,j),this.setSize()},P.prototype.setStrokeColor=function(j){this.strokeColor=j,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(j),this.stateChanged()},P.prototype.setFillColor=function(j){this.fillColor=j,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(j),this.stateChanged()},P.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},P.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},P.prototype.setOpacity=function(j){this.opacity=j,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){var $=j;this.fillColor=$.fillColor,this.strokeColor=$.strokeColor,this.strokeWidth=$.strokeWidth,this.strokeDasharray=$.strokeDasharray,this.opacity=$.opacity,this.createVisual(),V.prototype.restoreState.call(this,j),this.setSize()},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.setSize()},P.typeName="EllipseMarker",P.title="Ellipse marker",P.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',P}(D),Q=function(V){function P(j,$,J){return V.call(this,j,$,J)||this}return Y(P,V),Object.defineProperty(P.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.tip1&&j!==this.tip2)},P.prototype.createTips=function(){this.tip1=M.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(M.createTransform()),this.visual.appendChild(this.tip1),this.tip2=M.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(M.createTransform()),this.visual.appendChild(this.tip2)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="creating"&&this.createTips()},P.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(M.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()]]),M.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 j=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),$=this.tip1.transform.baseVal.getItem(0);$.setRotate(j,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem($,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(j+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j),this.createTips(),this.adjustVisual()},P.typeName="MeasurementMarker",P.title="Measurement marker",P.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',P}(d),te=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.strokePanel.colors=J.defaultColorSet,X.fillColor="transparent",X}return Y(P,V),Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.typeName="EllipseFrameMarker",P.title="Ellipse frame marker",P.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',P}(H),ae=function(){function V(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),V.prototype.addUndoStep=function(P){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(P)||(this.undoStack.push(P),JSON.stringify(this.lastRedoStep)!==JSON.stringify(P)&&this.redoStack.splice(0,this.redoStack.length))},V.prototype.replaceLastUndoStep=function(P){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=P)},V.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},V.prototype.undo=function(){if(this.undoStack.length>1){var P=this.undoStack.pop();return P!==void 0&&this.redoStack.push(P),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},V.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},V}(),Te=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.curveX=0,X.curveY=0,X.manipulationStartCurveX=0,X.manipulationStartCurveY=0,X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.positionGrips=X.positionGrips.bind(X),X.addControlGrips=X.addControlGrips.bind(X),X.adjustVisual=X.adjustVisual.bind(X),X.setupControlBox=X.setupControlBox.bind(X),X.resize=X.resize.bind(X),X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new p("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new R("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.selectorCurve&&j!==this.visibleCurve&&!this.curveGrip.ownsTarget(j))},P.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},P.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorCurve=M.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=M.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=j.x,this.curveY=j.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget($)&&(this.activeGrip=this.curveGrip,this._state="resize")},P.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),M.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},P.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=M.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=M.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},P.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,V.prototype.addControlGrips.call(this)},P.prototype.positionGrips=function(){V.prototype.positionGrips.call(this);var j=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-j/2,this.curveY-j/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},P.prototype.manipulate=function(j){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+j.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+j.y-this.manipulationStartY),V.prototype.manipulate.call(this,j)},P.prototype.resize=function(j){this.activeGrip===this.curveGrip&&(this.curveX=j.x,this.curveY=j.y),V.prototype.resize.call(this,j),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},P.prototype.setStrokeColor=function(j){this.strokeColor=j,this.adjustVisual(),this.colorChanged(j)},P.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.adjustVisual()},P.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.adjustVisual()},P.prototype.scale=function(j,$){this.curveX=this.curveX*j,this.curveY=this.curveY*$,V.prototype.scale.call(this,j,$)},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.strokeColor=$.strokeColor,this.strokeWidth=$.strokeWidth,this.strokeDasharray=$.strokeDasharray,this.curveX=$.curveX,this.curveY=$.curveY,this.createVisual(),this.adjustVisual()},P.typeName="CurveMarker",P.title="Curve marker",P.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',P}(_),_e=function(){function V(P,j){j===void 0&&(j=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=P,this.cancelable=j}return Object.defineProperty(V.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),V.prototype.preventDefault=function(){this._defaultPrevented=!0},V}(),ge=function(V){function P(j,$,J){var X=V.call(this,j,!1)||this;return X.dataUrl=$,X.state=J,X}return Y(P,V),P}(_e),ve=function(V){function P(j,$,J){J===void 0&&(J=!1);var X=V.call(this,j,J)||this;return X.marker=$,X}return Y(P,V),P}(_e),Oe=function(){function V(){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 V.prototype.addEventListener=function(P,j){this[P].push(j)},V.prototype.removeEventListener=function(P,j){var $=this[P].indexOf(j);$>-1&&this[P].splice($,1)},V}(),he=function(){function V(P){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new g,this._isOpen=!1,this.undoRedoManager=new ae,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 Oe,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=V.instanceCounter++,this.styles=new L(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=P,this.targetRoot=document.body,this.width=P.clientWidth,this.height=P.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(V.prototype,"ALL_MARKER_TYPES",{get:function(){return[O,E,B,C,te,H,k,y,Q,W,d,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[O,E,B,C,H,k,y]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[O,E,B,C,k]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(P){var j=this;this._availableMarkerTypes.splice(0),P.forEach(function($){if(typeof $=="string"){var J=j.ALL_MARKER_TYPES.find(function(X){return X.typeName===$});J!==void 0&&j._availableMarkerTypes.push(J)}else j._availableMarkerTypes.push($)})},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(P){this._zoomLevel=P,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),V.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),G.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},V.prototype.show=function(){var P=this;this.styles.styleSheetRoot===void 0&&n.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=n.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(j){return j(new _e(P))})},V.prototype.render=function(){return N(this,void 0,void 0,function(){var P;return z(this,function(j){switch(j.label){case 0:return this.setCurrentMarker(),(P=new K).naturalSize=this.renderAtNaturalSize,P.imageType=this.renderImageType,P.imageQuality=this.renderImageQuality,P.markersOnly=this.renderMarkersOnly,P.width=this.renderWidth,P.height=this.renderHeight,[4,P.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return j.sent(),[4,P.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,j.sent()]}})})},V.prototype.close=function(P){var j=this;if(P===void 0&&(P=!1),this.isOpen){var $=!1;P||this.eventListeners.beforeclose.forEach(function(J){var X=new _e(j,!0);J(X),X.defaultPrevented&&($=!0)}),$||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(J){return J(new _e(j))}),this.detachEvents(),this._isOpen=!1)}},V.prototype.addMarkersToToolbar=function(){for(var P,j=[],$=0;$<arguments.length;$++)j[$]=arguments[$];(P=this._availableMarkerTypes).push.apply(P,j)},V.prototype.addRenderEventListener=function(P){this.addEventListener("render",function(j){P(j.dataUrl,j.state)})},V.prototype.removeRenderEventListener=function(P){},V.prototype.addCloseEventListener=function(P){this.addEventListener("close",function(){P()})},V.prototype.removeCloseEventListener=function(P){},V.prototype.setupResizeObserver=function(){var P=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){P.resize(P.target.clientWidth,P.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return P.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},V.prototype.onPopupTargetResize=function(){var P=1*this.target.clientWidth/this.target.clientHeight,j=this.editorCanvas.clientWidth/P>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*P:this.editorCanvas.clientWidth,$=j<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/P;this.resize(j,$)},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.prototype.resize=function(P,j){this._isResizing=!0;var $=P/this.imageWidth,J=j/this.imageHeight;this.imageWidth=Math.round(P),this.imageHeight=Math.round(j),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($,J),this._isResizing=!1},V.prototype.scaleMarkers=function(P,j){var $,J=this;this._currentMarker&&this._currentMarker instanceof C?this._currentMarker.scale(P,j):($=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(X){X!==J._currentMarker&&X.scale(P,j)}),$!==void 0&&this.setCurrentMarker($)},V.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"},V.prototype.setTopLeft=function(){var P=this.editingTarget.getBoundingClientRect(),j=this.editorCanvas.getBoundingClientRect();this.left=P.left-j.left,this.top=P.top-j.top},V.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)},V.prototype.addDefs=function(){for(var P,j=[],$=0;$<arguments.length;$++)j[$]=arguments[$];this.defs=M.createDefs(),this.addDefsToImage(),(P=this.defs).append.apply(P,j)},V.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},V.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)},V.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},V.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},V.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)},V.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},V.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)},V.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var P=document.createElement("a");P.href="https://markerjs.com/",P.target="_blank",P.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',P.title="Powered by marker.js",P.style.display="grid",P.style.alignItems="center",P.style.justifyItems="center",P.style.padding="3px",P.style.width="20px",P.style.height="20px",this.logoUI.appendChild(P),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},V.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")},V.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"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var P=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=P+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new b(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 h(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},V.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.removeMarker=function(P){this.markerImage.removeChild(P.container),this.markers.indexOf(P)>-1&&this.markers.splice(this.markers.indexOf(P),1),P.dispose()},V.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())},V.prototype.toolbarButtonClicked=function(P,j){if(P==="marker"&&j!==void 0)this.createNewMarker(j);else if(P==="action")switch(j){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()}},V.prototype.deleteSelectedMarker=function(){var P=this;if(this._currentMarker!==void 0){var j=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var X=new ve(P,P._currentMarker,!0);J(X),X.defaultPrevented&&(j=!0)}),!j){var $=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(J){return J(new ve(P,$))})}}},V.prototype.clear=function(){var P=this,j=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ye){var Re=new ve(P,void 0,!0);ye(Re),Re.defaultPrevented&&(j=!0)}),!j)){this.setCurrentMarker();for(var $=function(ye){var Re=J.markers[ye];J.setCurrentMarker(J.markers[ye]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(Ke){return Ke(new ve(P,Re))})},J=this,X=this.markers.length-1;X>=0;X--)$(X);this.addUndoStep()}},Object.defineProperty(V.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),V.prototype.showNotesEditor=function(){var P;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(P=this._currentMarker.notes)!==null&&P!==void 0?P:"",this.overlayContainer.appendChild(this.notesArea))},V.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)},V.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},V.prototype.addUndoStep=function(){var P=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var j=this.getState(),$=this.undoRedoManager.getLastUndoStep();if(!$||$.width===j.width&&$.height===j.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(j),J<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(X){return X(new _e(P))})}else this.undoRedoManager.replaceLastUndoStep(j),this.eventListeners.statechange.forEach(function(X){return X(new _e(P))})}},V.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},V.prototype.undoStep=function(){var P=this,j=this.undoRedoManager.undo();j!==void 0&&(this.restoreState(j),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function($){return $(new _e(P))}))},V.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},V.prototype.redoStep=function(){var P=this,j=this.undoRedoManager.redo();j!==void 0&&(this.restoreState(j),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function($){return $(new _e(P))}))},V.prototype.stepZoom=function(){var P=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=P<this.zoomSteps.length-1?this.zoomSteps[P+1]:this.zoomSteps[0]},V.prototype.panTo=function(P){this.contentDiv.scrollBy({left:this.prevPanPoint.x-P.x,top:this.prevPanPoint.y-P.y}),this.prevPanPoint=P},V.prototype.startRenderAndClose=function(){return N(this,void 0,void 0,function(){var P,j,$=this;return z(this,function(J){switch(J.label){case 0:return[4,this.render()];case 1:return P=J.sent(),j=this.getState(),this.eventListeners.render.forEach(function(X){return X(new ge($,P,j))}),this.close(!0),[2]}})})},V.prototype.getState=function(P){P===!0&&this.setCurrentMarker();var j={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function($){return j.markers.push($.getState())}),j},V.prototype.restoreState=function(P){var j=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);P.markers.forEach(function($){var J=j._availableMarkerTypes.find(function(ye){return ye.typeName===$.typeName});if(J!==void 0){var X=j.addNewMarker(J);X.restoreState($),j.markers.push(X)}}),P.width&&P.height&&(P.width!==this.imageWidth||P.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/P.width,this.imageHeight/P.height),this.eventListeners.restorestate.forEach(function($){return $(new _e(j))})},V.prototype.addNewMarker=function(P){var j=M.createGroup();return this.markerImage.appendChild(j),new P(j,this.overlayContainer,this.settings)},V.prototype.createNewMarker=function(P){var j,$=this;(j=typeof P=="string"?this._availableMarkerTypes.find(function(J){return J.typeName===P}):P)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(j),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(j.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(J){return J(new ve($,$._currentMarker))}))},V.prototype.markerCreated=function(P){var j=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(P),this.setCurrentMarker(P),P instanceof E&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(E):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function($){return $(new ve(j,j._currentMarker))})},V.prototype.colorChanged=function(P){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=P,this.settings.defaultStrokeColor=P)},V.prototype.fillColorChanged=function(P){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=P)},V.prototype.markerStateChanged=function(P){var j=this;this.eventListeners.markerchange.forEach(function($){return $(new ve(j,P))})},V.prototype.setCurrentMarker=function(P){var j=this;this._currentMarker!==P&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function($){return $(new ve(j,j._currentMarker))})),this._currentMarker=P,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function($){return $(new ve(j,j._currentMarker))}))},V.prototype.onPointerDown=function(P){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||P.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var j=this.markers.find(function($){return $.ownsTarget(P.target)});j!==void 0?(this.setCurrentMarker(j),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(P.clientX,P.clientY),P.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:P.clientX,y:P.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(P.clientX,P.clientY))},V.prototype.onDblClick=function(P){if(this._isFocused||this.focus(),this.mode==="select"){var j=this.markers.find(function($){return $.ownsTarget(P.target)});j!==void 0&&j!==this._currentMarker&&this.setCurrentMarker(j),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(P.clientX,P.clientY),P.target):this.setCurrentMarker()}},V.prototype.onPointerMove=function(P){this.touchPoints!==1&&P.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||P.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(P.clientX,P.clientY)):this.zoomLevel>1&&this.panTo({x:P.clientX,y:P.clientY}))},V.prototype.onPointerUp=function(P){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(P.clientX,P.clientY)),this.isDragging=!1,this.addUndoStep()},V.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},V.prototype.onKeyUp=function(P){this._currentMarker===void 0||this.notesArea!==void 0||P.key!=="Delete"&&P.key!=="Backspace"||this.deleteSelectedMarker()},V.prototype.clientToLocalCoordinates=function(P,j){var $=this.markerImage.getBoundingClientRect();return{x:(P-$.left)/this.zoomLevel,y:(j-$.top)/this.zoomLevel}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var P=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=P+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},V.prototype.addLicenseKey=function(P){G.addKey(P)},V.prototype.addEventListener=function(P,j){this.eventListeners.addEventListener(P,j)},V.prototype.removeEventListener=function(P,j){this.eventListeners.removeEventListener(P,j)},V.prototype.renderState=function(P){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(P),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(V.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),V.prototype.focus=function(){var P=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(j){return j(new _e(P))}))},V.prototype.blur=function(){var P=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(j){return j(new _e(P))}))},V.instanceCounter=0,V}()},T8No:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return G}),U.d(Ee,"e",function(){return K}),U.d(Ee,"c",function(){return d}),U.d(Ee,"b",function(){return c}),U.d(Ee,"d",function(){return C}),U.d(Ee,"f",function(){return B});var ie=U("MNsG"),Y=U("N0LK"),N=U("Cg/j");let z=ie.k||"";const I=new Map;I.set("false",!1),I.set("true",!0),I.set("isMac",ie.f),I.set("isLinux",ie.d),I.set("isWindows",ie.i),I.set("isWeb",ie.h),I.set("isMacNative",ie.f&&!ie.h),I.set("isEdge",z.indexOf("Edg/")>=0),I.set("isFirefox",z.indexOf("Firefox")>=0),I.set("isChrome",z.indexOf("Chrome")>=0),I.set("isSafari",z.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class G{static has(T){return f.create(T)}static equals(T,k){return b.create(T,k)}static regex(T,k){return S.create(T,k)}static not(T){return l.create(T)}static and(...T){return g.create(T,null)}static or(...T){return _.create(T,null,!0)}static deserialize(T,k=!1){return T?this._deserializeOrExpression(T,k):void 0}static _deserializeOrExpression(T,k){let m=T.split("||");return _.create(m.map(y=>this._deserializeAndExpression(y,k)),null,!0)}static _deserializeAndExpression(T,k){let m=T.split("&&");return g.create(m.map(y=>this._deserializeOne(y,k)),null)}static _deserializeOne(T,k){if(T=T.trim(),T.indexOf("!=")>=0){let m=T.split("!=");return p.create(m[0].trim(),this._deserializeValue(m[1],k))}if(T.indexOf("==")>=0){let m=T.split("==");return b.create(m[0].trim(),this._deserializeValue(m[1],k))}if(T.indexOf("=~")>=0){let m=T.split("=~");return S.create(m[0].trim(),this._deserializeRegexValue(m[1],k))}if(T.indexOf(" in ")>=0){let m=T.split(" in ");return h.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(T)){const m=T.split(">=");return i.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(T)){const m=T.split(">");return s.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(T)){const m=T.split("<=");return A.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(T)){const m=T.split("<");return D.create(m[0].trim(),m[1].trim())}return/^\!\s*/.test(T)?l.create(T.substr(1).trim()):f.create(T)}static _deserializeValue(T,k){if(T=T.trim(),T==="true")return!0;if(T==="false")return!1;let m=/^'([^']*)'$/.exec(T);return m?m[1].trim():T}static _deserializeRegexValue(T,k){if(Object(Y.C)(T)){if(k)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let m=T.indexOf("/"),y=T.lastIndexOf("/");if(m===y||m<0){if(k)throw new Error(`bad regexp-value '${T}', missing /-enclosure`);return console.warn(`bad regexp-value '${T}', missing /-enclosure`),null}let H=T.slice(m+1,y),Q=T[y+1]==="i"?"i":"";try{return new RegExp(H,Q)}catch(te){if(k)throw new Error(`bad regexp-value '${T}', parse error: ${te}`);return console.warn(`bad regexp-value '${T}', parse error: ${te}`),null}}}function K(T,k){const m=T?T.substituteConstants():void 0,y=k?k.substituteConstants():void 0;return!m&&!y?!0:!m||!y?!1:m.equals(y)}function n(T,k){return T.cmp(k)}class L{constructor(){this.type=0}cmp(T){return this.type-T.type}equals(T){return T.type===this.type}substituteConstants(){return this}evaluate(T){return!1}serialize(){return"false"}keys(){return[]}negate(){return x.INSTANCE}}L.INSTANCE=new L;class x{constructor(){this.type=1}cmp(T){return this.type-T.type}equals(T){return T.type===this.type}substituteConstants(){return this}evaluate(T){return!0}serialize(){return"true"}keys(){return[]}negate(){return L.INSTANCE}}x.INSTANCE=new x;class f{constructor(T,k){this.key=T,this.negated=k,this.type=2}static create(T,k=null){const m=I.get(T);return typeof m=="boolean"?m?x.INSTANCE:L.INSTANCE:new f(T,k)}cmp(T){return T.type!==this.type?this.type-T.type:E(this.key,T.key)}equals(T){return T.type===this.type?this.key===T.key:!1}substituteConstants(){const T=I.get(this.key);return typeof T=="boolean"?T?x.INSTANCE:L.INSTANCE:this}evaluate(T){return!!T.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class b{constructor(T,k,m){this.key=T,this.value=k,this.negated=m,this.type=4}static create(T,k,m=null){if(typeof k=="boolean")return k?f.create(T,m):l.create(T,m);const y=I.get(T);if(typeof y=="boolean"){const H=y?"true":"false";return k===H?x.INSTANCE:L.INSTANCE}return new b(T,k,m)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){const T=I.get(this.key);if(typeof T=="boolean"){const k=T?"true":"false";return this.value===k?x.INSTANCE:L.INSTANCE}return this}evaluate(T){return T.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 h{constructor(T,k){this.key=T,this.valueKey=k,this.type=10,this.negated=null}static create(T,k){return new h(T,k)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.valueKey,T.key,T.valueKey)}equals(T){return T.type===this.type?this.key===T.key&&this.valueKey===T.valueKey:!1}substituteConstants(){return this}evaluate(T){const k=T.getValue(this.valueKey),m=T.getValue(this.key);return Array.isArray(k)?k.indexOf(m)>=0:typeof m=="string"&&typeof k=="object"&&k!==null?M.call(k,m):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(T){this._actual=T,this.type=11}static create(T){return new o(T)}cmp(T){return T.type!==this.type?this.type-T.type:this._actual.cmp(T._actual)}equals(T){return T.type===this.type?this._actual.equals(T._actual):!1}substituteConstants(){return this}evaluate(T){return!this._actual.evaluate(T)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class p{constructor(T,k,m){this.key=T,this.value=k,this.negated=m,this.type=5}static create(T,k,m=null){if(typeof k=="boolean")return k?l.create(T,m):f.create(T,m);const y=I.get(T);if(typeof y=="boolean"){const H=y?"true":"false";return k===H?L.INSTANCE:x.INSTANCE}return new p(T,k,m)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){const T=I.get(this.key);if(typeof T=="boolean"){const k=T?"true":"false";return this.value===k?L.INSTANCE:x.INSTANCE}return this}evaluate(T){return T.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}class l{constructor(T,k){this.key=T,this.negated=k,this.type=3}static create(T,k=null){const m=I.get(T);return typeof m=="boolean"?m?L.INSTANCE:x.INSTANCE:new l(T,k)}cmp(T){return T.type!==this.type?this.type-T.type:E(this.key,T.key)}equals(T){return T.type===this.type?this.key===T.key:!1}substituteConstants(){const T=I.get(this.key);return typeof T=="boolean"?T?L.INSTANCE:x.INSTANCE:this}evaluate(T){return!T.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function u(T,k){if(typeof T=="string"){const m=parseFloat(T);isNaN(m)||(T=m)}return typeof T=="string"||typeof T=="number"?k(T):L.INSTANCE}class s{constructor(T,k,m){this.key=T,this.value=k,this.negated=m,this.type=12}static create(T,k,m=null){return u(k,y=>new s(T,y,m))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class i{constructor(T,k,m){this.key=T,this.value=k,this.negated=m,this.type=13}static create(T,k,m=null){return u(k,y=>new i(T,y,m))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this.value,this)),this.negated}}class D{constructor(T,k,m){this.key=T,this.value=k,this.negated=m,this.type=14}static create(T,k,m=null){return u(k,y=>new D(T,y,m))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class A{constructor(T,k,m){this.key=T,this.value=k,this.negated=m,this.type=15}static create(T,k,m=null){return u(k,y=>new A(T,y,m))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class S{constructor(T,k){this.key=T,this.regexp=k,this.type=7,this.negated=null}static create(T,k){return new S(T,k)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.key<T.key)return-1;if(this.key>T.key)return 1;const k=this.regexp?this.regexp.source:"",m=T.regexp?T.regexp.source:"";return k<m?-1:k>m?1:0}equals(T){if(T.type===this.type){const k=this.regexp?this.regexp.source:"",m=T.regexp?T.regexp.source:"";return this.key===T.key&&k===m}return!1}substituteConstants(){return this}evaluate(T){let k=T.getValue(this.key);return this.regexp?this.regexp.test(k):!1}serialize(){const T=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${T}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(T){this._actual=T,this.type=8}static create(T){return new R(T)}cmp(T){return T.type!==this.type?this.type-T.type:this._actual.cmp(T._actual)}equals(T){return T.type===this.type?this._actual.equals(T._actual):!1}substituteConstants(){return this}evaluate(T){return!this._actual.evaluate(T)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(T){let k=null;for(let m=0,y=T.length;m<y;m++){const H=T[m].substituteConstants();if(T[m]!==H&&k===null){k=[];for(let Q=0;Q<m;Q++)k[Q]=T[Q]}k!==null&&(k[m]=H)}return k===null?T:k}class g{constructor(T,k){this.expr=T,this.negated=k,this.type=6}static create(T,k){return g._normalizeArr(T,k)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.expr.length<T.expr.length)return-1;if(this.expr.length>T.expr.length)return 1;for(let k=0,m=this.expr.length;k<m;k++){const y=n(this.expr[k],T.expr[k]);if(y!==0)return y}return 0}equals(T){if(T.type===this.type){if(this.expr.length!==T.expr.length)return!1;for(let k=0,m=this.expr.length;k<m;k++)if(!this.expr[k].equals(T.expr[k]))return!1;return!0}return!1}substituteConstants(){const T=O(this.expr);return T===this.expr?this:g.create(T,this.negated)}evaluate(T){for(let k=0,m=this.expr.length;k<m;k++)if(!this.expr[k].evaluate(T))return!1;return!0}static _normalizeArr(T,k){const m=[];let y=!1;for(const H of T){if(!H)continue;if(H.type===1){y=!0;continue}if(H.type===0)return L.INSTANCE;if(H.type===6){m.push(...H.expr);continue}m.push(H)}if(m.length===0&&y)return x.INSTANCE;if(m.length===0)return;if(m.length===1)return m[0];m.sort(n);for(let H=1;H<m.length;H++)m[H-1].equals(m[H])&&(m.splice(H,1),H--);if(m.length===1)return m[0];for(;m.length>1;){const H=m[m.length-1];if(H.type!==9)break;m.pop();const Q=m.pop(),te=m.length===0,ae=_.create(H.expr.map(Te=>g.create([Te,Q],null)),null,te);ae&&(m.push(ae),m.sort(n))}return m.length===1?m[0]:new g(m,k)}serialize(){return this.expr.map(T=>T.serialize()).join(" && ")}keys(){const T=[];for(let k of this.expr)T.push(...k.keys());return T}negate(){if(!this.negated){const T=[];for(let k of this.expr)T.push(k.negate());this.negated=_.create(T,this,!0)}return this.negated}}class _{constructor(T,k){this.expr=T,this.negated=k,this.type=9}static create(T,k,m){return _._normalizeArr(T,k,m)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.expr.length<T.expr.length)return-1;if(this.expr.length>T.expr.length)return 1;for(let k=0,m=this.expr.length;k<m;k++){const y=n(this.expr[k],T.expr[k]);if(y!==0)return y}return 0}equals(T){if(T.type===this.type){if(this.expr.length!==T.expr.length)return!1;for(let k=0,m=this.expr.length;k<m;k++)if(!this.expr[k].equals(T.expr[k]))return!1;return!0}return!1}substituteConstants(){const T=O(this.expr);return T===this.expr?this:_.create(T,this.negated,!1)}evaluate(T){for(let k=0,m=this.expr.length;k<m;k++)if(this.expr[k].evaluate(T))return!0;return!1}static _normalizeArr(T,k,m){let y=[],H=!1;if(T){for(let Q=0,te=T.length;Q<te;Q++){const ae=T[Q];if(!ae)continue;if(ae.type===0){H=!0;continue}if(ae.type===1)return x.INSTANCE;if(ae.type===9){y=y.concat(ae.expr);continue}y.push(ae)}if(y.length===0&&H)return L.INSTANCE;y.sort(n)}if(y.length===0)return;if(y.length===1)return y[0];for(let Q=1;Q<y.length;Q++)y[Q-1].equals(y[Q])&&(y.splice(Q,1),Q--);if(y.length===1)return y[0];if(m){for(let Q=0;Q<y.length;Q++)for(let te=Q+1;te<y.length;te++)B(y[Q],y[te])&&(y.splice(te,1),te--);if(y.length===1)return y[0]}return new _(y,k)}serialize(){return this.expr.map(T=>T.serialize()).join(" || ")}keys(){const T=[];for(let k of this.expr)T.push(...k.keys());return T}negate(){if(!this.negated){let T=[];for(let k of this.expr)T.push(k.negate());for(;T.length>1;){const k=T.shift(),m=T.shift(),y=[];for(const Q of W(k))for(const te of W(m))y.push(g.create([Q,te],null));const H=T.length===0;T.unshift(_.create(y,null,H))}this.negated=T[0]}return this.negated}}class d extends f{constructor(T,k,m){super(T,null);this._defaultValue=k,typeof m=="object"?d._info.push(Object.assign(Object.assign({},m),{key:T})):m!==!0&&d._info.push({key:T,description:m,type:k!=null?typeof k:void 0})}static all(){return d._info.values()}bindTo(T){return T.createKey(this.key,this._defaultValue)}getValue(T){return T.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(T){return b.create(this.key,T)}}d._info=[];const c=Object(N.c)("contextKeyService"),C="setContext";function E(T,k){return T<k?-1:T>k?1:0}function w(T,k,m,y){return T<m?-1:T>m?1:k<y?-1:k>y?1:0}function B(T,k){if(k.type===6&&T.type!==9&&T.type!==6){for(const H of k.expr)if(T.equals(H))return!0}const m=T.negate(),y=W(m).concat(W(k));y.sort(n);for(let H=0;H<y.length;H++){const Q=y[H],te=Q.negate();for(let ae=H+1;ae<y.length;ae++){const Te=y[ae];if(te.equals(Te))return!0}}return!1}function W(T){return T.type===9?T.expr:[T]}},TXwP:function(it,Ee,U){var ie,Y;(function(){var N;(function(){"use strict";var I=[,,function(n){function L(b){this.__parent=b,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=[]}L.prototype.clone_empty=function(){var b=new L(this.__parent);return b.set_indent(this.__indent_count,this.__alignment_count),b},L.prototype.item=function(b){return b<0?this.__items[this.__items.length+b]:this.__items[b]},L.prototype.has_match=function(b){for(var h=this.__items.length-1;h>=0;h--)if(this.__items[h].match(b))return!0;return!1},L.prototype.set_indent=function(b,h){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(b){this.__items.push(b);var h=b.lastIndexOf(`
`);h!==-1?this.__character_count=b.length-h:this.__character_count+=b.length},L.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function x(b,h){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),h=h||"",b.indent_level>0&&(h=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}x.prototype.get_indent_size=function(b,h){var o=this.__base_string_length;return h=h||0,b<0&&(o=0),o+=b*this.__indent_size,o+=h,o},x.prototype.get_indent_string=function(b,h){var o=this.__base_string;return h=h||0,b<0&&(b=0,o=""),h+=b*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},x.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var b=this.__cache.length,h=0,o="";this.__indent_size&&b>=this.__indent_size&&(h=Math.floor(b/this.__indent_size),b-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),b&&(o+=new Array(b+1).join(" ")),this.__cache.push(o)};function f(b,h){this.__indent_cache=new x(b,h),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(b,h){return this.__indent_cache.get_indent_string(b,h)},f.prototype.get_indent_size=function(b,h){return this.__indent_cache.get_indent_size(b,h)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(b){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===`
`&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return b!==`
`&&(o=o.replace(/[\n]/g,b)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(b,h){return b=b||0,h=h||0,this.next_line.set_indent(b,h),this.__lines.length>1?(this.current_line.set_indent(b,h),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(b){for(var h=0;h<b.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(b.whitespace_before),this.current_line.push(b.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(b){this.__add_space_before_token(),this.current_line.push(b),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(b){for(var h=this.__lines.length;b<h;)this.__lines[b]._remove_indent(),b++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(b){for(b=b===void 0?!1:b,this.current_line.trim();b&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(b,h){for(var o=this.__lines.length-2;o>=0;){var p=this.__lines[o];if(p.is_empty())break;if(p.item(0).indexOf(b)!==0&&p.item(-1)!==h){this.__lines.splice(o+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=f},,,,function(n){function L(b,h){this.raw_options=x(b,h),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}L.prototype._get_array=function(b,h){var o=this.raw_options[b],p=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(p=o.concat()):typeof o=="string"&&(p=o.split(/[^a-zA-Z0-9_\/\-]+/)),p},L.prototype._get_boolean=function(b,h){var o=this.raw_options[b],p=o===void 0?!!h:!!o;return p},L.prototype._get_characters=function(b,h){var o=this.raw_options[b],p=h||"";return typeof o=="string"&&(p=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},L.prototype._get_number=function(b,h){var o=this.raw_options[b];h=parseInt(h,10),isNaN(h)&&(h=0);var p=parseInt(o,10);return isNaN(p)&&(p=h),p},L.prototype._get_selection=function(b,h,o){var p=this._get_selection_list(b,h,o);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values:
`+h+`
You passed in: '`+this.raw_options[b]+"'");return p[0]},L.prototype._get_selection_list=function(b,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var p=this._get_array(b,o);if(!this._is_valid_selection(p,h))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values:
`+h+`
You passed in: '`+this.raw_options[b]+"'");return p},L.prototype._is_valid_selection=function(b,h){return b.length&&h.length&&!b.some(function(o){return h.indexOf(o)===-1})};function x(b,h){var o={};b=f(b);var p;for(p in b)p!==h&&(o[p]=b[p]);if(h&&b[h])for(p in b[h])o[p]=b[h][p];return o}function f(b){var h={},o;for(o in b){var p=o.replace(/-/g,"_");h[p]=b[o]}return h}n.exports.Options=L,n.exports.normalizeOpts=f,n.exports.mergeOpts=x},,function(n){var L=RegExp.prototype.hasOwnProperty("sticky");function x(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position<this.__input_length},x.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},x.prototype.peek=function(f){var b=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(b=this.__input.charAt(f)),b},x.prototype.__match=function(f,b){f.lastIndex=b;var h=f.exec(this.__input);return h&&!(L&&f.sticky)&&(h.index!==b&&(h=null)),h},x.prototype.test=function(f,b){return b=b||0,b+=this.__position,b>=0&&b<this.__input_length?!!this.__match(f,b):!1},x.prototype.testChar=function(f,b){var h=this.peek(b);return f.lastIndex=0,h!==null&&f.test(h)},x.prototype.match=function(f){var b=this.__match(f,this.__position);return b?this.__position+=b[0].length:b=null,b},x.prototype.read=function(f,b,h){var o="",p;return f&&(p=this.match(f),p&&(o+=p[0])),b&&(p||!f)&&(o+=this.readUntil(b,h)),o},x.prototype.readUntil=function(f,b){var h="",o=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(o=p.index,b&&(o+=p[0].length)):o=this.__input_length,h=this.__input.substring(this.__position,o),this.__position=o,h},x.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},x.prototype.get_regexp=function(f,b){var h=null,o="g";return b&&L&&(o="y"),typeof f=="string"&&f!==""?h=new RegExp(f,o):f&&(h=new RegExp(f.source,o)),h},x.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},x.prototype.peekUntilAfter=function(f){var b=this.__position,h=this.readUntilAfter(f);return this.__position=b,h},x.prototype.lookBack=function(f){var b=this.__position-1;return b>=f.length&&this.__input.substring(b-f.length,b).toLowerCase()===f},n.exports.InputScanner=x},,,,,function(n){function L(x,f){x=typeof x=="string"?x:x.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+f,"g")}L.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(x);b;)f[b[1]]=b[2],b=this.__directive_pattern.exec(x);return f},L.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=L},,function(n,L,x){var f=x(16).Beautifier,b=x(17).Options;function h(o,p){var l=new f(o,p);return l.beautify()}n.exports=h,n.exports.defaultOptions=function(){return new b}},function(n,L,x){var f=x(17).Options,b=x(2).Output,h=x(8).InputScanner,o=x(13).Directives,p=new o(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,s=/\s/,i=/(?:\s|\n)+/g,D=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(R,O){this._source_text=R||"",this._options=new f(O),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"]}S.prototype.eatString=function(R){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return O},S.prototype.eatWhitespace=function(R){for(var O=s.test(this._input.peek()),g=0;s.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
`&&((g===0||g<this._options.max_preserve_newlines)&&(g++,this._output.add_new_line(!0)));return O},S.prototype.foundNestedPseudoClass=function(){for(var R=0,O=1,g=this._input.peek(O);g;){if(g==="{")return!0;if(g==="(")R+=1;else if(g===")"){if(R===0)return!1;R-=1}else if(g===";"||g==="}")return!1;O++,g=this._input.peek(O)}return!1},S.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},S.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,O=this._options.eol;O==="auto"&&(O=`
`,R&&l.test(R||"")&&(O=R.match(l)[0])),R=R.replace(u,`
`);var g=R.match(/^[\t ]*/)[0];this._output=new b(this._options,g),this._input=new h(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,d=!1,c=!1,C=!1,E=!1,w=!1,B=!1,W=this._ch,T=!1,k,m,y;k=this._input.read(i),m=k!=="",y=W,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),W=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(D),Q=p.get_directives(H);Q&&Q.ignore==="start"&&(H+=p.readIgnored(this._input)),this.print_string(H),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(A)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(m),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var te=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);te.match(/[ :]$/)&&(te=this.eatString(": ").replace(/\s$/,""),this.print_string(te),this._output.space_before_token=!0),te=te.replace(/\s$/,""),te==="extend"?E=!0:te==="import"&&(w=!0),te in this.NESTED_AT_RULE?(this._nestedLevel+=1,te in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!d&&_===0&&te.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(m),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),C?(C=!1,d=this._indentLevel>=this._nestedLevel):d=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&d&&(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)):(y==="("?this._output.space_before_token=!1:y!==","&&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(),y==="{"&&this._output.trim(!0),w=!1,E=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),d=!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 ae=0;ae<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ae++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ae])){T=!0;break}(d||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&_===0?(this.print_string(":"),c||(c=!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 Te=y==='"'||y==="'";this.preserveSingleSpace(Te||m),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")T=!1,_===0?(c&&(this.outdent(),c=!1),E=!1,w=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),_++,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(")")),_&&(_--,this.outdent()));else{var _e=!1;this._input.lookBack("with")&&(_e=!0),this.preserveSingleSpace(m||_e),this.print_string(this._ch),c&&y==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),B=!0):(this.eatWhitespace(),_++,this.indent())}else if(this._ch===")")_&&(_--,this.outdent()),B&&this._input.peek()===";"&&this._options.selector_separator_newline&&(B=!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&&(!c||B)&&_===0&&!w&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&_===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&s.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(m),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),s.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 ge=y==='"'||y==="'";this.preserveSingleSpace(ge||m),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&T&&this._output.add_new_line()}var ve=this._output.get_code(O);return ve},n.exports.Beautifier=S},function(n,L,x){var f=x(6).Options;function b(h){f.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<p.length;l++)p[l]!=="expand"?this.brace_style="collapse":this.brace_style=p[l]}b.prototype=new f,n.exports.Options=b}],M={};function G(n){var L=M[n];if(L!==void 0)return L.exports;var x=M[n]={exports:{}};return I[n](x,x.exports,G),x.exports}var K=G(15);N=K})();var z=N;!(ie=[],Y=function(){return{css_beautify:z}}.apply(Ee,ie),Y!==void 0&&(it.exports=Y))})()},Vhoy:function(it,Ee,U){"use strict";U.d(Ee,"d",function(){return z}),U.d(Ee,"e",function(){return I}),U.d(Ee,"c",function(){return M}),U.d(Ee,"b",function(){return G}),U.d(Ee,"a",function(){return K});var ie=U("MI8n");class Y{constructor(){this._icons=new Map,this._onDidRegister=new ie.b}add(n){const L=this._icons.get(n.id);L?n.description?L.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const N=new Y,z=N;function I(n,L){return new G(n,L)}function M(n){return n?n.replace(/\$\((.*?)\)/g,(L,x)=>` ${x} `).trim():""}class G{constructor(n,L,x){this.id=n,this.definition=L,this.description=x,N.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var K;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const L=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function x(h){if(h instanceof G)return["codicon","codicon-"+h.id];const o=L.exec(h.id);if(!o)return x(G.error);let[,p,l]=o;const u=["codicon","codicon-"+p];return l&&u.push("codicon-modifier-"+l.substr(1)),u}n.asClassNameArray=x;function f(h){return x(h).join(" ")}n.asClassName=f;function b(h){return"."+x(h).join(".")}n.asCSSSelector=b})(K||(K={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(G||(G={}))},"VrN/":function(it,Ee,U){(function(ie,Y){it.exports=Y()})(this,function(){"use strict";var ie=navigator.userAgent,Y=navigator.platform,N=/gecko\/\d/i.test(ie),z=/MSIE \d/.test(ie),I=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),M=/Edge\/(\d+)/.exec(ie),G=z||I||M,K=G&&(z?document.documentMode||6:+(M||I)[1]),n=!M&&/WebKit\//.test(ie),L=n&&/Qt\/\d+\.\d+/.test(ie),x=!M&&/Chrome\//.test(ie),f=/Opera\//.test(ie),b=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),o=/PhantomJS/.test(ie),p=!M&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),l=/Android/.test(ie),u=p||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),s=p||/Mac/.test(Y),i=/\bCrOS\b/.test(ie),D=/win/i.test(Y),A=f&&ie.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(f=!1,n=!0);var S=s&&(L||f&&(A==null||A<12.11)),R=N||G&&K>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var g=function(e,t){var a=e.className,r=O(t).exec(a);if(r){var v=a.slice(r.index+r[0].length);e.className=a.slice(0,r.index)+(v?r[1]+v:"")}};function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function d(e,t){return _(e).appendChild(t)}function c(e,t,a,r){var v=document.createElement(e);if(a&&(v.className=a),r&&(v.style.cssText=r),typeof t=="string")v.appendChild(document.createTextNode(t));else if(t)for(var F=0;F<t.length;++F)v.appendChild(t[F]);return v}function C(e,t,a,r){var v=c(e,t,a,r);return v.setAttribute("role","presentation"),v}var E;document.createRange?E=function(e,t,a,r){var v=document.createRange();return v.setEnd(r||e,a),v.setStart(e,t),v}:E=function(e,t,a){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(v){return r}return r.collapse(!0),r.moveEnd("character",a),r.moveStart("character",t),r};function w(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function W(e,t){var a=e.className;O(t).test(a)||(e.className+=(a?" ":"")+t)}function T(e,t){for(var a=e.split(" "),r=0;r<a.length;r++)a[r]&&!O(a[r]).test(t)&&(t+=" "+a[r]);return t}var k=function(e){e.select()};p?k=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(k=function(e){try{e.select()}catch(t){}});function m(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function y(e,t,a){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(a!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function H(e,t,a,r,v){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var F=r||0,Z=v||0;;){var ee=e.indexOf(" ",F);if(ee<0||ee>=t)return Z+(t-F);Z+=ee-F,Z+=a-Z%a,F=ee+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=m(this.onTimeout,this)};Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Q.prototype.set=function(e,t){this.f=t;var a=+new Date+e;(!this.id||a<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=a)};function te(e,t){for(var a=0;a<e.length;++a)if(e[a]==t)return a;return-1}var ae=50,Te={toString:function(){return"CodeMirror.Pass"}},_e={scroll:!1},ge={origin:"*mouse"},ve={origin:"+move"};function Oe(e,t,a){for(var r=0,v=0;;){var F=e.indexOf(" ",r);F==-1&&(F=e.length);var Z=F-r;if(F==e.length||v+Z>=t)return r+Math.min(Z,t-v);if(v+=F-r,v+=a-v%a,r=F+1,v>=t)return r}}var he=[""];function V(e){for(;he.length<=e;)he.push(P(he)+" ");return he[e]}function P(e){return e[e.length-1]}function j(e,t){for(var a=[],r=0;r<e.length;r++)a[r]=t(e[r],r);return a}function $(e,t,a){for(var r=0,v=a(t);r<e.length&&a(e[r])<=v;)r++;e.splice(r,0,t)}function J(){}function X(e,t){var a;return Object.create?a=Object.create(e):(J.prototype=e,a=new J),t&&y(t,a),a}var ye=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Re(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ye.test(e))}function Ke(e,t){return t?t.source.indexOf("\\w")>-1&&Re(e)?!0:t.test(e):Re(e)}function pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var we=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ke(e){return e.charCodeAt(0)>=768&&we.test(e)}function Ue(e,t,a){for(;(a<0?t>0:t<e.length)&&ke(e.charAt(t));)t+=a;return t}function Qe(e,t,a){for(var r=t>a?-1:1;;){if(t==a)return t;var v=(t+a)/2,F=r<0?Math.ceil(v):Math.floor(v);if(F==t)return e(F)?t:a;e(F)?a=F:t=F+r}}function nt(e,t,a,r){if(!e)return r(t,a,"ltr",0);for(var v=!1,F=0;F<e.length;++F){var Z=e[F];(Z.from<a&&Z.to>t||t==a&&Z.to==t)&&(r(Math.max(Z.from,t),Math.min(Z.to,a),Z.level==1?"rtl":"ltr",F),v=!0)}v||r(t,a,"ltr")}var ot=null;function qe(e,t,a){var r;ot=null;for(var v=0;v<e.length;++v){var F=e[v];if(F.from<t&&F.to>t)return v;F.to==t&&(F.from!=F.to&&a=="before"?r=v:ot=v),F.from==t&&(F.from!=F.to&&a!="before"?r=v:ot=v)}return r!=null?r:ot}var ft=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(de){return de<=247?e.charAt(de):1424<=de&&de<=1524?"R":1536<=de&&de<=1785?t.charAt(de-1536):1774<=de&&de<=2220?"r":8192<=de&&de<=8203?"w":de==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,v=/[stwN]/,F=/[LRr]/,Z=/[Lb1n]/,ee=/[1n]/;function re(de,Ie,Ne){this.level=de,this.from=Ie,this.to=Ne}return function(de,Ie){var Ne=Ie=="ltr"?"L":"R";if(de.length==0||Ie=="ltr"&&!r.test(de))return!1;for(var Xe=de.length,ze=[],at=0;at<Xe;++at)ze.push(a(de.charCodeAt(at)));for(var dt=0,Et=Ne;dt<Xe;++dt){var At=ze[dt];At=="m"?ze[dt]=Et:Et=At}for(var Wt=0,Ot=Ne;Wt<Xe;++Wt){var Gt=ze[Wt];Gt=="1"&&Ot=="r"?ze[Wt]="n":F.test(Gt)&&(Ot=Gt,Gt=="r"&&(ze[Wt]="R"))}for(var vn=1,rn=ze[0];vn<Xe-1;++vn){var Jn=ze[vn];Jn=="+"&&rn=="1"&&ze[vn+1]=="1"?ze[vn]="1":Jn==","&&rn==ze[vn+1]&&(rn=="1"||rn=="n")&&(ze[vn]=rn),rn=Jn}for(var Dr=0;Dr<Xe;++Dr){var hi=ze[Dr];if(hi==",")ze[Dr]="N";else if(hi=="%"){var Gr=void 0;for(Gr=Dr+1;Gr<Xe&&ze[Gr]=="%";++Gr);for(var Ui=Dr&&ze[Dr-1]=="!"||Gr<Xe&&ze[Gr]=="1"?"1":"N",Ii=Dr;Ii<Gr;++Ii)ze[Ii]=Ui;Dr=Gr-1}}for(var ni=0,Pi=Ne;ni<Xe;++ni){var vi=ze[ni];Pi=="L"&&vi=="1"?ze[ni]="L":F.test(vi)&&(Pi=vi)}for(var si=0;si<Xe;++si)if(v.test(ze[si])){var ri=void 0;for(ri=si+1;ri<Xe&&v.test(ze[ri]);++ri);for(var Xr=(si?ze[si-1]:Ne)=="L",ki=(ri<Xe?ze[ri]:Ne)=="L",Ro=Xr==ki?Xr?"L":"R":Ne,Xa=si;Xa<ri;++Xa)ze[Xa]=Ro;si=ri-1}for(var xi=[],_a,fi=0;fi<Xe;)if(Z.test(ze[fi])){var _s=fi;for(++fi;fi<Xe&&Z.test(ze[fi]);++fi);xi.push(new re(0,_s,fi))}else{var La=fi,oo=xi.length,so=Ie=="rtl"?1:0;for(++fi;fi<Xe&&ze[fi]!="L";++fi);for(var Si=La;Si<fi;)if(ee.test(ze[Si])){La<Si&&(xi.splice(oo,0,new re(1,La,Si)),oo+=so);var Do=Si;for(++Si;Si<fi&&ee.test(ze[Si]);++Si);xi.splice(oo,0,new re(2,Do,Si)),oo+=so,La=Si}else++Si;La<fi&&xi.splice(oo,0,new re(1,La,fi))}return Ie=="ltr"&&(xi[0].level==1&&(_a=de.match(/^\s+/))&&(xi[0].from=_a[0].length,xi.unshift(new re(0,0,_a[0].length))),P(xi).level==1&&(_a=de.match(/\s+$/))&&(P(xi).to-=_a[0].length,xi.push(new re(0,Xe-_a[0].length,Xe)))),Ie=="rtl"?xi.reverse():xi}}();function lt(e,t){var a=e.order;return a==null&&(a=e.order=ft(e.text,t)),a}var pt=[],Ye=function(e,t,a){if(e.addEventListener)e.addEventListener(t,a,!1);else if(e.attachEvent)e.attachEvent("on"+t,a);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||pt).concat(a)}};function Tt(e,t){return e._handlers&&e._handlers[t]||pt}function bt(e,t,a){if(e.removeEventListener)e.removeEventListener(t,a,!1);else if(e.detachEvent)e.detachEvent("on"+t,a);else{var r=e._handlers,v=r&&r[t];if(v){var F=te(v,a);F>-1&&(r[t]=v.slice(0,F).concat(v.slice(F+1)))}}}function me(e,t){var a=Tt(e,t);if(!a.length)return;for(var r=Array.prototype.slice.call(arguments,2),v=0;v<a.length;++v)a[v].apply(null,r)}function ne(e,t,a){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),me(e,a||t.type,e,t),be(t)||t.codemirrorIgnore}function q(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var a=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)te(a,t[r])==-1&&a.push(t[r])}function se(e,t){return Tt(e,t).length>0}function ue(e){e.prototype.on=function(t,a){Ye(this,t,a)},e.prototype.off=function(t,a){bt(this,t,a)}}function oe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function be(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Se(e){oe(e),ce(e)}function Pe(e){return e.target||e.srcElement}function We(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var et=function(){if(G&&K<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),yt;function Rt(e){if(yt==null){var t=c("span","\u200B");d(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&K<8))}var a=yt?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var kt;function mn(e){if(kt!=null)return kt;var t=d(e,document.createTextNode("A\u062EA")),a=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return _(e),!a||a.left==a.right?!1:kt=r.right-a.right<3}var zt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,a=[],r=e.length;t<=r;){var v=e.indexOf(`
`,t);v==-1&&(v=e.length);var F=e.slice(t,e.charAt(v-1)=="\r"?v-1:v),Z=F.indexOf("\r");Z!=-1?(a.push(F.slice(0,Z)),t+=Z+1):(a.push(F),t=v+1)}return a}:function(e){return e.split(/\r\n?|\n/)},Mt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(a){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Qn=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),un=null;function hr(e){if(un!=null)return un;var t=d(e,c("span","x")),a=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return un=Math.abs(a.left-r.left)>1}var or={},bn={};function xr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),or[e]=t}function br(e,t){bn[e]=t}function Ar(e){if(typeof e=="string"&&bn.hasOwnProperty(e))e=bn[e];else if(e&&typeof e.name=="string"&&bn.hasOwnProperty(e.name)){var t=bn[e.name];typeof t=="string"&&(t={name:t}),e=X(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ar("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ar("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Br(e,t){t=Ar(t);var a=or[t.name];if(!a)return Br(e,"text/plain");var r=a(e,t);if(Ht.hasOwnProperty(t.name)){var v=Ht[t.name];for(var F in v){if(!v.hasOwnProperty(F))continue;r.hasOwnProperty(F)&&(r["_"+F]=r[F]),r[F]=v[F]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var Z in t.modeProps)r[Z]=t.modeProps[Z];return r}var Ht={};function an(e,t){var a=Ht.hasOwnProperty(e)?Ht[e]:Ht[e]={};y(t,a)}function Cn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var a={};for(var r in t){var v=t[r];v instanceof Array&&(v=v.concat([])),a[r]=v}return a}function qn(e,t){for(var a;e.innerMode&&!(a=e.innerMode(t),!a||a.mode==e);)t=a.state,e=a.mode;return a||{mode:e,state:t}}function Ir(e,t,a){return e.startState?e.startState(t,a):!0}var gn=function(e,t,a){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};gn.prototype.eol=function(){return this.pos>=this.string.length},gn.prototype.sol=function(){return this.pos==this.lineStart},gn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},gn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},gn.prototype.eat=function(e){var t=this.string.charAt(this.pos),a;if(typeof e=="string"?a=t==e:a=t&&(e.test?e.test(t):e(t)),a)return++this.pos,t},gn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},gn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},gn.prototype.skipToEnd=function(){this.pos=this.string.length},gn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},gn.prototype.backUp=function(e){this.pos-=e},gn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},gn.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},gn.prototype.match=function(e,t,a){if(typeof e=="string"){var r=function(Z){return a?Z.toLowerCase():Z},v=this.string.substr(this.pos,e.length);if(r(v)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var F=this.string.slice(this.pos).match(e);return F&&F.index>0?null:(F&&t!==!1&&(this.pos+=F[0].length),F)}},gn.prototype.current=function(){return this.string.slice(this.start,this.pos)},gn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},gn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},gn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function wt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var a=e;!a.lines;)for(var r=0;;++r){var v=a.children[r],F=v.chunkSize();if(t<F){a=v;break}t-=F}return a.lines[t]}function Rn(e,t,a){var r=[],v=t.line;return e.iter(t.line,a.line+1,function(F){var Z=F.text;v==a.line&&(Z=Z.slice(0,a.ch)),v==t.line&&(Z=Z.slice(t.ch)),r.push(Z),++v}),r}function jn(e,t,a){var r=[];return e.iter(t,a,function(v){r.push(v.text)}),r}function cn(e,t){var a=t-e.height;if(a)for(var r=e;r;r=r.parent)r.height+=a}function on(e){if(e.parent==null)return null;for(var t=e.parent,a=te(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var v=0;!(r.children[v]==t);++v)a+=r.children[v].chunkSize();return a+t.first}function Dn(e,t){var a=e.first;e:do{for(var r=0;r<e.children.length;++r){var v=e.children[r],F=v.height;if(t<F){e=v;continue e}t-=F,a+=v.chunkSize()}return a}while(!e.lines);for(var Z=0;Z<e.lines.length;++Z){var ee=e.lines[Z],re=ee.height;if(t<re)break;t-=re}return a+Z}function ei(e,t){return t>=e.first&&t<e.first+e.size}function Tr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ct(e,t,a){if(a===void 0&&(a=null),!(this instanceof ct))return new ct(e,t,a);this.line=e,this.ch=t,this.sticky=a}function Qt(e,t){return e.line-t.line||e.ch-t.ch}function ji(e,t){return e.sticky==t.sticky&&Qt(e,t)==0}function Xi(e){return ct(e.line,e.ch)}function ua(e,t){return Qt(e,t)<0?t:e}function Bi(e,t){return Qt(e,t)<0?e:t}function ca(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function En(e,t){if(t.line<e.first)return ct(e.first,0);var a=e.first+e.size-1;return t.line>a?ct(a,wt(e,a).text.length):Ia(t,wt(e,t.line).text.length)}function Ia(e,t){var a=e.ch;return a==null||a>t?ct(e.line,t):a<0?ct(e.line,0):e}function _t(e,t){for(var a=[],r=0;r<t.length;r++)a[r]=En(e,t[r]);return a}var Fi=function(e,t){this.state=e,this.lookAhead=t},yi=function(e,t,a,r){this.state=t,this.doc=e,this.line=a,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};yi.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},yi.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},yi.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},yi.fromSaved=function(e,t,a){return t instanceof Fi?new yi(e,Cn(e.mode,t.state),a,t.lookAhead):new yi(e,Cn(e.mode,t),a)},yi.prototype.save=function(e){var t=e!==!1?Cn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Fi(t,this.maxLookAhead):t};function ba(e,t,a,r){var v=[e.state.modeGen],F={};st(e,t.text,e.doc.mode,a,function(de,Ie){return v.push(de,Ie)},F,r);for(var Z=a.state,ee=function(de){a.baseTokens=v;var Ie=e.state.overlays[de],Ne=1,Xe=0;a.state=!0,st(e,t.text,Ie.mode,a,function(ze,at){for(var dt=Ne;Xe<ze;){var Et=v[Ne];Et>ze&&v.splice(Ne,1,ze,v[Ne+1],Et),Ne+=2,Xe=Math.min(ze,Et)}if(!at)return;if(Ie.opaque)v.splice(dt,Ne-dt,ze,"overlay "+at),Ne=dt+2;else for(;dt<Ne;dt+=2){var At=v[dt+1];v[dt+1]=(At?At+" ":"")+"overlay "+at}},F),a.state=Z,a.baseTokens=null,a.baseTokenPos=1},re=0;re<e.state.overlays.length;++re)ee(re);return{styles:v,classes:F.bgClass||F.textClass?F:null}}function ea(e,t,a){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=pi(e,on(t)),v=t.text.length>e.options.maxHighlightLength&&Cn(e.doc.mode,r.state),F=ba(e,t,r);v&&(r.state=v),t.stateAfter=r.save(!v),t.styles=F.styles,F.classes?t.styleClasses=F.classes:t.styleClasses&&(t.styleClasses=null),a===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pi(e,t,a){var r=e.doc,v=e.display;if(!r.mode.startState)return new yi(r,!0,t);var F=Pt(e,t,a),Z=F>r.first&&wt(r,F-1).stateAfter,ee=Z?yi.fromSaved(r,Z,F):new yi(r,Ir(r.mode),F);return r.iter(F,t,function(re){da(e,re.text,ee);var de=ee.line;re.stateAfter=de==t-1||de%5==0||de>=v.viewFrom&&de<v.viewTo?ee.save():null,ee.nextLine()}),a&&(r.modeFrontier=ee.line),ee}function da(e,t,a,r){var v=e.doc.mode,F=new gn(t,e.options.tabSize,a);for(F.start=F.pos=r||0,t==""&&Ea(v,a.state);!F.eol();)ur(v,F,a.state),F.start=F.pos}function Ea(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var a=qn(e,t);if(a.mode.blankLine)return a.mode.blankLine(a.state)}function ur(e,t,a,r){for(var v=0;v<10;v++){r&&(r[0]=qn(e,a).mode);var F=e.token(t,a);if(t.pos>t.start)return F}throw new Error("Mode "+e.name+" failed to advance stream.")}var xa=function(e,t,a){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=a};function Ya(e,t,a,r){var v=e.doc,F=v.mode,Z;t=En(v,t);var ee=wt(v,t.line),re=pi(e,t.line,a),de=new gn(ee.text,e.options.tabSize,re),Ie;for(r&&(Ie=[]);(r||de.pos<t.ch)&&!de.eol();)de.start=de.pos,Z=ur(F,de,re.state),r&&Ie.push(new xa(de,Z,Cn(v.mode,re.state)));return r?Ie:new xa(de,Z,re.state)}function Vt(e,t){if(e)for(;;){var a=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;e=e.slice(0,a.index)+e.slice(a.index+a[0].length);var r=a[1]?"bgClass":"textClass";t[r]==null?t[r]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+a[2])}return e}function st(e,t,a,r,v,F,Z){var ee=a.flattenSpans;ee==null&&(ee=e.options.flattenSpans);var re=0,de=null,Ie=new gn(t,e.options.tabSize,r),Ne,Xe=e.options.addModeClass&&[null];for(t==""&&Vt(Ea(a,r.state),F);!Ie.eol();){if(Ie.pos>e.options.maxHighlightLength?(ee=!1,Z&&da(e,t,r,Ie.pos),Ie.pos=t.length,Ne=null):Ne=Vt(ur(a,Ie,r.state,Xe),F),Xe){var ze=Xe[0].name;ze&&(Ne="m-"+(Ne?ze+" "+Ne:ze))}if(!ee||de!=Ne){for(;re<Ie.start;)re=Math.min(Ie.start,re+5e3),v(re,de);de=Ne}Ie.start=Ie.pos}for(;re<Ie.pos;){var at=Math.min(Ie.pos,re+5e3);v(at,de),re=at}}function Pt(e,t,a){for(var r,v,F=e.doc,Z=a?-1:t-(e.doc.mode.innerMode?1e3:100),ee=t;ee>Z;--ee){if(ee<=F.first)return F.first;var re=wt(F,ee-1),de=re.stateAfter;if(de&&(!a||ee+(de instanceof Fi?de.lookAhead:0)<=F.modeFrontier))return ee;var Ie=H(re.text,null,e.options.tabSize);(v==null||r>Ie)&&(v=ee-1,r=Ie)}return v}function xt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var a=e.first,r=t-1;r>a;r--){var v=wt(e,r).stateAfter;if(v&&(!(v instanceof Fi)||r+v.lookAhead<t)){a=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,a)}var Dt=!1,Zt=!1;function yn(){Dt=!0}function Tn(){Zt=!0}function en(e,t,a){this.marker=e,this.from=t,this.to=a}function xn(e,t){if(e)for(var a=0;a<e.length;++a){var r=e[a];if(r.marker==t)return r}}function Fn(e,t){for(var a,r=0;r<e.length;++r)e[r]!=t&&(a||(a=[])).push(e[r]);return a}function tn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function hn(e,t,a){var r;if(e)for(var v=0;v<e.length;++v){var F=e[v],Z=F.marker,ee=F.from==null||(Z.inclusiveLeft?F.from<=t:F.from<t);if(ee||F.from==t&&Z.type=="bookmark"&&(!a||!F.marker.insertLeft)){var re=F.to==null||(Z.inclusiveRight?F.to>=t:F.to>t);(r||(r=[])).push(new en(Z,F.from,re?null:F.to))}}return r}function ar(e,t,a){var r;if(e)for(var v=0;v<e.length;++v){var F=e[v],Z=F.marker,ee=F.to==null||(Z.inclusiveRight?F.to>=t:F.to>t);if(ee||F.from==t&&Z.type=="bookmark"&&(!a||F.marker.insertLeft)){var re=F.from==null||(Z.inclusiveLeft?F.from<=t:F.from<t);(r||(r=[])).push(new en(Z,re?null:F.from-t,F.to==null?null:F.to-t))}}return r}function Wn(e,t){if(t.full)return null;var a=ei(e,t.from.line)&&wt(e,t.from.line).markedSpans,r=ei(e,t.to.line)&&wt(e,t.to.line).markedSpans;if(!a&&!r)return null;var v=t.from.ch,F=t.to.ch,Z=Qt(t.from,t.to)==0,ee=hn(a,v,Z),re=ar(r,F,Z),de=t.text.length==1,Ie=P(t.text).length+(de?v:0);if(ee)for(var Ne=0;Ne<ee.length;++Ne){var Xe=ee[Ne];if(Xe.to==null){var ze=xn(re,Xe.marker);ze?de&&(Xe.to=ze.to==null?null:ze.to+Ie):Xe.to=v}}if(re)for(var at=0;at<re.length;++at){var dt=re[at];if(dt.to!=null&&(dt.to+=Ie),dt.from==null){var Et=xn(ee,dt.marker);Et||(dt.from=Ie,de&&(ee||(ee=[])).push(dt))}else dt.from+=Ie,de&&(ee||(ee=[])).push(dt)}ee&&(ee=Bt(ee)),re&&re!=ee&&(re=Bt(re));var At=[ee];if(!de){var Wt=t.text.length-2,Ot;if(Wt>0&&ee)for(var Gt=0;Gt<ee.length;++Gt)ee[Gt].to==null&&(Ot||(Ot=[])).push(new en(ee[Gt].marker,null,null));for(var vn=0;vn<Wt;++vn)At.push(Ot);At.push(re)}return At}function Bt(e){for(var t=0;t<e.length;++t){var a=e[t];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function _n(e,t,a){var r=null;if(e.iter(t.line,a.line+1,function(ze){if(ze.markedSpans)for(var at=0;at<ze.markedSpans.length;++at){var dt=ze.markedSpans[at].marker;dt.readOnly&&(!r||te(r,dt)==-1)&&(r||(r=[])).push(dt)}}),!r)return null;for(var v=[{from:t,to:a}],F=0;F<r.length;++F)for(var Z=r[F],ee=Z.find(0),re=0;re<v.length;++re){var de=v[re];if(Qt(de.to,ee.from)<0||Qt(de.from,ee.to)>0)continue;var Ie=[re,1],Ne=Qt(de.from,ee.from),Xe=Qt(de.to,ee.to);(Ne<0||!Z.inclusiveLeft&&!Ne)&&Ie.push({from:de.from,to:ee.from}),(Xe>0||!Z.inclusiveRight&&!Xe)&&Ie.push({from:ee.to,to:de.to}),v.splice.apply(v,Ie),re+=Ie.length-3}return v}function ir(e){var t=e.markedSpans;if(!t)return;for(var a=0;a<t.length;++a)t[a].marker.detachLine(e);e.markedSpans=null}function kn(e,t){if(!t)return;for(var a=0;a<t.length;++a)t[a].marker.attachLine(e);e.markedSpans=t}function Xt(e){return e.inclusiveLeft?-1:0}function sn(e){return e.inclusiveRight?1:0}function Sn(e,t){var a=e.lines.length-t.lines.length;if(a!=0)return a;var r=e.find(),v=t.find(),F=Qt(r.from,v.from)||Xt(e)-Xt(t);if(F)return-F;var Z=Qt(r.to,v.to)||sn(e)-sn(t);return Z||t.id-e.id}function Nt(e,t){var a=Zt&&e.markedSpans,r;if(a)for(var v=void 0,F=0;F<a.length;++F)v=a[F],v.marker.collapsed&&(t?v.from:v.to)==null&&(!r||Sn(r,v.marker)<0)&&(r=v.marker);return r}function Ut(e){return Nt(e,!0)}function jt(e){return Nt(e,!1)}function je(e,t){var a=Zt&&e.markedSpans,r;if(a)for(var v=0;v<a.length;++v){var F=a[v];F.marker.collapsed&&(F.from==null||F.from<t)&&(F.to==null||F.to>t)&&(!r||Sn(r,F.marker)<0)&&(r=F.marker)}return r}function Yt(e,t,a,r,v){var F=wt(e,t),Z=Zt&&F.markedSpans;if(Z)for(var ee=0;ee<Z.length;++ee){var re=Z[ee];if(!re.marker.collapsed)continue;var de=re.marker.find(0),Ie=Qt(de.from,a)||Xt(re.marker)-Xt(v),Ne=Qt(de.to,r)||sn(re.marker)-sn(v);if(Ie>=0&&Ne<=0||Ie<=0&&Ne>=0)continue;if(Ie<=0&&(re.marker.inclusiveRight&&v.inclusiveLeft?Qt(de.to,a)>=0:Qt(de.to,a)>0)||Ie>=0&&(re.marker.inclusiveRight&&v.inclusiveLeft?Qt(de.from,r)<=0:Qt(de.from,r)<0))return!0}}function fn(e){for(var t;t=Ut(e);)e=t.find(-1,!0).line;return e}function fr(e){for(var t;t=jt(e);)e=t.find(1,!0).line;return e}function pn(e){for(var t,a;t=jt(e);)e=t.find(1,!0).line,(a||(a=[])).push(e);return a}function Yr(e,t){var a=wt(e,t),r=fn(a);return a==r?t:on(r)}function $r(e,t){if(t>e.lastLine())return t;var a=wt(e,t),r;if(!kr(e,a))return t;for(;r=jt(a);)a=r.find(1,!0).line;return on(a)+1}function kr(e,t){var a=Zt&&t.markedSpans;if(a)for(var r=void 0,v=0;v<a.length;++v){if(r=a[v],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&An(e,t,r))return!0}}function An(e,t,a){if(a.to==null){var r=a.marker.find(1,!0);return An(e,r.line,xn(r.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==t.text.length)return!0;for(var v=void 0,F=0;F<t.markedSpans.length;++F)if(v=t.markedSpans[F],v.marker.collapsed&&!v.marker.widgetNode&&v.from==a.to&&(v.to==null||v.to!=a.from)&&(v.marker.inclusiveLeft||a.marker.inclusiveRight)&&An(e,t,v))return!0}function St(e){e=fn(e);for(var t=0,a=e.parent,r=0;r<a.lines.length;++r){var v=a.lines[r];if(v==e)break;t+=v.height}for(var F=a.parent;F;a=F,F=a.parent)for(var Z=0;Z<F.children.length;++Z){var ee=F.children[Z];if(ee==a)break;t+=ee.height}return t}function pr(e){if(e.height==0)return 0;for(var t=e.text.length,a,r=e;a=Ut(r);){var v=a.find(0,!0);r=v.from.line,t+=v.from.ch-v.to.ch}for(r=e;a=jt(r);){var F=a.find(0,!0);t-=r.text.length-F.from.ch,r=F.to.line,t+=r.text.length-F.to.ch}return t}function tr(e){var t=e.display,a=e.doc;t.maxLine=wt(a,a.first),t.maxLineLength=pr(t.maxLine),t.maxLineChanged=!0,a.iter(function(r){var v=pr(r);v>t.maxLineLength&&(t.maxLineLength=v,t.maxLine=r)})}var Hn=function(e,t,a){this.text=e,kn(this,t),this.height=a?a(this):1};Hn.prototype.lineNo=function(){return on(this)},ue(Hn);function Qr(e,t,a,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ir(e),kn(e,a);var v=r?r(e):1;v!=e.height&&cn(e,v)}function Lt(e){e.parent=null,ir(e)}var Ft={},It={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var a=t.addModeClass?It:Ft;return a[e]||(a[e]=e.replace(/\S+/g,"cm-$&"))}function Mn(e,t){var a=C("span",null,null,n?"padding-right: .1px":null),r={pre:C("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var v=0;v<=(t.rest?t.rest.length:0);v++){var F=v?t.rest[v-1]:t.line,Z=void 0;r.pos=0,r.addToken=Vn,mn(e.display.measure)&&(Z=lt(F,e.doc.direction))&&(r.addToken=mi(r.addToken,Z)),r.map=[];var ee=t!=e.display.externalMeasured&&on(F);Wi(F,r,ea(e,F,ee)),F.styleClasses&&(F.styleClasses.bgClass&&(r.bgClass=T(F.styleClasses.bgClass,r.bgClass||"")),F.styleClasses.textClass&&(r.textClass=T(F.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Rt(e.display.measure))),v==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var re=r.content.lastChild;(/\bcm-tab\b/.test(re.className)||re.querySelector&&re.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=T(r.pre.className,r.textClass||"")),r}function wn(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Vn(e,t,a,r,v,F,Z){if(!t)return;var ee=e.splitSpaces?sr(t,e.trailingSpace):t,re=e.cm.state.specialChars,de=!1,Ie;if(!re.test(t))e.col+=t.length,Ie=document.createTextNode(ee),e.map.push(e.pos,e.pos+t.length,Ie),G&&K<9&&(de=!0),e.pos+=t.length;else{Ie=document.createDocumentFragment();for(var Ne=0;;){re.lastIndex=Ne;var Xe=re.exec(t),ze=Xe?Xe.index-Ne:t.length-Ne;if(ze){var at=document.createTextNode(ee.slice(Ne,Ne+ze));G&&K<9?Ie.appendChild(c("span",[at])):Ie.appendChild(at),e.map.push(e.pos,e.pos+ze,at),e.col+=ze,e.pos+=ze}if(!Xe)break;Ne+=ze+1;var dt=void 0;if(Xe[0]==" "){var Et=e.cm.options.tabSize,At=Et-e.col%Et;dt=Ie.appendChild(c("span",V(At),"cm-tab")),dt.setAttribute("role","presentation"),dt.setAttribute("cm-text"," "),e.col+=At}else Xe[0]=="\r"||Xe[0]==`
`?(dt=Ie.appendChild(c("span",Xe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),dt.setAttribute("cm-text",Xe[0]),e.col+=1):(dt=e.cm.options.specialCharPlaceholder(Xe[0]),dt.setAttribute("cm-text",Xe[0]),G&&K<9?Ie.appendChild(c("span",[dt])):Ie.appendChild(dt),e.col+=1);e.map.push(e.pos,e.pos+1,dt),e.pos++}}if(e.trailingSpace=ee.charCodeAt(t.length-1)==32,a||r||v||de||F||Z){var Wt=a||"";r&&(Wt+=r),v&&(Wt+=v);var Ot=c("span",[Ie],Wt,F);if(Z)for(var Gt in Z)Z.hasOwnProperty(Gt)&&Gt!="style"&&Gt!="class"&&Ot.setAttribute(Gt,Z[Gt]);return e.content.appendChild(Ot)}e.content.appendChild(Ie)}function sr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var a=t,r="",v=0;v<e.length;v++){var F=e.charAt(v);F==" "&&a&&(v==e.length-1||e.charCodeAt(v+1)==32)&&(F="\xA0"),r+=F,a=F==" "}return r}function mi(e,t){return function(a,r,v,F,Z,ee,re){v=v?v+" cm-force-border":"cm-force-border";for(var de=a.pos,Ie=de+r.length;;){for(var Ne=void 0,Xe=0;Xe<t.length&&!(Ne=t[Xe],Ne.to>de&&Ne.from<=de);Xe++);if(Ne.to>=Ie)return e(a,r,v,F,Z,ee,re);e(a,r.slice(0,Ne.to-de),v,F,null,ee,re),F=null,r=r.slice(Ne.to-de),de=Ne.to}}}function Gn(e,t,a,r){var v=!r&&a.widgetNode;v&&e.map.push(e.pos,e.pos+t,v),!r&&e.cm.display.input.needsContentAttribute&&(v||(v=e.content.appendChild(document.createElement("span"))),v.setAttribute("cm-marker",a.id)),v&&(e.cm.display.input.setUneditable(v),e.content.appendChild(v)),e.pos+=t,e.trailingSpace=!1}function Wi(e,t,a){var r=e.markedSpans,v=e.text,F=0;if(!r){for(var Z=1;Z<a.length;Z+=2)t.addToken(t,v.slice(F,F=a[Z]),Jt(a[Z+1],t.cm.options));return}for(var ee=v.length,re=0,de=1,Ie="",Ne,Xe,ze=0,at,dt,Et,At,Wt;;){if(ze==re){at=dt=Et=Xe="",Wt=null,At=null,ze=Infinity;for(var Ot=[],Gt=void 0,vn=0;vn<r.length;++vn){var rn=r[vn],Jn=rn.marker;if(Jn.type=="bookmark"&&rn.from==re&&Jn.widgetNode)Ot.push(Jn);else if(rn.from<=re&&(rn.to==null||rn.to>re||Jn.collapsed&&rn.to==re&&rn.from==re)){if(rn.to!=null&&rn.to!=re&&ze>rn.to&&(ze=rn.to,dt=""),Jn.className&&(at+=" "+Jn.className),Jn.css&&(Xe=(Xe?Xe+";":"")+Jn.css),Jn.startStyle&&rn.from==re&&(Et+=" "+Jn.startStyle),Jn.endStyle&&rn.to==ze&&(Gt||(Gt=[])).push(Jn.endStyle,rn.to),Jn.title&&((Wt||(Wt={})).title=Jn.title),Jn.attributes)for(var Dr in Jn.attributes)(Wt||(Wt={}))[Dr]=Jn.attributes[Dr];Jn.collapsed&&(!At||Sn(At.marker,Jn)<0)&&(At=rn)}else rn.from>re&&ze>rn.from&&(ze=rn.from)}if(Gt)for(var hi=0;hi<Gt.length;hi+=2)Gt[hi+1]==ze&&(dt+=" "+Gt[hi]);if(!At||At.from==re)for(var Gr=0;Gr<Ot.length;++Gr)Gn(t,0,Ot[Gr]);if(At&&(At.from||0)==re){if(Gn(t,(At.to==null?ee+1:At.to)-re,At.marker,At.from==null),At.to==null)return;At.to==re&&(At=!1)}}if(re>=ee)break;for(var Ui=Math.min(ee,ze);;){if(Ie){var Ii=re+Ie.length;if(!At){var ni=Ii>Ui?Ie.slice(0,Ui-re):Ie;t.addToken(t,ni,Ne?Ne+at:at,Et,re+ni.length==ze?dt:"",Xe,Wt)}if(Ii>=Ui){Ie=Ie.slice(Ui-re),re=Ui;break}re=Ii,Et=""}Ie=v.slice(F,F=a[de++]),Ne=Jt(a[de++],t.cm.options)}}}function lr(e,t,a){this.line=t,this.rest=pn(t),this.size=this.rest?on(P(this.rest))-a+1:1,this.node=this.text=null,this.hidden=kr(e,t)}function ii(e,t,a){for(var r=[],v,F=t;F<a;F=v){var Z=new lr(e.doc,wt(e.doc,F),F);v=F+Z.size,r.push(Z)}return r}var Zr=null;function Ai(e){Zr?Zr.ops.push(e):e.ownsGroup=Zr={ops:[e],delayedCallbacks:[]}}function Pa(e){var t=e.delayedCallbacks,a=0;do{for(;a<t.length;a++)t[a].call(null);for(var r=0;r<e.ops.length;r++){var v=e.ops[r];if(v.cursorActivityHandlers)for(;v.cursorActivityCalled<v.cursorActivityHandlers.length;)v.cursorActivityHandlers[v.cursorActivityCalled++].call(null,v.cm)}}while(a<t.length)}function Lo(e,t){var a=e.ownsGroup;if(!a)return;try{Pa(a)}finally{Zr=null,t(a)}}var ta=null;function Mr(e,t){var a=Tt(e,t);if(!a.length)return;var r=Array.prototype.slice.call(arguments,2),v;Zr?v=Zr.delayedCallbacks:ta?v=ta:(v=ta=[],setTimeout(lo,0));for(var F=function(ee){v.push(function(){return a[ee].apply(null,r)})},Z=0;Z<a.length;++Z)F(Z)}function lo(){var e=ta;ta=null;for(var t=0;t<e.length;++t)e[t]()}function uo(e,t,a,r){for(var v=0;v<t.changes.length;v++){var F=t.changes[v];F=="text"?co(e,t):F=="gutter"?Ta(e,t,a,r):F=="class"?ka(e,t):F=="widget"&&ho(e,t,r)}t.changes=null}function ha(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&K<8&&(e.node.style.zIndex=2)),e.node}function fa(e,t){var a=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(a&&(a+=" CodeMirror-linebackground"),t.background)a?t.background.className=a:(t.background.parentNode.removeChild(t.background),t.background=null);else if(a){var r=ha(t);t.background=r.insertBefore(c("div",null,a),r.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var a=e.display.externalMeasured;return a&&a.line==t.line?(e.display.externalMeasured=null,t.measure=a.measure,a.built):Mn(e,t)}function co(e,t){var a=t.text.className,r=$a(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,ka(e,t)):a&&(t.text.className=a)}function ka(e,t){fa(e,t),t.line.wrapClass?ha(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var a=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=a||""}function Ta(e,t,a,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var v=ha(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),v.insertBefore(t.gutterBackground,t.text)}var F=t.line.gutterMarkers;if(e.options.lineNumbers||F){var Z=ha(t),ee=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ee),Z.insertBefore(ee,t.text),t.line.gutterClass&&(ee.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!F||!F["CodeMirror-linenumbers"])&&(t.lineNumber=ee.appendChild(c("div",Tr(e.options,a),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),F)for(var re=0;re<e.display.gutterSpecs.length;++re){var de=e.display.gutterSpecs[re].className,Ie=F.hasOwnProperty(de)&&F[de];Ie&&ee.appendChild(c("div",[Ie],"CodeMirror-gutter-elt","left: "+r.gutterLeft[de]+"px; width: "+r.gutterWidth[de]+"px"))}}}function ho(e,t,a){t.alignable&&(t.alignable=null);for(var r=O("CodeMirror-linewidget"),v=t.node.firstChild,F=void 0;v;v=F)F=v.nextSibling,r.test(v.className)&&t.node.removeChild(v);Ma(e,t,a)}function fo(e,t,a,r){var v=$a(e,t);return t.text=t.node=v.pre,v.bgClass&&(t.bgClass=v.bgClass),v.textClass&&(t.textClass=v.textClass),ka(e,t),Ta(e,t,a,r),Ma(e,t,r),t.node}function Ma(e,t,a){if(po(e,t.line,t,a,!0),t.rest)for(var r=0;r<t.rest.length;r++)po(e,t.rest[r],t,a,!1)}function po(e,t,a,r,v){if(!t.widgets)return;for(var F=ha(a),Z=0,ee=t.widgets;Z<ee.length;++Z){var re=ee[Z],de=c("div",[re.node],"CodeMirror-linewidget"+(re.className?" "+re.className:""));re.handleMouseEvents||de.setAttribute("cm-ignore-events","true"),Qa(re,de,a,r),e.display.input.setUneditable(de),v&&re.above?F.insertBefore(de,a.gutter||a.text):F.appendChild(de),Mr(re,"redraw")}}function Qa(e,t,a,r){if(e.noHScroll){(a.alignable||(a.alignable=[])).push(t);var v=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(v-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=v+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function pa(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(document.body,e.node)){var a="position: relative;";e.coverGutter&&(a+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(a+="width: "+t.display.wrapper.clientWidth+"px;"),d(t.display.measure,c("div",[e.node],null,a))}return e.height=e.node.parentNode.offsetHeight}function Yi(e,t){for(var a=Pe(t);a!=e.wrapper;a=a.parentNode)if(!a||a.nodeType==1&&a.getAttribute("cm-ignore-events")=="true"||a.parentNode==e.sizer&&a!=e.mover)return!0}function ma(e){return e.lineSpace.offsetTop}function Ae(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Me(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=d(e.measure,c("pre","x","CodeMirror-line-like")),a=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(a.paddingLeft),right:parseInt(a.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function He(e){return ae-e.display.nativeBarWidth}function De(e){return e.display.scroller.clientWidth-He(e)-e.display.barWidth}function le(e){return e.display.scroller.clientHeight-He(e)-e.display.barHeight}function xe(e,t,a){var r=e.options.lineWrapping,v=r&&De(e);if(!t.measure.heights||r&&t.measure.width!=v){var F=t.measure.heights=[];if(r){t.measure.width=v;for(var Z=t.text.firstChild.getClientRects(),ee=0;ee<Z.length-1;ee++){var re=Z[ee],de=Z[ee+1];Math.abs(re.bottom-de.bottom)>2&&F.push((re.bottom+de.top)/2-a.top)}}F.push(a.bottom-a.top)}}function fe(e,t,a){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var v=0;v<e.rest.length;v++)if(on(e.rest[v])>a)return{map:e.measure.maps[v],cache:e.measure.caches[v],before:!0}}function Le(e,t){t=fn(t);var a=on(t),r=e.display.externalMeasured=new lr(e.doc,t,a);r.lineN=a;var v=r.built=Mn(e,r);return r.text=v.pre,d(e.display.lineMeasure,v.pre),r}function Ce(e,t,a,r){return Ge(e,Be(e,t),a,r)}function Fe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[wr(e,t)];var a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size)return a}function Be(e,t){var a=on(t),r=Fe(e,a);r&&!r.text?r=null:r&&r.changes&&(uo(e,r,a,Lr(e)),e.curOp.forceUpdate=!0),r||(r=Le(e,t));var v=fe(r,t,a);return{line:t,view:r,rect:null,map:v.map,cache:v.cache,before:v.before,hasHeights:!1}}function Ge(e,t,a,r,v){t.before&&(a=-1);var F=a+(r||""),Z;return t.cache.hasOwnProperty(F)?Z=t.cache[F]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(xe(e,t.view,t.rect),t.hasHeights=!0),Z=Ct(e,t,a,r),Z.bogus||(t.cache[F]=Z)),{left:Z.left,right:Z.right,top:v?Z.rtop:Z.top,bottom:v?Z.rbottom:Z.bottom}}var Ze={left:0,right:0,top:0,bottom:0};function ut(e,t,a){for(var r,v,F,Z,ee,re,de=0;de<e.length;de+=3)if(ee=e[de],re=e[de+1],t<ee?(v=0,F=1,Z="left"):t<re?(v=t-ee,F=v+1):(de==e.length-3||t==re&&e[de+3]>t)&&(F=re-ee,v=F-1,t>=re&&(Z="right")),v!=null){if(r=e[de+2],ee==re&&a==(r.insertLeft?"left":"right")&&(Z=a),a=="left"&&v==0)for(;de&&e[de-2]==e[de-3]&&e[de-1].insertLeft;)r=e[(de-=3)+2],Z="left";if(a=="right"&&v==re-ee)for(;de<e.length-3&&e[de+3]==e[de+4]&&!e[de+5].insertLeft;)r=e[(de+=3)+2],Z="right";break}return{node:r,start:v,end:F,collapse:Z,coverStart:ee,coverEnd:re}}function ht(e,t){var a=Ze;if(t=="left")for(var r=0;r<e.length&&!((a=e[r]).left!=a.right);r++);else for(var v=e.length-1;v>=0&&!((a=e[v]).left!=a.right);v--);return a}function Ct(e,t,a,r){var v=ut(t.map,a,r),F=v.node,Z=v.start,ee=v.end,re=v.collapse,de;if(F.nodeType==3){for(var Ie=0;Ie<4;Ie++){for(;Z&&ke(t.line.text.charAt(v.coverStart+Z));)--Z;for(;v.coverStart+ee<v.coverEnd&&ke(t.line.text.charAt(v.coverStart+ee));)++ee;if(G&&K<9&&Z==0&&ee==v.coverEnd-v.coverStart?de=F.parentNode.getBoundingClientRect():de=ht(E(F,Z,ee).getClientRects(),r),de.left||de.right||Z==0)break;ee=Z,Z=Z-1,re="right"}G&&K<11&&(de=dn(e.display.measure,de))}else{Z>0&&(re=r="right");var Ne;e.options.lineWrapping&&(Ne=F.getClientRects()).length>1?de=Ne[r=="right"?Ne.length-1:0]:de=F.getBoundingClientRect()}if(G&&K<9&&!Z&&(!de||!de.left&&!de.right)){var Xe=F.parentNode.getClientRects()[0];Xe?de={left:Xe.left,right:Xe.left+Fr(e.display),top:Xe.top,bottom:Xe.bottom}:de=Ze}for(var ze=de.top-t.rect.top,at=de.bottom-t.rect.top,dt=(ze+at)/2,Et=t.view.measure.heights,At=0;At<Et.length-1&&!(dt<Et[At]);At++);var Wt=At?Et[At-1]:0,Ot=Et[At],Gt={left:(re=="right"?de.right:de.left)-t.rect.left,right:(re=="left"?de.left:de.right)-t.rect.left,top:Wt,bottom:Ot};return!de.left&&!de.right&&(Gt.bogus=!0),e.options.singleCursorHeightPerLine||(Gt.rtop=ze,Gt.rbottom=at),Gt}function dn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!hr(e))return t;var a=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*a,right:t.right*a,top:t.top*r,bottom:t.bottom*r}}function Kn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function On(e){e.display.externalMeasure=null,_(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Kn(e.display.view[t])}function Nn(e){On(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Bn(){return x&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Un(){return x&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ln(e){var t=0;if(e.widgets)for(var a=0;a<e.widgets.length;++a)e.widgets[a].above&&(t+=pa(e.widgets[a]));return t}function zn(e,t,a,r,v){if(!v){var F=Ln(t);a.top+=F,a.bottom+=F}if(r=="line")return a;r||(r="local");var Z=St(t);if(r=="local"?Z+=ma(e.display):Z-=e.display.viewOffset,r=="page"||r=="window"){var ee=e.display.lineSpace.getBoundingClientRect();Z+=ee.top+(r=="window"?0:Un());var re=ee.left+(r=="window"?0:Bn());a.left+=re,a.right+=re}return a.top+=Z,a.bottom+=Z,a}function Xn(e,t,a){if(a=="div")return t;var r=t.left,v=t.top;if(a=="page")r-=Bn(),v-=Un();else if(a=="local"||!a){var F=e.display.sizer.getBoundingClientRect();r+=F.left,v+=F.top}var Z=e.display.lineSpace.getBoundingClientRect();return{left:r-Z.left,top:v-Z.top}}function Or(e,t,a,r,v){return r||(r=wt(e.doc,t.line)),zn(e,r,Ce(e,r,t.ch,v),a)}function Yn(e,t,a,r,v,F){r=r||wt(e.doc,t.line),v||(v=Be(e,r));function Z(at,dt){var Et=Ge(e,v,at,dt?"right":"left",F);return dt?Et.left=Et.right:Et.right=Et.left,zn(e,r,Et,a)}var ee=lt(r,e.doc.direction),re=t.ch,de=t.sticky;if(re>=r.text.length?(re=r.text.length,de="before"):re<=0&&(re=0,de="after"),!ee)return Z(de=="before"?re-1:re,de=="before");function Ie(at,dt,Et){var At=ee[dt],Wt=At.level==1;return Z(Et?at-1:at,Wt!=Et)}var Ne=qe(ee,re,de),Xe=ot,ze=Ie(re,Ne,de=="before");return Xe!=null&&(ze.other=Ie(re,Xe,de!="before")),ze}function nn(e,t){var a=0;t=En(e.doc,t),e.options.lineWrapping||(a=Fr(e.display)*t.ch);var r=wt(e.doc,t.line),v=St(r)+ma(e.display);return{left:a,right:a,top:v,bottom:v+r.height}}function qt(e,t,a,r,v){var F=ct(e,t,a);return F.xRel=v,r&&(F.outside=r),F}function In(e,t,a){var r=e.doc;if(a+=e.display.viewOffset,a<0)return qt(r.first,0,null,-1,-1);var v=Dn(r,a),F=r.first+r.size-1;if(v>F)return qt(r.first+r.size-1,wt(r,F).text.length,null,1,1);t<0&&(t=0);for(var Z=wt(r,v);;){var ee=Rr(e,Z,v,t,a),re=je(Z,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!re)return ee;var de=re.find(1);if(de.line==v)return de;Z=wt(r,v=de.line)}}function nr(e,t,a,r){r-=Ln(t);var v=t.text.length,F=Qe(function(Z){return Ge(e,a,Z-1).bottom<=r},v,0);return v=Qe(function(Z){return Ge(e,a,Z).top>r},F,v),{begin:F,end:v}}function Kt(e,t,a,r){a||(a=Be(e,t));var v=zn(e,t,Ge(e,a,r),"line").top;return nr(e,t,a,v)}function rr(e,t,a,r){return e.bottom<=a?!1:e.top>a?!0:(r?e.left:e.right)>t}function Rr(e,t,a,r,v){v-=St(t);var F=Be(e,t),Z=Ln(t),ee=0,re=t.text.length,de=!0,Ie=lt(t,e.doc.direction);if(Ie){var Ne=(e.options.lineWrapping?_r:Zn)(e,t,a,F,Ie,r,v);de=Ne.level!=1,ee=de?Ne.from:Ne.to-1,re=de?Ne.to:Ne.from-1}var Xe=null,ze=null,at=Qe(function(vn){var rn=Ge(e,F,vn);return rn.top+=Z,rn.bottom+=Z,rr(rn,r,v,!1)?(rn.top<=v&&rn.left<=r&&(Xe=vn,ze=rn),!0):!1},ee,re),dt,Et,At=!1;if(ze){var Wt=r-ze.left<ze.right-r,Ot=Wt==de;at=Xe+(Ot?0:1),Et=Ot?"after":"before",dt=Wt?ze.left:ze.right}else{!de&&(at==re||at==ee)&&at++,Et=at==0?"after":at==t.text.length?"before":Ge(e,F,at-(de?1:0)).bottom+Z<=v==de?"after":"before";var Gt=Yn(e,ct(a,at,Et),"line",t,F);dt=Gt.left,At=v<Gt.top?-1:v>=Gt.bottom?1:0}return at=Ue(t.text,at,1),qt(a,at,Et,At,r-dt)}function Zn(e,t,a,r,v,F,Z){var ee=Qe(function(Ne){var Xe=v[Ne],ze=Xe.level!=1;return rr(Yn(e,ct(a,ze?Xe.to:Xe.from,ze?"before":"after"),"line",t,r),F,Z,!0)},0,v.length-1),re=v[ee];if(ee>0){var de=re.level!=1,Ie=Yn(e,ct(a,de?re.from:re.to,de?"after":"before"),"line",t,r);rr(Ie,F,Z,!0)&&Ie.top>Z&&(re=v[ee-1])}return re}function _r(e,t,a,r,v,F,Z){var ee=nr(e,t,r,Z),re=ee.begin,de=ee.end;/\s/.test(t.text.charAt(de-1))&&de--;for(var Ie=null,Ne=null,Xe=0;Xe<v.length;Xe++){var ze=v[Xe];if(ze.from>=de||ze.to<=re)continue;var at=ze.level!=1,dt=Ge(e,r,at?Math.min(de,ze.to)-1:Math.max(re,ze.from)).right,Et=dt<F?F-dt+1e9:dt-F;(!Ie||Ne>Et)&&(Ie=ze,Ne=Et)}return Ie||(Ie=v[v.length-1]),Ie.from<re&&(Ie={from:re,to:Ie.to,level:Ie.level}),Ie.to>de&&(Ie={from:Ie.from,to:de,level:Ie.level}),Ie}var mr;function Nr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(mr==null){mr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)mr.appendChild(document.createTextNode("x")),mr.appendChild(c("br"));mr.appendChild(document.createTextNode("x"))}d(e.measure,mr);var a=mr.offsetHeight/50;return a>3&&(e.cachedTextHeight=a),_(e.measure),a||1}function Fr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),a=c("pre",[t],"CodeMirror-line-like");d(e.measure,a);var r=t.getBoundingClientRect(),v=(r.right-r.left)/10;return v>2&&(e.cachedCharWidth=v),v||10}function Lr(e){for(var t=e.display,a={},r={},v=t.gutters.clientLeft,F=t.gutters.firstChild,Z=0;F;F=F.nextSibling,++Z){var ee=e.display.gutterSpecs[Z].className;a[ee]=F.offsetLeft+F.clientLeft+v,r[ee]=F.clientWidth}return{fixedPos:li(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function li(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ti(e){var t=Nr(e.display),a=e.options.lineWrapping,r=a&&Math.max(5,e.display.scroller.clientWidth/Fr(e.display)-3);return function(v){if(kr(e.doc,v))return 0;var F=0;if(v.widgets)for(var Z=0;Z<v.widgets.length;Z++)v.widgets[Z].height&&(F+=v.widgets[Z].height);return a?F+(Math.ceil(v.text.length/r)||1)*t:F+t}}function gi(e){var t=e.doc,a=Ti(e);t.iter(function(r){var v=a(r);v!=r.height&&cn(r,v)})}function Wr(e,t,a,r){var v=e.display;if(!a&&Pe(t).getAttribute("cm-not-content")=="true")return null;var F,Z,ee=v.lineSpace.getBoundingClientRect();try{F=t.clientX-ee.left,Z=t.clientY-ee.top}catch(Ne){return null}var re=In(e,F,Z),de;if(r&&re.xRel>0&&(de=wt(e.doc,re.line).text).length==re.ch){var Ie=H(de,de.length,e.options.tabSize)-de.length;re=ct(re.line,Math.max(0,Math.round((F-Me(e.display).left)/Fr(e.display))-Ie))}return re}function wr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var a=e.display.view,r=0;r<a.length;r++)if(t-=a[r].size,t<0)return r}function gr(e,t,a,r){t==null&&(t=e.doc.first),a==null&&(a=e.doc.first+e.doc.size),r||(r=0);var v=e.display;if(r&&a<v.viewTo&&(v.updateLineNumbers==null||v.updateLineNumbers>t)&&(v.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=v.viewTo)Zt&&Yr(e.doc,t)<v.viewTo&&vr(e);else if(a<=v.viewFrom)Zt&&$r(e.doc,a+r)>v.viewFrom?vr(e):(v.viewFrom+=r,v.viewTo+=r);else if(t<=v.viewFrom&&a>=v.viewTo)vr(e);else if(t<=v.viewFrom){var F=Oi(e,a,a+r,1);F?(v.view=v.view.slice(F.index),v.viewFrom=F.lineN,v.viewTo+=r):vr(e)}else if(a>=v.viewTo){var Z=Oi(e,t,t,-1);Z?(v.view=v.view.slice(0,Z.index),v.viewTo=Z.lineN):vr(e)}else{var ee=Oi(e,t,t,-1),re=Oi(e,a,a+r,1);ee&&re?(v.view=v.view.slice(0,ee.index).concat(ii(e,ee.lineN,re.lineN)).concat(v.view.slice(re.index)),v.viewTo+=r):vr(e)}var de=v.externalMeasured;de&&(a<de.lineN?de.lineN+=r:t<de.lineN+de.size&&(v.externalMeasured=null))}function ln(e,t,a){e.curOp.viewChanged=!0;var r=e.display,v=e.display.externalMeasured;if(v&&t>=v.lineN&&t<v.lineN+v.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var F=r.view[wr(e,t)];if(F.node==null)return;var Z=F.changes||(F.changes=[]);te(Z,a)==-1&&Z.push(a)}function vr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Oi(e,t,a,r){var v=wr(e,t),F,Z=e.display.view;if(!Zt||a==e.doc.first+e.doc.size)return{index:v,lineN:a};for(var ee=e.display.viewFrom,re=0;re<v;re++)ee+=Z[re].size;if(ee!=t){if(r>0){if(v==Z.length-1)return null;F=ee+Z[v].size-t,v++}else F=ee-t;t+=F,a+=F}for(;Yr(e.doc,a)!=a;){if(v==(r<0?0:Z.length-1))return null;a+=r*Z[v-(r<0?1:0)].size,v+=r}return{index:v,lineN:a}}function Hi(e,t,a){var r=e.display,v=r.view;v.length==0||t>=r.viewTo||a<=r.viewFrom?(r.view=ii(e,t,a),r.viewFrom=t):(r.viewFrom>t?r.view=ii(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(wr(e,t))),r.viewFrom=t,r.viewTo<a?r.view=r.view.concat(ii(e,r.viewTo,a)):r.viewTo>a&&(r.view=r.view.slice(0,wr(e,a)))),r.viewTo=a}function $i(e){for(var t=e.display.view,a=0,r=0;r<t.length;r++){var v=t[r];!v.hidden&&(!v.node||v.changes)&&++a}return a}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Mi(e,t){t===void 0&&(t=!0);for(var a=e.doc,r={},v=r.cursors=document.createDocumentFragment(),F=r.selection=document.createDocumentFragment(),Z=0;Z<a.sel.ranges.length;Z++){if(!t&&Z==a.sel.primIndex)continue;var ee=a.sel.ranges[Z];if(ee.from().line>=e.display.viewTo||ee.to().line<e.display.viewFrom)continue;var re=ee.empty();(re||e.options.showCursorWhenSelecting)&&Ki(e,ee.head,v),re||cr(e,ee,F)}return r}function Ki(e,t,a){var r=Yn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),v=a.appendChild(c("div","\xA0","CodeMirror-cursor"));if(v.style.left=r.left+"px",v.style.top=r.top+"px",v.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var F=a.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));F.style.display="",F.style.left=r.other.left+"px",F.style.top=r.other.top+"px",F.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Er(e,t){return e.top-t.top||e.left-t.left}function cr(e,t,a){var r=e.display,v=e.doc,F=document.createDocumentFragment(),Z=Me(e.display),ee=Z.left,re=Math.max(r.sizerWidth,De(e)-r.sizer.offsetLeft)-Z.right,de=v.direction=="ltr";function Ie(Ot,Gt,vn,rn){Gt<0&&(Gt=0),Gt=Math.round(Gt),rn=Math.round(rn),F.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+Ot+`px;
top: `+Gt+"px; width: "+(vn==null?re-Ot:vn)+`px;
height: `+(rn-Gt)+"px"))}function Ne(Ot,Gt,vn){var rn=wt(v,Ot),Jn=rn.text.length,Dr,hi;function Gr(ni,Pi){return Or(e,ct(Ot,ni),"div",rn,Pi)}function Ui(ni,Pi,vi){var si=Kt(e,rn,null,ni),ri=Pi=="ltr"==(vi=="after")?"left":"right",Xr=vi=="after"?si.begin:si.end-(/\s/.test(rn.text.charAt(si.end-1))?2:1);return Gr(Xr,ri)[ri]}var Ii=lt(rn,v.direction);return nt(Ii,Gt||0,vn==null?Jn:vn,function(ni,Pi,vi,si){var ri=vi=="ltr",Xr=Gr(ni,ri?"left":"right"),ki=Gr(Pi-1,ri?"right":"left"),Ro=Gt==null&&ni==0,Xa=vn==null&&Pi==Jn,xi=si==0,_a=!Ii||si==Ii.length-1;if(ki.top-Xr.top<=3){var fi=(de?Ro:Xa)&&xi,_s=(de?Xa:Ro)&&_a,La=fi?ee:(ri?Xr:ki).left,oo=_s?re:(ri?ki:Xr).right;Ie(La,Xr.top,oo-La,Xr.bottom)}else{var so,Si,Do,bs;ri?(so=de&&Ro&&xi?ee:Xr.left,Si=de?re:Ui(ni,vi,"before"),Do=de?ee:Ui(Pi,vi,"after"),bs=de&&Xa&&_a?re:ki.right):(so=de?Ui(ni,vi,"before"):ee,Si=!de&&Ro&&xi?re:Xr.right,Do=!de&&Xa&&_a?ee:ki.left,bs=de?Ui(Pi,vi,"after"):re),Ie(so,Xr.top,Si-so,Xr.bottom),Xr.bottom<ki.top&&Ie(ee,Xr.bottom,null,ki.top),Ie(Do,ki.top,bs-Do,ki.bottom)}(!Dr||Er(Xr,Dr)<0)&&(Dr=Xr),Er(ki,Dr)<0&&(Dr=ki),(!hi||Er(Xr,hi)<0)&&(hi=Xr),Er(ki,hi)<0&&(hi=ki)}),{start:Dr,end:hi}}var Xe=t.from(),ze=t.to();if(Xe.line==ze.line)Ne(Xe.line,Xe.ch,ze.ch);else{var at=wt(v,Xe.line),dt=wt(v,ze.line),Et=fn(at)==fn(dt),At=Ne(Xe.line,Xe.ch,Et?at.text.length+1:null).end,Wt=Ne(ze.line,Et?0:null,ze.ch).start;Et&&(At.top<Wt.top-2?(Ie(At.right,At.top,null,At.bottom),Ie(ee,Wt.top,Wt.left,Wt.bottom)):Ie(At.right,At.top,Wt.left-At.right,At.bottom)),At.bottom<Wt.top&&Ie(ee,At.bottom,null,Wt.top)}a.appendChild(F)}function Pr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var a=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ga(e),t.cursorDiv.style.visibility=(a=!a)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Na(e){e.state.focused||(e.display.input.focus(),na(e))}function Za(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ga(e))},100)}function na(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,W(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Pr(e)}function ga(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,g(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zr(e){for(var t=e.display,a=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var v=t.view[r],F=e.options.lineWrapping,Z=void 0,ee=0;if(v.hidden)continue;if(G&&K<8){var re=v.node.offsetTop+v.node.offsetHeight;Z=re-a,a=re}else{var de=v.node.getBoundingClientRect();Z=de.bottom-de.top,!F&&v.text.firstChild&&(ee=v.text.firstChild.getBoundingClientRect().right-de.left-1)}var Ie=v.line.height-Z;if((Ie>.005||Ie<-.005)&&(cn(v.line,Z),Ni(v.line),v.rest))for(var Ne=0;Ne<v.rest.length;Ne++)Ni(v.rest[Ne]);if(ee>e.display.sizerWidth){var Xe=Math.ceil(ee/Fr(e.display));Xe>e.display.maxLineLength&&(e.display.maxLineLength=Xe,e.display.maxLine=v.line,e.display.maxLineChanged=!0)}}}function Ni(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var a=e.widgets[t],r=a.node.parentNode;r&&(a.height=r.offsetHeight)}}function Ua(e,t,a){var r=a&&a.top!=null?Math.max(0,a.top):e.scroller.scrollTop;r=Math.floor(r-ma(e));var v=a&&a.bottom!=null?a.bottom:r+e.wrapper.clientHeight,F=Dn(t,r),Z=Dn(t,v);if(a&&a.ensure){var ee=a.ensure.from.line,re=a.ensure.to.line;ee<F?(F=ee,Z=Dn(t,St(wt(t,ee))+e.wrapper.clientHeight)):Math.min(re,t.lastLine())>=Z&&(F=Dn(t,St(wt(t,re))-e.wrapper.clientHeight),Z=re)}return{from:F,to:Math.max(Z,F+1)}}function Io(e,t){if(ne(e,"scrollCursorIntoView"))return;var a=e.display,r=a.sizer.getBoundingClientRect(),v=null;if(t.top+r.top<0?v=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(v=!1),v!=null&&!o){var F=c("div","\u200B",null,`position: absolute;
top: `+(t.top-a.viewOffset-ma(e.display))+`px;
height: `+(t.bottom-t.top+He(e)+a.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(F),F.scrollIntoView(v),e.display.lineSpace.removeChild(F)}}function Po(e,t,a,r){r==null&&(r=0);var v;!e.options.lineWrapping&&t==a&&(t=t.ch?ct(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,a=t.sticky=="before"?ct(t.line,t.ch+1,"before"):t);for(var F=0;F<5;F++){var Z=!1,ee=Yn(e,t),re=!a||a==t?ee:Yn(e,a);v={left:Math.min(ee.left,re.left),top:Math.min(ee.top,re.top)-r,right:Math.max(ee.left,re.left),bottom:Math.max(ee.bottom,re.bottom)+r};var de=Ja(e,v),Ie=e.doc.scrollTop,Ne=e.doc.scrollLeft;if(de.scrollTop!=null&&(ia(e,de.scrollTop),Math.abs(e.doc.scrollTop-Ie)>1&&(Z=!0)),de.scrollLeft!=null&&(wi(e,de.scrollLeft),Math.abs(e.doc.scrollLeft-Ne)>1&&(Z=!0)),!Z)break}return v}function mo(e,t){var a=Ja(e,t);a.scrollTop!=null&&ia(e,a.scrollTop),a.scrollLeft!=null&&wi(e,a.scrollLeft)}function Ja(e,t){var a=e.display,r=Nr(e.display);t.top<0&&(t.top=0);var v=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:a.scroller.scrollTop,F=le(e),Z={};t.bottom-t.top>F&&(t.bottom=t.top+F);var ee=e.doc.height+Ae(a),re=t.top<r,de=t.bottom>ee-r;if(t.top<v)Z.scrollTop=re?0:t.top;else if(t.bottom>v+F){var Ie=Math.min(t.top,(de?ee:t.bottom)-F);Ie!=v&&(Z.scrollTop=Ie)}var Ne=e.options.fixedGutter?0:a.gutters.offsetWidth,Xe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:a.scroller.scrollLeft-Ne,ze=De(e)-a.gutters.offsetWidth,at=t.right-t.left>ze;return at&&(t.right=t.left+ze),t.left<10?Z.scrollLeft=0:t.left<Xe?Z.scrollLeft=Math.max(0,t.left+Ne-(at?0:10)):t.right>ze+Xe-3&&(Z.scrollLeft=t.right+(at?0:10)-ze),Z}function qa(e,t){if(t==null)return;ja(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ra(e){ja(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function va(e,t,a){(t!=null||a!=null)&&ja(e),t!=null&&(e.curOp.scrollLeft=t),a!=null&&(e.curOp.scrollTop=a)}function go(e,t){ja(e),e.curOp.scrollToPos=t}function ja(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var a=nn(e,t.from),r=nn(e,t.to);ya(e,a,r,t.margin)}}function ya(e,t,a,r){var v=Ja(e,{left:Math.min(t.left,a.left),top:Math.min(t.top,a.top)-r,right:Math.max(t.right,a.right),bottom:Math.max(t.bottom,a.bottom)+r});va(e,v.scrollLeft,v.scrollTop)}function ia(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Sa(e,{top:t}),Cr(e,t,!0),N&&Sa(e),Ca(e,100)}function Cr(e,t,a){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!a)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function wi(e,t,a,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(a?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,er(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function aa(e){var t=e.display,a=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ae(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?a:0,docHeight:r,scrollHeight:r+He(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:a}}var Qi=function(e,t,a){this.cm=a;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),v=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=v.tabIndex=-1,e(r),e(v),Ye(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ye(v,"scroll",function(){v.clientWidth&&t(v.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&K<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Qi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,a=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var v=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+v)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=a?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var F=e.viewWidth-e.barLeft-(a?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+F)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:a?r:0,bottom:t?r:0}},Qi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Qi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Qi.prototype.zeroWidthHack=function(){var e=s&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Q,this.disableVert=new Q},Qi.prototype.enableZeroWidthBar=function(e,t,a){e.style.pointerEvents="auto";function r(){var v=e.getBoundingClientRect(),F=a=="vert"?document.elementFromPoint(v.right-1,(v.top+v.bottom)/2):document.elementFromPoint((v.right+v.left)/2,v.bottom-1);F!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Qi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wa=function(){};wa.prototype.update=function(){return{bottom:0,right:0}},wa.prototype.setScrollLeft=function(){},wa.prototype.setScrollTop=function(){},wa.prototype.clear=function(){};function oa(e,t){t||(t=aa(e));var a=e.display.barWidth,r=e.display.barHeight;Ba(e,t);for(var v=0;v<4&&a!=e.display.barWidth||r!=e.display.barHeight;v++)a!=e.display.barWidth&&e.options.lineWrapping&&zr(e),Ba(e,aa(e)),a=e.display.barWidth,r=e.display.barHeight}function Ba(e,t){var a=e.display,r=a.scrollbars.update(t);a.sizer.style.paddingRight=(a.barWidth=r.right)+"px",a.sizer.style.paddingBottom=(a.barHeight=r.bottom)+"px",a.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=r.bottom+"px",a.scrollbarFiller.style.width=r.right+"px"):a.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(a.gutterFiller.style.display="block",a.gutterFiller.style.height=r.bottom+"px",a.gutterFiller.style.width=t.gutterWidth+"px"):a.gutterFiller.style.display=""}var eo={native:Qi,null:wa};function Fa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&g(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new eo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ye(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,a){a=="horizontal"?wi(e,t):ia(e,t)},e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function Gi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++to},Ai(e.curOp)}function Zi(e){var t=e.curOp;t&&Lo(t,function(a){for(var r=0;r<a.ops.length;r++)a.ops[r].cm.curOp=null;no(a)})}function no(e){for(var t=e.ops,a=0;a<t.length;a++)ro(t[a]);for(var r=0;r<t.length;r++)ko(t[r]);for(var v=0;v<t.length;v++)Mo(t[v]);for(var F=0;F<t.length;F++)io(t[F]);for(var Z=0;Z<t.length;Z++)No(t[Z])}function ro(e){var t=e.cm,a=t.display;ao(t),e.updateMaxLine&&tr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<a.viewFrom||e.scrollToPos.to.line>=a.viewTo)||a.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ci(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ko(e){e.updatedDisplay=e.mustUpdate&&sa(e.cm,e.update)}function Mo(e){var t=e.cm,a=t.display;e.updatedDisplay&&zr(t),e.barMeasure=aa(t),a.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ce(t,a.maxLine,a.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(a.scroller.clientWidth,a.sizer.offsetLeft+e.adjustWidthTo+He(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,a.sizer.offsetLeft+e.adjustWidthTo-De(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=a.input.prepareSelection())}function io(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&wi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var a=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,a),(e.updatedDisplay||e.startHeight!=t.doc.height)&&oa(t,e.barMeasure),e.updatedDisplay&&dr(t,e.barMeasure),e.selectionChanged&&Pr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),a&&Na(e.cm)}function No(e){var t=e.cm,a=t.display,r=t.doc;if(e.updatedDisplay&&Ka(t,e.update),a.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(a.wheelStartX=a.wheelStartY=null),e.scrollTop!=null&&Cr(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&wi(t,e.scrollLeft,!0,!0),e.scrollToPos){var v=Po(t,En(r,e.scrollToPos.from),En(r,e.scrollToPos.to),e.scrollToPos.margin);Io(t,v)}var F=e.maybeHiddenMarkers,Z=e.maybeUnhiddenMarkers;if(F)for(var ee=0;ee<F.length;++ee)F[ee].lines.length||me(F[ee],"hide");if(Z)for(var re=0;re<Z.length;++re)Z[re].lines.length&&me(Z[re],"unhide");a.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&me(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Vr(e,t){if(e.curOp)return t();Gi(e);try{return t()}finally{Zi(e)}}function Hr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gi(e);try{return t.apply(e,arguments)}finally{Zi(e)}}}function ai(e){return function(){if(this.curOp)return e.apply(this,arguments);Gi(this);try{return e.apply(this,arguments)}finally{Zi(this)}}}function Kr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gi(t);try{return e.apply(this,arguments)}finally{Zi(t)}}}function Ca(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,m(Wa,e))}function Wa(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var a=+new Date+e.options.workTime,r=pi(e,t.highlightFrontier),v=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(F){if(r.line>=e.display.viewFrom){var Z=F.styles,ee=F.text.length>e.options.maxHighlightLength?Cn(t.mode,r.state):null,re=ba(e,F,r,!0);ee&&(r.state=ee),F.styles=re.styles;var de=F.styleClasses,Ie=re.classes;Ie?F.styleClasses=Ie:de&&(F.styleClasses=null);for(var Ne=!Z||Z.length!=F.styles.length||de!=Ie&&(!de||!Ie||de.bgClass!=Ie.bgClass||de.textClass!=Ie.textClass),Xe=0;!Ne&&Xe<Z.length;++Xe)Ne=Z[Xe]!=F.styles[Xe];Ne&&v.push(r.line),F.stateAfter=r.save(),r.nextLine()}else F.text.length<=e.options.maxHighlightLength&&da(e,F.text,r),F.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>a)return Ca(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),v.length&&Vr(e,function(){for(var F=0;F<v.length;F++)ln(e,v[F],"text")})}var Ci=function(e,t,a){var r=e.display;this.viewport=t,this.visible=Ua(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=De(e),this.force=a,this.dims=Lr(e),this.events=[]};Ci.prototype.signal=function(e,t){se(e,t)&&this.events.push(arguments)},Ci.prototype.finish=function(){for(var e=0;e<this.events.length;e++)me.apply(null,this.events[e])};function ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=He(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=He(e)+"px",t.scrollbarsClipped=!0)}function Ha(e){if(e.hasFocus())return null;var t=B();if(!t||!w(e.display.lineDiv,t))return null;var a={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&w(e.display.lineDiv,r.anchorNode)&&(a.anchorNode=r.anchorNode,a.anchorOffset=r.anchorOffset,a.focusNode=r.focusNode,a.focusOffset=r.focusOffset)}return a}function vo(e){if(!e||!e.activeElt||e.activeElt==B())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(document.body,e.focusNode)){var t=window.getSelection(),a=document.createRange();a.setEnd(e.anchorNode,e.anchorOffset),a.collapse(!1),t.removeAllRanges(),t.addRange(a),t.extend(e.focusNode,e.focusOffset)}}function sa(e,t){var a=e.display,r=e.doc;if(t.editorIsHidden)return vr(e),!1;if(!t.force&&t.visible.from>=a.viewFrom&&t.visible.to<=a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&$i(e)==0)return!1;ti(e)&&(vr(e),t.dims=Lr(e));var v=r.first+r.size,F=Math.max(t.visible.from-e.options.viewportMargin,r.first),Z=Math.min(v,t.visible.to+e.options.viewportMargin);a.viewFrom<F&&F-a.viewFrom<20&&(F=Math.max(r.first,a.viewFrom)),a.viewTo>Z&&a.viewTo-Z<20&&(Z=Math.min(v,a.viewTo)),Zt&&(F=Yr(e.doc,F),Z=$r(e.doc,Z));var ee=F!=a.viewFrom||Z!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth;Hi(e,F,Z),a.viewOffset=St(wt(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px";var re=$i(e);if(!ee&&re==0&&!t.force&&a.renderedView==a.view&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo))return!1;var de=Ha(e);return re>4&&(a.lineDiv.style.display="none"),yo(e,a.updateLineNumbers,t.dims),re>4&&(a.lineDiv.style.display=""),a.renderedView=a.view,vo(de),_(a.cursorDiv),_(a.selectionDiv),a.gutters.style.height=a.sizer.style.minHeight=0,ee&&(a.lastWrapHeight=t.wrapperHeight,a.lastWrapWidth=t.wrapperWidth,Ca(e,400)),a.updateLineNumbers=null,!0}function Ka(e,t){for(var a=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==De(e)){if(a&&a.top!=null&&(a={top:Math.min(e.doc.height+Ae(e.display)-le(e),a.top)}),t.visible=Ua(e.display,e.doc,a),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ua(e.display,e.doc,a));if(!sa(e,t))break;zr(e);var v=aa(e);yr(e),oa(e,v),dr(e,v),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Sa(e,t){var a=new Ci(e,t);if(sa(e,a)){zr(e),Ka(e,a);var r=aa(e);yr(e),oa(e,r),dr(e,r),a.finish()}}function yo(e,t,a){var r=e.display,v=e.options.lineNumbers,F=r.lineDiv,Z=F.firstChild;function ee(at){var dt=at.nextSibling;return n&&s&&e.display.currentWheelTarget==at?at.style.display="none":at.parentNode.removeChild(at),dt}for(var re=r.view,de=r.viewFrom,Ie=0;Ie<re.length;Ie++){var Ne=re[Ie];if(!Ne.hidden)if(!Ne.node||Ne.node.parentNode!=F){var Xe=fo(e,Ne,de,a);F.insertBefore(Xe,Z)}else{for(;Z!=Ne.node;)Z=ee(Z);var ze=v&&t!=null&&t<=de&&Ne.lineNumber;Ne.changes&&(te(Ne.changes,"gutter")>-1&&(ze=!1),uo(e,Ne,de,a)),ze&&(_(Ne.lineNumber),Ne.lineNumber.appendChild(document.createTextNode(Tr(e.options,de)))),Z=Ne.node.nextSibling}de+=Ne.size}for(;Z;)Z=ee(Z)}function Ga(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function dr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+He(e)+"px"}function er(e){var t=e.display,a=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=li(t)-t.scroller.scrollLeft+e.doc.scrollLeft,v=t.gutters.offsetWidth,F=r+"px",Z=0;Z<a.length;Z++)if(!a[Z].hidden){e.options.fixedGutter&&(a[Z].gutter&&(a[Z].gutter.style.left=F),a[Z].gutterBackground&&(a[Z].gutterBackground.style.left=F));var ee=a[Z].alignable;if(ee)for(var re=0;re<ee.length;re++)ee[re].style.left=F}e.options.fixedGutter&&(t.gutters.style.left=r+v+"px")}function ti(e){if(!e.options.lineNumbers)return!1;var t=e.doc,a=Tr(e.options,t.first+t.size-1),r=e.display;if(a.length!=r.lineNumChars){var v=r.measure.appendChild(c("div",[c("div",a)],"CodeMirror-linenumber CodeMirror-gutter-elt")),F=v.firstChild.offsetWidth,Z=v.offsetWidth-F;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(F,r.lineGutter.offsetWidth-Z)+1,r.lineNumWidth=r.lineNumInnerWidth+Z,r.lineNumChars=r.lineNumInnerWidth?a.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Ga(e.display),!0}return!1}function ui(e,t){for(var a=[],r=!1,v=0;v<e.length;v++){var F=e[v],Z=null;if(typeof F!="string"&&(Z=F.style,F=F.className),F=="CodeMirror-linenumbers")if(t)r=!0;else continue;a.push({className:F,style:Z})}return t&&!r&&a.push({className:"CodeMirror-linenumbers",style:null}),a}function Ji(e){var t=e.gutters,a=e.gutterSpecs;_(t),e.lineGutter=null;for(var r=0;r<a.length;++r){var v=a[r],F=v.className,Z=v.style,ee=t.appendChild(c("div",null,"CodeMirror-gutter "+F));Z&&(ee.style.cssText=Z),F=="CodeMirror-linenumbers"&&(e.lineGutter=ee,ee.style.width=(e.lineNumWidth||1)+"px")}t.style.display=a.length?"":"none",Ga(e)}function zi(e){Ji(e.display),gr(e),er(e)}function Aa(e,t,a,r){var v=this;this.input=a,v.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),v.scrollbarFiller.setAttribute("cm-not-content","true"),v.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),v.gutterFiller.setAttribute("cm-not-content","true"),v.lineDiv=C("div",null,"CodeMirror-code"),v.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),v.cursorDiv=c("div",null,"CodeMirror-cursors"),v.measure=c("div",null,"CodeMirror-measure"),v.lineMeasure=c("div",null,"CodeMirror-measure"),v.lineSpace=C("div",[v.measure,v.lineMeasure,v.selectionDiv,v.cursorDiv,v.lineDiv],null,"position: relative; outline: none");var F=C("div",[v.lineSpace],"CodeMirror-lines");v.mover=c("div",[F],null,"position: relative"),v.sizer=c("div",[v.mover],"CodeMirror-sizer"),v.sizerWidth=null,v.heightForcer=c("div",null,null,"position: absolute; height: "+ae+"px; width: 1px;"),v.gutters=c("div",null,"CodeMirror-gutters"),v.lineGutter=null,v.scroller=c("div",[v.sizer,v.heightForcer,v.gutters],"CodeMirror-scroll"),v.scroller.setAttribute("tabIndex","-1"),v.wrapper=c("div",[v.scrollbarFiller,v.gutterFiller,v.scroller],"CodeMirror"),G&&K<8&&(v.gutters.style.zIndex=-1,v.scroller.style.paddingRight=0),!n&&!(N&&u)&&(v.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(v.wrapper):e(v.wrapper)),v.viewFrom=v.viewTo=t.first,v.reportedViewFrom=v.reportedViewTo=t.first,v.view=[],v.renderedView=null,v.externalMeasured=null,v.viewOffset=0,v.lastWrapHeight=v.lastWrapWidth=0,v.updateLineNumbers=null,v.nativeBarWidth=v.barHeight=v.barWidth=0,v.scrollbarsClipped=!1,v.lineNumWidth=v.lineNumInnerWidth=v.lineNumChars=null,v.alignWidgets=!1,v.cachedCharWidth=v.cachedTextHeight=v.cachedPaddingH=null,v.maxLine=null,v.maxLineLength=0,v.maxLineChanged=!1,v.wheelDX=v.wheelDY=v.wheelStartX=v.wheelStartY=null,v.shift=!1,v.selForContextMenu=null,v.activeTouch=null,v.gutterSpecs=ui(r.gutters,r.lineNumbers),Ji(v),a.init(v)}var qi=0,Jr=null;G?Jr=-.53:N?Jr=15:x?Jr=-.7:b&&(Jr=-1/3);function Oa(e){var t=e.wheelDeltaX,a=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),a==null&&e.detail&&e.axis==e.VERTICAL_AXIS?a=e.detail:a==null&&(a=e.wheelDelta),{x:t,y:a}}function Je(e){var t=Oa(e);return t.x*=Jr,t.y*=Jr,t}function $e(e,t){var a=Oa(t),r=a.x,v=a.y,F=e.display,Z=F.scroller,ee=Z.scrollWidth>Z.clientWidth,re=Z.scrollHeight>Z.clientHeight;if(!(r&&ee||v&&re))return;if(v&&s&&n){e:for(var de=t.target,Ie=F.view;de!=Z;de=de.parentNode)for(var Ne=0;Ne<Ie.length;Ne++)if(Ie[Ne].node==de){e.display.currentWheelTarget=de;break e}}if(r&&!N&&!f&&Jr!=null){v&&re&&ia(e,Math.max(0,Z.scrollTop+v*Jr)),wi(e,Math.max(0,Z.scrollLeft+r*Jr)),(!v||v&&re)&&oe(t),F.wheelStartX=null;return}if(v&&Jr!=null){var Xe=v*Jr,ze=e.doc.scrollTop,at=ze+F.wrapper.clientHeight;Xe<0?ze=Math.max(0,ze+Xe-50):at=Math.min(e.doc.height,at+Xe+50),Sa(e,{top:ze,bottom:at})}qi<20&&(F.wheelStartX==null?(F.wheelStartX=Z.scrollLeft,F.wheelStartY=Z.scrollTop,F.wheelDX=r,F.wheelDY=v,setTimeout(function(){if(F.wheelStartX==null)return;var dt=Z.scrollLeft-F.wheelStartX,Et=Z.scrollTop-F.wheelStartY,At=Et&&F.wheelDY&&Et/F.wheelDY||dt&&F.wheelDX&&dt/F.wheelDX;if(F.wheelStartX=F.wheelStartY=null,!At)return;Jr=(Jr*qi+At)/(qi+1),++qi},200)):(F.wheelDX+=r,F.wheelDY+=v))}var Ve=function(e,t){this.ranges=e,this.primIndex=t};Ve.prototype.primary=function(){return this.ranges[this.primIndex]},Ve.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var a=this.ranges[t],r=e.ranges[t];if(!ji(a.anchor,r.anchor)||!ji(a.head,r.head))return!1}return!0},Ve.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new tt(Xi(this.ranges[t].anchor),Xi(this.ranges[t].head));return new Ve(e,this.primIndex)},Ve.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ve.prototype.contains=function(e,t){t||(t=e);for(var a=0;a<this.ranges.length;a++){var r=this.ranges[a];if(Qt(t,r.from())>=0&&Qt(e,r.to())<=0)return a}return-1};var tt=function(e,t){this.anchor=e,this.head=t};tt.prototype.from=function(){return Bi(this.anchor,this.head)},tt.prototype.to=function(){return ua(this.anchor,this.head)},tt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function rt(e,t,a){var r=e&&e.options.selectionsMayTouch,v=t[a];t.sort(function(Xe,ze){return Qt(Xe.from(),ze.from())}),a=te(t,v);for(var F=1;F<t.length;F++){var Z=t[F],ee=t[F-1],re=Qt(ee.to(),Z.from());if(r&&!Z.empty()?re>0:re>=0){var de=Bi(ee.from(),Z.from()),Ie=ua(ee.to(),Z.to()),Ne=ee.empty()?Z.from()==Z.head:ee.from()==ee.head;F<=a&&--a,t.splice(--F,2,new tt(Ne?Ie:de,Ne?de:Ie))}}return new Ve(t,a)}function vt(e,t){return new Ve([new tt(e,t||e)],0)}function gt(e){return e.text?ct(e.from.line+e.text.length-1,P(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function mt(e,t){if(Qt(e,t.from)<0)return e;if(Qt(e,t.to)<=0)return gt(t);var a=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=gt(t).ch-t.to.ch),ct(a,r)}function $t(e,t){for(var a=[],r=0;r<e.sel.ranges.length;r++){var v=e.sel.ranges[r];a.push(new tt(mt(v.anchor,t),mt(v.head,t)))}return rt(e.cm,a,e.sel.primIndex)}function $n(e,t,a){return e.line==t.line?ct(a.line,e.ch-t.ch+a.ch):ct(a.line+(e.line-t.line),e.ch)}function _i(e,t,a){for(var r=[],v=ct(e.first,0),F=v,Z=0;Z<t.length;Z++){var ee=t[Z],re=$n(ee.from,v,F),de=$n(gt(ee),v,F);if(v=ee.to,F=de,a=="around"){var Ie=e.sel.ranges[Z],Ne=Qt(Ie.head,Ie.anchor)<0;r[Z]=new tt(Ne?de:re,Ne?re:de)}else r[Z]=new tt(re,re)}return new Ve(r,e.sel.primIndex)}function Pn(e){e.doc.mode=Br(e.options,e.doc.modeOption),ci(e)}function ci(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ca(e,100),e.state.modeGen++,e.curOp&&gr(e)}function di(e,t){return t.from.ch==0&&t.to.ch==0&&P(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function oi(e,t,a,r){function v(Wt){return a?a[Wt]:null}function F(Wt,Ot,Gt){Qr(Wt,Ot,Gt,r),Mr(Wt,"change",Wt,t)}function Z(Wt,Ot){for(var Gt=[],vn=Wt;vn<Ot;++vn)Gt.push(new Hn(de[vn],v(vn),r));return Gt}var ee=t.from,re=t.to,de=t.text,Ie=wt(e,ee.line),Ne=wt(e,re.line),Xe=P(de),ze=v(de.length-1),at=re.line-ee.line;if(t.full)e.insert(0,Z(0,de.length)),e.remove(de.length,e.size-de.length);else if(di(e,t)){var dt=Z(0,de.length-1);F(Ne,Ne.text,ze),at&&e.remove(ee.line,at),dt.length&&e.insert(ee.line,dt)}else if(Ie==Ne)if(de.length==1)F(Ie,Ie.text.slice(0,ee.ch)+Xe+Ie.text.slice(re.ch),ze);else{var Et=Z(1,de.length-1);Et.push(new Hn(Xe+Ie.text.slice(re.ch),ze,r)),F(Ie,Ie.text.slice(0,ee.ch)+de[0],v(0)),e.insert(ee.line+1,Et)}else if(de.length==1)F(Ie,Ie.text.slice(0,ee.ch)+de[0]+Ne.text.slice(re.ch),v(0)),e.remove(ee.line+1,at);else{F(Ie,Ie.text.slice(0,ee.ch)+de[0],v(0)),F(Ne,Xe+Ne.text.slice(re.ch),ze);var At=Z(1,de.length-1);at>1&&e.remove(ee.line+1,at-1),e.insert(ee.line+1,At)}Mr(e,"change",e,t)}function bi(e,t,a){function r(v,F,Z){if(v.linked)for(var ee=0;ee<v.linked.length;++ee){var re=v.linked[ee];if(re.doc==F)continue;var de=Z&&re.sharedHist;if(a&&!de)continue;t(re.doc,de),r(re.doc,v,de)}}r(e,null,!0)}function Ur(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,gi(e),Pn(e),Ri(e),e.options.lineWrapping||tr(e),e.options.mode=t.modeOption,gr(e)}function Ri(e){(e.doc.direction=="rtl"?W:g)(e.display.lineDiv,"CodeMirror-rtl")}function Vi(e){Vr(e,function(){Ri(e),gr(e)})}function Ra(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Di(e,t){var a={from:Xi(t.from),to:gt(t),text:Rn(e,t.from,t.to)};return xs(e,a,t.from.line,t.to.line+1),bi(e,function(r){return xs(r,a,t.from.line,t.to.line+1)},!0),a}function _o(e){for(;e.length;){var t=P(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return _o(e.done),P(e.done);if(e.done.length&&!P(e.done).ranges)return P(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),P(e.done)}function Es(e,t,a,r){var v=e.history;v.undone.length=0;var F=+new Date,Z,ee;if((v.lastOp==r||v.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&v.lastModTime>F-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(Z=pl(v,v.lastOp==r)))ee=P(Z.changes),Qt(t.from,t.to)==0&&Qt(t.from,ee.to)==0?ee.to=gt(t):Z.changes.push(Di(e,t));else{var re=P(v.done);for((!re||!re.ranges)&&Qo(e.sel,v.done),Z={changes:[Di(e,t)],generation:v.generation},v.done.push(Z);v.done.length>v.undoDepth;)v.done.shift(),v.done[0].ranges||v.done.shift()}v.done.push(a),v.generation=++v.maxGeneration,v.lastModTime=v.lastSelTime=F,v.lastOp=v.lastSelOp=r,v.lastOrigin=v.lastSelOrigin=t.origin,ee||me(e,"historyAdded")}function ml(e,t,a,r){var v=t.charAt(0);return v=="*"||v=="+"&&a.ranges.length==r.ranges.length&&a.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,a,r){var v=e.history,F=r&&r.origin;a==v.lastSelOp||F&&v.lastSelOrigin==F&&(v.lastModTime==v.lastSelTime&&v.lastOrigin==F||ml(e,F,P(v.done),t))?v.done[v.done.length-1]=t:Qo(t,v.done),v.lastSelTime=+new Date,v.lastSelOrigin=F,v.lastSelOp=a,r&&r.clearRedo!==!1&&_o(v.undone)}function Qo(e,t){var a=P(t);a&&a.ranges&&a.equals(e)||t.push(e)}function xs(e,t,a,r){var v=t["spans_"+e.id],F=0;e.iter(Math.max(e.first,a),Math.min(e.first+e.size,r),function(Z){Z.markedSpans&&((v||(v=t["spans_"+e.id]={}))[F]=Z.markedSpans),++F})}function vl(e){if(!e)return null;for(var t,a=0;a<e.length;++a)e[a].marker.explicitlyCleared?t||(t=e.slice(0,a)):t&&t.push(e[a]);return t?t.length?t:null:e}function yl(e,t){var a=t["spans_"+e.id];if(!a)return null;for(var r=[],v=0;v<t.text.length;++v)r.push(vl(a[v]));return r}function Ts(e,t){var a=yl(e,t),r=Wn(e,t);if(!a)return r;if(!r)return a;for(var v=0;v<a.length;++v){var F=a[v],Z=r[v];if(F&&Z){e:for(var ee=0;ee<Z.length;++ee){for(var re=Z[ee],de=0;de<F.length;++de)if(F[de].marker==re.marker)continue e;F.push(re)}}else Z&&(a[v]=Z)}return a}function bo(e,t,a){for(var r=[],v=0;v<e.length;++v){var F=e[v];if(F.ranges){r.push(a?Ve.prototype.deepCopy.call(F):F);continue}var Z=F.changes,ee=[];r.push({changes:ee});for(var re=0;re<Z.length;++re){var de=Z[re],Ie=void 0;if(ee.push({from:de.from,to:de.to,text:de.text}),t)for(var Ne in de)(Ie=Ne.match(/^spans_(\d+)$/))&&(te(t,Number(Ie[1]))>-1&&(P(ee)[Ne]=de[Ne],delete de[Ne]))}}return r}function ls(e,t,a,r){if(r){var v=e.anchor;if(a){var F=Qt(t,v)<0;F!=Qt(a,v)<0?(v=t,t=a):F!=Qt(t,a)<0&&(t=a)}return new tt(v,t)}else return new tt(a||t,t)}function Zo(e,t,a,r,v){v==null&&(v=e.cm&&(e.cm.display.shift||e.extend)),Ei(e,new Ve([ls(e.sel.primary(),t,a,v)],0),r)}function ws(e,t,a){for(var r=[],v=e.cm&&(e.cm.display.shift||e.extend),F=0;F<e.sel.ranges.length;F++)r[F]=ls(e.sel.ranges[F],t[F],null,v);var Z=rt(e.cm,r,e.sel.primIndex);Ei(e,Z,a)}function us(e,t,a,r){var v=e.sel.ranges.slice(0);v[t]=a,Ei(e,rt(e.cm,v,e.sel.primIndex),r)}function Cs(e,t,a,r){Ei(e,vt(t,a),r)}function _l(e,t,a){var r={ranges:t.ranges,update:function(v){this.ranges=[];for(var F=0;F<v.length;F++)this.ranges[F]=new tt(En(e,v[F].anchor),En(e,v[F].head))},origin:a&&a.origin};return me(e,"beforeSelectionChange",e,r),e.cm&&me(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?rt(e.cm,r.ranges,r.ranges.length-1):t}function Ss(e,t,a){var r=e.history.done,v=P(r);v&&v.ranges?(r[r.length-1]=t,Jo(e,t,a)):Ei(e,t,a)}function Ei(e,t,a){Jo(e,t,a),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,a)}function Jo(e,t,a){(se(e,"beforeSelectionChange")||e.cm&&se(e.cm,"beforeSelectionChange"))&&(t=_l(e,t,a));var r=a&&a.bias||(Qt(t.primary().head,e.sel.primary().head)<0?-1:1);As(e,Rs(e,t,r,!0)),!(a&&a.scroll===!1)&&e.cm&&ra(e.cm)}function As(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,q(e.cm)),Mr(e,"cursorActivity",e)}function Os(e){As(e,Rs(e,e.sel,null,!1))}function Rs(e,t,a,r){for(var v,F=0;F<t.ranges.length;F++){var Z=t.ranges[F],ee=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[F],re=qo(e,Z.anchor,ee&&ee.anchor,a,r),de=qo(e,Z.head,ee&&ee.head,a,r);(v||re!=Z.anchor||de!=Z.head)&&(v||(v=t.ranges.slice(0,F)),v[F]=new tt(re,de))}return v?rt(e.cm,v,t.primIndex):t}function Eo(e,t,a,r,v){var F=wt(e,t.line);if(F.markedSpans)for(var Z=0;Z<F.markedSpans.length;++Z){var ee=F.markedSpans[Z],re=ee.marker,de="selectLeft"in re?!re.selectLeft:re.inclusiveLeft,Ie="selectRight"in re?!re.selectRight:re.inclusiveRight;if((ee.from==null||(de?ee.from<=t.ch:ee.from<t.ch))&&(ee.to==null||(Ie?ee.to>=t.ch:ee.to>t.ch))){if(v&&(me(re,"beforeCursorEnter"),re.explicitlyCleared))if(F.markedSpans){--Z;continue}else break;if(!re.atomic)continue;if(a){var Ne=re.find(r<0?1:-1),Xe=void 0;if((r<0?Ie:de)&&(Ne=Ds(e,Ne,-r,Ne&&Ne.line==t.line?F:null)),Ne&&Ne.line==t.line&&(Xe=Qt(Ne,a))&&(r<0?Xe<0:Xe>0))return Eo(e,Ne,t,r,v)}var ze=re.find(r<0?-1:1);return(r<0?de:Ie)&&(ze=Ds(e,ze,r,ze.line==t.line?F:null)),ze?Eo(e,ze,t,r,v):null}}return t}function qo(e,t,a,r,v){var F=r||1,Z=Eo(e,t,a,F,v)||!v&&Eo(e,t,a,F,!0)||Eo(e,t,a,-F,v)||!v&&Eo(e,t,a,-F,!0);return Z||(e.cantEdit=!0,ct(e.first,0))}function Ds(e,t,a,r){return a<0&&t.ch==0?t.line>e.first?En(e,ct(t.line-1)):null:a>0&&t.ch==(r||wt(e,t.line)).text.length?t.line<e.first+e.size-1?ct(t.line+1,0):null:new ct(t.line,t.ch+a)}function Ls(e){e.setSelection(ct(e.firstLine(),0),ct(e.lastLine()),_e)}function Is(e,t,a){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return a&&(r.update=function(v,F,Z,ee){v&&(r.from=En(e,v)),F&&(r.to=En(e,F)),Z&&(r.text=Z),ee!==void 0&&(r.origin=ee)}),me(e,"beforeChange",e,r),e.cm&&me(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function xo(e,t,a){if(e.cm){if(!e.cm.curOp)return Hr(e.cm,xo)(e,t,a);if(e.cm.state.suppressEdits)return}if((se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"))&&(t=Is(e,t,!0),!t))return;var r=Dt&&!a&&_n(e,t.from,t.to);if(r)for(var v=r.length-1;v>=0;--v)Ps(e,{from:r[v].from,to:r[v].to,text:v?[""]:t.text,origin:t.origin});else Ps(e,t)}function Ps(e,t){if(t.text.length==1&&t.text[0]==""&&Qt(t.from,t.to)==0)return;var a=$t(e,t);Es(e,t,a,e.cm?e.cm.curOp.id:NaN),Uo(e,t,a,Wn(e,t));var r=[];bi(e,function(v,F){!F&&te(r,v.history)==-1&&(Us(v.history,t),r.push(v.history)),Uo(v,t,null,Wn(v,t))})}function es(e,t,a){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!a)return;for(var v=e.history,F,Z=e.sel,ee=t=="undo"?v.done:v.undone,re=t=="undo"?v.undone:v.done,de=0;de<ee.length&&!(F=ee[de],a?F.ranges&&!F.equals(e.sel):!F.ranges);de++);if(de==ee.length)return;for(v.lastOrigin=v.lastSelOrigin=null;;)if(F=ee.pop(),F.ranges){if(Qo(F,re),a&&!F.equals(e.sel)){Ei(e,F,{clearRedo:!1});return}Z=F}else if(r){ee.push(F);return}else break;var Ie=[];Qo(Z,re),re.push({changes:Ie,generation:v.generation}),v.generation=F.generation||++v.maxGeneration;for(var Ne=se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"),Xe=function(dt){var Et=F.changes[dt];if(Et.origin=t,Ne&&!Is(e,Et,!1))return ee.length=0,{};Ie.push(Di(e,Et));var At=dt?$t(e,Et):P(ee);Uo(e,Et,At,Ts(e,Et)),!dt&&e.cm&&e.cm.scrollIntoView({from:Et.from,to:gt(Et)});var Wt=[];bi(e,function(Ot,Gt){!Gt&&te(Wt,Ot.history)==-1&&(Us(Ot.history,Et),Wt.push(Ot.history)),Uo(Ot,Et,null,Ts(Ot,Et))})},ze=F.changes.length-1;ze>=0;--ze){var at=Xe(ze);if(at)return at.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ve(j(e.sel.ranges,function(v){return new tt(ct(v.anchor.line+t,v.anchor.ch),ct(v.head.line+t,v.head.ch))}),e.sel.primIndex),e.cm){gr(e.cm,e.first,e.first-t,t);for(var a=e.cm.display,r=a.viewFrom;r<a.viewTo;r++)ln(e.cm,r,"gutter")}}function Uo(e,t,a,r){if(e.cm&&!e.cm.curOp)return Hr(e.cm,Uo)(e,t,a,r);if(t.to.line<e.first){ks(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var v=t.text.length-1-(e.first-t.from.line);ks(e,v),t={from:ct(e.first,0),to:ct(t.to.line+v,t.to.ch),text:[P(t.text)],origin:t.origin}}var F=e.lastLine();t.to.line>F&&(t={from:t.from,to:ct(F,wt(e,F).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Rn(e,t.from,t.to),a||(a=$t(e,t)),e.cm?bl(e.cm,t,r):oi(e,t,r),Jo(e,a,_e),e.cantEdit&&qo(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,a){var r=e.doc,v=e.display,F=t.from,Z=t.to,ee=!1,re=F.line;e.options.lineWrapping||(re=on(fn(wt(r,F.line))),r.iter(re,Z.line+1,function(ze){if(ze==v.maxLine)return ee=!0,!0})),r.sel.contains(t.from,t.to)>-1&&q(e),oi(r,t,a,Ti(e)),e.options.lineWrapping||(r.iter(re,F.line+t.text.length,function(ze){var at=pr(ze);at>v.maxLineLength&&(v.maxLine=ze,v.maxLineLength=at,v.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),xt(r,F.line),Ca(e,400);var de=t.text.length-(Z.line-F.line)-1;t.full?gr(e):F.line==Z.line&&t.text.length==1&&!di(e.doc,t)?ln(e,F.line,"text"):gr(e,F.line,Z.line+1,de);var Ie=se(e,"changes"),Ne=se(e,"change");if(Ne||Ie){var Xe={from:F,to:Z,text:t.text,removed:t.removed,origin:t.origin};Ne&&Mr(e,"change",e,Xe),Ie&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Xe)}e.display.selForContextMenu=null}function To(e,t,a,r,v){var F;r||(r=a),Qt(r,a)<0&&(F=[r,a],a=F[0],r=F[1]),typeof t=="string"&&(t=e.splitLines(t)),xo(e,{from:a,to:r,text:t,origin:v})}function Ms(e,t,a,r){a<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ns(e,t,a,r){for(var v=0;v<e.length;++v){var F=e[v],Z=!0;if(F.ranges){F.copied||(F=e[v]=F.deepCopy(),F.copied=!0);for(var ee=0;ee<F.ranges.length;ee++)Ms(F.ranges[ee].anchor,t,a,r),Ms(F.ranges[ee].head,t,a,r);continue}for(var re=0;re<F.changes.length;++re){var de=F.changes[re];if(a<de.from.line)de.from=ct(de.from.line+r,de.from.ch),de.to=ct(de.to.line+r,de.to.ch);else if(t<=de.to.line){Z=!1;break}}Z||(e.splice(0,v+1),v=0)}}function Us(e,t){var a=t.from.line,r=t.to.line,v=t.text.length-(r-a)-1;Ns(e.done,a,r,v),Ns(e.undone,a,r,v)}function jo(e,t,a,r){var v=t,F=t;return typeof t=="number"?F=wt(e,ca(e,t)):v=on(t),v==null?null:(r(F,v)&&e.cm&&ln(e.cm,v,a),F)}function Bo(e){this.lines=e,this.parent=null;for(var t=0,a=0;a<e.length;++a)e[a].parent=this,t+=e[a].height;this.height=t}Bo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var a=e,r=e+t;a<r;++a){var v=this.lines[a];this.height-=v.height,Lt(v),Mr(v,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,a){this.height+=a,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,a){for(var r=e+t;e<r;++e)if(a(this.lines[e]))return!0}};function Fo(e){this.children=e;for(var t=0,a=0,r=0;r<e.length;++r){var v=e[r];t+=v.chunkSize(),a+=v.height,v.parent=this}this.size=t,this.height=a,this.parent=null}Fo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var a=0;a<this.children.length;++a){var r=this.children[a],v=r.chunkSize();if(e<v){var F=Math.min(t,v-e),Z=r.height;if(r.removeInner(e,F),this.height-=Z-r.height,v==F&&(this.children.splice(a--,1),r.parent=null),(t-=F)==0)break;e=0}else e-=v}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Bo))){var ee=[];this.collapse(ee),this.children=[new Bo(ee)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,a){this.size+=t.length,this.height+=a;for(var r=0;r<this.children.length;++r){var v=this.children[r],F=v.chunkSize();if(e<=F){if(v.insertInner(e,t,a),v.lines&&v.lines.length>50){for(var Z=v.lines.length%25+25,ee=Z;ee<v.lines.length;){var re=new Bo(v.lines.slice(ee,ee+=25));v.height-=re.height,this.children.splice(++r,0,re),re.parent=this}v.lines=v.lines.slice(0,Z),this.maybeSpill()}break}e-=F}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),a=new Fo(t);if(e.parent){e.size-=a.size,e.height-=a.height;var v=te(e.parent.children,e);e.parent.children.splice(v+1,0,a)}else{var r=new Fo(e.children);r.parent=e,e.children=[r,a],e=r}a.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,a){for(var r=0;r<this.children.length;++r){var v=this.children[r],F=v.chunkSize();if(e<F){var Z=Math.min(t,F-e);if(v.iterN(e,Z,a))return!0;if((t-=Z)==0)break;e=0}else e-=F}}};var Wo=function(e,t,a){if(a)for(var r in a)a.hasOwnProperty(r)&&(this[r]=a[r]);this.doc=e,this.node=t};Wo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,a=this.line,r=on(a);if(r==null||!t)return;for(var v=0;v<t.length;++v)t[v]==this&&t.splice(v--,1);t.length||(a.widgets=null);var F=pa(this);cn(a,Math.max(0,a.height-F)),e&&(Vr(e,function(){js(e,a,-F),ln(e,r,"widget")}),Mr(e,"lineWidgetCleared",e,this,r))},Wo.prototype.changed=function(){var e=this,t=this.height,a=this.doc.cm,r=this.line;this.height=null;var v=pa(this)-t;if(!v)return;kr(this.doc,r)||cn(r,r.height+v),a&&Vr(a,function(){a.curOp.forceUpdate=!0,js(a,r,v),Mr(a,"lineWidgetChanged",a,e,on(r))})},ue(Wo);function js(e,t,a){St(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qa(e,a)}function El(e,t,a,r){var v=new Wo(e,a,r),F=e.cm;return F&&v.noHScroll&&(F.display.alignWidgets=!0),jo(e,t,"widget",function(Z){var ee=Z.widgets||(Z.widgets=[]);if(v.insertAt==null?ee.push(v):ee.splice(Math.min(ee.length-1,Math.max(0,v.insertAt)),0,v),v.line=Z,F&&!kr(e,Z)){var re=St(Z)<e.scrollTop;cn(Z,Z.height+pa(v)),re&&qa(F,v.height),F.curOp.forceUpdate=!0}return!0}),F&&Mr(F,"lineWidgetAdded",F,v,typeof t=="number"?t:on(t)),v}var Bs=0,za=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Bs};za.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gi(e),se(this,"clear")){var a=this.find();a&&Mr(this,"clear",a.from,a.to)}for(var r=null,v=null,F=0;F<this.lines.length;++F){var Z=this.lines[F],ee=xn(Z.markedSpans,this);e&&!this.collapsed?ln(e,on(Z),"text"):e&&(ee.to!=null&&(v=on(Z)),ee.from!=null&&(r=on(Z))),Z.markedSpans=Fn(Z.markedSpans,ee),ee.from==null&&this.collapsed&&!kr(this.doc,Z)&&e&&cn(Z,Nr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var re=0;re<this.lines.length;++re){var de=fn(this.lines[re]),Ie=pr(de);Ie>e.display.maxLineLength&&(e.display.maxLine=de,e.display.maxLineLength=Ie,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&gr(e,r,v+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Mr(e,"markerCleared",e,this,r,v),t&&Zi(e),this.parent&&this.parent.clear()},za.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var a,r,v=0;v<this.lines.length;++v){var F=this.lines[v],Z=xn(F.markedSpans,this);if(Z.from!=null&&(a=ct(t?F:on(F),Z.from),e==-1))return a;if(Z.to!=null&&(r=ct(t?F:on(F),Z.to),e==1))return r}return a&&{from:a,to:r}},za.prototype.changed=function(){var e=this,t=this.find(-1,!0),a=this,r=this.doc.cm;if(!t||!r)return;Vr(r,function(){var v=t.line,F=on(t.line),Z=Fe(r,F);if(Z&&(Kn(Z),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!kr(a.doc,v)&&a.height!=null){var ee=a.height;a.height=null;var re=pa(a)-ee;re&&cn(v,v.height+re)}Mr(r,"markerChanged",r,e)})},za.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||te(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},za.prototype.detachLine=function(e){if(this.lines.splice(te(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ue(za);function wo(e,t,a,r,v){if(r&&r.shared)return xl(e,t,a,r,v);if(e.cm&&!e.cm.curOp)return Hr(e.cm,wo)(e,t,a,r,v);var F=new za(e,v),Z=Qt(t,a);if(r&&y(r,F,!1),Z>0||Z==0&&F.clearWhenEmpty!==!1)return F;if(F.replacedWith&&(F.collapsed=!0,F.widgetNode=C("span",[F.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||F.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(F.widgetNode.insertLeft=!0)),F.collapsed){if(Yt(e,t.line,t,a,F)||t.line!=a.line&&Yt(e,a.line,t,a,F))throw new Error("Inserting collapsed marker partially overlapping an existing one");Tn()}F.addToHistory&&Es(e,{from:t,to:a,origin:"markText"},e.sel,NaN);var ee=t.line,re=e.cm,de;if(e.iter(ee,a.line+1,function(Ne){re&&F.collapsed&&!re.options.lineWrapping&&fn(Ne)==re.display.maxLine&&(de=!0),F.collapsed&&ee!=t.line&&cn(Ne,0),tn(Ne,new en(F,ee==t.line?t.ch:null,ee==a.line?a.ch:null)),++ee}),F.collapsed&&e.iter(t.line,a.line+1,function(Ne){kr(e,Ne)&&cn(Ne,0)}),F.clearOnEnter&&Ye(F,"beforeCursorEnter",function(){return F.clear()}),F.readOnly&&(yn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),F.collapsed&&(F.id=++Bs,F.atomic=!0),re){if(de&&(re.curOp.updateMaxLine=!0),F.collapsed)gr(re,t.line,a.line+1);else if(F.className||F.startStyle||F.endStyle||F.css||F.attributes||F.title)for(var Ie=t.line;Ie<=a.line;Ie++)ln(re,Ie,"text");F.atomic&&Os(re.doc),Mr(re,"markerAdded",re,F)}return F}var Ho=function(e,t){this.markers=e,this.primary=t;for(var a=0;a<e.length;++a)e[a].parent=this};Ho.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Mr(this,"clear")},Ho.prototype.find=function(e,t){return this.primary.find(e,t)},ue(Ho);function xl(e,t,a,r,v){r=y(r),r.shared=!1;var F=[wo(e,t,a,r,v)],Z=F[0],ee=r.widgetNode;return bi(e,function(re){ee&&(r.widgetNode=ee.cloneNode(!0)),F.push(wo(re,En(re,t),En(re,a),r,v));for(var de=0;de<re.linked.length;++de)if(re.linked[de].isParent)return;Z=P(F)}),new Ho(F,Z)}function Fs(e){return e.findMarks(ct(e.first,0),e.clipPos(ct(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var a=0;a<t.length;a++){var r=t[a],v=r.find(),F=e.clipPos(v.from),Z=e.clipPos(v.to);if(Qt(F,Z)){var ee=wo(e,F,Z,r.primary,r.primary.type);r.markers.push(ee),ee.parent=r}}}function wl(e){for(var t=function(r){var v=e[r],F=[v.primary.doc];bi(v.primary.doc,function(re){return F.push(re)});for(var Z=0;Z<v.markers.length;Z++){var ee=v.markers[Z];te(F,ee.doc)==-1&&(ee.parent=null,v.markers.splice(Z--,1))}},a=0;a<e.length;a++)t(a)}var Cl=0,Li=function(e,t,a,r,v){if(!(this instanceof Li))return new Li(e,t,a,r,v);a==null&&(a=0),Fo.call(this,[new Bo([new Hn("",null)])]),this.first=a,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=a;var F=ct(a,0);this.sel=vt(F),this.history=new Ra(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction=v=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),oi(this,{from:F,to:F,text:e}),Ei(this,vt(F),_e)};Li.prototype=X(Fo.prototype,{constructor:Li,iter:function(e,t,a){a?this.iterN(e-this.first,t-e,a):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var a=0,r=0;r<t.length;++r)a+=t[r].height;this.insertInner(e-this.first,t,a)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=jn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Kr(function(e){var t=ct(this.first,0),a=this.first+this.size-1;xo(this,{from:t,to:ct(a,wt(this,a).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&va(this.cm,0,0),Ei(this,vt(t),_e)}),replaceRange:function(e,t,a,r){t=En(this,t),a=a?En(this,a):t,To(this,e,t,a,r)},getRange:function(e,t,a){var r=Rn(this,En(this,e),En(this,t));return a===!1?r:r.join(a||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ei(this,e))return wt(this,e)},getLineNumber:function(e){return on(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=wt(this,e)),fn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return En(this,e)},getCursor:function(e){var t=this.sel.primary(),a;return e==null||e=="head"?a=t.head:e=="anchor"?a=t.anchor:e=="end"||e=="to"||e===!1?a=t.to():a=t.from(),a},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Kr(function(e,t,a){Cs(this,En(this,typeof e=="number"?ct(e,t||0):e),null,a)}),setSelection:Kr(function(e,t,a){Cs(this,En(this,e),En(this,t||e),a)}),extendSelection:Kr(function(e,t,a){Zo(this,En(this,e),t&&En(this,t),a)}),extendSelections:Kr(function(e,t){ws(this,_t(this,e),t)}),extendSelectionsBy:Kr(function(e,t){var a=j(this.sel.ranges,e);ws(this,_t(this,a),t)}),setSelections:Kr(function(e,t,a){if(!e.length)return;for(var r=[],v=0;v<e.length;v++)r[v]=new tt(En(this,e[v].anchor),En(this,e[v].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ei(this,rt(this.cm,r,t),a)}),addSelection:Kr(function(e,t,a){var r=this.sel.ranges.slice(0);r.push(new tt(En(this,e),En(this,t||e))),Ei(this,rt(this.cm,r,r.length-1),a)}),getSelection:function(e){for(var t=this.sel.ranges,a,r=0;r<t.length;r++){var v=Rn(this,t[r].from(),t[r].to());a=a?a.concat(v):v}return e===!1?a:a.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],a=this.sel.ranges,r=0;r<a.length;r++){var v=Rn(this,a[r].from(),a[r].to());e!==!1&&(v=v.join(e||this.lineSeparator())),t[r]=v}return t},replaceSelection:function(e,t,a){for(var r=[],v=0;v<this.sel.ranges.length;v++)r[v]=e;this.replaceSelections(r,t,a||"+input")},replaceSelections:Kr(function(e,t,a){for(var r=[],v=this.sel,F=0;F<v.ranges.length;F++){var Z=v.ranges[F];r[F]={from:Z.from(),to:Z.to(),text:this.splitLines(e[F]),origin:a}}for(var ee=t&&t!="end"&&_i(this,r,t),re=r.length-1;re>=0;re--)xo(this,r[re]);ee?Ss(this,ee):this.cm&&ra(this.cm)}),undo:Kr(function(){es(this,"undo")}),redo:Kr(function(){es(this,"redo")}),undoSelection:Kr(function(){es(this,"undo",!0)}),redoSelection:Kr(function(){es(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,a=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var v=0;v<e.undone.length;v++)e.undone[v].ranges||++a;return{undo:t,redo:a}},clearHistory:function(){var e=this;this.history=new Ra(this.history.maxGeneration),bi(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:bo(this.history.done),undone:bo(this.history.undone)}},setHistory:function(e){var t=this.history=new Ra(this.history.maxGeneration);t.done=bo(e.done.slice(0),null,!0),t.undone=bo(e.undone.slice(0),null,!0)},setGutterMarker:Kr(function(e,t,a){return jo(this,e,"gutter",function(r){var v=r.gutterMarkers||(r.gutterMarkers={});return v[t]=a,!a&&pe(v)&&(r.gutterMarkers=null),!0})}),clearGutter:Kr(function(e){var t=this;this.iter(function(a){a.gutterMarkers&&a.gutterMarkers[e]&&jo(t,a,"gutter",function(){return a.gutterMarkers[e]=null,pe(a.gutterMarkers)&&(a.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!ei(this,e))return null;if(t=e,e=wt(this,e),!e)return null}else if(t=on(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Kr(function(e,t,a){return jo(this,e,t=="gutter"?"gutter":"class",function(r){var v=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[v])r[v]=a;else{if(O(a).test(r[v]))return!1;r[v]+=" "+a}return!0})}),removeLineClass:Kr(function(e,t,a){return jo(this,e,t=="gutter"?"gutter":"class",function(r){var v=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",F=r[v];if(F)if(a==null)r[v]=null;else{var Z=F.match(O(a));if(!Z)return!1;var ee=Z.index+Z[0].length;r[v]=F.slice(0,Z.index)+(!Z.index||ee==F.length?"":" ")+F.slice(ee)||null}else return!1;return!0})}),addLineWidget:Kr(function(e,t,a){return El(this,e,t,a)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,a){return wo(this,En(this,e),En(this,t),a,a&&a.type||"range")},setBookmark:function(e,t){var a={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=En(this,e),wo(this,e,e,a,"bookmark")},findMarksAt:function(e){e=En(this,e);var t=[],a=wt(this,e.line).markedSpans;if(a)for(var r=0;r<a.length;++r){var v=a[r];(v.from==null||v.from<=e.ch)&&(v.to==null||v.to>=e.ch)&&t.push(v.marker.parent||v.marker)}return t},findMarks:function(e,t,a){e=En(this,e),t=En(this,t);var r=[],v=e.line;return this.iter(e.line,t.line+1,function(F){var Z=F.markedSpans;if(Z)for(var ee=0;ee<Z.length;ee++){var re=Z[ee];!(re.to!=null&&v==e.line&&e.ch>=re.to||re.from==null&&v!=e.line||re.from!=null&&v==t.line&&re.from>=t.ch)&&(!a||a(re.marker))&&r.push(re.marker.parent||re.marker)}++v}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var a=t.markedSpans;if(a)for(var r=0;r<a.length;++r)a[r].from!=null&&e.push(a[r].marker)}),e},posFromIndex:function(e){var t,a=this.first,r=this.lineSeparator().length;return this.iter(function(v){var F=v.text.length+r;if(F>e)return t=e,!0;e-=F,++a}),En(this,ct(a,t))},indexFromPos:function(e){e=En(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var a=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+a}),t},copy:function(e){var t=new Li(jn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,a=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<a&&(a=e.to);var r=new Li(jn(this,t,a),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,Fs(this)),r},unlinkDoc:function(e){if(e instanceof jr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var a=this.linked[t];if(a.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(Fs(this));break}if(e.history==this.history){var r=[e.id];bi(e,function(v){return r.push(v.id)},!0),e.history=new Ra(null),e.history.done=bo(this.history.done,r),e.history.undone=bo(this.history.undone,r)}},iterLinkedDocs:function(e){bi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):zt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Kr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Vi(this.cm)})}),Li.prototype.eachLine=Li.prototype.iter;var Ws=0;function Sl(e){var t=this;if(Hs(t),ne(t,e)||Yi(t.display,e))return;oe(e),G&&(Ws=+new Date);var a=Wr(t,e,!0),r=e.dataTransfer.files;if(!a||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var v=r.length,F=Array(v),Z=0,ee=function(){++Z==v&&Hr(t,function(){a=En(t.doc,a);var ze={from:a,to:a,text:t.doc.splitLines(F.filter(function(at){return at!=null}).join(t.doc.lineSeparator())),origin:"paste"};xo(t.doc,ze),Ss(t.doc,vt(En(t.doc,a),En(t.doc,gt(ze))))})()},re=function(ze,at){if(t.options.allowDropFileTypes&&te(t.options.allowDropFileTypes,ze.type)==-1){ee();return}var dt=new FileReader;dt.onerror=function(){return ee()},dt.onload=function(){var Et=dt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Et)){ee();return}F[at]=Et,ee()},dt.readAsText(ze)},de=0;de<r.length;de++)re(r[de],de);else{if(t.state.draggingText&&t.doc.sel.contains(a)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ie=e.dataTransfer.getData("Text");if(Ie){var Ne;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ne=t.listSelections()),Jo(t.doc,vt(a,a)),Ne)for(var Xe=0;Xe<Ne.length;++Xe)To(t.doc,"",Ne[Xe].anchor,Ne[Xe].head,"drag");t.replaceSelection(Ie,"around","paste"),t.display.input.focus()}}catch(ze){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-Ws<100)){Se(t);return}if(ne(e,t)||Yi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!b){var a=c("img",null,null,"position: fixed; left: 0; top: 0;");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(a.width=a.height=1,e.display.wrapper.appendChild(a),a._top=a.offsetTop),t.dataTransfer.setDragImage(a,0,0),f&&a.parentNode.removeChild(a)}}function Ol(e,t){var a=Wr(e,t);if(!a)return;var r=document.createDocumentFragment();Ki(e,a,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),d(e.display.dragCursor,r)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ks(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),a=[],r=0;r<t.length;r++){var v=t[r].CodeMirror;v&&a.push(v)}a.length&&a[0].operation(function(){for(var F=0;F<a.length;F++)e(a[F])})}var Gs=!1;function Rl(){if(Gs)return;Dl(),Gs=!0}function Dl(){var e;Ye(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ks(Ll)},100))}),Ye(window,"blur",function(){return Ks(ga)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Va={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Ko=0;Ko<10;Ko++)Va[Ko+48]=Va[Ko+96]=String(Ko);for(var ts=65;ts<=90;ts++)Va[ts]=String.fromCharCode(ts);for(var Go=1;Go<=12;Go++)Va[Go+111]=Va[Go+63235]="F"+Go;var Da={};Da.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Da.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Da.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Da.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Da.default=s?Da.macDefault:Da.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var a,r,v,F,Z=0;Z<t.length-1;Z++){var ee=t[Z];if(/^(cmd|meta|m)$/i.test(ee))F=!0;else if(/^a(lt)?$/i.test(ee))a=!0;else if(/^(c|ctrl|control)$/i.test(ee))r=!0;else if(/^s(hift)?$/i.test(ee))v=!0;else throw new Error("Unrecognized modifier name: "+ee)}return a&&(e="Alt-"+e),r&&(e="Ctrl-"+e),F&&(e="Cmd-"+e),v&&(e="Shift-"+e),e}function Pl(e){var t={};for(var a in e)if(e.hasOwnProperty(a)){var r=e[a];if(/^(name|fallthrough|(de|at)tach)$/.test(a))continue;if(r=="..."){delete e[a];continue}for(var v=j(a.split(" "),Il),F=0;F<v.length;F++){var Z=void 0,ee=void 0;F==v.length-1?(ee=v.join(" "),Z=r):(ee=v.slice(0,F+1).join(" "),Z="...");var re=t[ee];if(!re)t[ee]=Z;else if(re!=Z)throw new Error("Inconsistent bindings for "+ee)}delete e[a]}for(var de in t)e[de]=t[de];return e}function Co(e,t,a,r){t=ns(t);var v=t.call?t.call(e,r):t[e];if(v===!1)return"nothing";if(v==="...")return"multi";if(v!=null&&a(v))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Co(e,t.fallthrough,a,r);for(var F=0;F<t.fallthrough.length;F++){var Z=Co(e,t.fallthrough[F],a,r);if(Z)return Z}}}function zs(e){var t=typeof e=="string"?e:Va[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Vs(e,t,a){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!a&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Xs(e,t){if(f&&e.keyCode==34&&e.char)return!1;var a=Va[e.keyCode];return a==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(a=e.code),Vs(a,e,t))}function ns(e){return typeof e=="string"?Da[e]:e}function So(e,t){for(var a=e.doc.sel.ranges,r=[],v=0;v<a.length;v++){for(var F=t(a[v]);r.length&&Qt(F.from,P(r).to)<=0;){var Z=r.pop();if(Qt(Z.from,F.from)<0){F.from=Z.from;break}}r.push(F)}Vr(e,function(){for(var ee=r.length-1;ee>=0;ee--)To(e.doc,"",r[ee].from,r[ee].to,"+delete");ra(e)})}function cs(e,t,a){var r=Ue(e.text,t+a,a);return r<0||r>e.text.length?null:r}function ds(e,t,a){var r=cs(e,t.ch,a);return r==null?null:new ct(t.line,r,a<0?"after":"before")}function hs(e,t,a,r,v){if(e){t.doc.direction=="rtl"&&(v=-v);var F=lt(a,t.doc.direction);if(F){var Z=v<0?P(F):F[0],ee=v<0==(Z.level==1),re=ee?"after":"before",de;if(Z.level>0||t.doc.direction=="rtl"){var Ie=Be(t,a);de=v<0?a.text.length-1:0;var Ne=Ge(t,Ie,de).top;de=Qe(function(Xe){return Ge(t,Ie,Xe).top==Ne},v<0==(Z.level==1)?Z.from:Z.to-1,de),re=="before"&&(de=cs(a,de,1))}else de=v<0?Z.to:Z.from;return new ct(r,de,re)}}return new ct(r,v<0?a.text.length:0,v<0?"before":"after")}function kl(e,t,a,r){var v=lt(t,e.doc.direction);if(!v)return ds(t,a,r);a.ch>=t.text.length?(a.ch=t.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var F=qe(v,a.ch,a.sticky),Z=v[F];if(e.doc.direction=="ltr"&&Z.level%2==0&&(r>0?Z.to>a.ch:Z.from<a.ch))return ds(t,a,r);var ee=function(At,Wt){return cs(t,At instanceof ct?At.ch:At,Wt)},re,de=function(At){return e.options.lineWrapping?(re=re||Be(e,t),Kt(e,t,re,At)):{begin:0,end:t.text.length}},Ie=de(a.sticky=="before"?ee(a,-1):a.ch);if(e.doc.direction=="rtl"||Z.level==1){var Ne=Z.level==1==r<0,Xe=ee(a,Ne?1:-1);if(Xe!=null&&(Ne?Xe<=Z.to&&Xe<=Ie.end:Xe>=Z.from&&Xe>=Ie.begin)){var ze=Ne?"before":"after";return new ct(a.line,Xe,ze)}}var at=function(At,Wt,Ot){for(var Gt=function(Dr,hi){return hi?new ct(a.line,ee(Dr,1),"before"):new ct(a.line,Dr,"after")};At>=0&&At<v.length;At+=Wt){var vn=v[At],rn=Wt>0==(vn.level!=1),Jn=rn?Ot.begin:ee(Ot.end,-1);if(vn.from<=Jn&&Jn<vn.to)return Gt(Jn,rn);if(Jn=rn?vn.from:ee(vn.to,-1),Ot.begin<=Jn&&Jn<Ot.end)return Gt(Jn,rn)}},dt=at(F+r,r,Ie);if(dt)return dt;var Et=r>0?Ie.end:ee(Ie.begin,-1);return Et!=null&&!(r>0&&Et==t.text.length)&&(dt=at(r>0?0:v.length-1,r,de(Et)),dt)?dt:null}var zo={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),_e)},killLine:function(e){return So(e,function(t){if(t.empty()){var a=wt(e.doc,t.head.line).text.length;return t.head.ch==a&&t.head.line<e.lastLine()?{from:t.head,to:ct(t.head.line+1,0)}:{from:t.head,to:ct(t.head.line,a)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return So(e,function(t){return{from:ct(t.from().line,0),to:En(e.doc,ct(t.to().line+1,0))}})},delLineLeft:function(e){return So(e,function(t){return{from:ct(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return So(e,function(t){var a=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:a},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return So(e,function(t){var a=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ct(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ct(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return $s(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:a},"div")},ve)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:a},"div")},ve)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var a=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:a},"div");return r.ch<e.getLine(r.line).search(/\S/)?$s(e,t.head):r},ve)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],a=e.listSelections(),r=e.options.tabSize,v=0;v<a.length;v++){var F=a[v].from(),Z=H(e.getLine(F.line),F.ch,r);t.push(V(r-Z%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Vr(e,function(){for(var t=e.listSelections(),a=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var v=t[r].head,F=wt(e.doc,v.line).text;if(F){if(v.ch==F.length&&(v=new ct(v.line,v.ch-1)),v.ch>0)v=new ct(v.line,v.ch+1),e.replaceRange(F.charAt(v.ch-1)+F.charAt(v.ch-2),ct(v.line,v.ch-2),v,"+transpose");else if(v.line>e.doc.first){var Z=wt(e.doc,v.line-1).text;Z&&(v=new ct(v.line,1),e.replaceRange(F.charAt(0)+e.doc.lineSeparator()+Z.charAt(Z.length-1),ct(v.line-1,Z.length-1),v,"+transpose"))}}a.push(new tt(v,v))}e.setSelections(a)})},newlineAndIndent:function(e){return Vr(e,function(){for(var t=e.listSelections(),a=t.length-1;a>=0;a--)e.replaceRange(e.doc.lineSeparator(),t[a].anchor,t[a].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);ra(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var a=wt(e.doc,t),r=fn(a);return r!=a&&(t=on(r)),hs(!0,e,r,t,1)}function Ml(e,t){var a=wt(e.doc,t),r=fr(a);return r!=a&&(t=on(r)),hs(!0,e,a,t,-1)}function $s(e,t){var a=Ys(e,t.line),r=wt(e.doc,a.line),v=lt(r,e.doc.direction);if(!v||v[0].level==0){var F=Math.max(a.ch,r.text.search(/\S/)),Z=t.line==a.line&&t.ch<=F&&t.ch;return ct(a.line,Z?0:F,a.sticky)}return a}function rs(e,t,a){if(typeof t=="string"&&(t=zo[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,v=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a&&(e.display.shift=!1),v=t(e)!=Te}finally{e.display.shift=r,e.state.suppressEdits=!1}return v}function Nl(e,t,a){for(var r=0;r<e.state.keyMaps.length;r++){var v=Co(t,e.state.keyMaps[r],a,e);if(v)return v}return e.options.extraKeys&&Co(t,e.options.extraKeys,a,e)||Co(t,e.options.keyMap,a,e)}var Ul=new Q;function Vo(e,t,a,r){var v=e.state.keySeq;if(v){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==v&&(e.state.keySeq=null,e.display.input.reset())}),Qs(e,v+" "+t,a,r))return!0}return Qs(e,t,a,r)}function Qs(e,t,a,r){var v=Nl(e,t,r);return v=="multi"&&(e.state.keySeq=t),v=="handled"&&Mr(e,"keyHandled",e,t,a),(v=="handled"||v=="multi")&&(oe(a),Pr(e)),!!v}function Zs(e,t){var a=Xs(t,!0);return a?t.shiftKey&&!e.state.keySeq?Vo(e,"Shift-"+a,t,function(r){return rs(e,r,!0)})||Vo(e,a,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return rs(e,r)}):Vo(e,a,t,function(r){return rs(e,r)}):!1}function jl(e,t,a){return Vo(e,"'"+a+"'",t,function(r){return rs(e,r,!0)})}var fs=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=B(),ne(t,e))return;G&&K<11&&e.keyCode==27&&(e.returnValue=!1);var a=e.keyCode;t.display.shift=a==16||e.shiftKey;var r=Zs(t,e);f&&(fs=r?a:null,!r&&a==88&&!Qn&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!s&&!r&&a==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;W(t,"CodeMirror-crosshair");function a(r){(r.keyCode==18||!r.altKey)&&(g(t,"CodeMirror-crosshair"),bt(document,"keyup",a),bt(document,"mouseover",a))}Ye(document,"keyup",a),Ye(document,"mouseover",a)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),ne(this,e)}function el(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Yi(t.display,e)||ne(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var a=e.keyCode,r=e.charCode;if(f&&a==fs){fs=null,oe(e);return}if(f&&(!e.which||e.which<10)&&Zs(t,e))return;var v=String.fromCharCode(r==null?a:r);if(v=="\b")return;if(jl(t,e,v))return;t.display.input.onKeyPress(e)}var Fl=400,ps=function(e,t,a){this.time=e,this.pos=t,this.button=a};ps.prototype.compare=function(e,t,a){return this.time+Fl>e&&Qt(t,this.pos)==0&&a==this.button};var Xo,Yo;function Wl(e,t){var a=+new Date;return Yo&&Yo.compare(a,e,t)?(Xo=Yo=null,"triple"):Xo&&Xo.compare(a,e,t)?(Yo=new ps(a,e,t),Xo=null,"double"):(Xo=new ps(a,e,t),Yo=null,"single")}function tl(e){var t=this,a=t.display;if(ne(t,e)||a.activeTouch&&a.input.supportsTouch())return;if(a.input.ensurePolled(),a.shift=e.shiftKey,Yi(a,e)){n||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(ms(t,e))return;var r=Wr(t,e),v=We(e),F=r?Wl(r,v):"single";if(window.focus(),v==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,v,r,F,e))return;v==1?r?Gl(t,r,F,e):Pe(e)==a.scroller&&oe(e):v==2?(r&&Zo(t.doc,r),setTimeout(function(){return a.input.focus()},20)):v==3&&(R?t.display.input.onContextMenu(e):Za(t))}function Hl(e,t,a,r,v){var F="Click";return r=="double"?F="Double"+F:r=="triple"&&(F="Triple"+F),F=(t==1?"Left":t==2?"Middle":"Right")+F,Vo(e,Vs(F,v),v,function(Z){if(typeof Z=="string"&&(Z=zo[Z]),!Z)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=Z(e,a)!=Te}finally{e.state.suppressEdits=!1}return ee})}function Kl(e,t,a){var r=e.getOption("configureMouse"),v=r?r(e,t,a):{};if(v.unit==null){var F=i?a.shiftKey&&a.metaKey:a.altKey;v.unit=F?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(v.extend==null||e.doc.extend)&&(v.extend=e.doc.extend||a.shiftKey),v.addNew==null&&(v.addNew=s?a.metaKey:a.ctrlKey),v.moveOnDrag==null&&(v.moveOnDrag=!(s?a.altKey:a.ctrlKey)),v}function Gl(e,t,a,r){G?setTimeout(m(Na,e),0):e.curOp.focus=B();var v=Kl(e,a,r),F=e.doc.sel,Z;e.options.dragDrop&&et&&!e.isReadOnly()&&a=="single"&&(Z=F.contains(t))>-1&&(Qt((Z=F.ranges[Z]).from(),t)<0||t.xRel>0)&&(Qt(Z.to(),t)>0||t.xRel<0)?zl(e,r,t,v):Vl(e,r,t,v)}function zl(e,t,a,r){var v=e.display,F=!1,Z=Hr(e,function(de){n&&(v.scroller.draggable=!1),e.state.draggingText=!1,bt(v.wrapper.ownerDocument,"mouseup",Z),bt(v.wrapper.ownerDocument,"mousemove",ee),bt(v.scroller,"dragstart",re),bt(v.scroller,"drop",Z),F||(oe(de),r.addNew||Zo(e.doc,a,null,null,r.extend),n&&!b||G&&K==9?setTimeout(function(){v.wrapper.ownerDocument.body.focus({preventScroll:!0}),v.input.focus()},20):v.input.focus())}),ee=function(de){F=F||Math.abs(t.clientX-de.clientX)+Math.abs(t.clientY-de.clientY)>=10},re=function(){return F=!0};n&&(v.scroller.draggable=!0),e.state.draggingText=Z,Z.copy=!r.moveOnDrag,v.scroller.dragDrop&&v.scroller.dragDrop(),Ye(v.wrapper.ownerDocument,"mouseup",Z),Ye(v.wrapper.ownerDocument,"mousemove",ee),Ye(v.scroller,"dragstart",re),Ye(v.scroller,"drop",Z),Za(e),setTimeout(function(){return v.input.focus()},20)}function nl(e,t,a){if(a=="char")return new tt(t,t);if(a=="word")return e.findWordAt(t);if(a=="line")return new tt(ct(t.line,0),En(e.doc,ct(t.line+1,0)));var r=a(e,t);return new tt(r.from,r.to)}function Vl(e,t,a,r){var v=e.display,F=e.doc;oe(t);var Z,ee,re=F.sel,de=re.ranges;if(r.addNew&&!r.extend?(ee=F.sel.contains(a),ee>-1?Z=de[ee]:Z=new tt(a,a)):(Z=F.sel.primary(),ee=F.sel.primIndex),r.unit=="rectangle")r.addNew||(Z=new tt(a,a)),a=Wr(e,t,!0,!0),ee=-1;else{var Ie=nl(e,a,r.unit);r.extend?Z=ls(Z,Ie.anchor,Ie.head,r.extend):Z=Ie}r.addNew?ee==-1?(ee=de.length,Ei(F,rt(e,de.concat([Z]),ee),{scroll:!1,origin:"*mouse"})):de.length>1&&de[ee].empty()&&r.unit=="char"&&!r.extend?(Ei(F,rt(e,de.slice(0,ee).concat(de.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),re=F.sel):us(F,ee,Z,ge):(ee=0,Ei(F,new Ve([Z],0),ge),re=F.sel);var Ne=a;function Xe(Ot){if(Qt(Ne,Ot)==0)return;if(Ne=Ot,r.unit=="rectangle"){for(var Gt=[],vn=e.options.tabSize,rn=H(wt(F,a.line).text,a.ch,vn),Jn=H(wt(F,Ot.line).text,Ot.ch,vn),Dr=Math.min(rn,Jn),hi=Math.max(rn,Jn),Gr=Math.min(a.line,Ot.line),Ui=Math.min(e.lastLine(),Math.max(a.line,Ot.line));Gr<=Ui;Gr++){var Ii=wt(F,Gr).text,ni=Oe(Ii,Dr,vn);Dr==hi?Gt.push(new tt(ct(Gr,ni),ct(Gr,ni))):Ii.length>ni&&Gt.push(new tt(ct(Gr,ni),ct(Gr,Oe(Ii,hi,vn))))}Gt.length||Gt.push(new tt(a,a)),Ei(F,rt(e,re.ranges.slice(0,ee).concat(Gt),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ot)}else{var Pi=Z,vi=nl(e,Ot,r.unit),si=Pi.anchor,ri;Qt(vi.anchor,si)>0?(ri=vi.head,si=Bi(Pi.from(),vi.anchor)):(ri=vi.anchor,si=ua(Pi.to(),vi.head));var Xr=re.ranges.slice(0);Xr[ee]=Xl(e,new tt(En(F,si),ri)),Ei(F,rt(e,Xr,ee),ge)}}var ze=v.wrapper.getBoundingClientRect(),at=0;function dt(Ot){var Gt=++at,vn=Wr(e,Ot,!0,r.unit=="rectangle");if(!vn)return;if(Qt(vn,Ne)!=0){e.curOp.focus=B(),Xe(vn);var rn=Ua(v,F);(vn.line>=rn.to||vn.line<rn.from)&&setTimeout(Hr(e,function(){at==Gt&&dt(Ot)}),150)}else{var Jn=Ot.clientY<ze.top?-20:Ot.clientY>ze.bottom?20:0;Jn&&setTimeout(Hr(e,function(){if(at!=Gt)return;v.scroller.scrollTop+=Jn,dt(Ot)}),50)}}function Et(Ot){e.state.selectingText=!1,at=Infinity,Ot&&(oe(Ot),v.input.focus()),bt(v.wrapper.ownerDocument,"mousemove",At),bt(v.wrapper.ownerDocument,"mouseup",Wt),F.history.lastSelOrigin=null}var At=Hr(e,function(Ot){Ot.buttons===0||!We(Ot)?Et(Ot):dt(Ot)}),Wt=Hr(e,Et);e.state.selectingText=Wt,Ye(v.wrapper.ownerDocument,"mousemove",At),Ye(v.wrapper.ownerDocument,"mouseup",Wt)}function Xl(e,t){var a=t.anchor,r=t.head,v=wt(e.doc,a.line);if(Qt(a,r)==0&&a.sticky==r.sticky)return t;var F=lt(v);if(!F)return t;var Z=qe(F,a.ch,a.sticky),ee=F[Z];if(ee.from!=a.ch&&ee.to!=a.ch)return t;var re=Z+(ee.from==a.ch==(ee.level!=1)?0:1);if(re==0||re==F.length)return t;var de;if(r.line!=a.line)de=(r.line-a.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ie=qe(F,r.ch,r.sticky),Ne=Ie-Z||(r.ch-a.ch)*(ee.level==1?-1:1);Ie==re-1||Ie==re?de=Ne<0:de=Ne>0}var Xe=F[re+(de?-1:0)],ze=de==(Xe.level==1),at=ze?Xe.from:Xe.to,dt=ze?"after":"before";return a.ch==at&&a.sticky==dt?t:new tt(new ct(a.line,at,dt),r)}function rl(e,t,a,r){var v,F;if(t.touches)v=t.touches[0].clientX,F=t.touches[0].clientY;else try{v=t.clientX,F=t.clientY}catch(Xe){return!1}if(v>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&oe(t);var Z=e.display,ee=Z.lineDiv.getBoundingClientRect();if(F>ee.bottom||!se(e,a))return be(t);F-=ee.top-Z.viewOffset;for(var re=0;re<e.display.gutterSpecs.length;++re){var de=Z.gutters.childNodes[re];if(de&&de.getBoundingClientRect().right>=v){var Ie=Dn(e.doc,F),Ne=e.display.gutterSpecs[re];return me(e,a,e,Ie,Ne.className,t),be(t)}}}function ms(e,t){return rl(e,t,"gutterClick",!0)}function il(e,t){if(Yi(e.display,t)||Yl(e,t))return;if(ne(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return se(e,"gutterContextMenu")?rl(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Nn(e)}var Ao={toString:function(){return"CodeMirror.Init"}},ol={},is={};function $l(e){var t=e.optionHandlers;function a(r,v,F,Z){e.defaults[r]=v,F&&(t[r]=Z?function(ee,re,de){de!=Ao&&F(ee,re,de)}:F)}e.defineOption=a,e.Init=Ao,a("value","",function(r,v){return r.setValue(v)},!0),a("mode",null,function(r,v){r.doc.modeOption=v,Pn(r)},!0),a("indentUnit",2,Pn,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(r){ci(r),Nn(r),gr(r)},!0),a("lineSeparator",null,function(r,v){if(r.doc.lineSep=v,!v)return;var F=[],Z=r.doc.first;r.doc.iter(function(re){for(var de=0;;){var Ie=re.text.indexOf(v,de);if(Ie==-1)break;de=Ie+v.length,F.push(ct(Z,Ie))}Z++});for(var ee=F.length-1;ee>=0;ee--)To(r.doc,v,F[ee],ct(F[ee].line,F[ee].ch+v.length))}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,v,F){r.state.specialChars=new RegExp(v.source+(v.test(" ")?"":"| "),"g"),F!=Ao&&r.refresh()}),a("specialCharPlaceholder",wn,function(r){return r.refresh()},!0),a("electricChars",!0),a("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(r,v){return r.getInputField().spellcheck=v},!0),a("autocorrect",!1,function(r,v){return r.getInputField().autocorrect=v},!0),a("autocapitalize",!1,function(r,v){return r.getInputField().autocapitalize=v},!0),a("rtlMoveVisually",!D),a("wholeLineUpdateBefore",!0),a("theme","default",function(r){al(r),zi(r)},!0),a("keyMap","default",function(r,v,F){var Z=ns(v),ee=F!=Ao&&ns(F);ee&&ee.detach&&ee.detach(r,Z),Z.attach&&Z.attach(r,ee||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,Zl,!0),a("gutters",[],function(r,v){r.display.gutterSpecs=ui(v,r.options.lineNumbers),zi(r)},!0),a("fixedGutter",!0,function(r,v){r.display.gutters.style.left=v?li(r.display)+"px":"0",r.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(r){return oa(r)},!0),a("scrollbarStyle","native",function(r){Fa(r),oa(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),a("lineNumbers",!1,function(r,v){r.display.gutterSpecs=ui(r.options.gutters,v),zi(r)},!0),a("firstLineNumber",1,zi,!0),a("lineNumberFormatter",function(r){return r},zi,!0),a("showCursorWhenSelecting",!1,yr,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(r,v){v=="nocursor"&&(ga(r),r.display.input.blur()),r.display.input.readOnlyChanged(v)}),a("screenReaderLabel",null,function(r,v){v=v===""?null:v,r.display.input.screenReaderLabelChanged(v)}),a("disableInput",!1,function(r,v){v||r.display.input.reset()},!0),a("dragDrop",!0,Ql),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,yr,!0),a("singleCursorHeightPerLine",!0,yr,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,ci,!0),a("addModeClass",!1,ci,!0),a("pollInterval",100),a("undoDepth",200,function(r,v){return r.doc.history.undoDepth=v}),a("historyEventDelay",1250),a("viewportMargin",10,function(r){return r.refresh()},!0),a("maxHighlightLength",1e4,ci,!0),a("moveInputWithCursor",!0,function(r,v){v||r.display.input.resetPosition()}),a("tabindex",null,function(r,v){return r.display.input.getField().tabIndex=v||""}),a("autofocus",null),a("direction","ltr",function(r,v){return r.doc.setDirection(v)},!0),a("phrases",null)}function Ql(e,t,a){var r=a&&a!=Ao;if(!t!=!r){var v=e.display.dragFunctions,F=t?Ye:bt;F(e.display.scroller,"dragstart",v.start),F(e.display.scroller,"dragenter",v.enter),F(e.display.scroller,"dragover",v.over),F(e.display.scroller,"dragleave",v.leave),F(e.display.scroller,"drop",v.drop)}}function Zl(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(g(e.display.wrapper,"CodeMirror-wrap"),tr(e)),gi(e),gr(e),Nn(e),setTimeout(function(){return oa(e)},100)}function jr(e,t){var a=this;if(!(this instanceof jr))return new jr(e,t);this.options=t=t?y(t):{},y(ol,t,!1);var r=t.value;typeof r=="string"?r=new Li(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var v=new jr.inputStyles[t.inputStyle](this),F=this.display=new Aa(e,r,v,t);F.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fa(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Q,keySeq:null,specialChars:null},t.autofocus&&!u&&F.input.focus(),G&&K<11&&setTimeout(function(){return a.display.input.reset(!0)},20),Jl(this),Rl(),Gi(this),this.curOp.forceUpdate=!0,Ur(this,r),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&na(a)},20):ga(this);for(var Z in is)is.hasOwnProperty(Z)&&is[Z](this,t[Z],Ao);ti(this),t.finishInit&&t.finishInit(this);for(var ee=0;ee<gs.length;++ee)gs[ee](this);Zi(this),n&&t.lineWrapping&&getComputedStyle(F.lineDiv).textRendering=="optimizelegibility"&&(F.lineDiv.style.textRendering="auto")}jr.defaults=ol,jr.optionHandlers=is;function Jl(e){var t=e.display;Ye(t.scroller,"mousedown",Hr(e,tl)),G&&K<11?Ye(t.scroller,"dblclick",Hr(e,function(re){if(ne(e,re))return;var de=Wr(e,re);if(!de||ms(e,re)||Yi(e.display,re))return;oe(re);var Ie=e.findWordAt(de);Zo(e.doc,Ie.anchor,Ie.head)})):Ye(t.scroller,"dblclick",function(re){return ne(e,re)||oe(re)}),Ye(t.scroller,"contextmenu",function(re){return il(e,re)}),Ye(t.input.getField(),"contextmenu",function(re){t.scroller.contains(re.target)||il(e,re)});var a,r={end:0};function v(){t.activeTouch&&(a=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function F(re){if(re.touches.length!=1)return!1;var de=re.touches[0];return de.radiusX<=1&&de.radiusY<=1}function Z(re,de){if(de.left==null)return!0;var Ie=de.left-re.left,Ne=de.top-re.top;return Ie*Ie+Ne*Ne>20*20}Ye(t.scroller,"touchstart",function(re){if(!ne(e,re)&&!F(re)&&!ms(e,re)){t.input.ensurePolled(),clearTimeout(a);var de=+new Date;t.activeTouch={start:de,moved:!1,prev:de-r.end<=300?r:null},re.touches.length==1&&(t.activeTouch.left=re.touches[0].pageX,t.activeTouch.top=re.touches[0].pageY)}}),Ye(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ye(t.scroller,"touchend",function(re){var de=t.activeTouch;if(de&&!Yi(t,re)&&de.left!=null&&!de.moved&&new Date-de.start<300){var Ie=e.coordsChar(t.activeTouch,"page"),Ne;!de.prev||Z(de,de.prev)?Ne=new tt(Ie,Ie):!de.prev.prev||Z(de,de.prev.prev)?Ne=e.findWordAt(Ie):Ne=new tt(ct(Ie.line,0),En(e.doc,ct(Ie.line+1,0))),e.setSelection(Ne.anchor,Ne.head),e.focus(),oe(re)}v()}),Ye(t.scroller,"touchcancel",v),Ye(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ia(e,t.scroller.scrollTop),wi(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))}),Ye(t.scroller,"mousewheel",function(re){return $e(e,re)}),Ye(t.scroller,"DOMMouseScroll",function(re){return $e(e,re)}),Ye(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(re){ne(e,re)||Se(re)},over:function(re){ne(e,re)||(Ol(e,re),Se(re))},start:function(re){return Al(e,re)},drop:Hr(e,Sl),leave:function(re){ne(e,re)||Hs(e)}};var ee=t.input.getField();Ye(ee,"keyup",function(re){return qs.call(e,re)}),Ye(ee,"keydown",Hr(e,Js)),Ye(ee,"keypress",Hr(e,el)),Ye(ee,"focus",function(re){return na(e,re)}),Ye(ee,"blur",function(re){return ga(e,re)})}var gs=[];jr.defineInitHook=function(e){return gs.push(e)};function $o(e,t,a,r){var v=e.doc,F;a==null&&(a="add"),a=="smart"&&(v.mode.indent?F=pi(e,t).state:a="prev");var Z=e.options.tabSize,ee=wt(v,t),re=H(ee.text,null,Z);ee.stateAfter&&(ee.stateAfter=null);var de=ee.text.match(/^\s*/)[0],Ie;if(!r&&!/\S/.test(ee.text))Ie=0,a="not";else if(a=="smart"&&(Ie=v.mode.indent(F,ee.text.slice(de.length),ee.text),Ie==Te||Ie>150)){if(!r)return;a="prev"}a=="prev"?t>v.first?Ie=H(wt(v,t-1).text,null,Z):Ie=0:a=="add"?Ie=re+e.options.indentUnit:a=="subtract"?Ie=re-e.options.indentUnit:typeof a=="number"&&(Ie=re+a),Ie=Math.max(0,Ie);var Ne="",Xe=0;if(e.options.indentWithTabs)for(var ze=Math.floor(Ie/Z);ze;--ze)Xe+=Z,Ne+=" ";if(Xe<Ie&&(Ne+=V(Ie-Xe)),Ne!=de)return To(v,Ne,ct(t,0),ct(t,de.length),"+input"),ee.stateAfter=null,!0;for(var at=0;at<v.sel.ranges.length;at++){var dt=v.sel.ranges[at];if(dt.head.line==t&&dt.head.ch<de.length){var Et=ct(t,de.length);us(v,at,new tt(Et,Et));break}}}var la=null;function as(e){la=e}function vs(e,t,a,r,v){var F=e.doc;e.display.shift=!1,r||(r=F.sel);var Z=+new Date-200,ee=v=="paste"||e.state.pasteIncoming>Z,re=zt(t),de=null;if(ee&&r.ranges.length>1)if(la&&la.text.join(`
`)==t){if(r.ranges.length%la.text.length==0){de=[];for(var Ie=0;Ie<la.text.length;Ie++)de.push(F.splitLines(la.text[Ie]))}}else re.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(de=j(re,function(At){return[At]}));for(var Ne=e.curOp.updateInput,Xe=r.ranges.length-1;Xe>=0;Xe--){var ze=r.ranges[Xe],at=ze.from(),dt=ze.to();ze.empty()&&(a&&a>0?at=ct(at.line,at.ch-a):e.state.overwrite&&!ee?dt=ct(dt.line,Math.min(wt(F,dt.line).text.length,dt.ch+P(re).length)):ee&&la&&la.lineWise&&la.text.join(`
`)==re.join(`
`)&&(at=dt=ct(at.line,0)));var Et={from:at,to:dt,text:de?de[Xe%de.length]:re,origin:v||(ee?"paste":e.state.cutIncoming>Z?"cut":"+input")};xo(e.doc,Et),Mr(e,"inputRead",e,Et)}t&&!ee&&ll(e,t),ra(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ne),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var a=e.clipboardData&&e.clipboardData.getData("Text");if(a)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Vr(t,function(){return vs(t,a,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var a=e.doc.sel,r=a.ranges.length-1;r>=0;r--){var v=a.ranges[r];if(v.head.ch>100||r&&a.ranges[r-1].head.line==v.head.line)continue;var F=e.getModeAt(v.head),Z=!1;if(F.electricChars){for(var ee=0;ee<F.electricChars.length;ee++)if(t.indexOf(F.electricChars.charAt(ee))>-1){Z=$o(e,v.head.line,"smart");break}}else F.electricInput&&(F.electricInput.test(wt(e.doc,v.head.line).text.slice(0,v.head.ch))&&(Z=$o(e,v.head.line,"smart")));Z&&Mr(e,"electricInput",e,v.head.line)}}function ul(e){for(var t=[],a=[],r=0;r<e.doc.sel.ranges.length;r++){var v=e.doc.sel.ranges[r].head.line,F={anchor:ct(v,0),head:ct(v+1,0)};a.push(F),t.push(e.getRange(F.anchor,F.head))}return{text:t,ranges:a}}function cl(e,t,a,r){e.setAttribute("autocorrect",a?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),p&&(e.style.border="1px solid black"),cl(e),t}function ql(e){var t=e.optionHandlers,a=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,v){var F=this.options,Z=F[r];if(F[r]==v&&r!="mode")return;F[r]=v,t.hasOwnProperty(r)&&Hr(this,t[r])(this,v,Z),me(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,v){this.state.keyMaps[v?"push":"unshift"](ns(r))},removeKeyMap:function(r){for(var v=this.state.keyMaps,F=0;F<v.length;++F)if(v[F]==r||v[F].name==r)return v.splice(F,1),!0},addOverlay:ai(function(r,v){var F=r.token?r:e.getMode(this.options,r);if(F.startState)throw new Error("Overlays may not be stateful.");$(this.state.overlays,{mode:F,modeSpec:r,opaque:v&&v.opaque,priority:v&&v.priority||0},function(Z){return Z.priority}),this.state.modeGen++,gr(this)}),removeOverlay:ai(function(r){for(var v=this.state.overlays,F=0;F<v.length;++F){var Z=v[F].modeSpec;if(Z==r||typeof r=="string"&&Z.name==r){v.splice(F,1),this.state.modeGen++,gr(this);return}}}),indentLine:ai(function(r,v,F){typeof v!="string"&&typeof v!="number"&&(v==null?v=this.options.smartIndent?"smart":"prev":v=v?"add":"subtract"),ei(this.doc,r)&&$o(this,r,v,F)}),indentSelection:ai(function(r){for(var v=this.doc.sel.ranges,F=-1,Z=0;Z<v.length;Z++){var ee=v[Z];if(ee.empty())ee.head.line>F&&($o(this,ee.head.line,r,!0),F=ee.head.line,Z==this.doc.sel.primIndex&&ra(this));else{var re=ee.from(),de=ee.to(),Ie=Math.max(F,re.line);F=Math.min(this.lastLine(),de.line-(de.ch?0:1))+1;for(var Ne=Ie;Ne<F;++Ne)$o(this,Ne,r);var Xe=this.doc.sel.ranges;re.ch==0&&v.length==Xe.length&&Xe[Z].from().ch>0&&us(this.doc,Z,new tt(re,Xe[Z].to()),_e)}}}),getTokenAt:function(r,v){return Ya(this,r,v)},getLineTokens:function(r,v){return Ya(this,ct(r),v,!0)},getTokenTypeAt:function(r){r=En(this.doc,r);var v=ea(this,wt(this.doc,r.line)),F=0,Z=(v.length-1)/2,ee=r.ch,re;if(ee==0)re=v[2];else for(;;){var de=F+Z>>1;if((de?v[de*2-1]:0)>=ee)Z=de;else if(v[de*2+1]<ee)F=de+1;else{re=v[de*2+2];break}}var Ie=re?re.indexOf("overlay "):-1;return Ie<0?re:Ie==0?null:re.slice(0,Ie-1)},getModeAt:function(r){var v=this.doc.mode;return v.innerMode?e.innerMode(v,this.getTokenAt(r).state).mode:v},getHelper:function(r,v){return this.getHelpers(r,v)[0]},getHelpers:function(r,v){var F=[];if(!a.hasOwnProperty(v))return F;var Z=a[v],ee=this.getModeAt(r);if(typeof ee[v]=="string")Z[ee[v]]&&F.push(Z[ee[v]]);else if(ee[v])for(var re=0;re<ee[v].length;re++){var de=Z[ee[v][re]];de&&F.push(de)}else ee.helperType&&Z[ee.helperType]?F.push(Z[ee.helperType]):Z[ee.name]&&F.push(Z[ee.name]);for(var Ie=0;Ie<Z._global.length;Ie++){var Ne=Z._global[Ie];Ne.pred(ee,this)&&te(F,Ne.val)==-1&&F.push(Ne.val)}return F},getStateAfter:function(r,v){var F=this.doc;return r=ca(F,r==null?F.first+F.size-1:r),pi(this,r+1,v).state},cursorCoords:function(r,v){var F,Z=this.doc.sel.primary();return r==null?F=Z.head:typeof r=="object"?F=En(this.doc,r):F=r?Z.from():Z.to(),Yn(this,F,v||"page")},charCoords:function(r,v){return Or(this,En(this.doc,r),v||"page")},coordsChar:function(r,v){return r=Xn(this,r,v||"page"),In(this,r.left,r.top)},lineAtHeight:function(r,v){return r=Xn(this,{top:r,left:0},v||"page").top,Dn(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,v,F){var Z=!1,ee;if(typeof r=="number"){var re=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>re&&(r=re,Z=!0),ee=wt(this.doc,r)}else ee=r;return zn(this,ee,{top:0,left:0},v||"page",F||Z).top+(Z?this.doc.height-St(ee):0)},defaultTextHeight:function(){return Nr(this.display)},defaultCharWidth:function(){return Fr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,v,F,Z,ee){var re=this.display;r=Yn(this,En(this.doc,r));var de=r.bottom,Ie=r.left;if(v.style.position="absolute",v.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(v),re.sizer.appendChild(v),Z=="over")de=r.top;else if(Z=="above"||Z=="near"){var Ne=Math.max(re.wrapper.clientHeight,this.doc.height),Xe=Math.max(re.sizer.clientWidth,re.lineSpace.clientWidth);(Z=="above"||r.bottom+v.offsetHeight>Ne)&&r.top>v.offsetHeight?de=r.top-v.offsetHeight:r.bottom+v.offsetHeight<=Ne&&(de=r.bottom),Ie+v.offsetWidth>Xe&&(Ie=Xe-v.offsetWidth)}v.style.top=de+"px",v.style.left=v.style.right="",ee=="right"?(Ie=re.sizer.clientWidth-v.offsetWidth,v.style.right="0px"):(ee=="left"?Ie=0:ee=="middle"&&(Ie=(re.sizer.clientWidth-v.offsetWidth)/2),v.style.left=Ie+"px"),F&&mo(this,{left:Ie,top:de,right:Ie+v.offsetWidth,bottom:de+v.offsetHeight})},triggerOnKeyDown:ai(Js),triggerOnKeyPress:ai(el),triggerOnKeyUp:qs,triggerOnMouseDown:ai(tl),execCommand:function(r){if(zo.hasOwnProperty(r))return zo[r].call(null,this)},triggerElectric:ai(function(r){ll(this,r)}),findPosH:function(r,v,F,Z){var ee=1;v<0&&(ee=-1,v=-v);for(var re=En(this.doc,r),de=0;de<v&&!(re=ys(this.doc,re,ee,F,Z),re.hitSide);++de);return re},moveH:ai(function(r,v){var F=this;this.extendSelectionsBy(function(Z){return F.display.shift||F.doc.extend||Z.empty()?ys(F.doc,Z.head,r,v,F.options.rtlMoveVisually):r<0?Z.from():Z.to()},ve)}),deleteH:ai(function(r,v){var F=this.doc.sel,Z=this.doc;F.somethingSelected()?Z.replaceSelection("",null,"+delete"):So(this,function(ee){var re=ys(Z,ee.head,r,v,!1);return r<0?{from:re,to:ee.head}:{from:ee.head,to:re}})}),findPosV:function(r,v,F,Z){var ee=1,re=Z;v<0&&(ee=-1,v=-v);for(var de=En(this.doc,r),Ie=0;Ie<v;++Ie){var Ne=Yn(this,de,"div");if(re==null?re=Ne.left:Ne.left=re,de=hl(this,Ne,ee,F),de.hitSide)break}return de},moveV:ai(function(r,v){var F=this,Z=this.doc,ee=[],re=!this.display.shift&&!Z.extend&&Z.sel.somethingSelected();if(Z.extendSelectionsBy(function(Ie){if(re)return r<0?Ie.from():Ie.to();var Ne=Yn(F,Ie.head,"div");Ie.goalColumn!=null&&(Ne.left=Ie.goalColumn),ee.push(Ne.left);var Xe=hl(F,Ne,r,v);return v=="page"&&Ie==Z.sel.primary()&&qa(F,Or(F,Xe,"div").top-Ne.top),Xe},ve),ee.length)for(var de=0;de<Z.sel.ranges.length;de++)Z.sel.ranges[de].goalColumn=ee[de]}),findWordAt:function(r){var v=this.doc,F=wt(v,r.line).text,Z=r.ch,ee=r.ch;if(F){var re=this.getHelper(r,"wordChars");(r.sticky=="before"||ee==F.length)&&Z?--Z:++ee;for(var de=F.charAt(Z),Ie=Ke(de,re)?function(Ne){return Ke(Ne,re)}:/\s/.test(de)?function(Ne){return/\s/.test(Ne)}:function(Ne){return!/\s/.test(Ne)&&!Ke(Ne)};Z>0&&Ie(F.charAt(Z-1));)--Z;for(;ee<F.length&&Ie(F.charAt(ee));)++ee}return new tt(ct(r.line,Z),ct(r.line,ee))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?W(this.display.cursorDiv,"CodeMirror-overwrite"):g(this.display.cursorDiv,"CodeMirror-overwrite"),me(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ai(function(r,v){va(this,r,v)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-He(this)-this.display.barHeight,width:r.scrollWidth-He(this)-this.display.barWidth,clientHeight:le(this),clientWidth:De(this)}},scrollIntoView:ai(function(r,v){r==null?(r={from:this.doc.sel.primary().head,to:null},v==null&&(v=this.options.cursorScrollMargin)):typeof r=="number"?r={from:ct(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=v||0,r.from.line!=null?go(this,r):ya(this,r.from,r.to,r.margin)}),setSize:ai(function(r,v){var F=this,Z=function(re){return typeof re=="number"||/^\d+$/.test(String(re))?re+"px":re};r!=null&&(this.display.wrapper.style.width=Z(r)),v!=null&&(this.display.wrapper.style.height=Z(v)),this.options.lineWrapping&&On(this);var ee=this.display.viewFrom;this.doc.iter(ee,this.display.viewTo,function(re){if(re.widgets){for(var de=0;de<re.widgets.length;de++)if(re.widgets[de].noHScroll){ln(F,ee,"widget");break}}++ee}),this.curOp.forceUpdate=!0,me(this,"refresh",this)}),operation:function(r){return Vr(this,r)},startOperation:function(){return Gi(this)},endOperation:function(){return Zi(this)},refresh:ai(function(){var r=this.display.cachedTextHeight;gr(this),this.curOp.forceUpdate=!0,Nn(this),va(this,this.doc.scrollLeft,this.doc.scrollTop),Ga(this.display),(r==null||Math.abs(r-Nr(this.display))>.5||this.options.lineWrapping)&&gi(this),me(this,"refresh",this)}),swapDoc:ai(function(r){var v=this.doc;return v.cm=null,this.state.selectingText&&this.state.selectingText(),Ur(this,r),Nn(this),this.display.input.reset(),va(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Mr(this,"swapDoc",this,v),v}),phrase:function(r){var v=this.options.phrases;return v&&Object.prototype.hasOwnProperty.call(v,r)?v[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ue(e),e.registerHelper=function(r,v,F){a.hasOwnProperty(r)||(a[r]=e[r]={_global:[]}),a[r][v]=F},e.registerGlobalHelper=function(r,v,F,Z){e.registerHelper(r,v,Z),a[r]._global.push({pred:F,val:Z})}}function ys(e,t,a,r,v){var F=t,Z=a,ee=wt(e,t.line),re=v&&e.direction=="rtl"?-a:a;function de(){var Wt=t.line+re;return Wt<e.first||Wt>=e.first+e.size?!1:(t=new ct(Wt,t.ch,t.sticky),ee=wt(e,Wt))}function Ie(Wt){var Ot;if(r=="codepoint"){var Gt=ee.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Gt)?Ot=null:Ot=new ct(t.line,Math.max(0,Math.min(ee.text.length,t.ch+a*(Gt>=55296&&Gt<56320?2:1))),-a)}else v?Ot=kl(e.cm,ee,t,a):Ot=ds(ee,t,a);if(Ot==null)if(!Wt&&de())t=hs(v,e.cm,ee,t.line,re);else return!1;else t=Ot;return!0}if(r=="char"||r=="codepoint")Ie();else if(r=="column")Ie(!0);else if(r=="word"||r=="group")for(var Ne=null,Xe=r=="group",ze=e.cm&&e.cm.getHelper(t,"wordChars"),at=!0;!(a<0&&!Ie(!at));at=!1){var dt=ee.text.charAt(t.ch)||`
`,Et=Ke(dt,ze)?"w":Xe&&dt==`
`?"n":!Xe||/\s/.test(dt)?null:"p";if(Xe&&!at&&!Et&&(Et="s"),Ne&&Ne!=Et){a<0&&(a=1,Ie(),t.sticky="after");break}if(Et&&(Ne=Et),a>0&&!Ie(!at))break}var At=qo(e,t,F,Z,!0);return ji(F,At)&&(At.hitSide=!0),At}function hl(e,t,a,r){var v=e.doc,F=t.left,Z;if(r=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),re=Math.max(ee-.5*Nr(e.display),3);Z=(a>0?t.bottom:t.top)+a*re}else r=="line"&&(Z=a>0?t.bottom+3:t.top-3);for(var de;!(de=In(e,F,Z),!de.outside);){if(a<0?Z<=0:Z>=v.height){de.hitSide=!0;break}Z+=a*5}return de}var Sr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Sr.prototype.init=function(e){var t=this,a=this,r=a.cm,v=a.div=e.lineDiv;cl(v,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function F(ee){for(var re=ee.target;re;re=re.parentNode){if(re==v)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(re.className))break}return!1}Ye(v,"paste",function(ee){if(!F(ee)||ne(r,ee)||sl(ee,r))return;K<=11&&setTimeout(Hr(r,function(){return t.updateFromDOM()}),20)}),Ye(v,"compositionstart",function(ee){t.composing={data:ee.data,done:!1}}),Ye(v,"compositionupdate",function(ee){t.composing||(t.composing={data:ee.data,done:!1})}),Ye(v,"compositionend",function(ee){t.composing&&(ee.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ye(v,"touchstart",function(){return a.forceCompositionEnd()}),Ye(v,"input",function(){t.composing||t.readFromDOMSoon()});function Z(ee){if(!F(ee)||ne(r,ee))return;if(r.somethingSelected())as({lineWise:!1,text:r.getSelections()}),ee.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var re=ul(r);as({lineWise:!0,text:re.text}),ee.type=="cut"&&r.operation(function(){r.setSelections(re.ranges,0,_e),r.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var de=la.text.join(`
`);if(ee.clipboardData.setData("Text",de),ee.clipboardData.getData("Text")==de){ee.preventDefault();return}}var Ie=dl(),Ne=Ie.firstChild;r.display.lineSpace.insertBefore(Ie,r.display.lineSpace.firstChild),Ne.value=la.text.join(`
`);var Xe=document.activeElement;k(Ne),setTimeout(function(){r.display.lineSpace.removeChild(Ie),Xe.focus(),Xe==v&&a.showPrimarySelection()},50)}Ye(v,"copy",Z),Ye(v,"cut",Z)},Sr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Sr.prototype.prepareSelection=function(){var e=Mi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Sr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Sr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Sr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,a=t.doc.sel.primary(),r=a.from(),v=a.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||v.line<t.display.viewFrom){e.removeAllRanges();return}var F=os(t,e.anchorNode,e.anchorOffset),Z=os(t,e.focusNode,e.focusOffset);if(F&&!F.bad&&Z&&!Z.bad&&Qt(Bi(F,Z),r)==0&&Qt(ua(F,Z),v)==0)return;var ee=t.display.view,re=r.line>=t.display.viewFrom&&fl(t,r)||{node:ee[0].measure.map[2],offset:0},de=v.line<t.display.viewTo&&fl(t,v);if(!de){var Ie=ee[ee.length-1].measure,Ne=Ie.maps?Ie.maps[Ie.maps.length-1]:Ie.map;de={node:Ne[Ne.length-1],offset:Ne[Ne.length-2]-Ne[Ne.length-3]}}if(!re||!de){e.removeAllRanges();return}var Xe=e.rangeCount&&e.getRangeAt(0),ze;try{ze=E(re.node,re.offset,de.offset,de.node)}catch(at){}ze&&(!N&&t.state.focused?(e.collapse(re.node,re.offset),ze.collapsed||(e.removeAllRanges(),e.addRange(ze))):(e.removeAllRanges(),e.addRange(ze)),Xe&&e.anchorNode==null?e.addRange(Xe):N&&this.startGracePeriod()),this.rememberSelection()},Sr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Sr.prototype.showMultipleSelections=function(e){d(this.cm.display.cursorDiv,e.cursors),d(this.cm.display.selectionDiv,e.selection)},Sr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Sr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},Sr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Sr.prototype.blur=function(){this.div.blur()},Sr.prototype.getField=function(){return this.div},Sr.prototype.supportsTouch=function(){return!0},Sr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Vr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Sr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Sr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&x&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var a=os(t,e.anchorNode,e.anchorOffset),r=os(t,e.focusNode,e.focusOffset);a&&r&&Vr(t,function(){Ei(t.doc,vt(a,r),_e),(a.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},Sr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,a=e.doc.sel.primary(),r=a.from(),v=a.to();if(r.ch==0&&r.line>e.firstLine()&&(r=ct(r.line-1,wt(e.doc,r.line-1).length)),v.ch==wt(e.doc,v.line).text.length&&v.line<e.lastLine()&&(v=ct(v.line+1,0)),r.line<t.viewFrom||v.line>t.viewTo-1)return!1;var F,Z,ee;r.line==t.viewFrom||(F=wr(e,r.line))==0?(Z=on(t.view[0].line),ee=t.view[0].node):(Z=on(t.view[F].line),ee=t.view[F-1].node.nextSibling);var re=wr(e,v.line),de,Ie;if(re==t.view.length-1?(de=t.viewTo-1,Ie=t.lineDiv.lastChild):(de=on(t.view[re+1].line)-1,Ie=t.view[re+1].node.previousSibling),!ee)return!1;for(var Ne=e.doc.splitLines(tu(e,ee,Ie,Z,de)),Xe=Rn(e.doc,ct(Z,0),ct(de,wt(e.doc,de).text.length));Ne.length>1&&Xe.length>1;)if(P(Ne)==P(Xe))Ne.pop(),Xe.pop(),de--;else if(Ne[0]==Xe[0])Ne.shift(),Xe.shift(),Z++;else break;for(var ze=0,at=0,dt=Ne[0],Et=Xe[0],At=Math.min(dt.length,Et.length);ze<At&&dt.charCodeAt(ze)==Et.charCodeAt(ze);)++ze;for(var Wt=P(Ne),Ot=P(Xe),Gt=Math.min(Wt.length-(Ne.length==1?ze:0),Ot.length-(Xe.length==1?ze:0));at<Gt&&Wt.charCodeAt(Wt.length-at-1)==Ot.charCodeAt(Ot.length-at-1);)++at;if(Ne.length==1&&Xe.length==1&&Z==r.line)for(;ze&&ze>r.ch&&Wt.charCodeAt(Wt.length-at-1)==Ot.charCodeAt(Ot.length-at-1);)ze--,at++;Ne[Ne.length-1]=Wt.slice(0,Wt.length-at).replace(/^\u200b+/,""),Ne[0]=Ne[0].slice(ze).replace(/\u200b+$/,"");var vn=ct(Z,ze),rn=ct(de,Xe.length?P(Xe).length-at:0);if(Ne.length>1||Ne[0]||Qt(vn,rn))return To(e.doc,Ne,vn,rn,"+input"),!0},Sr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Sr.prototype.reset=function(){this.forceCompositionEnd()},Sr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Sr.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Sr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Vr(this.cm,function(){return gr(e.cm)})},Sr.prototype.setUneditable=function(e){e.contentEditable="false"},Sr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Hr(this.cm,vs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Sr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Sr.prototype.onContextMenu=function(){},Sr.prototype.resetPosition=function(){},Sr.prototype.needsContentAttribute=!0;function fl(e,t){var a=Fe(e,t.line);if(!a||a.hidden)return null;var r=wt(e.doc,t.line),v=fe(a,r,t.line),F=lt(r,e.doc.direction),Z="left";if(F){var ee=qe(F,t.ch);Z=ee%2?"right":"left"}var re=ut(v.map,t.ch,Z);return re.offset=re.collapse=="right"?re.end:re.start,re}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Oo(e,t){return t&&(e.bad=!0),e}function tu(e,t,a,r,v){var F="",Z=!1,ee=e.doc.lineSeparator(),re=!1;function de(ze){return function(at){return at.id==ze}}function Ie(){Z&&(F+=ee,re&&(F+=ee),Z=re=!1)}function Ne(ze){ze&&(Ie(),F+=ze)}function Xe(ze){if(ze.nodeType==1){var at=ze.getAttribute("cm-text");if(at){Ne(at);return}var dt=ze.getAttribute("cm-marker"),Et;if(dt){var At=e.findMarks(ct(r,0),ct(v+1,0),de(+dt));At.length&&(Et=At[0].find(0))&&Ne(Rn(e.doc,Et.from,Et.to).join(ee));return}if(ze.getAttribute("contenteditable")=="false")return;var Wt=/^(pre|div|p|li|table|br)$/i.test(ze.nodeName);if(!/^br$/i.test(ze.nodeName)&&ze.textContent.length==0)return;Wt&&Ie();for(var Ot=0;Ot<ze.childNodes.length;Ot++)Xe(ze.childNodes[Ot]);/^(pre|p)$/i.test(ze.nodeName)&&(re=!0),Wt&&(Z=!0)}else ze.nodeType==3&&Ne(ze.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Xe(t),t==a);)t=t.nextSibling,re=!1;return F}function os(e,t,a){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[a],!r)return Oo(e.clipPos(ct(e.display.viewTo-1)),!0);t=null,a=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var v=0;v<e.display.view.length;v++){var F=e.display.view[v];if(F.node==r)return nu(F,t,a)}}function nu(e,t,a){var r=e.text.firstChild,v=!1;if(!t||!w(r,t))return Oo(ct(on(e.line),0),!0);if(t==r&&(v=!0,t=r.childNodes[a],a=0,!t)){var F=e.rest?P(e.rest):e.line;return Oo(ct(on(F),F.text.length),v)}var Z=t.nodeType==3?t:null,ee=t;for(!Z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(Z=t.firstChild,a&&(a=Z.nodeValue.length));ee.parentNode!=r;)ee=ee.parentNode;var re=e.measure,de=re.maps;function Ie(Et,At,Wt){for(var Ot=-1;Ot<(de?de.length:0);Ot++)for(var Gt=Ot<0?re.map:de[Ot],vn=0;vn<Gt.length;vn+=3){var rn=Gt[vn+2];if(rn==Et||rn==At){var Jn=on(Ot<0?e.line:e.rest[Ot]),Dr=Gt[vn]+Wt;return(Wt<0||rn!=Et)&&(Dr=Gt[vn+(Wt?1:0)]),ct(Jn,Dr)}}}var Ne=Ie(Z,ee,a);if(Ne)return Oo(Ne,v);for(var Xe=ee.nextSibling,ze=Z?Z.nodeValue.length-a:0;Xe;Xe=Xe.nextSibling){if(Ne=Ie(Xe,Xe.firstChild,0),Ne)return Oo(ct(Ne.line,Ne.ch-ze),v);ze+=Xe.textContent.length}for(var at=ee.previousSibling,dt=a;at;at=at.previousSibling){if(Ne=Ie(at,at.firstChild,-1),Ne)return Oo(ct(Ne.line,Ne.ch+dt),v);dt+=at.textContent.length}}var qr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null};qr.prototype.init=function(e){var t=this,a=this,r=this.cm;this.createField(e);var v=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),p&&(v.style.width="0px"),Ye(v,"input",function(){G&&K>=9&&t.hasSelection&&(t.hasSelection=null),a.poll()}),Ye(v,"paste",function(Z){if(ne(r,Z)||sl(Z,r))return;r.state.pasteIncoming=+new Date,a.fastPoll()});function F(Z){if(ne(r,Z))return;if(r.somethingSelected())as({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var ee=ul(r);as({lineWise:!0,text:ee.text}),Z.type=="cut"?r.setSelections(ee.ranges,null,_e):(a.prevInput="",v.value=ee.text.join(`
`),k(v))}else return;Z.type=="cut"&&(r.state.cutIncoming=+new Date)}Ye(v,"cut",F),Ye(v,"copy",F),Ye(e.scroller,"paste",function(Z){if(Yi(e,Z)||ne(r,Z))return;if(!v.dispatchEvent){r.state.pasteIncoming=+new Date,a.focus();return}var ee=new Event("paste");ee.clipboardData=Z.clipboardData,v.dispatchEvent(ee)}),Ye(e.lineSpace,"selectstart",function(Z){Yi(e,Z)||oe(Z)}),Ye(v,"compositionstart",function(){var Z=r.getCursor("from");a.composing&&a.composing.range.clear(),a.composing={start:Z,range:r.markText(Z,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ye(v,"compositionend",function(){a.composing&&(a.poll(),a.composing.range.clear(),a.composing=null)})},qr.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},qr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,a=e.doc,r=Mi(e);if(e.options.moveInputWithCursor){var v=Yn(e,a.sel.primary().head,"div"),F=t.wrapper.getBoundingClientRect(),Z=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,v.top+Z.top-F.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,v.left+Z.left-F.left))}return r},qr.prototype.showSelection=function(e){var t=this.cm,a=t.display;d(a.cursorDiv,e.cursors),d(a.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var a=t.getSelection();this.textarea.value=a,t.state.focused&&k(this.textarea),G&&K>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",G&&K>=9&&(this.hasSelection=null))},qr.prototype.getField=function(){return this.textarea},qr.prototype.supportsTouch=function(){return!1},qr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},qr.prototype.blur=function(){this.textarea.blur()},qr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qr.prototype.receivedFocus=function(){this.slowPoll()},qr.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function a(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,a)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,a)},qr.prototype.poll=function(){var e=this,t=this.cm,a=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Mt(a)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var v=a.value;if(v==r&&!t.somethingSelected())return!1;if(G&&K>=9&&this.hasSelection===v||s&&/[\uf700-\uf7ff]/.test(v))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var F=v.charCodeAt(0);if(F==8203&&!r&&(r="\u200B"),F==8666)return this.reset(),this.cm.execCommand("undo")}for(var Z=0,ee=Math.min(r.length,v.length);Z<ee&&r.charCodeAt(Z)==v.charCodeAt(Z);)++Z;return Vr(t,function(){vs(t,v.slice(Z),r.length-Z,null,e.composing?"*compose":null),v.length>1e3||v.indexOf(`
`)>-1?a.value=e.prevInput="":e.prevInput=v,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qr.prototype.onKeyPress=function(){G&&K>=9&&(this.hasSelection=null),this.fastPoll()},qr.prototype.onContextMenu=function(e){var t=this,a=t.cm,r=a.display,v=t.textarea;t.contextMenuPending&&t.contextMenuPending();var F=Wr(a,e),Z=r.scroller.scrollTop;if(!F||f)return;var ee=a.options.resetSelectionOnContextMenu;ee&&a.doc.sel.contains(F)==-1&&Hr(a,Ei)(a.doc,vt(F),_e);var re=v.style.cssText,de=t.wrapper.style.cssText,Ie=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",v.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Ie.top-5)+"px; left: "+(e.clientX-Ie.left-5)+`px;
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ne;n&&(Ne=window.scrollY),r.input.focus(),n&&window.scrollTo(null,Ne),r.input.reset(),a.somethingSelected()||(v.value=t.prevInput=" "),t.contextMenuPending=ze,r.selForContextMenu=a.doc.sel,clearTimeout(r.detectingSelectAll);function Xe(){if(v.selectionStart!=null){var dt=a.somethingSelected(),Et="\u200B"+(dt?v.value:"");v.value="\u21DA",v.value=Et,t.prevInput=dt?"":"\u200B",v.selectionStart=1,v.selectionEnd=Et.length,r.selForContextMenu=a.doc.sel}}function ze(){if(t.contextMenuPending!=ze)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=de,v.style.cssText=re,G&&K<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=Z),v.selectionStart!=null){(!G||G&&K<9)&&Xe();var dt=0,Et=function(){r.selForContextMenu==a.doc.sel&&v.selectionStart==0&&v.selectionEnd>0&&t.prevInput=="\u200B"?Hr(a,Ls)(a):dt++<10?r.detectingSelectAll=setTimeout(Et,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Et,200)}}if(G&&K>=9&&Xe(),R){Se(e);var at=function(){bt(window,"mouseup",at),setTimeout(ze,20)};Ye(window,"mouseup",at)}else setTimeout(ze,50)},qr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qr.prototype.setUneditable=function(){},qr.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?y(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var a=B();t.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body}function r(){e.value=ee.getValue()}var v;if(e.form&&(Ye(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var F=e.form;v=F.submit;try{var Z=F.submit=function(){r(),F.submit=v,F.submit(),F.submit=Z}}catch(re){}}t.finishInit=function(re){re.save=r,re.getTextArea=function(){return e},re.toTextArea=function(){re.toTextArea=isNaN,r(),e.parentNode.removeChild(re.getWrapperElement()),e.style.display="",e.form&&(bt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=v))}},e.style.display="none";var ee=jr(function(re){return e.parentNode.insertBefore(re,e.nextSibling)},t);return ee}function iu(e){e.off=bt,e.on=Ye,e.wheelEventPixels=Je,e.Doc=Li,e.splitLines=zt,e.countColumn=H,e.findColumn=Oe,e.isWordChar=Re,e.Pass=Te,e.signal=me,e.Line=Hn,e.changeEnd=gt,e.scrollbarModel=eo,e.Pos=ct,e.cmpPos=Qt,e.modes=or,e.mimeModes=bn,e.resolveMode=Ar,e.getMode=Br,e.modeExtensions=Ht,e.extendMode=an,e.copyState=Cn,e.startState=Ir,e.innerMode=qn,e.commands=zo,e.keyMap=Da,e.keyName=Xs,e.isModifierKey=zs,e.lookupKey=Co,e.normalizeKeyMap=Pl,e.StringStream=gn,e.SharedTextMarker=Ho,e.TextMarker=za,e.LineWidget=Wo,e.e_preventDefault=oe,e.e_stopPropagation=ce,e.e_stop=Se,e.addClass=W,e.contains=w,e.rmClass=g,e.keyNames=Va}$l(jr),ql(jr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ss in Li.prototype)Li.prototype.hasOwnProperty(ss)&&te(au,ss)<0&&(jr.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[ss]));return ue(Li),jr.inputStyles={textarea:qr,contenteditable:Sr},jr.defineMode=function(e){!jr.defaults.mode&&e!="null"&&(jr.defaults.mode=e),xr.apply(this,arguments)},jr.defineMIME=br,jr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jr.defineMIME("text/plain","null"),jr.defineExtension=function(e,t){jr.prototype[e]=t},jr.defineDocExtension=function(e,t){Li.prototype[e]=t},jr.fromTextArea=ru,iu(jr),jr.version="5.58.2",jr})},WaYH:function(it,Ee,U){"use strict";var ie=U("rePB"),Y=U("Ff2n"),N=U("VTBJ"),z=U("1OyB"),I=U("vuIU"),M=U("JX7q"),G=U("Ji7U"),K=U("LK+K"),n=U("q1tI"),L=U("TSYQ"),x=U.n(L),f=U("sboe"),b=U("OZM5"),h=function(R){var O=R.prefixCls,g=R.level,_=R.isStart,d=R.isEnd;if(!g)return null;for(var c="".concat(O,"-indent-unit"),C=[],E=0;E<g;E+=1){var w;C.push(n.createElement("span",{key:E,className:x()(c,(w={},Object(ie.a)(w,"".concat(c,"-start"),_[E+1]),Object(ie.a)(w,"".concat(c,"-end"),d[E+1]),Object(ie.a)(w,"".concat(c,"-end-first-level"),!E&&d[0]),w))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},C)},o=h,p=U("815F"),l="open",u="close",s="---",i=function(S){Object(G.a)(O,S);var R=Object(K.a)(O);function O(){var g;return Object(z.a)(this,O),g=R.apply(this,arguments),g.state={dragNodeHighlight:!1},g.onSelectorClick=function(_){var d=g.props.context.onNodeClick;d(_,Object(p.b)(g.props)),g.isSelectable()?g.onSelect(_):g.onCheck(_)},g.onSelectorDoubleClick=function(_){var d=g.props.context.onNodeDoubleClick;d(_,Object(p.b)(g.props))},g.onSelect=function(_){if(g.isDisabled())return;var d=g.props.context.onNodeSelect;_.preventDefault(),d(_,Object(p.b)(g.props))},g.onCheck=function(_){if(g.isDisabled())return;var d=g.props,c=d.disableCheckbox,C=d.checked,E=g.props.context.onNodeCheck;if(!g.isCheckable()||c)return;_.preventDefault();var w=!C;E(_,Object(p.b)(g.props),w)},g.onMouseEnter=function(_){var d=g.props.context.onNodeMouseEnter;d(_,Object(p.b)(g.props))},g.onMouseLeave=function(_){var d=g.props.context.onNodeMouseLeave;d(_,Object(p.b)(g.props))},g.onContextMenu=function(_){var d=g.props.context.onNodeContextMenu;d(_,Object(p.b)(g.props))},g.onDragStart=function(_){var d=g.props.context.onNodeDragStart;_.stopPropagation(),g.setState({dragNodeHighlight:!0}),d(_,Object(M.a)(g));try{_.dataTransfer.setData("text/plain","")}catch(c){}},g.onDragEnter=function(_){var d=g.props.context.onNodeDragEnter;_.preventDefault(),_.stopPropagation(),d(_,Object(M.a)(g))},g.onDragOver=function(_){var d=g.props.context.onNodeDragOver;_.preventDefault(),_.stopPropagation(),d(_,Object(M.a)(g))},g.onDragLeave=function(_){var d=g.props.context.onNodeDragLeave;_.stopPropagation(),d(_,Object(M.a)(g))},g.onDragEnd=function(_){var d=g.props.context.onNodeDragEnd;_.stopPropagation(),g.setState({dragNodeHighlight:!1}),d(_,Object(M.a)(g))},g.onDrop=function(_){var d=g.props.context.onNodeDrop;_.preventDefault(),_.stopPropagation(),g.setState({dragNodeHighlight:!1}),d(_,Object(M.a)(g))},g.onExpand=function(_){var d=g.props.context.onNodeExpand;d(_,Object(p.b)(g.props))},g.setSelectHandle=function(_){g.selectHandle=_},g.getNodeState=function(){var _=g.props.expanded;return g.isLeaf()?null:_?l:u},g.hasChildren=function(){var _=g.props.eventKey,d=g.props.context.keyEntities,c=d[_]||{},C=c.children;return!!(C||[]).length},g.isLeaf=function(){var _=g.props,d=_.isLeaf,c=_.loaded,C=g.props.context.loadData,E=g.hasChildren();return d===!1?!1:d||!C&&!E||C&&c&&!E},g.isDisabled=function(){var _=g.props.disabled,d=g.props.context.disabled;return!!(d||_)},g.isCheckable=function(){var _=g.props.checkable,d=g.props.context.checkable;return!d||_===!1?!1:d},g.syncLoadData=function(_){var d=_.expanded,c=_.loading,C=_.loaded,E=g.props.context,w=E.loadData,B=E.onNodeLoad;if(c)return;w&&d&&!g.isLeaf()&&(!g.hasChildren()&&!C&&B(Object(p.b)(g.props)))},g.renderSwitcher=function(){var _=g.props,d=_.expanded,c=_.switcherIcon,C=g.props.context,E=C.prefixCls,w=C.switcherIcon,B=c||w;if(g.isLeaf())return n.createElement("span",{className:x()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof B=="function"?B(Object(N.a)(Object(N.a)({},g.props),{},{isLeaf:!0})):B);var W=x()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(d?l:u));return n.createElement("span",{onClick:g.onExpand,className:W},typeof B=="function"?B(Object(N.a)(Object(N.a)({},g.props),{},{isLeaf:!1})):B)},g.renderCheckbox=function(){var _=g.props,d=_.checked,c=_.halfChecked,C=_.disableCheckbox,E=g.props.context.prefixCls,w=g.isDisabled(),B=g.isCheckable();if(!B)return null;var W=typeof B!="boolean"?B:null;return n.createElement("span",{className:x()("".concat(E,"-checkbox"),d&&"".concat(E,"-checkbox-checked"),!d&&c&&"".concat(E,"-checkbox-indeterminate"),(w||C)&&"".concat(E,"-checkbox-disabled")),onClick:g.onCheck},W)},g.renderIcon=function(){var _=g.props.loading,d=g.props.context.prefixCls;return n.createElement("span",{className:x()("".concat(d,"-iconEle"),"".concat(d,"-icon__").concat(g.getNodeState()||"docu"),_&&"".concat(d,"-icon_loading"))})},g.renderSelector=function(){var _=g.state.dragNodeHighlight,d=g.props,c=d.title,C=d.selected,E=d.icon,w=d.loading,B=d.data,W=g.props.context,T=W.prefixCls,k=W.showIcon,m=W.icon,y=W.draggable,H=W.loadData,Q=W.titleRender,te=g.isDisabled(),ae="".concat(T,"-node-content-wrapper"),Te;if(k){var _e=E||m;Te=_e?n.createElement("span",{className:x()("".concat(T,"-iconEle"),"".concat(T,"-icon__customize"))},typeof _e=="function"?_e(g.props):_e):g.renderIcon()}else H&&w&&(Te=g.renderIcon());var ge;typeof c=="function"?ge=c(B):Q?ge=Q(B):ge=c;var ve=n.createElement("span",{className:"".concat(T,"-title")},ge);return n.createElement("span",{ref:g.setSelectHandle,title:typeof c=="string"?c:"",className:x()("".concat(ae),"".concat(ae,"-").concat(g.getNodeState()||"normal"),!te&&(C||_)&&"".concat(T,"-node-selected"),!te&&y&&"draggable"),draggable:!te&&y||void 0,"aria-grabbed":!te&&y||void 0,onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onContextMenu:g.onContextMenu,onClick:g.onSelectorClick,onDoubleClick:g.onSelectorDoubleClick,onDragStart:y?g.onDragStart:void 0},Te,ve)},g}return Object(I.a)(O,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var _=this.props.selectable,d=this.props.context.selectable;return typeof _=="boolean"?_:d}},{key:"render",value:function(){var _,d=this.props,c=d.eventKey,C=d.className,E=d.style,w=d.dragOver,B=d.dragOverGapTop,W=d.dragOverGapBottom,T=d.isLeaf,k=d.isStart,m=d.isEnd,y=d.expanded,H=d.selected,Q=d.checked,te=d.halfChecked,ae=d.loading,Te=d.domRef,_e=d.active,ge=d.onMouseMove,ve=Object(Y.a)(d,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Oe=this.props.context,he=Oe.prefixCls,V=Oe.filterTreeNode,P=Oe.draggable,j=Oe.keyEntities,$=this.isDisabled(),J=Object(b.f)(ve),X=j[c]||{},ye=X.level,Re=m[m.length-1];return n.createElement("div",Object.assign({ref:Te,className:x()(C,"".concat(he,"-treenode"),(_={},Object(ie.a)(_,"".concat(he,"-treenode-disabled"),$),Object(ie.a)(_,"".concat(he,"-treenode-switcher-").concat(y?"open":"close"),!T),Object(ie.a)(_,"".concat(he,"-treenode-checkbox-checked"),Q),Object(ie.a)(_,"".concat(he,"-treenode-checkbox-indeterminate"),te),Object(ie.a)(_,"".concat(he,"-treenode-selected"),H),Object(ie.a)(_,"".concat(he,"-treenode-loading"),ae),Object(ie.a)(_,"".concat(he,"-treenode-active"),_e),Object(ie.a)(_,"".concat(he,"-treenode-leaf-last"),Re),Object(ie.a)(_,"drag-over",!$&&w),Object(ie.a)(_,"drag-over-gap-top",!$&&B),Object(ie.a)(_,"drag-over-gap-bottom",!$&&W),Object(ie.a)(_,"filter-node",V&&V(Object(p.b)(this.props))),_)),style:E,onDragEnter:P?this.onDragEnter:void 0,onDragOver:P?this.onDragOver:void 0,onDragLeave:P?this.onDragLeave:void 0,onDrop:P?this.onDrop:void 0,onDragEnd:P?this.onDragEnd:void 0,onMouseMove:ge},J),n.createElement(o,{prefixCls:he,level:ye,isStart:k,isEnd:m}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(n.Component),D=function(R){return n.createElement(f.a.Consumer,null,function(O){return n.createElement(i,Object.assign({},R,{context:O}))})};D.displayName="TreeNode",D.defaultProps={title:s},D.isTreeNode=1;var A=Ee.a=D},Y1PL:function(it,Ee,U){"use strict";U.r(Ee),U.d(Ee,"ResizableTextArea",function(){return te});var ie=U("wx14"),Y=U("1OyB"),N=U("vuIU"),z=U("Ji7U"),I=U("LK+K"),M=U("q1tI"),G=U("VTBJ"),K=U("rePB"),n=U("Zm9Q"),L=U("Kwbf"),x=U("c+Xe"),f=U("m+aA"),b=U("bdgK"),h=new Map;function o(_e){_e.forEach(function(ge){var ve,Oe=ge.target;(ve=h.get(Oe))===null||ve===void 0||ve.forEach(function(he){return he(Oe)})})}var p=new b.default(o),l=null,u=null;function s(_e,ge){h.has(_e)||(h.set(_e,new Set),p.observe(_e)),h.get(_e).add(ge)}function i(_e,ge){h.has(_e)&&(h.get(_e).delete(ge),h.get(_e).size||(p.unobserve(_e),h.delete(_e)))}var D=function(_e){Object(z.a)(ve,_e);var ge=Object(I.a)(ve);function ve(){return Object(Y.a)(this,ve),ge.apply(this,arguments)}return Object(N.a)(ve,[{key:"render",value:function(){return this.props.children}}]),ve}(M.Component),A=M.createContext(null);function S(_e){var ge=_e.children,ve=_e.onBatchResize,Oe=M.useRef(0),he=M.useRef([]),V=M.useContext(A),P=M.useCallback(function(j,$,J){Oe.current+=1;var X=Oe.current;he.current.push({size:j,element:$,data:J}),Promise.resolve().then(function(){X===Oe.current&&(ve==null||ve(he.current),he.current=[])}),V==null||V(j,$,J)},[ve,V]);return M.createElement(A.Provider,{value:P},ge)}function R(_e){var ge=_e.children,ve=_e.disabled,Oe=M.useRef(null),he=M.useRef(null),V=M.useContext(A),P=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),j=M.isValidElement(ge)&&Object(x.c)(ge),$=j?ge.ref:null,J=M.useMemo(function(){return Object(x.a)($,Oe)},[$,Oe]),X=M.useRef(_e);X.current=_e;var ye=M.useCallback(function(Re){var Ke=X.current,pe=Ke.onResize,we=Ke.data,ke=Re.getBoundingClientRect(),Ue=ke.width,Qe=ke.height,nt=Re.offsetWidth,ot=Re.offsetHeight,qe=Math.floor(Ue),ft=Math.floor(Qe);if(P.current.width!==qe||P.current.height!==ft||P.current.offsetWidth!==nt||P.current.offsetHeight!==ot){var lt={width:qe,height:ft,offsetWidth:nt,offsetHeight:ot};P.current=lt;var pt=nt===Math.round(Ue)?Ue:nt,Ye=ot===Math.round(Qe)?Qe:ot,Tt=Object(G.a)(Object(G.a)({},lt),{},{offsetWidth:pt,offsetHeight:Ye});V==null||V(Tt,Re,we),pe&&Promise.resolve().then(function(){pe(Tt,Re)})}},[]);return M.useEffect(function(){var Re=Object(f.a)(Oe.current)||Object(f.a)(he.current);return Re&&!ve&&s(Re,ye),function(){return i(Re,ye)}},[Oe.current,ve]),M.createElement(D,{ref:he},j?M.cloneElement(ge,{ref:J}):ge)}var O="rc-observer-key";function g(_e){var ge=_e.children,ve=Object(n.a)(ge);return ve.map(function(Oe,he){var V=(Oe==null?void 0:Oe.key)||"".concat(O,"-").concat(he);return M.createElement(R,Object(ie.a)({},_e,{key:V}),Oe)})}g.Collection=S;var _=g,d=U("bT9E"),c=U("TSYQ"),C=U.n(c),E=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],B={},W;function T(_e){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=_e.getAttribute("id")||_e.getAttribute("data-reactid")||_e.getAttribute("name");if(ge&&B[ve])return B[ve];var Oe=window.getComputedStyle(_e),he=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),V=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),P=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),j=w.map(function(J){return"".concat(J,":").concat(Oe.getPropertyValue(J))}).join(";"),$={sizingStyle:j,paddingSize:V,borderSize:P,boxSizing:he};return ge&&ve&&(B[ve]=$),$}function k(_e){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),document.body.appendChild(W)),_e.getAttribute("wrap")?W.setAttribute("wrap",_e.getAttribute("wrap")):W.removeAttribute("wrap");var he=T(_e,ge),V=he.paddingSize,P=he.borderSize,j=he.boxSizing,$=he.sizingStyle;W.setAttribute("style","".concat($,";").concat(E)),W.value=_e.value||_e.placeholder||"";var J=Number.MIN_SAFE_INTEGER,X=Number.MAX_SAFE_INTEGER,ye=W.scrollHeight,Re;if(j==="border-box"?ye+=P:j==="content-box"&&(ye-=V),ve!==null||Oe!==null){W.value=" ";var Ke=W.scrollHeight-V;ve!==null&&(J=Ke*ve,j==="border-box"&&(J=J+V+P),ye=Math.max(J,ye)),Oe!==null&&(X=Ke*Oe,j==="border-box"&&(X=X+V+P),Re=ye>X?"":"hidden",ye=Math.min(X,ye))}return{height:ye,minHeight:J,maxHeight:X,overflowY:Re,resize:"none"}}var m=U("Gytx"),y=U.n(m),H;(function(_e){_e[_e.NONE=0]="NONE",_e[_e.RESIZING=1]="RESIZING",_e[_e.RESIZED=2]="RESIZED"})(H||(H={}));var Q=function(_e){Object(z.a)(ve,_e);var ge=Object(I.a)(ve);function ve(Oe){var he;return Object(Y.a)(this,ve),he=ge.call(this,Oe),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(V){he.textArea=V},he.handleResize=function(V){var P=he.state.resizeStatus,j=he.props,$=j.autoSize,J=j.onResize;if(P!==H.NONE)return;typeof J=="function"&&J(V),$&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var V=he.props.autoSize;if(!V||!he.textArea)return;var P=V.minRows,j=V.maxRows,$=k(he.textArea,!1,P,j);he.setState({textareaStyles:$,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var V=he.props,P=V.prefixCls,j=P===void 0?"rc-textarea":P,$=V.autoSize,J=V.onResize,X=V.className,ye=V.disabled,Re=he.state,Ke=Re.textareaStyles,pe=Re.resizeStatus,we=Object(d.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ke=C()(j,X,Object(K.a)({},"".concat(j,"-disabled"),ye));"value"in we&&(we.value=we.value||"");var Ue=Object(G.a)(Object(G.a)(Object(G.a)({},he.props.style),Ke),pe===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(_,{onResize:he.handleResize,disabled:!($||J)},M.createElement("textarea",Object(ie.a)({},we,{className:ke,style:Ue,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:H.NONE},he}return Object(N.a)(ve,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!y()(he.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 he=this.textArea.selectionStart,V=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,V)}}catch(P){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ve}(M.Component),te=Q,ae=function(_e){Object(z.a)(ve,_e);var ge=Object(I.a)(ve);function ve(Oe){var he;Object(Y.a)(this,ve),he=ge.call(this,Oe),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(P){he.resizableTextArea=P},he.handleChange=function(P){var j=he.props.onChange;he.setValue(P.target.value,function(){he.resizableTextArea.resizeTextarea()}),j&&j(P)},he.handleKeyDown=function(P){var j=he.props,$=j.onPressEnter,J=j.onKeyDown;P.keyCode===13&&$&&$(P),J&&J(P)};var V=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return he.state={value:V},he}return Object(N.a)(ve,[{key:"setValue",value:function(he,V){"value"in this.props||this.setState({value:he},V)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(te,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),ve}(M.Component),Te=Ee.default=ae},ZW9T:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return m});var ie=U("k1fw"),Y=U("oBTY"),N=U("miYZ"),z=U("tsqr"),I=U("rAM+"),M=U("tJVT"),G=U("PpiC"),K=U("q1tI"),n=U.n(K),L=U("bdgK"),x=U("9og8"),f=U("WmNS"),b=U.n(f),h={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"]},o={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"]},p={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(`
`)}]},l={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(`
`)}]},u=U("5VLF"),s=U.n(u),i={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},D=function(H,Q){return Q.map(function(te){return{label:te,kind:H.languages.CompletionItemKind.Keyword,insertText:te}})},A=function(H){return Object.keys(i.tables).map(function(Q){return{label:Q,kind:H.languages.CompletionItemKind.Variable,insertText:Q}})},S=function(H,Q){var te=i.tables[H];return te?te.map(function(ae){return{label:ae,kind:Q.languages.CompletionItemKind.Field,insertText:ae}}):[]};function R(y,H,Q,te,ae){var Te=H.getWordUntilPosition(Q),_e={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},ge=te.map(function(ve){return{label:ve,kind:y.languages.CompletionItemKind.Keyword,insertText:ve,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}});return ae.map(function(ve){ge.push(Object(ie.a)(Object(ie.a)({},ve),{},{range:_e}))}),ge}var O=function(y){i.languages.map(function(ae){return y.languages.registerDocumentFormattingEditProvider(ae,{provideDocumentFormattingEdits:function(_e,ge,ve){return Object(x.a)(b.a.mark(function Oe(){var he;return b.a.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return he=s()(_e.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}),P.abrupt("return",[{range:_e.getFullModelRange(),text:he}]);case 2:case"end":return P.stop()}},Oe)}))()}}),ae});var H=p.quickKey.map(function(ae){return{label:ae.label,kind:y.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=l.quickKey.map(function(ae){return{label:ae.label,kind:y.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=o.quickKey.map(function(ae){return{label:ae.label,kind:y.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}});y.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Te,_e){var ge=Te.getWordUntilPosition(_e),ve={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},Oe=Te.getLineContent(_e.lineNumber).substring(ge.startColumn-2,ge.endColumn);return{suggestions:[].concat(Object(Y.a)(p.keywords.map(function(he){return{label:he,kind:y.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})),Object(Y.a)(p.quickKey.map(function(he){return{label:he.label,kind:y.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})))}}}),y.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Te,_e){var ge=Te.getWordUntilPosition(_e),ve={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn};return{suggestions:Object(Y.a)(h.keywords.map(function(Oe){return{label:Oe,kind:y.languages.CompletionItemKind.Function,documentation:Oe,insertText:Oe,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}}))}}}),y.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Te,_e){var ge=Te.getWordUntilPosition(_e),ve={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},Oe=Te.getLineContent(_e.lineNumber).substring(ge.startColumn-2,ge.endColumn);return{suggestions:[].concat(Object(Y.a)(o.keywords.map(function(he){return{label:he,kind:y.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})),Object(Y.a)(o.quickKey.map(function(he){return{label:he.label,kind:y.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})))}}}),y.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Te,_e){var ge=Te.getWordUntilPosition(_e),ve={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},Oe=Te.getLineContent(_e.lineNumber).substring(ge.startColumn-2,ge.endColumn);return{suggestions:[].concat(Object(Y.a)(l.keywords.map(function(he){return{label:he,kind:y.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})),Object(Y.a)(l.quickKey.map(function(he){return{label:he.label,kind:y.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})))}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=U("fjLI"),d=U("LvDl"),c=U("+ua5");function C(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function E(){}var w=!1,B={"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 W(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=y;if(Array.isArray(y)){for(var Q=0;Q<y.length;Q++){var te=B[y[Q]];if(te)return te}return H[0]}return B[H]||H}var T=null,k=Ee.b=function(y){var H=y.width,Q=H===void 0?"100%":H,te=y.height,ae=te===void 0?"100%":te,Te=y.value,_e=y.language,ge=_e===void 0?"javascript":_e,ve=y.style,Oe=ve===void 0?{}:ve,he=y.options,V=he===void 0?{}:he,P=y.overrideServices,j=P===void 0?{}:P,$=y.theme,J=$===void 0?"vs-dark":$,X=y.onEditBlur,ye=y.onSave,Re=y.autoHeight,Ke=Re===void 0?!1:Re,pe=y.forbidCopy,we=pe===void 0?!1:pe,ke=y.onChange,Ue=ke===void 0?E:ke,Qe=y.editorDidMount,nt=Qe===void 0?E:Qe,ot=y.onFocus,qe=ot===void 0?E:ot,ft=y.filename,lt=ft===void 0?"educoder.txt":ft,pt=y.errorLine,Ye=y.errorContent,Tt=Ye===void 0?"":Ye,bt=Object(G.a)(y,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),me=Object(K.useRef)(),ne=Object(K.useRef)({}),q=Object(K.useRef)(),se=Object(K.useRef)(),ue=Object(K.useRef)(!1),oe=Object(K.useRef)(),ce=Object(K.useState)(!1),be=Object(M.a)(ce,2),Se=be[0],Pe=be[1];function We(){var Ht;return me.current&&(Ht=new L.default(function(an){var Cn=Object(I.a)(an),qn;try{for(Cn.s();!(qn=Cn.n()).done;){var Ir=qn.value;(Ir.target.offsetHeight>0||Ir.target.offsetWidth>0)&&ne.current.instance.layout()}}catch(gn){Cn.e(gn)}finally{Cn.f()}}),Ht.observe(me.current)),Ht}function et(){z.b.warn(decodeURIComponent(g))}var yt=function(){var an=ne.current.instance;if(Te!=null&&an&&Se){var Cn=an.getModel();Cn&&Te!==Cn.getValue()&&(w=!0,Cn.setValue(Te),an.layout(),w=!1)}};Object(K.useEffect)(function(){se.current&&clearTimeout(se.current),se.current=setTimeout(function(){yt()},500)},[Te,Se,ne.current]),Object(K.useEffect)(function(){if(pt&&ne.current&&ne.current.instance){var Ht=ne.current.instance;Ht.changeViewZones(function(Cn){var qn=document.createElement("div");qn.style.padding="10px 20px",qn.style.width="calc(100% - 20px)",qn.className="my-error-line-wrp",qn.innerHTML=Tt,Cn.addZone({afterLineNumber:pt||11,heightInLines:3,domNode:qn})});var an={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}};Ht.addOverlayWidget(an),Ht.revealPositionInCenter({lineNumber:20,column:1})}},[pt,ne.current,Se]);function Rt(){var Ht=ne.current.instance;if(Ht){var an=Ht.getSelection(),Cn=ne.current.pastePos||{},qn=new T.Range(Cn.startLineNumber||an.endLineNumber,Cn.startColumn||an.endColumn,Cn.endLineNumber||an.endLineNumber,Cn.endColumn||an.endColumn);setTimeout(function(){Ht.executeEdits("",[{range:qn,text:""}])},300)}}function kt(Ht){(window.navigator.platform.match("Mac")?Ht.metaKey:Ht.ctrlKey)&&Ht.keyCode==83&&(Ht.preventDefault(),ye())}var mn=function(){if(Ke&&ne.current.instance){var an=ne.current.instance.getContentHeight();Ar(an<ae?ae:an)}else Ar(ae)};function zt(Ht){var an=document.createEvent("MouseEvents");an.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Ht.dispatchEvent(an)}function Mt(Ht,an){var Cn=window.URL||window.webkitURL||window,qn=new Blob([an]),Ir=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ir.href=Cn.createObjectURL(qn),Ir.download=Ht,zt(Ir)}Object(K.useEffect)(function(){mn()},[mn]),Object(K.useEffect)(function(){me.current&&!Se&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(Ht){try{T=Ht,ne.current.instance=T.editor.create(me.current,{value:Te,language:W(ge),theme:J,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},j);var an=ne.current.instance,Cn=_.d._menuItems,qn=Object(Y.a)(Cn).find(function(jn){return jn[0]._debugName=="EditorContext"}),Ir=qn[1],gn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],wt=function(cn,on){var Dn=cn._first;do{var ei,Tr,ct=on.includes((ei=Dn.element)===null||ei===void 0||((Tr=ei.command)===null||Tr===void 0)?void 0:Tr.id);ct&&cn._remove(Dn)}while(Dn=Dn.next)};if(nt(an,T),setTimeout(function(){mn(),ne.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Mt(lt||"educoder.txt",an.getValue())}}),an.getDomNode().addEventListener("input",function(){q.current.autoFormat&&an.getAction("editor.action.formatDocument").run()})},500),ne.current.subscription=an.onDidChangeModelContent(function(jn){ue.current?clearTimeout(oe.current):(mn(),Ue(an.getValue(),jn)),oe.current=setTimeout(function(){ue.current=!1},500)}),window.Monaco||O(T,W(ge)),we&&(wt(Ir,gn),me.current.classList.add("noCopyPaste"),an.onKeyDown(function(jn){var cn=jn.keyCode,on=jn.ctrlKey,Dn=jn.metaKey;(cn===33||cn===52)&&(Dn||on)&&(et(),jn.preventDefault())})),window.Monaco=T,X&&an.onDidBlurEditorWidget(function(){X(an.getValue())}),qe&&an.onDidFocusEditorText(function(){qe(an.getValue())}),we){an.addCommand(T.KeyMod.CtrlCmd|T.KeyCode.KEY_V,function(){return et(),null}),an.onDidPaste(function(jn){ne.current.pastePos=jn});try{window.addEventListener("paste",Rt)}catch(jn){}}var Rn=We();return Pe(!0),function(){var jn=ne.current.instance;jn.dispose();var cn=jn.getModel();cn&&cn.dispose(),ne.current.subscription&&ne.current.subscription.dispose(),we&&window.removeEventListener("paste",Rt),Rn.unobserve(me.current)}}catch(jn){}})},[]),Object(K.useEffect)(function(){var Ht=ne.current.instance;if(Ht&&Se)return document.addEventListener("keydown",kt,!1),function(){document.removeEventListener("keydown",kt)}},[ye,Se]),Object(K.useEffect)(function(){var Ht=ne.current.instance;if(Ht&&Se){var an=W(ge);T.editor.setModelLanguage(Ht.getModel(),an),console.log("language:",ge,Ht.getModel(),an)}},[ge,Se]),Object(K.useEffect)(function(){var Ht=ne.current.instance;Ht&&Se&&T.editor.setTheme(J)},[J,Se]),Object(K.useEffect)(function(){var Ht=ne.current.instance;q.current=V,Ht&&Se&&(Ht.updateOptions(Object(ie.a)({},V)),setTimeout(function(){Ht.getModel().updateOptions(Object(ie.a)({},V))},200))},[JSON.stringify(V),Se]),Object(K.useEffect)(function(){var Ht=ne.current.instance;Ht&&Se&&Ht.layout()},[Q,ae,Se]);var Qn=Object(K.useState)(C(Q)),un=Object(M.a)(Qn,2),hr=un[0],or=un[1],bn=Object(K.useState)(C(ae)),xr=Object(M.a)(bn,2),br=xr[0],Ar=xr[1],Br=Object(ie.a)(Object(ie.a)({},Oe),{},{width:hr,height:br});return n.a.createElement("div",{className:"my-monaco-editor",ref:me,style:Br})};function m(y){var H=y.width,Q=H===void 0?"100%":H,te=y.height,ae=te===void 0?"100%":te,Te=y.original,_e=y.modified,ge=y.language,ve=y.options,Oe=ve===void 0?{}:ve,he=Object(K.useRef)(),V=Object(K.useState)(null),P=Object(M.a)(V,2),j=P[0],$=P[1];function J(Ke){var pe;return he.current&&(pe=new L.default(function(we){var ke=Object(I.a)(we),Ue;try{for(ke.s();!(Ue=ke.n()).done;){var Qe=Ue.value;(Qe.target.offsetHeight>0||Qe.target.offsetWidth>0)&&Ke.layout()}}catch(nt){ke.e(nt)}finally{ke.f()}}),pe.observe(he.current)),pe}Object(K.useEffect)(function(){he.current&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(Ke){T=Ke;var pe=T.editor.createDiffEditor(he.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},Oe),{},{wordWrap:!0}));$(pe);var we=J(pe);return function(){pe.dispose();var ke=pe.getModel();ke&&ke.dispose(),we.unobserve(he.current)}})},[]),Object(K.useEffect)(function(){j&&j.setModel({original:T.editor.createModel(Te,ge),modified:T.editor.createModel(_e,ge)})},[Te,_e,ge,j]);var X=C(Q),ye=C(ae),Re={width:X,height:ye};return n.a.createElement("div",{className:"my-diff-editor",ref:he,style:Re})}},"a+yL":function(it,Ee,U){it.exports={search:"search___t0h96",btn:"btn___t2oDx"}},bT9E:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return Y});var ie=U("VTBJ");function Y(N,z){var I=Object(ie.a)({},N);return Array.isArray(z)&&z.forEach(function(M){delete I[M]}),I}},c5Ni:function(it,Ee,U){},d5o6:function(it,Ee,U){it.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"}},dejd:function(it,Ee,U){},dmUQ:function(it,Ee,U){"use strict";var ie=U("Ff2n"),Y=U("rePB"),N=U("1OyB"),z=U("vuIU"),I=U("Ji7U"),M=U("md7G"),G=U("foSv"),K=U("q1tI"),n=U.n(K),L=U("TSYQ"),x=U.n(L),f=U("4IlW");function b(d,c){var C=Object.keys(d);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(d);c&&(E=E.filter(function(w){return Object.getOwnPropertyDescriptor(d,w).enumerable})),C.push.apply(C,E)}return C}function h(d){for(var c=1;c<arguments.length;c++){var C=arguments[c]!=null?arguments[c]:{};c%2?b(Object(C),!0).forEach(function(E){Object(Y.a)(d,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(C)):b(Object(C)).forEach(function(E){Object.defineProperty(d,E,Object.getOwnPropertyDescriptor(C,E))})}return d}function o(d){var c=p();return function(){var E=Object(G.a)(d),w;if(c){var B=Object(G.a)(this).constructor;w=Reflect.construct(E,arguments,B)}else w=E.apply(this,arguments);return Object(M.a)(this,w)}}function p(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(d){return!1}}function l(){}function u(d){d.preventDefault()}var s=function(c){return c.replace(/[^\w.-]+/g,"")},i=200,D=600,A=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(c){return c!=null},R=function(c,C){return C===c||typeof C=="number"&&typeof c=="number"&&isNaN(C)&&isNaN(c)},O=function(d){Object(I.a)(C,d);var c=o(C);function C(E){var w;Object(N.a)(this,C),w=c.call(this,E),w.onKeyDown=function(T){var k=w.props,m=k.onKeyDown,y=k.onPressEnter;if(T.keyCode===f.a.UP){var H=w.getRatio(T);w.up(T,H,null),w.stop()}else if(T.keyCode===f.a.DOWN){var Q=w.getRatio(T);w.down(T,Q,null),w.stop()}else T.keyCode===f.a.ENTER&&y&&y(T);if(w.recordCursorPosition(),w.lastKeyCode=T.keyCode,m){for(var te=arguments.length,ae=new Array(te>1?te-1:0),Te=1;Te<te;Te++)ae[Te-1]=arguments[Te];m.apply(void 0,[T].concat(ae))}},w.onKeyUp=function(T){var k=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),k){for(var m=arguments.length,y=new Array(m>1?m-1:0),H=1;H<m;H++)y[H-1]=arguments[H];k.apply(void 0,[T].concat(y))}},w.onChange=function(T){var k=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(T)),w.setState({inputValue:w.rawInput}),k(w.toNumber(w.rawInput))},w.onMouseUp=function(){var T=w.props.onMouseUp;w.recordCursorPosition(),T&&T.apply(void 0,arguments)},w.onFocus=function(){var T;w.setState({focused:!0}),(T=w.props).onFocus.apply(T,arguments)},w.onBlur=function(){var T=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var k=w.getCurrentValidValue(w.state.inputValue),m=w.setValue(k,l);if(T){var y=w.input.value,H=w.getInputDisplayValue({focus:!1,value:m});w.input.value=H&&Number(H),T.apply(void 0,arguments),w.input.value=y}},w.getRatio=function(T){var k=1;return T.metaKey||T.ctrlKey?k=.1:T.shiftKey&&(k=10),k},w.getFullNum=function(T){return isNaN(T)?T:/e/i.test(String(T))?Number(T).toFixed(18).replace(/\.?0+$/,""):T},w.getPrecision=function(T){if(S(w.props.precision))return w.props.precision;var k=String(T);if(k.indexOf("e-")>=0)return parseInt(k.slice(k.indexOf("e-")+2),10);var m=0;return k.indexOf(".")>=0&&(m=k.length-k.indexOf(".")-1),m},w.getInputDisplayValue=function(T){var k=T||w.state,m=k.focused,y=k.inputValue,H=k.value,Q;m?Q=y:Q=w.toPrecisionAsStep(H),Q==null&&(Q="");var te=w.formatWrapper(Q);return S(w.props.decimalSeparator)&&(te=te.toString().replace(".",w.props.decimalSeparator)),te},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(T){}},w.restoreByAfter=function(T){if(T===void 0)return!1;var k=w.input.value,m=k.lastIndexOf(T);if(m===-1)return!1;var y=w.cursorBefore.length;return w.lastKeyCode===f.a.DELETE&&w.cursorBefore.charAt(y-1)===T[0]?(w.fixCaret(y,y),!0):m+T.length===k.length?(w.fixCaret(m,m),!0):!1},w.partRestoreByAfter=function(T){return T===void 0?!1:Array.prototype.some.call(T,function(k,m){var y=T.substring(m);return w.restoreByAfter(y)})},w.isNotCompleteNumber=function(T){return isNaN(T)||T===""||T===null||T&&T.toString().indexOf(".")===T.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(T,k,m){w.pressingUpOrDown=!0,w.step("down",T,k,m)},w.up=function(T,k,m){w.pressingUpOrDown=!0,w.step("up",T,k,m)},w.saveInput=function(T){w.input=T};var B=E.value;B===void 0&&(B=E.defaultValue),w.state={focused:E.autoFocus};var W=w.getValidValue(w.toNumber(B));return w.state=h(h({},w.state),{},{inputValue:w.toPrecisionAsStep(W),value:W}),w}return Object(z.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var B=this.props,W=B.value,T=B.onChange,k=B.max,m=B.min,y=this.state.focused;if(w){if(!R(w.value,W)||!R(w.max,k)||!R(w.min,m)){var H=y?W:this.getValidValue(W),Q;this.pressingUpOrDown?Q=H:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:Q})}var te="value"in this.props?W:this.state.value;"max"in this.props&&w.max!==k&&typeof te=="number"&&te>k&&T&&T(k),"min"in this.props&&w.min!==m&&typeof te=="number"&&te<m&&T&&T(m)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ae=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?ae=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(ae=this.cursorStart):ae=this.input.value.length,this.fixCaret(ae,ae)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Te){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(w){var B=w;return B===""?B="":this.isNotCompleteNumber(parseFloat(B))?B=this.state.value:B=this.getValidValue(B),this.toNumber(B)}},{key:"getValueFromEvent",value:function(w){var B=w.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(B=B.replace(this.props.decimalSeparator,".")),B}},{key:"getValidValue",value:function(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,T=parseFloat(w);return isNaN(T)?w:(T<B&&(T=B),T>W&&(T=W),T)}},{key:"setValue",value:function(w,B){var W=this.props.precision,T=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),k=this.state.value,m=k===void 0?null:k,y=this.state.inputValue,H=y===void 0?null:y,Q=typeof T=="number"?T.toFixed(W):"".concat(T),te=T!==m||Q!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},B)):this.setState({value:T,inputValue:this.toPrecisionAsStep(w)},B),te&&this.props.onChange(T),T}},{key:"getMaxPrecision",value:function(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,T=W.precision,k=W.step;if(S(T))return T;var m=this.getPrecision(B),y=this.getPrecision(k),H=this.getPrecision(w);return w?Math.max(H,m+y):m+y}},{key:"getPrecisionFactor",value:function(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(w,B);return Math.pow(10,W)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var B=Math.abs(this.getMaxPrecision(w));return isNaN(B)?w.toString():Number(w).toFixed(B)}},{key:"toNumber",value:function(w){var B=this.props.precision,W=this.state.focused,T=w&&w.length>16&&W;return this.isNotCompleteNumber(w)||T?w:S(B)?Math.round(w*Math.pow(10,B))/Math.pow(10,B):Number(w)}},{key:"upStep",value:function(w,B){var W=this.props.step,T=this.getPrecisionFactor(w,B),k=Math.abs(this.getMaxPrecision(w,B)),m=((T*w+T*W*B)/T).toFixed(k);return this.toNumber(m)}},{key:"downStep",value:function(w,B){var W=this.props.step,T=this.getPrecisionFactor(w,B),k=Math.abs(this.getMaxPrecision(w,B)),m=((T*w-T*W*B)/T).toFixed(k);return this.toNumber(m)}},{key:"step",value:function(w,B){var W=this,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var m=this.props;if(m.disabled)return;var y=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(y))return;var H=this["".concat(w,"Step")](y,T),Q=H>m.max||H<m.min;if(H>m.max?H=m.max:H<m.min&&(H=m.min),this.setValue(H,null),this.setState({focused:!0},function(){W.pressingUpOrDown=!1}),Q)return;this.autoStepTimer=setTimeout(function(){W[w](B,T,!0)},k?i:D)}},{key:"fixCaret",value:function(w,B){if(w===void 0||B===void 0||!this.input||!this.input.value)return;try{var W=this.input.selectionStart,T=this.input.selectionEnd;(w!==W||B!==T)&&this.input.setSelectionRange(w,B)}catch(k){}}},{key:"render",value:function(){var w,B=this.props,W=B.prefixCls,T=B.disabled,k=B.readOnly,m=B.useTouch,y=B.autoComplete,H=B.upHandler,Q=B.downHandler,te=B.className,ae=B.max,Te=B.min,_e=B.style,ge=B.title,ve=B.onMouseEnter,Oe=B.onMouseLeave,he=B.onMouseOver,V=B.onMouseOut,P=B.required,j=B.onClick,$=B.tabIndex,J=B.type,X=B.placeholder,ye=B.id,Re=B.inputMode,Ke=B.pattern,pe=B.step,we=B.maxLength,ke=B.autoFocus,Ue=B.name,Qe=B.onPaste,nt=B.onInput,ot=Object(ie.a)(B,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),qe=this.state,ft=qe.value,lt=qe.focused,pt=x()(W,(w={},Object(Y.a)(w,te,!!te),Object(Y.a)(w,"".concat(W,"-disabled"),T),Object(Y.a)(w,"".concat(W,"-focused"),lt),w)),Ye={};Object.keys(ot).forEach(function(Se){(Se.substr(0,5)==="data-"||Se.substr(0,5)==="aria-"||Se==="role")&&(Ye[Se]=ot[Se])});var Tt=!k&&!T,bt=this.getInputDisplayValue(null),me=(ft||ft===0)&&(isNaN(ft)||Number(ft)>=ae),ne=(ft||ft===0)&&(isNaN(ft)||Number(ft)<=Te),q=me||T||k,se=ne||T||k,ue=x()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Y.a)({},"".concat(W,"-handler-up-disabled"),q)),oe=x()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(Y.a)({},"".concat(W,"-handler-down-disabled"),se)),ce=m?{onTouchStart:q?l:this.up,onTouchEnd:this.stop}:{onMouseDown:q?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},be=m?{onTouchStart:se?l:this.down,onTouchEnd:this.stop}:{onMouseDown:se?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:pt,style:_e,title:ge,onMouseEnter:ve,onMouseLeave:Oe,onMouseOver:he,onMouseOut:V,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(W,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Increase Value","aria-disabled":q,className:ue}),H||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:u})),n.a.createElement("span",Object.assign({unselectable:"on"},be,{role:"button","aria-label":"Decrease Value","aria-disabled":se,className:oe}),Q||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:u}))),n.a.createElement("div",{className:"".concat(W,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Te,"aria-valuemax":ae,"aria-valuenow":ft,required:P,type:J,placeholder:X,onPaste:Qe,onClick:j,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:$,autoComplete:y,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Tt?this.onKeyDown:l,onKeyUp:Tt?this.onKeyUp:l,autoFocus:ke,maxLength:we,readOnly:k,disabled:T,max:ae,min:Te,step:pe,name:Ue,title:ge,id:ye,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(bt),pattern:Ke,inputMode:Re,onInput:nt},Ye))))}}]),C}(n.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:A,min:-A,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:s,required:!1,autoComplete:"off"};var g=O,_=Ee.a=g},fAei:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return i.a});var ie=U("rePB"),Y=U("VTBJ"),N=U("KQm4"),z=U("1OyB"),I=U("vuIU"),M=U("Ji7U"),G=U("LK+K"),K=U("q1tI"),n=U("4IlW"),L=U("Kwbf"),x=U("TSYQ"),f=U.n(x),b=U("sboe"),h=U("OZM5"),o=U("815F"),p=U("ODXe"),l=U("Ff2n"),u=U("+nKL"),s=U("8XRh"),i=U("WaYH"),D=function(Te,_e){var ge=Te.className,ve=Te.style,Oe=Te.motion,he=Te.motionNodes,V=Te.motionType,P=Te.onMotionStart,j=Te.onMotionEnd,$=Te.active,J=Te.treeNodeRequiredProps,X=Object(l.a)(Te,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),ye=K.useState(!0),Re=Object(p.a)(ye,2),Ke=Re[0],pe=Re[1],we=K.useContext(b.a),ke=we.prefixCls,Ue=K.useRef(!1),Qe=function(){Ue.current||j(),Ue.current=!0};return Object(K.useEffect)(function(){he&&V==="hide"&&Ke&&pe(!1)},[he]),Object(K.useEffect)(function(){return he&&P(),function(){he&&Qe()}},[]),he?K.createElement(s.default,Object.assign({ref:_e,visible:Ke},Oe,{motionAppear:V==="show",onAppearEnd:Qe,onLeaveEnd:Qe}),function(nt,ot){var qe=nt.className,ft=nt.style;return K.createElement("div",{ref:ot,className:f()("".concat(ke,"-treenode-motion"),qe),style:ft},he.map(function(lt){var pt=lt.data,Ye=pt.key,Tt=Object(l.a)(pt,["key"]),bt=lt.isStart,me=lt.isEnd;delete Tt.children;var ne=Object(o.f)(Ye,J);return K.createElement(i.a,Object.assign({},Tt,ne,{active:$,data:lt.data,key:Ye,isStart:bt,isEnd:me}))}))}):K.createElement(i.a,Object.assign({domRef:_e,className:ge,style:ve},X,{active:$}))};D.displayName="MotionTreeNode";var A=K.forwardRef(D),S=A;function R(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_e=ae.length,ge=Te.length;if(Math.abs(_e-ge)!==1)return{add:!1,key:null};function ve(Oe,he){var V=new Map;Oe.forEach(function(j){V.set(j,!0)});var P=he.filter(function(j){return!V.has(j)});return P.length===1?P[0]:null}return _e<ge?{add:!0,key:ve(ae,Te)}:{add:!1,key:ve(Te,ae)}}function O(ae,Te,_e){var ge=ae.findIndex(function(V){var P=V.data;return P.key===_e}),ve=ae[ge+1],Oe=Te.findIndex(function(V){var P=V.data;return P.key===_e});if(ve){var he=Te.findIndex(function(V){var P=V.data;return P.key===ve.data.key});return Te.slice(Oe+1,he)}return Te.slice(Oe+1)}var g={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},_=function(){},d="RC_TREE_MOTION_".concat(Math.random()),c={key:d},C={key:d,level:0,index:0,pos:"0",node:c},E={parent:null,children:[],pos:C.pos,data:c,isStart:[],isEnd:[]};function w(ae,Te,_e,ge){return Te===!1||!_e?ae:ae.slice(0,Math.ceil(_e/ge)+1)}function B(ae){var Te=ae.data.key,_e=ae.pos;return Object(o.e)(Te,_e)}function W(ae){for(var Te=String(ae.data.key),_e=ae;_e.parent;)_e=_e.parent,Te="".concat(_e.data.key," > ").concat(Te);return Te}var T=function(Te,_e){var ge=Te.prefixCls,ve=Te.data,Oe=Te.selectable,he=Te.checkable,V=Te.expandedKeys,P=Te.selectedKeys,j=Te.checkedKeys,$=Te.loadedKeys,J=Te.loadingKeys,X=Te.halfCheckedKeys,ye=Te.keyEntities,Re=Te.disabled,Ke=Te.dragging,pe=Te.dragOverNodeKey,we=Te.dropPosition,ke=Te.motion,Ue=Te.height,Qe=Te.itemHeight,nt=Te.virtual,ot=Te.focusable,qe=Te.activeItem,ft=Te.focused,lt=Te.tabIndex,pt=Te.onKeyDown,Ye=Te.onFocus,Tt=Te.onBlur,bt=Te.onActiveChange,me=Te.onListChangeStart,ne=Te.onListChangeEnd,q=Object(l.a)(Te,["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"]),se=K.useRef(null);K.useImperativeHandle(_e,function(){return{scrollTo:function(an){se.current.scrollTo(an)}}});var ue=K.useState(V),oe=Object(p.a)(ue,2),ce=oe[0],be=oe[1],Se=K.useState(ve),Pe=Object(p.a)(Se,2),We=Pe[0],et=Pe[1],yt=K.useState(ve),Rt=Object(p.a)(yt,2),kt=Rt[0],mn=Rt[1],zt=K.useState([]),Mt=Object(p.a)(zt,2),Qn=Mt[0],un=Mt[1],hr=K.useState(null),or=Object(p.a)(hr,2),bn=or[0],xr=or[1];function br(){et(ve),mn(ve),un([]),xr(null),ne()}K.useEffect(function(){be(V);var Ht=R(ce,V);if(Ht.key!==null)if(Ht.add){var an=We.findIndex(function(Rn){var jn=Rn.data.key;return jn===Ht.key}),Cn=w(O(We,ve,Ht.key),nt,Ue,Qe),qn=We.slice();qn.splice(an+1,0,E),mn(qn),un(Cn),xr("show")}else{var Ir=ve.findIndex(function(Rn){var jn=Rn.data.key;return jn===Ht.key}),gn=w(O(ve,We,Ht.key),nt,Ue,Qe),wt=ve.slice();wt.splice(Ir+1,0,E),mn(wt),un(gn),xr("hide")}else We!==ve&&(et(ve),mn(ve))},[V,ve]),K.useEffect(function(){Ke||br()},[Ke]);var Ar=ke?kt:ve,Br={expandedKeys:V,selectedKeys:P,loadedKeys:$,loadingKeys:J,checkedKeys:j,halfCheckedKeys:X,dragOverNodeKey:pe,dropPosition:we,keyEntities:ye};return K.createElement(K.Fragment,null,ft&&qe&&K.createElement("span",{style:g,"aria-live":"assertive"},W(qe)),K.createElement("div",{role:"tree"},K.createElement("input",{style:g,disabled:ot===!1||Re,tabIndex:ot!==!1?lt:null,onKeyDown:pt,onFocus:Ye,onBlur:Tt,value:"",onChange:_})),K.createElement(u.a,Object.assign({},q,{data:Ar,itemKey:B,height:Ue,fullHeight:!1,virtual:nt,itemHeight:Qe,prefixCls:"".concat(ge,"-list"),ref:se}),function(Ht){var an=Ht.pos,Cn=Ht.data,qn=Cn.key,Ir=Object(l.a)(Cn,["key"]),gn=Ht.isStart,wt=Ht.isEnd,Rn=Object(o.e)(qn,an);delete Ir.children;var jn=Object(o.f)(Rn,Br);return K.createElement(S,Object.assign({},Ir,jn,{active:qe&&qn===qe.data.key,pos:an,data:Ht.data,isStart:gn,isEnd:wt,motion:ke,motionNodes:qn===d?Qn:null,motionType:bn,onMotionStart:me,onMotionEnd:br,treeNodeRequiredProps:Br,onMouseMove:function(){bt(null)}}))}))},k=K.forwardRef(T);k.displayName="NodeList";var m=k,y=U("NvD2"),H=function(ae){Object(M.a)(_e,ae);var Te=Object(G.a)(_e);function _e(){var ge;return Object(z.a)(this,_e),ge=Te.apply(this,arguments),ge.destroyed=!1,ge.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},ge.listRef=K.createRef(),ge.onNodeDragStart=function(ve,Oe){var he=ge.state,V=he.expandedKeys,P=he.keyEntities,j=ge.props.onDragStart,$=Oe.props.eventKey;ge.dragNode=Oe;var J=Object(h.b)(V,$);ge.setState({dragging:!0,dragNodesKeys:Object(h.g)($,P)}),ge.setExpandedKeys(J),j&&j({event:ve,node:Object(o.b)(Oe.props)})},ge.onNodeDragEnter=function(ve,Oe){var he=ge.state,V=he.expandedKeys,P=he.keyEntities,j=he.dragNodesKeys,$=ge.props.onDragEnter,J=Oe.props,X=J.pos,ye=J.eventKey;if(!ge.dragNode||j.indexOf(ye)!==-1)return;var Re=Object(h.c)(ve,Oe);if(ge.dragNode.props.eventKey===ye&&Re===0){ge.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ge.setState({dragOverNodeKey:ye,dropPosition:Re}),ge.delayedDragEnterLogic||(ge.delayedDragEnterLogic={}),Object.keys(ge.delayedDragEnterLogic).forEach(function(Ke){clearTimeout(ge.delayedDragEnterLogic[Ke])}),ge.delayedDragEnterLogic[X]=window.setTimeout(function(){if(!ge.state.dragging)return;var Ke=Object(N.a)(V),pe=P[ye];pe&&(pe.children||[]).length&&(Ke=Object(h.a)(V,ye)),"expandedKeys"in ge.props||ge.setExpandedKeys(Ke),$&&$({event:ve,node:Object(o.b)(Oe.props),expandedKeys:Ke})},400)},0)},ge.onNodeDragOver=function(ve,Oe){var he=ge.state.dragNodesKeys,V=ge.props.onDragOver,P=Oe.props.eventKey;if(he.indexOf(P)!==-1)return;if(ge.dragNode&&P===ge.state.dragOverNodeKey){var j=Object(h.c)(ve,Oe);if(j===ge.state.dropPosition)return;ge.setState({dropPosition:j})}V&&V({event:ve,node:Object(o.b)(Oe.props)})},ge.onNodeDragLeave=function(ve,Oe){var he=ge.props.onDragLeave;ge.setState({dragOverNodeKey:""}),he&&he({event:ve,node:Object(o.b)(Oe.props)})},ge.onNodeDragEnd=function(ve,Oe){var he=ge.props.onDragEnd;ge.setState({dragOverNodeKey:""}),ge.cleanDragState(),he&&he({event:ve,node:Object(o.b)(Oe.props)}),ge.dragNode=null},ge.onNodeDrop=function(ve,Oe){var he=ge.state,V=he.dragNodesKeys,P=V===void 0?[]:V,j=he.dropPosition,$=ge.props.onDrop,J=Oe.props,X=J.eventKey,ye=J.pos;if(ge.setState({dragOverNodeKey:""}),ge.cleanDragState(),P.indexOf(X)!==-1){Object(L.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Re=Object(h.k)(ye),Ke={event:ve,node:Object(o.b)(Oe.props),dragNode:ge.dragNode?Object(o.b)(ge.dragNode.props):null,dragNodesKeys:P.slice(),dropPosition:j+Number(Re[Re.length-1]),dropToGap:!1};j!==0&&(Ke.dropToGap=!0),$&&$(Ke),ge.dragNode=null},ge.cleanDragState=function(){var ve=ge.state.dragging;ve&&ge.setState({dragging:!1})},ge.onNodeClick=function(ve,Oe){var he=ge.props.onClick;he&&he(ve,Oe)},ge.onNodeDoubleClick=function(ve,Oe){var he=ge.props.onDoubleClick;he&&he(ve,Oe)},ge.onNodeSelect=function(ve,Oe){var he=ge.state.selectedKeys,V=ge.state.keyEntities,P=ge.props,j=P.onSelect,$=P.multiple,J=Oe.selected,X=Oe.key,ye=!J;ye?$?he=Object(h.a)(he,X):he=[X]:he=Object(h.b)(he,X);var Re=he.map(function(Ke){var pe=V[Ke];return pe?pe.node:null}).filter(function(Ke){return Ke});ge.setUncontrolledState({selectedKeys:he}),j&&j(he,{event:"select",selected:ye,node:Oe,selectedNodes:Re,nativeEvent:ve.nativeEvent})},ge.onNodeCheck=function(ve,Oe,he){var V=ge.state,P=V.keyEntities,j=V.checkedKeys,$=V.halfCheckedKeys,J=ge.props,X=J.checkStrictly,ye=J.onCheck,Re=Oe.key,Ke,pe={event:"check",node:Oe,checked:he,nativeEvent:ve.nativeEvent};if(X){var we=he?Object(h.a)(j,Re):Object(h.b)(j,Re),ke=Object(h.b)($,Re);Ke={checked:we,halfChecked:ke},pe.checkedNodes=we.map(function(ft){return P[ft]}).filter(function(ft){return ft}).map(function(ft){return ft.node}),ge.setUncontrolledState({checkedKeys:we})}else{var Ue=Object(y.a)([].concat(Object(N.a)(j),[Re]),!0,P),Qe=Ue.checkedKeys,nt=Ue.halfCheckedKeys;if(!he){var ot=new Set(Qe);ot.delete(Re);var qe=Object(y.a)(Array.from(ot),{checked:!1,halfCheckedKeys:nt},P);Qe=qe.checkedKeys,nt=qe.halfCheckedKeys}Ke=Qe,pe.checkedNodes=[],pe.checkedNodesPositions=[],pe.halfCheckedKeys=nt,Qe.forEach(function(ft){var lt=P[ft];if(!lt)return;var pt=lt.node,Ye=lt.pos;pe.checkedNodes.push(pt),pe.checkedNodesPositions.push({node:pt,pos:Ye})}),ge.setUncontrolledState({checkedKeys:Qe},!1,{halfCheckedKeys:nt})}ye&&ye(Ke,pe)},ge.onNodeLoad=function(ve){return new Promise(function(Oe){ge.setState(function(he){var V=he.loadedKeys,P=V===void 0?[]:V,j=he.loadingKeys,$=j===void 0?[]:j,J=ge.props,X=J.loadData,ye=J.onLoad,Re=ve.key;if(!X||P.indexOf(Re)!==-1||$.indexOf(Re)!==-1)return{};var Ke=X(ve);return Ke.then(function(){var pe=ge.state,we=pe.loadedKeys,ke=pe.loadingKeys,Ue=Object(h.a)(we,Re),Qe=Object(h.b)(ke,Re);ye&&ye(Ue,{event:"load",node:ve}),ge.setUncontrolledState({loadedKeys:Ue}),ge.setState({loadingKeys:Qe}),Oe()}),{loadingKeys:Object(h.a)($,Re)}})})},ge.onNodeMouseEnter=function(ve,Oe){var he=ge.props.onMouseEnter;he&&he({event:ve,node:Oe})},ge.onNodeMouseLeave=function(ve,Oe){var he=ge.props.onMouseLeave;he&&he({event:ve,node:Oe})},ge.onNodeContextMenu=function(ve,Oe){var he=ge.props.onRightClick;he&&(ve.preventDefault(),he({event:ve,node:Oe}))},ge.onFocus=function(){var ve=ge.props.onFocus;ge.setState({focused:!0}),ve&&ve.apply(void 0,arguments)},ge.onBlur=function(){var ve=ge.props.onBlur;ge.setState({focused:!1}),ge.onActiveChange(null),ve&&ve.apply(void 0,arguments)},ge.getTreeNodeRequiredProps=function(){var ve=ge.state,Oe=ve.expandedKeys,he=ve.selectedKeys,V=ve.loadedKeys,P=ve.loadingKeys,j=ve.checkedKeys,$=ve.halfCheckedKeys,J=ve.dragOverNodeKey,X=ve.dropPosition,ye=ve.keyEntities;return{expandedKeys:Oe||[],selectedKeys:he||[],loadedKeys:V||[],loadingKeys:P||[],checkedKeys:j||[],halfCheckedKeys:$||[],dragOverNodeKey:J,dropPosition:X,keyEntities:ye}},ge.setExpandedKeys=function(ve){var Oe=ge.state.treeData,he=Object(o.d)(Oe,ve);ge.setUncontrolledState({expandedKeys:ve,flattenNodes:he},!0)},ge.onNodeExpand=function(ve,Oe){var he=ge.state.expandedKeys,V=ge.state.listChanging,P=ge.props,j=P.onExpand,$=P.loadData,J=Oe.key,X=Oe.expanded;if(V)return;var ye=he.indexOf(J),Re=!X;if(Object(L.a)(X&&ye!==-1||!X&&ye===-1,"Expand state not sync with index check"),Re?he=Object(h.a)(he,J):he=Object(h.b)(he,J),ge.setExpandedKeys(he),j&&j(he,{node:Oe,expanded:Re,nativeEvent:ve.nativeEvent}),Re&&$){var Ke=ge.onNodeLoad(Oe);Ke&&Ke.then(function(){var pe=Object(o.d)(ge.state.treeData,he);ge.setUncontrolledState({flattenNodes:pe})})}},ge.onListChangeStart=function(){ge.setUncontrolledState({listChanging:!0})},ge.onListChangeEnd=function(){setTimeout(function(){ge.setUncontrolledState({listChanging:!1})})},ge.onActiveChange=function(ve){var Oe=ge.state.activeKey,he=ge.props.onActiveChange;if(Oe===ve)return;ge.setState({activeKey:ve}),ve!==null&&ge.scrollTo({key:ve}),he&&he(ve)},ge.getActiveItem=function(){var ve=ge.state,Oe=ve.activeKey,he=ve.flattenNodes;return Oe===null?null:he.find(function(V){var P=V.data.key;return P===Oe})||null},ge.offsetActiveKey=function(ve){var Oe=ge.state,he=Oe.flattenNodes,V=Oe.activeKey,P=he.findIndex(function(J){var X=J.data.key;return X===V});P===-1&&ve<0&&(P=he.length),P=(P+ve+he.length)%he.length;var j=he[P];if(j){var $=j.data.key;ge.onActiveChange($)}else ge.onActiveChange(null)},ge.onKeyDown=function(ve){var Oe=ge.state,he=Oe.activeKey,V=Oe.expandedKeys,P=Oe.checkedKeys,j=ge.props,$=j.onKeyDown,J=j.checkable,X=j.selectable;switch(ve.which){case n.a.UP:{ge.offsetActiveKey(-1),ve.preventDefault();break}case n.a.DOWN:{ge.offsetActiveKey(1),ve.preventDefault();break}}var ye=ge.getActiveItem();if(ye&&ye.data){var Re=ge.getTreeNodeRequiredProps(),Ke=ye.data.isLeaf===!1||!!(ye.data.children||[]).length,pe=Object(o.b)(Object(Y.a)(Object(Y.a)({},Object(o.f)(he,Re)),{},{data:ye.data,active:!0}));switch(ve.which){case n.a.LEFT:{Ke&&V.includes(he)?ge.onNodeExpand({},pe):ye.parent&&ge.onActiveChange(ye.parent.data.key),ve.preventDefault();break}case n.a.RIGHT:{Ke&&!V.includes(he)?ge.onNodeExpand({},pe):ye.children&&ye.children.length&&ge.onActiveChange(ye.children[0].data.key),ve.preventDefault();break}case n.a.ENTER:case n.a.SPACE:{J&&!pe.disabled&&pe.checkable!==!1&&!pe.disableCheckbox?ge.onNodeCheck({},pe,!P.includes(he)):!J&&X&&!pe.disabled&&pe.selectable!==!1&&ge.onNodeSelect({},pe);break}}}$&&$(ve)},ge.setUncontrolledState=function(ve){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ge.destroyed)return;var V=!1,P=!0,j={};Object.keys(ve).forEach(function($){if($ in ge.props){P=!1;return}V=!0,j[$]=ve[$]}),V&&(!Oe||P)&&ge.setState(Object(Y.a)(Object(Y.a)({},j),he))},ge.scrollTo=function(ve){ge.listRef.current.scrollTo(ve)},ge}return Object(I.a)(_e,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ve,Oe=this.state,he=Oe.focused,V=Oe.flattenNodes,P=Oe.keyEntities,j=Oe.dragging,$=Oe.activeKey,J=this.props,X=J.prefixCls,ye=J.className,Re=J.style,Ke=J.showLine,pe=J.focusable,we=J.tabIndex,ke=we===void 0?0:we,Ue=J.selectable,Qe=J.showIcon,nt=J.icon,ot=J.switcherIcon,qe=J.draggable,ft=J.checkable,lt=J.checkStrictly,pt=J.disabled,Ye=J.motion,Tt=J.loadData,bt=J.filterTreeNode,me=J.height,ne=J.itemHeight,q=J.virtual,se=J.titleRender,ue=J.onContextMenu,oe=Object(h.f)(this.props);return K.createElement(b.a.Provider,{value:{prefixCls:X,selectable:Ue,showIcon:Qe,icon:nt,switcherIcon:ot,draggable:qe,checkable:ft,checkStrictly:lt,disabled:pt,keyEntities:P,loadData:Tt,filterTreeNode:bt,titleRender:se,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}},K.createElement("div",{className:f()(X,ye,(ve={},Object(ie.a)(ve,"".concat(X,"-show-line"),Ke),Object(ie.a)(ve,"".concat(X,"-focused"),he),Object(ie.a)(ve,"".concat(X,"-active-focused"),$!==null),ve))},K.createElement(m,Object.assign({ref:this.listRef,prefixCls:X,style:Re,data:V,disabled:pt,selectable:Ue,checkable:!!ft,motion:Ye,dragging:j,height:me,itemHeight:ne,virtual:q,focusable:pe,focused:he,tabIndex:ke,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ue},this.getTreeNodeRequiredProps(),oe))))}}],[{key:"getDerivedStateFromProps",value:function(ve,Oe){var he=Oe.prevProps,V={prevProps:ve};function P(nt){return!he&&nt in ve||he&&he[nt]!==ve[nt]}var j;if(P("treeData")?j=ve.treeData:P("children")&&(Object(L.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),j=Object(o.c)(ve.children)),j){V.treeData=j;var $=Object(o.a)(j);V.keyEntities=Object(Y.a)(Object(ie.a)({},d,C),$.keyEntities)}var J=V.keyEntities||Oe.keyEntities;if(P("expandedKeys")||he&&P("autoExpandParent"))V.expandedKeys=ve.autoExpandParent||!he&&ve.defaultExpandParent?Object(h.e)(ve.expandedKeys,J):ve.expandedKeys;else if(!he&&ve.defaultExpandAll){var X=Object(Y.a)({},J);delete X[d],V.expandedKeys=Object.keys(X).map(function(nt){return X[nt].key})}else!he&&ve.defaultExpandedKeys&&(V.expandedKeys=ve.autoExpandParent||ve.defaultExpandParent?Object(h.e)(ve.defaultExpandedKeys,J):ve.defaultExpandedKeys);if(V.expandedKeys||delete V.expandedKeys,j||V.expandedKeys){var ye=Object(o.d)(j||Oe.treeData,V.expandedKeys||Oe.expandedKeys);V.flattenNodes=ye}if(ve.selectable&&(P("selectedKeys")?V.selectedKeys=Object(h.d)(ve.selectedKeys,ve):!he&&ve.defaultSelectedKeys&&(V.selectedKeys=Object(h.d)(ve.defaultSelectedKeys,ve))),ve.checkable){var Re;if(P("checkedKeys")?Re=Object(h.j)(ve.checkedKeys)||{}:!he&&ve.defaultCheckedKeys?Re=Object(h.j)(ve.defaultCheckedKeys)||{}:j&&(Re=Object(h.j)(ve.checkedKeys)||{checkedKeys:Oe.checkedKeys,halfCheckedKeys:Oe.halfCheckedKeys}),Re){var Ke=Re,pe=Ke.checkedKeys,we=pe===void 0?[]:pe,ke=Ke.halfCheckedKeys,Ue=ke===void 0?[]:ke;if(!ve.checkStrictly){var Qe=Object(y.a)(we,!0,J);we=Qe.checkedKeys,Ue=Qe.halfCheckedKeys}V.checkedKeys=we,V.halfCheckedKeys=Ue}}return P("loadedKeys")&&(V.loadedKeys=ve.loadedKeys),V}}]),_e}(K.Component);H.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:[]},H.TreeNode=i.a;var Q=H,te=Ee.b=Q},fcSX:function(it,Ee,U){"use strict";var ie=U("Ff2n"),Y=U("1OyB"),N=U("vuIU"),z=U("Ji7U"),I=U("md7G"),M=U("foSv"),G=U("1W/9"),K=U("q1tI"),n=U("rePB"),L=U("JX7q"),x=U("TSYQ"),f=U.n(x),b=U("qx4F"),h=U("4IlW");function o(T){return Array.isArray(T)?T:[T]}var p={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(p).filter(function(T){if(typeof document=="undefined")return!1;var k=document.getElementsByTagName("html")[0];return T in(k?k.style:{})})[0],u=p[l];function s(T,k,m,y){T.addEventListener?T.addEventListener(k,m,y):T.attachEvent&&T.attachEvent("on".concat(k),m)}function i(T,k,m,y){T.removeEventListener?T.removeEventListener(k,m,y):T.attachEvent&&T.detachEvent("on".concat(k),m)}function D(T,k){var m=typeof T=="function"?T(k):T;return Array.isArray(m)?m.length===2?m:[m[0],m[1]]:[m]}var A=function(k){return!isNaN(parseFloat(k))&&isFinite(k)},S=!(typeof window!="undefined"&&window.document&&window.document.createElement),R=function T(k,m,y,H){if(!m||m===document||m instanceof Document)return!1;if(m===k.parentNode)return!0;var Q=Math.max(Math.abs(y),Math.abs(H))===Math.abs(H),te=Math.max(Math.abs(y),Math.abs(H))===Math.abs(y),ae=m.scrollHeight-m.clientHeight,Te=m.scrollWidth-m.clientWidth,_e=document.defaultView.getComputedStyle(m),ge=_e.overflowY==="auto"||_e.overflowY==="scroll",ve=_e.overflowX==="auto"||_e.overflowX==="scroll",Oe=ae&&ge,he=Te&&ve;return Q&&(!Oe||Oe&&(m.scrollTop>=ae&&H<0||m.scrollTop<=0&&H>0))||te&&(!he||he&&(m.scrollLeft>=Te&&y<0||m.scrollLeft<=0&&y>0))?T(k,m.parentNode,y,H):!1};function O(T){var k=g();return function(){var y=Object(M.a)(T),H;if(k){var Q=Object(M.a)(this).constructor;H=Reflect.construct(y,arguments,Q)}else H=y.apply(this,arguments);return Object(I.a)(this,H)}}function g(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(T){return!1}}var _={},d=function(T){Object(z.a)(m,T);var k=O(m);function m(y){var H;return Object(Y.a)(this,m),H=k.call(this,y),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(Q){if(Q.touches.length>1)return;H.startPos={x:Q.touches[0].clientX,y:Q.touches[0].clientY}},H.removeMoveHandler=function(Q){if(Q.changedTouches.length>1)return;var te=Q.currentTarget,ae=Q.changedTouches[0].clientX-H.startPos.x,Te=Q.changedTouches[0].clientY-H.startPos.y;(te===H.maskDom||te===H.handlerDom||te===H.contentDom&&R(te,Q.target,ae,Te))&&Q.cancelable&&Q.preventDefault()},H.transitionEnd=function(Q){var te=Q.target;i(te,u,H.transitionEnd),te.style.transition=""},H.onKeyDown=function(Q){if(Q.keyCode===h.a.ESC){var te=H.props.onClose;Q.stopPropagation(),te&&te(Q)}},H.onWrapperTransitionEnd=function(Q){var te=H.props,ae=te.open,Te=te.afterVisibleChange;Q.target===H.contentWrapper&&Q.propertyName.match(/transform$/)&&(H.dom.style.transition="",!ae&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),Te&&Te(!!ae))},H.openLevelTransition=function(){var Q=H.props,te=Q.open,ae=Q.width,Te=Q.height,_e=H.getHorizontalBoolAndPlacementName(),ge=_e.isHorizontal,ve=_e.placementName,Oe=H.contentDom?H.contentDom.getBoundingClientRect()[ge?"width":"height"]:0,he=(ge?ae:Te)||Oe;H.setLevelAndScrolling(te,ve,he)},H.setLevelTransform=function(Q,te,ae,Te){var _e=H.props,ge=_e.placement,ve=_e.levelMove,Oe=_e.duration,he=_e.ease,V=_e.showMask;H.levelDom.forEach(function(P){P.style.transition="transform ".concat(Oe," ").concat(he),s(P,u,H.transitionEnd);var j=Q?ae:0;if(ve){var $=D(ve,{target:P,open:Q});j=Q?$[0]:$[1]||0}var J=typeof j=="number"?"".concat(j,"px"):j,X=ge==="left"||ge==="top"?J:"-".concat(J);X=V&&ge==="right"&&Te?"calc(".concat(X," + ").concat(Te,"px)"):X,P.style.transform=j?"".concat(te,"(").concat(X,")"):""})},H.setLevelAndScrolling=function(Q,te,ae){var Te=H.props.onChange;if(!S){var _e=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(b.a)(!0):0;H.setLevelTransform(Q,te,ae,_e),H.toggleScrollingToDrawerAndBody(_e)}Te&&Te(Q)},H.toggleScrollingToDrawerAndBody=function(Q){var te=H.props,ae=te.getOpenCount,Te=te.getContainer,_e=te.showMask,ge=te.open,ve=Te&&Te(),Oe=ae&&ae();if(ve&&ve.parentNode===document.body&&_e){var he=["touchstart"],V=[document.body,H.maskDom,H.handlerDom,H.contentDom];ge&&document.body.style.overflow!=="hidden"?(Q&&H.addScrollingEffect(Q),Oe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",V.forEach(function(P,j){if(!P)return;s(P,he[j]||"touchmove",j?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(Oe||(document.body.style.overflow=""),document.body.style.touchAction="",Q&&H.remScrollingEffect(Q),V.forEach(function(P,j){if(!P)return;i(P,he[j]||"touchmove",j?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(Q){var te=H.props,ae=te.placement,Te=te.duration,_e=te.ease,ge=te.getOpenCount,ve=te.switchScrollingEffect,Oe=ge&&ge();Oe===1&&ve();var he="width ".concat(Te," ").concat(_e),V="transform ".concat(Te," ").concat(_e);H.dom.style.transition="none";switch(ae){case"right":H.dom.style.transform="translateX(-".concat(Q,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(Q,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(V,",").concat(he),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(Q){var te=H.props,ae=te.placement,Te=te.duration,_e=te.ease,ge=te.getOpenCount,ve=te.switchScrollingEffect,Oe=ge&&ge();Oe||ve(!0),l&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var he,V="width ".concat(Te," ").concat(_e),P="transform ".concat(Te," ").concat(_e);switch(ae){case"left":{H.dom.style.width="100%",V="width 0s ".concat(_e," ").concat(Te);break}case"right":{H.dom.style.transform="translateX(".concat(Q,"px)"),H.dom.style.width="100%",V="width 0s ".concat(_e," ").concat(Te),H.maskDom&&(H.maskDom.style.left="-".concat(Q,"px"),H.maskDom.style.width="calc(100% + ".concat(Q,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(Q,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",he="height 0s ".concat(_e," ").concat(Te);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(P,",").concat(he?"".concat(he,","):"").concat(V),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(_).some(function(Q){return _[Q]})},H.getLevelDom=function(Q){var te=Q.level,ae=Q.getContainer;if(S)return;var Te=ae&&ae(),_e=Te?Te.parentNode:null;if(H.levelDom=[],te==="all"){var ge=_e?Array.prototype.slice.call(_e.children):[];ge.forEach(function(ve){ve.nodeName!=="SCRIPT"&&ve.nodeName!=="STYLE"&&ve.nodeName!=="LINK"&&ve!==Te&&H.levelDom.push(ve)})}else te&&o(te).forEach(function(ve){document.querySelectorAll(ve).forEach(function(Oe){H.levelDom.push(Oe)})})},H.getHorizontalBoolAndPlacementName=function(){var Q=H.props.placement,te=Q==="left"||Q==="right",ae="translate".concat(te?"X":"Y");return{isHorizontal:te,placementName:ae}},H.state={_self:Object(L.a)(H)},H}return Object(N.a)(m,[{key:"componentDidMount",value:function(){var H=this;if(!S){var Q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Q=!0,null}}))}catch(ge){}this.passive=Q?{passive:!1}:!1}var te=this.props,ae=te.open,Te=te.getContainer,_e=Te&&Te();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ae&&(_e&&_e.parentNode===document.body&&(_[this.drawerId]=ae),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var Q=this.props,te=Q.open,ae=Q.getContainer,Te=ae&&ae();te!==H.open&&(te&&this.domFocus(),Te&&Te.parentNode===document.body&&(_[this.drawerId]=!!te),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,Q=H.getOpenCount,te=H.open,ae=H.switchScrollingEffect,Te=typeof Q=="function"&&Q();delete _[this.drawerId],te&&(this.setLevelTransform(!1),document.body.style.touchAction=""),Te||(document.body.style.overflow="",ae(!0))}},{key:"render",value:function(){var H,Q=this,te=this.props,ae=te.className,Te=te.children,_e=te.style,ge=te.width,ve=te.height,Oe=te.defaultOpen,he=te.open,V=te.prefixCls,P=te.placement,j=te.level,$=te.levelMove,J=te.ease,X=te.duration,ye=te.getContainer,Re=te.handler,Ke=te.onChange,pe=te.afterVisibleChange,we=te.showMask,ke=te.maskClosable,Ue=te.maskStyle,Qe=te.onClose,nt=te.onHandleClick,ot=te.keyboard,qe=te.getOpenCount,ft=te.switchScrollingEffect,lt=Object(ie.a)(te,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),pt=this.dom?he:!1,Ye=f()(V,(H={},Object(n.a)(H,"".concat(V,"-").concat(P),!0),Object(n.a)(H,"".concat(V,"-open"),pt),Object(n.a)(H,ae||"",!!ae),Object(n.a)(H,"no-mask",!we),H)),Tt=this.getHorizontalBoolAndPlacementName(),bt=Tt.placementName,me=P==="left"||P==="top"?"-100%":"100%",ne=pt?"":"".concat(bt,"(").concat(me,")"),q=Re&&K.cloneElement(Re,{onClick:function(ue){Re.props.onClick&&Re.props.onClick(),nt&&nt(ue)},ref:function(ue){Q.handlerDom=ue}});return K.createElement("div",Object.assign({},lt,{tabIndex:-1,className:Ye,style:_e,ref:function(ue){Q.dom=ue},onKeyDown:pt&&ot?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),we&&K.createElement("div",{className:"".concat(V,"-mask"),onClick:ke?Qe:void 0,style:Ue,ref:function(ue){Q.maskDom=ue}}),K.createElement("div",{className:"".concat(V,"-content-wrapper"),style:{transform:ne,msTransform:ne,width:A(ge)?"".concat(ge,"px"):ge,height:A(ve)?"".concat(ve,"px"):ve},ref:function(ue){Q.contentWrapper=ue}},K.createElement("div",{className:"".concat(V,"-content"),ref:function(ue){Q.contentDom=ue},onTouchStart:pt&&we?this.removeStartHandler:void 0,onTouchMove:pt&&we?this.removeMoveHandler:void 0},Te),q))}}],[{key:"getDerivedStateFromProps",value:function(H,Q){var te=Q.prevProps,ae=Q._self,Te={prevProps:H};if(te!==void 0){var _e=H.placement,ge=H.level;_e!==te.placement&&(ae.contentDom=null),ge!==te.level&&ae.getLevelDom(H)}return Te}}]),m}(K.Component);d.defaultProps={switchScrollingEffect:function(){}};var c=d;function C(T){var k=E();return function(){var y=Object(M.a)(T),H;if(k){var Q=Object(M.a)(this).constructor;H=Reflect.construct(y,arguments,Q)}else H=y.apply(this,arguments);return Object(I.a)(this,H)}}function E(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(T){return!1}}var w=function(T){Object(z.a)(m,T);var k=C(m);function m(y){var H;Object(Y.a)(this,m),H=k.call(this,y),H.onHandleClick=function(te){var ae=H.props,Te=ae.onHandleClick,_e=ae.open;if(Te&&Te(te),typeof _e=="undefined"){var ge=H.state.open;H.setState({open:!ge})}},H.onClose=function(te){var ae=H.props,Te=ae.onClose,_e=ae.open;Te&&Te(te),typeof _e=="undefined"&&H.setState({open:!1})};var Q=typeof y.open!="undefined"?y.open:!!y.defaultOpen;return H.state={open:Q},"onMaskClick"in y&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(N.a)(m,[{key:"render",value:function(){var H=this,Q=this.props,te=Q.defaultOpen,ae=Q.getContainer,Te=Q.wrapperClassName,_e=Q.forceRender,ge=Q.handler,ve=Object(ie.a)(Q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Oe=this.state.open;if(!ae)return K.createElement("div",{className:Te,ref:function(P){H.dom=P}},K.createElement(c,Object.assign({},ve,{open:Oe,handler:ge,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var he=!!ge||_e;return K.createElement(G.a,{visible:Oe,forceRender:he,getContainer:ae,wrapperClassName:Te},function(V){var P=V.visible,j=V.afterClose,$=Object(ie.a)(V,["visible","afterClose"]);return K.createElement(c,Object.assign({},ve,$,{open:P!==void 0?P:Oe,afterVisibleChange:j!==void 0?j:ve.afterVisibleChange,handler:ge,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,Q){var te=Q.prevProps,ae={prevProps:H};return typeof te!="undefined"&&H.open!==te.open&&(ae.open=H.open),ae}}]),m}(K.Component);w.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:K.createElement("div",{className:"drawer-handle"},K.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var B=w,W=Ee.a=B},fjLI:function(it,Ee,U){"use strict";U.d(Ee,"f",function(){return b}),U.d(Ee,"b",function(){return h}),U.d(Ee,"a",function(){return o}),U.d(Ee,"d",function(){return p}),U.d(Ee,"e",function(){return l}),U.d(Ee,"c",function(){return u});var ie=U("8HAY"),Y=U("Vhoy"),N=U("MI8n"),z=U("JYp7"),I=U("pmY6"),M=U("24hK"),G=U("nnTU"),K=U("T8No"),n=U("Cg/j"),L=U("t9D7"),x=function(s,i,D,A){var S=arguments.length,R=S<3?i:A===null?A=Object.getOwnPropertyDescriptor(i,D):A,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(s,i,D,A);else for(var g=s.length-1;g>=0;g--)(O=s[g])&&(R=(S<3?O(R):S>3?O(i,D,R):O(i,D))||R);return S>3&&R&&Object.defineProperty(i,D,R),R},f=function(s,i){return function(D,A){i(D,A,s)}};function b(s){return s.command!==void 0}class h{constructor(s){this.id=h._idPool++,this._debugName=s}}h._idPool=0,h.CommandPalette=new h("CommandPalette"),h.EditorContext=new h("EditorContext"),h.SimpleEditorContext=new h("SimpleEditorContext"),h.EditorContextCopy=new h("EditorContextCopy"),h.EditorContextPeek=new h("EditorContextPeek"),h.MenubarEditMenu=new h("MenubarEditMenu"),h.MenubarCopy=new h("MenubarCopy"),h.MenubarGoMenu=new h("MenubarGoMenu"),h.MenubarSelectionMenu=new h("MenubarSelectionMenu"),h.InlineCompletionsActions=new h("InlineCompletionsActions");const o=Object(n.c)("menuService"),p=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===h.CommandPalette}}addCommand(s){return this.addCommands(z.a.single(s))}addCommands(s){for(const i of s)this._commands.set(i.id,i);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(I.i)(()=>{let i=!1;for(const D of s)i=this._commands.delete(D.id)||i;i&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((i,D)=>s.set(D,i)),s}appendMenuItem(s,i){return this.appendMenuItems(z.a.single({id:s,item:i}))}appendMenuItems(s){const i=new Set,D=new M.a;for(const{id:A,item:S}of s){let R=this._menuItems.get(A);R||(R=new M.a,this._menuItems.set(A,R)),D.push(R.push(S)),i.add(A)}return this._onDidChangeMenu.fire(i),Object(I.i)(()=>{if(D.size>0){for(let A of D)A();this._onDidChangeMenu.fire(i),D.clear()}})}getMenuItems(s){let i;return this._menuItems.has(s)?i=[...this._menuItems.get(s)]:i=[],s===h.CommandPalette&&this._appendImplicitItems(i),i}_appendImplicitItems(s){const i=new Set;for(const D of s)b(D)&&(i.add(D.command.id),D.alt&&i.add(D.alt.id));this._commands.forEach((D,A)=>{i.has(A)||s.push({command:D})})}};class l extends ie.e{constructor(s,i,D,A){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=i,this._contextKeyService=D,this._options=A}get actions(){const s=[],i=this._menuService.createMenu(this.item.submenu,this._contextKeyService),D=i.getActions(this._options);i.dispose();for(const[,A]of D)A.length>0&&(s.push(...A),s.push(new ie.d));return s.length&&s.pop(),s}}let u=class s{constructor(i,D,A,S,R){var O,g;if(this._commandService=R,this.id=i.id,this.label=(A==null?void 0:A.renderShortTitle)&&i.shortTitle?typeof i.shortTitle=="string"?i.shortTitle:i.shortTitle.value:typeof i.title=="string"?i.title:i.title.value,this.tooltip=(g=typeof i.tooltip=="string"?i.tooltip:(O=i.tooltip)===null||O===void 0?void 0:O.value)!==null&&g!==void 0?g:"",this.enabled=!i.precondition||S.contextMatchesRules(i.precondition),this.checked=void 0,i.toggled){const _=i.toggled.condition?i.toggled:{condition:i.toggled};this.checked=S.contextMatchesRules(_.condition),this.checked&&_.tooltip&&(this.tooltip=typeof _.tooltip=="string"?_.tooltip:_.tooltip.value),_.title&&(this.label=typeof _.title=="string"?_.title:_.title.value)}this.item=i,this.alt=D?new s(D,void 0,A,S,R):void 0,this._options=A,L.d.isThemeIcon(i.icon)&&(this.class=Y.a.asClassName(i.icon))}dispose(){}run(...i){var D,A;let S=[];return((D=this._options)===null||D===void 0?void 0:D.arg)&&(S=[...S,this._options.arg]),((A=this._options)===null||A===void 0?void 0:A.shouldForwardArgs)&&(S=[...S,...i]),this._commandService.executeCommand(this.id,...S)}};u=x([f(3,K.b),f(4,G.b)],u)},i8i3:function(it,Ee,U){it.exports={flex_box_center:"flex_box_center___3Vf6o",flex_space_between:"flex_space_between___3kR1x",flex_box_vertical_center:"flex_box_vertical_center___25a0b",flex_box_center_end:"flex_box_center_end___3k_KQ",flex_box_column:"flex_box_column___38BD-",customModal:"customModal___2JXW3",shareModal:"shareModal___1xuLw",content:"content___1yjOV",group:"group___2tJcj",teachGroup:"teachGroup___VMxNc",footer:"footer___1OQG5"}},iNYN:function(it,Ee,U){it.exports={modalContent:"modalContent___3NP2x",modalContentLeft:"modalContentLeft___ycFEY",green:"green___2njFR",textArea:"textArea___28pXQ",red:"red___2bPlD",row:"row___tW7CE",html:"html___30ord",line:"line___1f3U7"}},ic2d:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return z});var ie=U("FWmy"),Y=U("746U");class N{constructor(){this.data=new Map}add(I,M){ie.a(Y.l(I)),ie.a(Y.k(M)),ie.a(!this.data.has(I),"There is already an extension with this id"),this.data.set(I,M)}as(I){return this.data.get(I)||null}}const z=new N},iris:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return b});var ie=U("qVdP"),Y=U("jsC+"),N=U("lUTK"),z=U("BvKs"),I=U("tJVT"),M=U("q1tI"),G=U.n(M),K=U("Q0Vu"),n=U.n(K),L=[{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"}],x=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],f=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],b=function(o){var p=o.showSelectAll,l=p===void 0?!1:p,u=o.disciplinesData,s=u===void 0?[]:u,i=o.knowledgeData,D=i===void 0?[]:i,A=o.directionValue,S=o.subDisciplineValue,R=o.typeValue,O=o.knowledgeValue,g=o.showKnowledge,_=g===void 0?!1:g,d=o.showRandomType,c=d===void 0?!1:d,C=o.difficultyValue,E=o.randomValue,w=o.selectAll,B=o.languagesvalue,W=o.className,T=o.languages,k=T===void 0?[]:T,m=o.isprogram_homework,y=o.showShixun,H=y===void 0?!1:y,Q=o.showItemType,te=Q===void 0?!0:Q,ae=o.onShixunChange,Te=ae===void 0?function(){}:ae,_e=o.onDirectionChange,ge=_e===void 0?function(){}:_e,ve=o.onTypeChange,Oe=ve===void 0?function(){}:ve,he=o.onDifficultyChange,V=he===void 0?function(){}:he,P=o.handlelanguagesChange,j=P===void 0?function(){}:P,$=o.onKnowledgeChange,J=$===void 0?function(){}:$,X=o.onRandomChange,ye=X===void 0?function(){}:X,Re=o.showTeachGroup,Ke=Re===void 0?!1:Re,pe=o.teachGroupData,we=pe===void 0?[]:pe,ke=o.onTeachGroupChange,Ue=ke===void 0?function(){}:ke,Qe=o.teachGroupValue,nt=Object(M.useState)(0),ot=Object(I.a)(nt,2),qe=ot[0],ft=ot[1],lt=Object(M.useRef)(null),pt=Object(M.useState)(0),Ye=Object(I.a)(pt,2),Tt=Ye[0],bt=Ye[1],me=Object(M.useRef)(null);Object(M.useEffect)(function(){if(s.length!==0){var q;(lt==null||((q=lt.current)===null||q===void 0)?void 0:q.clientHeight)>108?ft(1):ft(0)}s.length===0&&ft(0)},[s]),Object(M.useEffect)(function(){if(console.log(D.length===0,"\u6570\u91CF"),D.length!==0){var q,se;console.log(me==null||((q=me.current)===null||q===void 0)?void 0:q.clientHeight,"\u9AD8\u5EA6"),(me==null||((se=me.current)===null||se===void 0)?void 0:se.clientHeight)>108?bt(1):bt(0)}D.length===0&&bt(0)},[D]);var ne=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ue=arguments.length>1?arguments[1]:void 0;return G.a.createElement(z.a,{className:n.a.subMenu},se.map(function(oe){return G.a.createElement(z.a.Item,{key:oe.id},G.a.createElement("a",{className:"".concat(n.a.subItem," ").concat(S===oe.id?n.a.subActive:""),onClick:function(){return ge(ue,oe.id)}},oe.name))}))};return G.a.createElement("aside",{className:W?"".concat(n.a.main," ").concat(W):n.a.main},G.a.createElement("div",{className:n.a.wrap},m&&G.a.createElement("div",{className:n.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Ke&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u56E2\u961F"),G.a.createElement("div",{className:n.a.directionContentWrap},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(Qe?"":n.a.active," "),onClick:function(){return Ue(null)}},"\u5168\u90E8"),we==null?void 0:we.map(function(q){return G.a.createElement("li",{key:q.group_id,className:"".concat(n.a.directionItem," ").concat(Qe===q.group_id?n.a.active:""," "),onClick:function(){return Ue(q.group_id)}},q.name)}))),G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u65B9\u5411"),G.a.createElement("span",null),G.a.createElement("div",{className:n.a.directionContentWrap,style:{overflow:"hidden",height:qe===1?88:"auto"}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A?"":n.a.active," "),onClick:function(){return ge(null)}},"\u5168\u90E8"),s.map(function(q){var se;return G.a.createElement(G.a.Fragment,{key:q.id},((se=q.sub_disciplines)===null||se===void 0?void 0:se.length)>0?G.a.createElement(Y.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(oe){return oe.parentNode},overlay:function(){return ne(q.sub_disciplines,q.id)}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===q.id?n.a.active:""," "),onClick:function(){return ge(q.id)}},q.name)):G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===q.id?n.a.active:""," "),onClick:function(){return ge(q.id)}},q.name))})),G.a.createElement("div",{className:n.a.directionContentWrap,ref:lt,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},s.map(function(q){var se;return G.a.createElement(G.a.Fragment,{key:q.id},((se=q.sub_disciplines)===null||se===void 0?void 0:se.length)>0?G.a.createElement(Y.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(oe){return oe.parentNode},overlay:function(){return ne(q.sub_disciplines,q.id)}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===q.id?n.a.active:""," "),onClick:function(){return ge(q.id)}},q.name)):G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===q.id?n.a.active:""," "),onClick:function(){return ge(q.id)}},q.name))})),!!qe&&G.a.createElement("div",{className:n.a.action},qe===1&&G.a.createElement("span",{onClick:function(){return ft(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),qe===2&&G.a.createElement("span",{onClick:function(){return ft(1)}},"\u6536\u8D77",G.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),_&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u77E5\u8BC6\u70B9"),G.a.createElement("div",{className:n.a.directionContentWrap,style:{overflow:"hidden",height:Tt===1?106:"auto"}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(O===-1?n.a.active:""," "),onClick:function(){return J(-1)}},"\u5168\u90E8"),D.map(function(q){return G.a.createElement("li",{key:q.id,className:"".concat(n.a.directionItem," ").concat(O===q.id?n.a.active:""," "),onClick:function(){return J(q.id)}},q.name)})),G.a.createElement("div",{ref:me,className:n.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},D.map(function(q){return G.a.createElement("li",{key:q.id,className:"".concat(n.a.directionItem," ").concat(O===q.id?n.a.active:""," "),onClick:function(){return J(q.id)}},q.name)})),!!Tt&&G.a.createElement("div",{className:n.a.action},Tt===1&&G.a.createElement("span",{onClick:function(){return bt(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),Tt===2&&G.a.createElement("span",{onClick:function(){return bt(1)}},"\u6536\u8D77",G.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),te&&!m&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u9898\u578B"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(R?"":n.a.active," "),onClick:function(){return Oe(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},L.map(function(q){return G.a.createElement("li",{key:q.name,className:"".concat(n.a.directionItem," ").concat(R===q.value?n.a.active:""," "),onClick:function(){return Oe(q.value)}},q.name)}),H&&G.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:n.a.directionItem,onClick:function(){return Te()}},"\u5B9E\u8BAD\u9898"))),G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u96BE\u5EA6"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(C?"":n.a.active," "),onClick:function(){return V(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},x.map(function(q){return G.a.createElement("li",{key:q.name,className:"".concat(n.a.directionItem," ").concat(C===q.value?n.a.active:""," "),onClick:function(){return V(q.value)}},q.name)}))),c&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u7C7B\u578B"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(E?"":n.a.active," "),onClick:function(){return ye(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},f.map(function(q){return G.a.createElement("li",{key:q.name,className:"".concat(n.a.directionItem," ").concat(E===q.value?n.a.active:""," "),onClick:function(){return ye(q.value)}},q.name)})))))}},jcZT:function(it,Ee,U){"use strict";var ie=U("2qtc"),Y=U("kLXV"),N=U("5NDa"),z=U("5rEg"),I=U("miYZ"),M=U("tsqr"),G=U("9og8"),K=U("tJVT"),n=U("WmNS"),L=U.n(n),x=U("q1tI"),f=U.n(x),b=U("d5o6"),h=U.n(b),o=U("P/tu"),p=U("WCUW"),l=U("9kvl"),u=function(i){var D=i.problemset,A=i.dispatch,S=i.onOk,R=Object(x.useState)(""),O=Object(K.a)(R,2),g=O[0],_=O[1],d=Object(x.useState)([0]),c=Object(K.a)(d,2),C=c[0],E=c[1],w=function(){A({type:"problemset/setActionTabs",payload:{}})};Object(x.useEffect)(function(){if(D.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var W,T;E([(W=D.actionTabs)===null||W===void 0||((T=W.params)===null||T===void 0)?void 0:T.group_id]),_("")}},[D.actionTabs.key]);var B=function(){var W=Object(G.a)(L.a.mark(function T(){var k,m,y;return L.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(k=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],g.trim()){Q.next=4;break}return M.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Q.abrupt("return");case 4:if(!(g.charAt(0)===" ")){Q.next=7;break}return M.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Q.abrupt("return");case 7:m=0;case 8:if(!(m<g.length)){Q.next=15;break}if(!k.includes(g.charAt(m))){Q.next=12;break}return M.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),Q.abrupt("return",!1);case 12:m++,Q.next=8;break;case 15:return Q.next=17,Object(p.p)({parent_id:C.length>0?C[0]:0,name:g});case 17:y=Q.sent,y.status===0&&(w(),S(y==null?void 0:y.id));case 19:case"end":return Q.stop()}},T)}));return function(){return W.apply(this,arguments)}}();return f.a.createElement(Y.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:D.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:w,onOk:B,destroyOnClose:!0},f.a.createElement("div",{className:h.a.addModal},f.a.createElement("div",{className:h.a.row},f.a.createElement("span",{className:h.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),f.a.createElement(z.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:g,onChange:function(T){return _(T.target.value)}})),f.a.createElement("div",{className:h.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},f.a.createElement("span",{className:h.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),f.a.createElement(o.a,{value:C,onChange:function(T){return E(T)}}))))};Ee.a=Object(l.a)(function(s){var i=s.problemset;return{problemset:i}})(u)},k3GJ:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return fo});var ie=U("rePB"),Y=U("ODXe"),N=U("Ff2n"),z=U("VTBJ"),I=U("q1tI"),M=U("TSYQ"),G=U.n(M),K=U("Zm9Q"),n=U("6cGi"),L=U("KQm4"),x=U("xEkU"),f=U.n(x),b=U("t23M");function h(Ae){var Me=Object(I.useRef)(),He=Object(I.useRef)(!1);function De(){for(var le=arguments.length,xe=new Array(le),fe=0;fe<le;fe++)xe[fe]=arguments[fe];He.current||(f.a.cancel(Me.current),Me.current=f()(function(){Ae.apply(void 0,xe)}))}return Object(I.useEffect)(function(){return function(){He.current=!0,f.a.cancel(Me.current)}},[]),De}function o(Ae){var Me=Object(I.useRef)([]),He=Object(I.useState)({}),De=Object(Y.a)(He,2),le=De[1],xe=Object(I.useRef)(typeof Ae=="function"?Ae():Ae),fe=h(function(){var Ce=xe.current;Me.current.forEach(function(Fe){Ce=Fe(Ce)}),Me.current=[],xe.current=Ce,le({})});function Le(Ce){Me.current.push(Ce),fe()}return[xe.current,Le]}var p=U("4IlW");function l(Ae,Me){var He,De=Ae.prefixCls,le=Ae.id,xe=Ae.active,fe=Ae.rtl,Le=Ae.tab,Ce=Le.key,Fe=Le.tab,Be=Le.disabled,Ge=Le.closeIcon,Ze=Ae.tabBarGutter,ut=Ae.tabPosition,ht=Ae.closable,Ct=Ae.renderWrapper,dn=Ae.removeAriaLabel,Kn=Ae.editable,On=Ae.onClick,Nn=Ae.onRemove,Bn=Ae.onFocus,Un="".concat(De,"-tab");I.useEffect(function(){return Nn},[]);var Ln={};ut==="top"||ut==="bottom"?Ln[fe?"marginLeft":"marginRight"]=Ze:Ln.marginBottom=Ze;var zn=Kn&&ht!==!1&&!Be;function Xn(nn){if(Be)return;On(nn)}function Or(nn){nn.preventDefault(),nn.stopPropagation(),Kn.onEdit("remove",{key:Ce,event:nn})}var Yn=I.createElement("div",{key:Ce,ref:Me,className:G()(Un,(He={},Object(ie.a)(He,"".concat(Un,"-with-remove"),zn),Object(ie.a)(He,"".concat(Un,"-active"),xe),Object(ie.a)(He,"".concat(Un,"-disabled"),Be),He)),style:Ln,onClick:Xn},I.createElement("div",{role:"tab","aria-selected":xe,id:le&&"".concat(le,"-tab-").concat(Ce),className:"".concat(Un,"-btn"),"aria-controls":le&&"".concat(le,"-panel-").concat(Ce),"aria-disabled":Be,tabIndex:Be?null:0,onClick:function(qt){qt.stopPropagation(),Xn(qt)},onKeyDown:function(qt){[p.a.SPACE,p.a.ENTER].includes(qt.which)&&(qt.preventDefault(),Xn(qt))},onFocus:Bn},Fe),zn&&I.createElement("button",{type:"button","aria-label":dn||"remove",tabIndex:0,className:"".concat(Un,"-remove"),onClick:function(qt){qt.stopPropagation(),Or(qt)}},Ge||Kn.removeIcon||"\xD7"));return Ct&&(Yn=Ct(Yn)),Yn}var u=I.forwardRef(l),s={width:0,height:0,left:0,top:0};function i(Ae,Me,He){return Object(I.useMemo)(function(){for(var De,le=new Map,xe=Me.get((De=Ae[0])===null||De===void 0?void 0:De.key)||s,fe=xe.left+xe.width,Le=0;Le<Ae.length;Le+=1){var Ce=Ae[Le].key,Fe=Me.get(Ce);if(!Fe){var Be;Fe=Me.get((Be=Ae[Le-1])===null||Be===void 0?void 0:Be.key)||s}var Ge=le.get(Ce)||Object(z.a)({},Fe);Ge.right=fe-Ge.left-Ge.width,le.set(Ce,Ge)}return le},[Ae.map(function(De){return De.key}).join("_"),Me,He])}var D={width:0,height:0,left:0,top:0,right:0};function A(Ae,Me,He,De,le){var xe=le.tabs,fe=le.tabPosition,Le=le.rtl,Ce,Fe,Be;["top","bottom"].includes(fe)?(Ce="width",Fe=Le?"right":"left",Be=Math.abs(Me.left)):(Ce="height",Fe="top",Be=-Me.top);var Ge=Me[Ce],Ze=He[Ce],ut=De[Ce],ht=Ge;return Ze+ut>Ge&&(ht=Ge-ut),Object(I.useMemo)(function(){if(!xe.length)return[0,0];for(var Ct=xe.length,dn=Ct,Kn=0;Kn<Ct;Kn+=1){var On=Ae.get(xe[Kn].key)||D;if(On[Fe]+On[Ce]>Be+ht){dn=Kn-1;break}}for(var Nn=0,Bn=Ct-1;Bn>=0;Bn-=1){var Un=Ae.get(xe[Bn].key)||D;if(Un[Fe]<Be){Nn=Bn+1;break}}return[Nn,dn]},[Ae,Be,ht,fe,xe.map(function(Ct){return Ct.key}).join("_"),Le])}var S=U("wx14"),R=U("1OyB"),O=U("vuIU"),g=U("JX7q"),_=U("Ji7U"),d=U("LK+K"),c=U("I8Z2"),C=U("bT9E"),E=U("2GS6"),w=U("Gytx"),B=U.n(w),W=U("U8pU"),T=/iPhone/i,k=/iPod/i,m=/iPad/i,y=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,Q=/\bAndroid(?:.+)SD4930UR\b/i,te=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ae=/Windows Phone/i,Te=/\bWindows(?:.+)ARM\b/i,_e=/BlackBerry/i,ge=/BB10/i,ve=/Opera Mini/i,Oe=/\b(CriOS|Chrome)(?:.+)Mobile/i,he=/Mobile(?:.+)Firefox\b/i;function V(Ae,Me){return Ae.test(Me)}function P(Ae){var Me=Ae||(typeof navigator!="undefined"?navigator.userAgent:""),He=(Me||"").split("[FBAN");if(typeof He[1]!="undefined"){var De=He,le=Object(Y.a)(De,1);Me=le[0]}if(He=Me.split("Twitter"),typeof He[1]!="undefined"){var xe=He,fe=Object(Y.a)(xe,1);Me=fe[0]}var Le={apple:{phone:V(T,Me)&&!V(ae,Me),ipod:V(k,Me),tablet:!V(T,Me)&&V(m,Me)&&!V(ae,Me),device:(V(T,Me)||V(k,Me)||V(m,Me))&&!V(ae,Me)},amazon:{phone:V(Q,Me),tablet:!V(Q,Me)&&V(te,Me),device:V(Q,Me)||V(te,Me)},android:{phone:!V(ae,Me)&&V(Q,Me)||!V(ae,Me)&&V(y,Me),tablet:!V(ae,Me)&&!V(Q,Me)&&!V(y,Me)&&(V(te,Me)||V(H,Me)),device:!V(ae,Me)&&(V(Q,Me)||V(te,Me)||V(y,Me)||V(H,Me))||V(/\bokhttp\b/i,Me)},windows:{phone:V(ae,Me),tablet:V(Te,Me),device:V(ae,Me)||V(Te,Me)},other:{blackberry:V(_e,Me),blackberry10:V(ge,Me),opera:V(ve,Me),firefox:V(he,Me),chrome:V(Oe,Me),device:V(_e,Me)||V(ge,Me)||V(ve,Me)||V(he,Me)||V(Oe,Me)},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 j=Object(z.a)(Object(z.a)({},P()),{},{isMobile:P}),$=j;function J(){}function X(Ae,Me,He){var De=Me||"";return Ae.key||"".concat(De,"item_").concat(He)}function ye(Ae){return"".concat(Ae,"-menu-")}function Re(Ae,Me){var He=-1;I.Children.forEach(Ae,function(De){He+=1,De&&De.type&&De.type.isMenuItemGroup?I.Children.forEach(De.props.children,function(le){He+=1,Me(le,He)}):Me(De,He)})}function Ke(Ae,Me,He){if(!Ae||He.find)return;I.Children.forEach(Ae,function(De){if(De){var le=De.type;if(!le||!(le.isSubMenu||le.isMenuItem||le.isMenuItemGroup))return;Me.indexOf(De.key)!==-1?He.find=!0:De.props.children&&Ke(De.props.children,Me,He)}})}var pe=["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"],we=function(Me){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,De=Me&&typeof Me.getBoundingClientRect=="function"&&Me.getBoundingClientRect().width;if(De){if(He){var le=getComputedStyle(Me),xe=le.marginLeft,fe=le.marginRight;De+=+xe.replace("px","")+ +fe.replace("px","")}De=+De.toFixed(6)}return De||0},ke=function(Me,He,De){Me&&Object(W.a)(Me.style)==="object"&&(Me.style[He]=De)},Ue=function(){return $.any},Qe=U("bdgK"),nt=U("i8i4"),ot=U.n(nt),qe=U("wgJM"),ft=U("l4aY"),lt=U("m+aA"),pt=U("c+Xe"),Ye=U("zT1h"),Tt=U("QC+M");function bt(Ae,Me,He){return He?Ae[0]===Me[0]:Ae[0]===Me[0]&&Ae[1]===Me[1]}function me(Ae,Me,He){var De=Ae[Me]||{};return Object(z.a)(Object(z.a)({},De),He)}function ne(Ae,Me,He,De){for(var le=He.points,xe=Object.keys(Ae),fe=0;fe<xe.length;fe+=1){var Le=xe[fe];if(bt(Ae[Le].points,le,De))return"".concat(Me,"-placement-").concat(Le)}return""}var q=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ae=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(Ae)||/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(Ae==null?void 0:Ae.substr(0,4)))},se=U("MNnm");function ue(Ae,Me){var He={};return He[Ae.toLowerCase()]=Me.toLowerCase(),He["Webkit".concat(Ae)]="webkit".concat(Me),He["Moz".concat(Ae)]="moz".concat(Me),He["ms".concat(Ae)]="MS".concat(Me),He["O".concat(Ae)]="o".concat(Me.toLowerCase()),He}function oe(Ae,Me){var He={animationend:ue("Animation","AnimationEnd"),transitionend:ue("Transition","TransitionEnd")};return Ae&&("AnimationEvent"in Me||delete He.animationend.animation,"TransitionEvent"in Me||delete He.transitionend.transition),He}var ce=oe(Object(se.a)(),typeof window!="undefined"?window:{}),be={};if(Object(se.a)()){var Se=document.createElement("div");be=Se.style}var Pe={};function We(Ae){if(Pe[Ae])return Pe[Ae];var Me=ce[Ae];if(Me)for(var He=Object.keys(Me),De=He.length,le=0;le<De;le+=1){var xe=He[le];if(Object.prototype.hasOwnProperty.call(Me,xe)&&xe in be)return Pe[Ae]=Me[xe],Pe[Ae]}return""}var et=We("animationend"),yt=We("transitionend"),Rt=!!(et&&yt),kt=et||"animationend",mn=yt||"transitionend";function zt(Ae,Me){if(!Ae)return null;if(Object(W.a)(Ae)==="object"){var He=Me.replace(/-\w/g,function(De){return De[1].toUpperCase()});return Ae[He]}return"".concat(Ae,"-").concat(Me)}var Mt="none",Qn="appear",un="enter",hr="leave",or="none",bn="prepare",xr="start",br="active",Ar="end";function Br(Ae){var Me=Object(I.useRef)(!1),He=Object(I.useState)(Ae),De=Object(Y.a)(He,2),le=De[0],xe=De[1];function fe(Le){Me.current||xe(Le)}return Object(I.useEffect)(function(){return function(){Me.current=!0}},[]),[le,fe]}var Ht=Object(se.a)()?I.useLayoutEffect:I.useEffect,an=Ht,Cn=function(){var Ae=I.useRef(null);function Me(){qe.a.cancel(Ae.current)}function He(De){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Me();var xe=Object(qe.a)(function(){le<=1?De({isCanceled:function(){return xe!==Ae.current}}):He(De,le-1)});Ae.current=xe}return I.useEffect(function(){return function(){Me()}},[]),[He,Me]},qn=[bn,xr,br,Ar],Ir=!1,gn=!0;function wt(Ae){return Ae===br||Ae===Ar}var Rn=function(Ae,Me){var He=I.useState(or),De=Object(Y.a)(He,2),le=De[0],xe=De[1],fe=Cn(),Le=Object(Y.a)(fe,2),Ce=Le[0],Fe=Le[1];function Be(){xe(bn)}return an(function(){if(le!==or&&le!==Ar){var Ge=qn.indexOf(le),Ze=qn[Ge+1],ut=Me(le);ut===Ir?xe(Ze):Ce(function(ht){function Ct(){if(ht.isCanceled())return;xe(Ze)}ut===!0?Ct():Promise.resolve(ut).then(Ct)})}},[Ae,le]),I.useEffect(function(){return function(){Fe()}},[]),[Be,le]},jn=function(Ae){var Me=Object(I.useRef)(),He=Object(I.useRef)(Ae);He.current=Ae;var De=I.useCallback(function(fe){He.current(fe)},[]);function le(fe){fe&&(fe.removeEventListener(mn,De),fe.removeEventListener(kt,De))}function xe(fe){Me.current&&Me.current!==fe&&le(Me.current),fe&&fe!==Me.current&&(fe.addEventListener(mn,De),fe.addEventListener(kt,De),Me.current=fe)}return I.useEffect(function(){return function(){le(Me.current)}},[]),[xe,le]};function cn(Ae,Me,He,De){var le=De.motionEnter,xe=le===void 0?!0:le,fe=De.motionAppear,Le=fe===void 0?!0:fe,Ce=De.motionLeave,Fe=Ce===void 0?!0:Ce,Be=De.motionDeadline,Ge=De.motionLeaveImmediately,Ze=De.onAppearPrepare,ut=De.onEnterPrepare,ht=De.onLeavePrepare,Ct=De.onAppearStart,dn=De.onEnterStart,Kn=De.onLeaveStart,On=De.onAppearActive,Nn=De.onEnterActive,Bn=De.onLeaveActive,Un=De.onAppearEnd,Ln=De.onEnterEnd,zn=De.onLeaveEnd,Xn=De.onVisibleChanged,Or=Br(),Yn=Object(Y.a)(Or,2),nn=Yn[0],qt=Yn[1],In=Br(Mt),nr=Object(Y.a)(In,2),Kt=nr[0],rr=nr[1],Rr=Br(null),Zn=Object(Y.a)(Rr,2),_r=Zn[0],mr=Zn[1],Nr=Object(I.useRef)(!1),Fr=Object(I.useRef)(null),Lr=Object(I.useRef)(!1),li=Object(I.useRef)(null);function Ti(){var Er=He();return Er||li.current}var gi=Object(I.useRef)(!1);function Wr(Er){var cr=Ti();if(Er&&!Er.deadline&&Er.target!==cr)return;var Pr;Kt===Qn&&gi.current?Pr=Un==null?void 0:Un(cr,Er):Kt===un&&gi.current?Pr=Ln==null?void 0:Ln(cr,Er):Kt===hr&&gi.current&&(Pr=zn==null?void 0:zn(cr,Er)),Pr!==!1&&!Lr.current&&(rr(Mt),mr(null))}var wr=jn(Wr),gr=Object(Y.a)(wr,1),ln=gr[0],vr=I.useMemo(function(){var Er,cr,Pr;switch(Kt){case"appear":return Er={},Object(ie.a)(Er,bn,Ze),Object(ie.a)(Er,xr,Ct),Object(ie.a)(Er,br,On),Er;case"enter":return cr={},Object(ie.a)(cr,bn,ut),Object(ie.a)(cr,xr,dn),Object(ie.a)(cr,br,Nn),cr;case"leave":return Pr={},Object(ie.a)(Pr,bn,ht),Object(ie.a)(Pr,xr,Kn),Object(ie.a)(Pr,br,Bn),Pr;default:return{}}},[Kt]),Oi=Rn(Kt,function(Er){if(Er===bn){var cr=vr[bn];return cr?cr(Ti()):Ir}if(yr in vr){var Pr;mr(((Pr=vr[yr])===null||Pr===void 0?void 0:Pr.call(vr,Ti(),null))||null)}return yr===br&&(ln(Ti()),Be>0&&(clearTimeout(Fr.current),Fr.current=setTimeout(function(){Wr({deadline:!0})},Be))),gn}),Hi=Object(Y.a)(Oi,2),$i=Hi[0],yr=Hi[1],Mi=wt(yr);gi.current=Mi,an(function(){qt(Me);var Er=Nr.current;if(Nr.current=!0,!Ae)return;var cr;!Er&&Me&&Le&&(cr=Qn),Er&&Me&&xe&&(cr=un),(Er&&!Me&&Fe||!Er&&Ge&&!Me&&Fe)&&(cr=hr),cr&&(rr(cr),$i())},[Me]),Object(I.useEffect)(function(){(Kt===Qn&&!Le||Kt===un&&!xe||Kt===hr&&!Fe)&&rr(Mt)},[Le,xe,Fe]),Object(I.useEffect)(function(){return function(){clearTimeout(Fr.current),Lr.current=!0}},[]),Object(I.useEffect)(function(){nn!==void 0&&Kt===Mt&&(Xn==null||Xn(nn))},[nn,Kt]);var Ki=_r;return vr[bn]&&yr===xr&&(Ki=Object(z.a)({transition:"none"},Ki)),[Kt,yr,Ki,nn!=null?nn:Me]}var on=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(){return Object(R.a)(this,He),Me.apply(this,arguments)}return Object(O.a)(He,[{key:"render",value:function(){return this.props.children}}]),He}(I.Component),Dn=on;function ei(Ae){var Me=Ae;Object(W.a)(Ae)==="object"&&(Me=Ae.transitionSupport);function He(le){return!!(le.motionName&&Me)}var De=I.forwardRef(function(le,xe){var fe=le.visible,Le=fe===void 0?!0:fe,Ce=le.removeOnLeave,Fe=Ce===void 0?!0:Ce,Be=le.forceRender,Ge=le.children,Ze=le.motionName,ut=le.leavedClassName,ht=le.eventProps,Ct=He(le),dn=Object(I.useRef)(),Kn=Object(I.useRef)();function On(){try{return Object(lt.a)(dn.current||Kn.current)}catch(rr){return null}}var Nn=cn(Ct,Le,On,le),Bn=Object(Y.a)(Nn,4),Un=Bn[0],Ln=Bn[1],zn=Bn[2],Xn=Bn[3],Or=I.useRef(Xn);Xn&&(Or.current=!0);var Yn=Object(I.useRef)(xe);Yn.current=xe;var nn=I.useCallback(function(rr){dn.current=rr,Object(pt.b)(Yn.current,rr)},[]),qt,In=Object(z.a)(Object(z.a)({},ht),{},{visible:Le});if(!Ge)qt=null;else if(Un===Mt||!He(le))Xn?qt=Ge(Object(z.a)({},In),nn):!Fe&&Or.current?qt=Ge(Object(z.a)(Object(z.a)({},In),{},{className:ut}),nn):Be?qt=Ge(Object(z.a)(Object(z.a)({},In),{},{style:{display:"none"}}),nn):qt=null;else{var nr,Kt;Ln===bn?Kt="prepare":wt(Ln)?Kt="active":Ln===xr&&(Kt="start"),qt=Ge(Object(z.a)(Object(z.a)({},In),{},{className:G()(zt(Ze,Un),(nr={},Object(ie.a)(nr,zt(Ze,"".concat(Un,"-").concat(Kt)),Kt),Object(ie.a)(nr,Ze,typeof Ze=="string"),nr)),style:zn}),nn)}return I.createElement(Dn,{ref:Kn},qt)});return De.displayName="CSSMotion",De}var Tr=ei(Rt),ct="add",Qt="keep",ji="remove",Xi="removed";function ua(Ae){var Me;return Ae&&Object(W.a)(Ae)==="object"&&"key"in Ae?Me=Ae:Me={key:Ae},Object(z.a)(Object(z.a)({},Me),{},{key:String(Me.key)})}function Bi(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ae.map(ua)}function ca(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],He=[],De=0,le=Me.length,xe=Bi(Ae),fe=Bi(Me);xe.forEach(function(Fe){for(var Be=!1,Ge=De;Ge<le;Ge+=1){var Ze=fe[Ge];if(Ze.key===Fe.key){De<Ge&&(He=He.concat(fe.slice(De,Ge).map(function(ut){return Object(z.a)(Object(z.a)({},ut),{},{status:ct})})),De=Ge),He.push(Object(z.a)(Object(z.a)({},Ze),{},{status:Qt})),De+=1,Be=!0;break}}Be||He.push(Object(z.a)(Object(z.a)({},Fe),{},{status:ji}))}),De<le&&(He=He.concat(fe.slice(De).map(function(Fe){return Object(z.a)(Object(z.a)({},Fe),{},{status:ct})})));var Le={};He.forEach(function(Fe){var Be=Fe.key;Le[Be]=(Le[Be]||0)+1});var Ce=Object.keys(Le).filter(function(Fe){return Le[Fe]>1});return Ce.forEach(function(Fe){He=He.filter(function(Be){var Ge=Be.key,Ze=Be.status;return Ge!==Fe||Ze!==ji}),He.forEach(function(Be){Be.key===Fe&&(Be.status=Qt)})}),He}var En=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Ia(Ae){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tr,He=function(De){Object(_.a)(xe,De);var le=Object(d.a)(xe);function xe(){var fe;return Object(R.a)(this,xe),fe=le.apply(this,arguments),fe.state={keyEntities:[]},fe.removeKey=function(Le){fe.setState(function(Ce){var Fe=Ce.keyEntities;return{keyEntities:Fe.map(function(Be){return Be.key!==Le?Be:Object(z.a)(Object(z.a)({},Be),{},{status:Xi})})}})},fe}return Object(O.a)(xe,[{key:"render",value:function(){var Le=this,Ce=this.state.keyEntities,Fe=this.props,Be=Fe.component,Ge=Fe.children,Ze=Fe.onVisibleChanged,ut=Object(N.a)(Fe,["component","children","onVisibleChanged"]),ht=Be||I.Fragment,Ct={};return En.forEach(function(dn){Ct[dn]=ut[dn],delete ut[dn]}),delete ut.keys,I.createElement(ht,ut,Ce.map(function(dn){var Kn=dn.status,On=Object(N.a)(dn,["status"]),Nn=Kn===ct||Kn===Qt;return I.createElement(Me,Object(S.a)({},Ct,{key:On.key,visible:Nn,eventProps:On,onVisibleChanged:function(Un){Ze==null||Ze(Un,{key:On.key}),Un||Le.removeKey(On.key)}}),Ge)}))}}],[{key:"getDerivedStateFromProps",value:function(Le,Ce){var Fe=Le.keys,Be=Ce.keyEntities,Ge=Bi(Fe),Ze=ca(Be,Ge);return{keyEntities:Ze.filter(function(ut){var ht=Be.find(function(Ct){var dn=Ct.key;return ut.key===dn});return!(ht&&ht.status===Xi&&ut.status===ji)})}}}]),xe}(I.Component);return He.defaultProps={component:"div"},He}var _t=Ia(Rt),Fi=Tr;function yi(Ae){var Me=Ae.prefixCls,He=Ae.motion,De=Ae.animation,le=Ae.transitionName;return He||(De?{motionName:"".concat(Me,"-").concat(De)}:le?{motionName:le}:null)}function ba(Ae){var Me=Ae.prefixCls,He=Ae.visible,De=Ae.zIndex,le=Ae.mask,xe=Ae.maskMotion,fe=Ae.maskAnimation,Le=Ae.maskTransitionName;if(!le)return null;var Ce={};return(xe||Le||fe)&&(Ce=Object(z.a)({motionAppear:!0},yi({motion:xe,prefixCls:Me,transitionName:Le,animation:fe}))),I.createElement(Fi,Object(S.a)({},Ce,{visible:He,removeOnLeave:!0}),function(Fe){var Be=Fe.className;return I.createElement("div",{style:{zIndex:De},className:G()("".concat(Me,"-mask"),Be)})})}var ea=U("9mu1"),pi=U("o0o1"),da=U.n(pi),Ea=U("HaE+"),ur=["measure","align",null,"motion"],xa=function(Ae,Me){var He=Object(I.useState)(null),De=Object(Y.a)(He,2),le=De[0],xe=De[1],fe=Object(I.useRef)(),Le=Object(I.useRef)(!1);function Ce(Ge){Le.current||xe(Ge)}function Fe(){qe.a.cancel(fe.current)}function Be(Ge){Fe(),fe.current=Object(qe.a)(function(){Ce(function(Ze){switch(le){case"align":return"motion";case"motion":return"stable";default:}return Ze}),Ge==null||Ge()})}return Object(I.useEffect)(function(){Ce("measure")},[Ae]),Object(I.useEffect)(function(){switch(le){case"measure":Me();break;default:}le&&(fe.current=Object(qe.a)(Object(Ea.a)(da.a.mark(function Ge(){var Ze,ut;return da.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:Ze=ur.indexOf(le),ut=ur[Ze+1],ut&&Ze!==-1&&Ce(ut);case 3:case"end":return Ct.stop()}},Ge)}))))},[le]),Object(I.useEffect)(function(){return function(){Le.current=!0,Fe()}},[]),[le,Be]},Ya=function(Ae){var Me=I.useState({width:0,height:0}),He=Object(Y.a)(Me,2),De=He[0],le=He[1];function xe(Le){le({width:Le.offsetWidth,height:Le.offsetHeight})}var fe=I.useMemo(function(){var Le={};if(Ae){var Ce=De.width,Fe=De.height;Ae.indexOf("height")!==-1&&Fe?Le.height=Fe:Ae.indexOf("minHeight")!==-1&&Fe&&(Le.minHeight=Fe),Ae.indexOf("width")!==-1&&Ce?Le.width=Ce:Ae.indexOf("minWidth")!==-1&&Ce&&(Le.minWidth=Ce)}return Le},[Ae,De]);return[fe,xe]},Vt=I.forwardRef(function(Ae,Me){var He=Ae.visible,De=Ae.prefixCls,le=Ae.className,xe=Ae.style,fe=Ae.children,Le=Ae.zIndex,Ce=Ae.stretch,Fe=Ae.destroyPopupOnHide,Be=Ae.forceRender,Ge=Ae.align,Ze=Ae.point,ut=Ae.getRootDomNode,ht=Ae.getClassNameFromAlign,Ct=Ae.onAlign,dn=Ae.onMouseEnter,Kn=Ae.onMouseLeave,On=Ae.onMouseDown,Nn=Ae.onTouchStart,Bn=Object(I.useRef)(),Un=Object(I.useRef)(),Ln=Object(I.useState)(),zn=Object(Y.a)(Ln,2),Xn=zn[0],Or=zn[1],Yn=Ya(Ce),nn=Object(Y.a)(Yn,2),qt=nn[0],In=nn[1];function nr(){Ce&&In(ut())}var Kt=xa(He,nr),rr=Object(Y.a)(Kt,2),Rr=rr[0],Zn=rr[1],_r=Object(I.useRef)();function mr(){return Ze||ut}function Nr(){var wr;(wr=Bn.current)===null||wr===void 0||wr.forceAlign()}function Fr(wr,gr){var ln=ht(gr);Xn!==ln&&Or(ln),Rr==="align"&&(Xn!==ln?Promise.resolve().then(function(){Nr()}):Zn(function(){var vr;(vr=_r.current)===null||vr===void 0||vr.call(_r)}),Ct==null||Ct(wr,gr))}var Lr=Object(z.a)({},yi(Ae));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(wr){var gr=Lr[wr];Lr[wr]=function(ln,vr){return Zn(),gr==null?void 0:gr(ln,vr)}});function li(){return new Promise(function(wr){_r.current=wr})}I.useEffect(function(){!Lr.motionName&&Rr==="motion"&&Zn()},[Lr.motionName,Rr]),I.useImperativeHandle(Me,function(){return{forceAlign:Nr,getElement:function(){return Un.current}}});var Ti=Object(z.a)(Object(z.a)({},qt),{},{zIndex:Le,opacity:Rr==="motion"||Rr==="stable"||!He?void 0:0,pointerEvents:Rr==="stable"?void 0:"none"},xe),gi=!0;(Ge==null?void 0:Ge.points)&&(Rr==="align"||Rr==="stable")&&(gi=!1);var Wr=fe;return I.Children.count(fe)>1&&(Wr=I.createElement("div",{className:"".concat(De,"-content")},fe)),I.createElement(Fi,Object(S.a)({visible:He,ref:Un,leavedClassName:"".concat(De,"-hidden")},Lr,{onAppearPrepare:li,onEnterPrepare:li,removeOnLeave:Fe,forceRender:Be}),function(wr,gr){var ln=wr.className,vr=wr.style,Oi=G()(De,le,Xn,ln);return I.createElement(ea.a,{target:mr(),key:"popup",ref:Bn,monitorWindowResize:!0,disabled:gi,align:Ge,onAlign:Fr},I.createElement("div",{ref:gr,className:Oi,onMouseEnter:dn,onMouseLeave:Kn,onMouseDownCapture:On,onTouchStartCapture:Nn,style:Object(z.a)(Object(z.a)({},vr),Ti)},Wr))})});Vt.displayName="PopupInner";var st=Vt,Pt=I.forwardRef(function(Ae,Me){var He=Ae.prefixCls,De=Ae.visible,le=Ae.zIndex,xe=Ae.children,fe=Ae.mobile;fe=fe===void 0?{}:fe;var Le=fe.popupClassName,Ce=fe.popupStyle,Fe=fe.popupMotion,Be=Fe===void 0?{}:Fe,Ge=fe.popupRender,Ze=I.useRef();I.useImperativeHandle(Me,function(){return{forceAlign:function(){},getElement:function(){return Ze.current}}});var ut=Object(z.a)({zIndex:le},Ce),ht=xe;return I.Children.count(xe)>1&&(ht=I.createElement("div",{className:"".concat(He,"-content")},xe)),Ge&&(ht=Ge(ht)),I.createElement(Fi,Object(S.a)({visible:De,ref:Ze,removeOnLeave:!0},Be),function(Ct,dn){var Kn=Ct.className,On=Ct.style,Nn=G()(He,Le,Kn);return I.createElement("div",{ref:dn,className:Nn,style:Object(z.a)(Object(z.a)({},On),ut)},ht)})});Pt.displayName="MobilePopupInner";var xt=Pt,Dt=["visible","mobile"],Zt=I.forwardRef(function(Ae,Me){var He=Ae.visible,De=Ae.mobile,le=Object(N.a)(Ae,Dt),xe=Object(I.useState)(He),fe=Object(Y.a)(xe,2),Le=fe[0],Ce=fe[1],Fe=Object(I.useState)(!1),Be=Object(Y.a)(Fe,2),Ge=Be[0],Ze=Be[1],ut=Object(z.a)(Object(z.a)({},le),{},{visible:Le});Object(I.useEffect)(function(){Ce(He),He&&De&&Ze(q())},[He,De]);var ht=Ge?I.createElement(xt,Object(S.a)({},ut,{mobile:De,ref:Me})):I.createElement(st,Object(S.a)({},ut,{ref:Me}));return I.createElement("div",null,I.createElement(ba,ut),ht)});Zt.displayName="Popup";var yn=Zt,Tn=I.createContext(null),en=Tn;function xn(){}function Fn(){return""}function tn(Ae){return Ae?Ae.ownerDocument:window.document}var hn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function ar(Ae){var Me=function(He){Object(_.a)(le,He);var De=Object(d.a)(le);function le(xe){var fe;Object(R.a)(this,le),fe=De.call(this,xe),fe.popupRef=I.createRef(),fe.triggerRef=I.createRef(),fe.attachId=void 0,fe.clickOutsideHandler=void 0,fe.touchOutsideHandler=void 0,fe.contextMenuOutsideHandler1=void 0,fe.contextMenuOutsideHandler2=void 0,fe.mouseDownTimeout=void 0,fe.focusTime=void 0,fe.preClickTime=void 0,fe.preTouchTime=void 0,fe.delayTimer=void 0,fe.hasPopupMouseDown=void 0,fe.onMouseEnter=function(Ce){var Fe=fe.props.mouseEnterDelay;fe.fireEvents("onMouseEnter",Ce),fe.delaySetPopupVisible(!0,Fe,Fe?null:Ce)},fe.onMouseMove=function(Ce){fe.fireEvents("onMouseMove",Ce),fe.setPoint(Ce)},fe.onMouseLeave=function(Ce){fe.fireEvents("onMouseLeave",Ce),fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onPopupMouseEnter=function(){fe.clearDelayTimer()},fe.onPopupMouseLeave=function(Ce){var Fe;if(Ce.relatedTarget&&!Ce.relatedTarget.setTimeout&&Object(ft.a)((Fe=fe.popupRef.current)===null||Fe===void 0?void 0:Fe.getElement(),Ce.relatedTarget))return;fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onFocus=function(Ce){fe.fireEvents("onFocus",Ce),fe.clearDelayTimer(),fe.isFocusToShow()&&(fe.focusTime=Date.now(),fe.delaySetPopupVisible(!0,fe.props.focusDelay))},fe.onMouseDown=function(Ce){fe.fireEvents("onMouseDown",Ce),fe.preClickTime=Date.now()},fe.onTouchStart=function(Ce){fe.fireEvents("onTouchStart",Ce),fe.preTouchTime=Date.now()},fe.onBlur=function(Ce){fe.fireEvents("onBlur",Ce),fe.clearDelayTimer(),fe.isBlurToHide()&&fe.delaySetPopupVisible(!1,fe.props.blurDelay)},fe.onContextMenu=function(Ce){Ce.preventDefault(),fe.fireEvents("onContextMenu",Ce),fe.setPopupVisible(!0,Ce)},fe.onContextMenuClose=function(){fe.isContextMenuToShow()&&fe.close()},fe.onClick=function(Ce){if(fe.fireEvents("onClick",Ce),fe.focusTime){var Fe;if(fe.preClickTime&&fe.preTouchTime?Fe=Math.min(fe.preClickTime,fe.preTouchTime):fe.preClickTime?Fe=fe.preClickTime:fe.preTouchTime&&(Fe=fe.preTouchTime),Math.abs(Fe-fe.focusTime)<20)return;fe.focusTime=0}fe.preClickTime=0,fe.preTouchTime=0,fe.isClickToShow()&&(fe.isClickToHide()||fe.isBlurToHide())&&Ce&&Ce.preventDefault&&Ce.preventDefault();var Be=!fe.state.popupVisible;(fe.isClickToHide()&&!Be||Be&&fe.isClickToShow())&&fe.setPopupVisible(!fe.state.popupVisible,Ce)},fe.onPopupMouseDown=function(){if(fe.hasPopupMouseDown=!0,clearTimeout(fe.mouseDownTimeout),fe.mouseDownTimeout=window.setTimeout(function(){fe.hasPopupMouseDown=!1},0),fe.context){var Ce;(Ce=fe.context).onPopupMouseDown.apply(Ce,arguments)}},fe.onDocumentClick=function(Ce){if(fe.props.mask&&!fe.props.maskClosable)return;var Fe=Ce.target,Be=fe.getRootDomNode(),Ge=fe.getPopupDomNode();(!Object(ft.a)(Be,Fe)||fe.isContextMenuOnly())&&!Object(ft.a)(Ge,Fe)&&!fe.hasPopupMouseDown&&fe.close()},fe.getRootDomNode=function(){var Ce=fe.props.getTriggerDOMNode;if(Ce)return Ce(fe.triggerRef.current);try{var Fe=Object(lt.a)(fe.triggerRef.current);if(Fe)return Fe}catch(Be){}return ot.a.findDOMNode(Object(g.a)(fe))},fe.getPopupClassNameFromAlign=function(Ce){var Fe=[],Be=fe.props,Ge=Be.popupPlacement,Ze=Be.builtinPlacements,ut=Be.prefixCls,ht=Be.alignPoint,Ct=Be.getPopupClassNameFromAlign;return Ge&&Ze&&Fe.push(ne(Ze,ut,Ce,ht)),Ct&&Fe.push(Ct(Ce)),Fe.join(" ")},fe.getComponent=function(){var Ce=fe.props,Fe=Ce.prefixCls,Be=Ce.destroyPopupOnHide,Ge=Ce.popupClassName,Ze=Ce.onPopupAlign,ut=Ce.popupMotion,ht=Ce.popupAnimation,Ct=Ce.popupTransitionName,dn=Ce.popupStyle,Kn=Ce.mask,On=Ce.maskAnimation,Nn=Ce.maskTransitionName,Bn=Ce.maskMotion,Un=Ce.zIndex,Ln=Ce.popup,zn=Ce.stretch,Xn=Ce.alignPoint,Or=Ce.mobile,Yn=Ce.forceRender,nn=fe.state,qt=nn.popupVisible,In=nn.point,nr=fe.getPopupAlign(),Kt={};return fe.isMouseEnterToShow()&&(Kt.onMouseEnter=fe.onPopupMouseEnter),fe.isMouseLeaveToHide()&&(Kt.onMouseLeave=fe.onPopupMouseLeave),Kt.onMouseDown=fe.onPopupMouseDown,Kt.onTouchStart=fe.onPopupMouseDown,I.createElement(yn,Object(S.a)({prefixCls:Fe,destroyPopupOnHide:Be,visible:qt,point:Xn&&In,className:Ge,align:nr,onAlign:Ze,animation:ht,getClassNameFromAlign:fe.getPopupClassNameFromAlign},Kt,{stretch:zn,getRootDomNode:fe.getRootDomNode,style:dn,mask:Kn,zIndex:Un,transitionName:Ct,maskAnimation:On,maskTransitionName:Nn,maskMotion:Bn,ref:fe.popupRef,motion:ut,mobile:Or,forceRender:Yn}),typeof Ln=="function"?Ln():Ln)},fe.attachParent=function(Ce){qe.a.cancel(fe.attachId);var Fe=fe.props,Be=Fe.getPopupContainer,Ge=Fe.getDocument,Ze=fe.getRootDomNode(),ut;Be?(Ze||Be.length===0)&&(ut=Be(Ze)):ut=Ge(fe.getRootDomNode()).body,ut?ut.appendChild(Ce):fe.attachId=Object(qe.a)(function(){fe.attachParent(Ce)})},fe.getContainer=function(){var Ce=fe.props.getDocument,Fe=Ce(fe.getRootDomNode()).createElement("div");return Fe.style.position="absolute",Fe.style.top="0",Fe.style.left="0",Fe.style.width="100%",fe.attachParent(Fe),Fe},fe.setPoint=function(Ce){var Fe=fe.props.alignPoint;if(!Fe||!Ce)return;fe.setState({point:{pageX:Ce.pageX,pageY:Ce.pageY}})},fe.handlePortalUpdate=function(){fe.state.prevPopupVisible!==fe.state.popupVisible&&fe.props.afterPopupVisibleChange(fe.state.popupVisible)},fe.triggerContextValue={onPopupMouseDown:fe.onPopupMouseDown};var Le;return"popupVisible"in xe?Le=!!xe.popupVisible:Le=!!xe.defaultPopupVisible,fe.state={prevPopupVisible:Le,popupVisible:Le},hn.forEach(function(Ce){fe["fire".concat(Ce)]=function(Fe){fe.fireEvents(Ce,Fe)}}),fe}return Object(O.a)(le,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var fe=this.props,Le=this.state;if(Le.popupVisible){var Ce;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ce=fe.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ye.a)(Ce,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ce=Ce||fe.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ye.a)(Ce,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ce=Ce||fe.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ye.a)(Ce,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ye.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),qe.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var fe;return((fe=this.popupRef.current)===null||fe===void 0?void 0:fe.getElement())||null}},{key:"getPopupAlign",value:function(){var fe=this.props,Le=fe.popupPlacement,Ce=fe.popupAlign,Fe=fe.builtinPlacements;return Le&&Fe?me(Fe,Le,Ce):Ce}},{key:"setPopupVisible",value:function(fe,Le){var Ce=this.props.alignPoint,Fe=this.state.popupVisible;this.clearDelayTimer(),Fe!==fe&&("popupVisible"in this.props||this.setState({popupVisible:fe,prevPopupVisible:Fe}),this.props.onPopupVisibleChange(fe)),Ce&&Le&&fe&&this.setPoint(Le)}},{key:"delaySetPopupVisible",value:function(fe,Le,Ce){var Fe=this,Be=Le*1e3;if(this.clearDelayTimer(),Be){var Ge=Ce?{pageX:Ce.pageX,pageY:Ce.pageY}:null;this.delayTimer=window.setTimeout(function(){Fe.setPopupVisible(fe,Ge),Fe.clearDelayTimer()},Be)}else this.setPopupVisible(fe,Ce)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(fe){var Le=this.props.children.props,Ce=this.props;return Le[fe]&&Ce[fe]?this["fire".concat(fe)]:Le[fe]||Ce[fe]}},{key:"isClickToShow",value:function(){var fe=this.props,Le=fe.action,Ce=fe.showAction;return Le.indexOf("click")!==-1||Ce.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var fe=this.props.action;return fe==="contextMenu"||fe.length===1&&fe[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var fe=this.props,Le=fe.action,Ce=fe.showAction;return Le.indexOf("contextMenu")!==-1||Ce.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var fe=this.props,Le=fe.action,Ce=fe.hideAction;return Le.indexOf("click")!==-1||Ce.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var fe=this.props,Le=fe.action,Ce=fe.showAction;return Le.indexOf("hover")!==-1||Ce.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var fe=this.props,Le=fe.action,Ce=fe.hideAction;return Le.indexOf("hover")!==-1||Ce.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var fe=this.props,Le=fe.action,Ce=fe.showAction;return Le.indexOf("focus")!==-1||Ce.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var fe=this.props,Le=fe.action,Ce=fe.hideAction;return Le.indexOf("focus")!==-1||Ce.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var fe;(fe=this.popupRef.current)===null||fe===void 0||fe.forceAlign()}}},{key:"fireEvents",value:function(fe,Le){var Ce=this.props.children.props[fe];Ce&&Ce(Le);var Fe=this.props[fe];Fe&&Fe(Le)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var fe=this.state.popupVisible,Le=this.props,Ce=Le.children,Fe=Le.forceRender,Be=Le.alignPoint,Ge=Le.className,Ze=Le.autoDestroy,ut=I.Children.only(Ce),ht={key:"trigger"};this.isContextMenuToShow()?ht.onContextMenu=this.onContextMenu:ht.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(ht.onClick=this.onClick,ht.onMouseDown=this.onMouseDown,ht.onTouchStart=this.onTouchStart):(ht.onClick=this.createTwoChains("onClick"),ht.onMouseDown=this.createTwoChains("onMouseDown"),ht.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(ht.onMouseEnter=this.onMouseEnter,Be&&(ht.onMouseMove=this.onMouseMove)):ht.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?ht.onMouseLeave=this.onMouseLeave:ht.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(ht.onFocus=this.onFocus,ht.onBlur=this.onBlur):(ht.onFocus=this.createTwoChains("onFocus"),ht.onBlur=this.createTwoChains("onBlur"));var Ct=G()(ut&&ut.props&&ut.props.className,Ge);Ct&&(ht.className=Ct);var dn=Object(z.a)({},ht);Object(pt.c)(ut)&&(dn.ref=Object(pt.a)(this.triggerRef,ut.ref));var Kn=I.cloneElement(ut,dn),On;return(fe||this.popupRef.current||Fe)&&(On=I.createElement(Ae,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!fe&&Ze&&(On=null),I.createElement(en.Provider,{value:this.triggerContextValue},Kn,On)}}],[{key:"getDerivedStateFromProps",value:function(fe,Le){var Ce=fe.popupVisible,Fe={};return Ce!==void 0&&Le.popupVisible!==Ce&&(Fe.popupVisible=Ce,Fe.prevPopupVisible=Le.popupVisible),Fe}}]),le}(I.Component);return Me.contextType=en,Me.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Fn,getDocument:tn,onPopupVisibleChange:xn,afterPopupVisibleChange:xn,onPopupAlign:xn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Me}var Wn=ar(Tt.a),Bt={adjustX:1,adjustY:1},_n={topLeft:{points:["bl","tl"],overflow:Bt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Bt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Bt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Bt,offset:[4,0]}},ir={topLeft:{points:["bl","tl"],overflow:Bt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Bt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Bt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Bt,offset:[4,0]}},kn=_n,Xt=0,sn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Sn=function(Me,He,De){var le=ye(He),xe=Me.getState();Me.setState({defaultActiveFirst:Object(z.a)(Object(z.a)({},xe.defaultActiveFirst),{},Object(ie.a)({},le,De))})},Nt=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(De){var le;Object(R.a)(this,He),le=Me.call(this,De),le.onDestroy=function(Be){le.props.onDestroy(Be)},le.onKeyDown=function(Be){var Ge=Be.keyCode,Ze=le.menuInstance,ut=le.props.store,ht=le.getVisible();if(Ge===p.a.ENTER)return le.onTitleClick(Be),Sn(ut,le.props.eventKey,!0),!0;if(Ge===p.a.RIGHT)return ht?Ze.onKeyDown(Be):(le.triggerOpenChange(!0),Sn(ut,le.props.eventKey,!0)),!0;if(Ge===p.a.LEFT){var Ct;if(ht)Ct=Ze.onKeyDown(Be);else return;return Ct||(le.triggerOpenChange(!1),Ct=!0),Ct}return ht&&(Ge===p.a.UP||Ge===p.a.DOWN)?Ze.onKeyDown(Be):void 0},le.onOpenChange=function(Be){le.props.onOpenChange(Be)},le.onPopupVisibleChange=function(Be){le.triggerOpenChange(Be,Be?"mouseenter":"mouseleave")},le.onMouseEnter=function(Be){var Ge=le.props,Ze=Ge.eventKey,ut=Ge.onMouseEnter,ht=Ge.store;Sn(ht,le.props.eventKey,!1),ut({key:Ze,domEvent:Be})},le.onMouseLeave=function(Be){var Ge=le.props,Ze=Ge.parentMenu,ut=Ge.eventKey,ht=Ge.onMouseLeave;Ze.subMenuInstance=Object(g.a)(le),ht({key:ut,domEvent:Be})},le.onTitleMouseEnter=function(Be){var Ge=le.props,Ze=Ge.eventKey,ut=Ge.onItemHover,ht=Ge.onTitleMouseEnter;ut({key:Ze,hover:!0}),ht({key:Ze,domEvent:Be})},le.onTitleMouseLeave=function(Be){var Ge=le.props,Ze=Ge.parentMenu,ut=Ge.eventKey,ht=Ge.onItemHover,Ct=Ge.onTitleMouseLeave;Ze.subMenuInstance=Object(g.a)(le),ht({key:ut,hover:!1}),Ct({key:ut,domEvent:Be})},le.onTitleClick=function(Be){var Ge=Object(g.a)(le),Ze=Ge.props;if(Ze.onTitleClick({key:Ze.eventKey,domEvent:Be}),Ze.triggerSubMenuAction==="hover")return;le.triggerOpenChange(!le.getVisible(),"click"),Sn(Ze.store,le.props.eventKey,!1)},le.onSubMenuClick=function(Be){typeof le.props.onClick=="function"&&le.props.onClick(le.addKeyPath(Be))},le.onSelect=function(Be){le.props.onSelect(Be)},le.onDeselect=function(Be){le.props.onDeselect(Be)},le.getPrefixCls=function(){return"".concat(le.props.rootPrefixCls,"-submenu")},le.getActiveClassName=function(){return"".concat(le.getPrefixCls(),"-active")},le.getDisabledClassName=function(){return"".concat(le.getPrefixCls(),"-disabled")},le.getSelectedClassName=function(){return"".concat(le.getPrefixCls(),"-selected")},le.getOpenClassName=function(){return"".concat(le.props.rootPrefixCls,"-submenu-open")},le.getVisible=function(){return le.state.isOpen},le.getMode=function(){return le.state.mode},le.saveMenuInstance=function(Be){le.menuInstance=Be},le.addKeyPath=function(Be){return Object(z.a)(Object(z.a)({},Be),{},{keyPath:(Be.keyPath||[]).concat(le.props.eventKey)})},le.triggerOpenChange=function(Be,Ge){var Ze=le.props.eventKey,ut=function(){le.onOpenChange({key:Ze,item:Object(g.a)(le),trigger:Ge,open:Be})};Ge==="mouseenter"?le.mouseenterTimeout=setTimeout(function(){ut()},0):ut()},le.isChildrenSelected=function(){var Be={find:!1};return Ke(le.props.children,le.props.selectedKeys,Be),Be.find},le.isInlineMode=function(){return le.getMode()==="inline"},le.adjustWidth=function(){if(!le.subMenuTitle||!le.menuInstance)return;var Be=nt.findDOMNode(le.menuInstance);if(Be.offsetWidth>=le.subMenuTitle.offsetWidth)return;Be.style.minWidth="".concat(le.subMenuTitle.offsetWidth,"px")},le.saveSubMenuTitle=function(Be){le.subMenuTitle=Be},le.getBaseProps=function(){var Be=Object(g.a)(le),Ge=Be.props,Ze=le.getMode();return{mode:Ze==="horizontal"?"vertical":Ze,visible:le.getVisible(),level:Ge.level+1,inlineIndent:Ge.inlineIndent,focusable:!1,onClick:le.onSubMenuClick,onSelect:le.onSelect,onDeselect:le.onDeselect,onDestroy:le.onDestroy,selectedKeys:Ge.selectedKeys,eventKey:"".concat(Ge.eventKey,"-menu-"),openKeys:Ge.openKeys,motion:Ge.motion,onOpenChange:le.onOpenChange,subMenuOpenDelay:Ge.subMenuOpenDelay,parentMenu:Object(g.a)(le),subMenuCloseDelay:Ge.subMenuCloseDelay,forceSubMenuRender:Ge.forceSubMenuRender,triggerSubMenuAction:Ge.triggerSubMenuAction,builtinPlacements:Ge.builtinPlacements,defaultActiveFirst:Ge.store.getState().defaultActiveFirst[ye(Ge.eventKey)],multiple:Ge.multiple,prefixCls:Ge.rootPrefixCls,id:le.internalMenuId,manualRef:le.saveMenuInstance,itemIcon:Ge.itemIcon,expandIcon:Ge.expandIcon,direction:Ge.direction}},le.getMotion=function(Be,Ge){var Ze=Object(g.a)(le),ut=Ze.haveRendered,ht=le.props,Ct=ht.motion,dn=ht.rootPrefixCls,Kn=Object(z.a)(Object(z.a)({},Ct),{},{leavedClassName:"".concat(dn,"-hidden"),removeOnLeave:!1,motionAppear:ut||!Ge||Be!=="inline"});return Kn};var xe=De.store,fe=De.eventKey,Le=xe.getState(),Ce=Le.defaultActiveFirst;le.isRootMenu=!1;var Fe=!1;return Ce&&(Fe=Ce[fe]),Sn(xe,fe,Fe),le.state={mode:De.mode,isOpen:De.isOpen},le}return Object(O.a)(He,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this,xe=this.props,fe=xe.mode,Le=xe.parentMenu,Ce=xe.manualRef,Fe=xe.isOpen,Be=function(){le.setState({mode:fe,isOpen:Fe})},Ge=Fe!==this.state.isOpen,Ze=fe!==this.state.mode;if((Ze||Ge)&&(qe.a.cancel(this.updateStateRaf),Ze?this.updateStateRaf=Object(qe.a)(Be):Be()),Ce&&Ce(this),fe!=="horizontal"||!(Le==null?void 0:Le.isRootMenu)||!Fe)return;this.minWidthTimeout=setTimeout(function(){return le.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var le=this.props,xe=le.onDestroy,fe=le.eventKey;xe&&xe(fe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),qe.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(le,xe){var fe=this.getBaseProps();return I.createElement(tr,Object(S.a)({},fe,{id:this.internalMenuId,className:le,style:xe}),this.props.children)}},{key:"renderChildren",value:function(){var le=this,xe=this.getBaseProps(),fe=xe.mode,Le=xe.visible,Ce=xe.forceSubMenuRender,Fe=xe.direction,Be=this.getMotion(fe,Le);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Le||Ce,!this.haveOpened)return I.createElement("div",null);var Ge=G()("".concat(xe.prefixCls,"-sub"),Object(ie.a)({},"".concat(xe.prefixCls,"-rtl"),Fe==="rtl"));return this.isInlineMode()?I.createElement(Fi,Object(S.a)({visible:xe.visible,forceRender:Ce},Be),function(Ze){var ut=Ze.className,ht=Ze.style,Ct=G()(Ge,ut);return le.renderPopupMenu(Ct,ht)}):this.renderPopupMenu(Ge)}},{key:"render",value:function(){var le,xe,fe,Le=Object(z.a)({},this.props),Ce=this.getVisible(),Fe=this.getPrefixCls(),Be=this.isInlineMode(),Ge=this.getMode(),Ze=G()(Fe,"".concat(Fe,"-").concat(Ge),(le={},Object(ie.a)(le,Le.className,!!Le.className),Object(ie.a)(le,this.getOpenClassName(),Ce),Object(ie.a)(le,this.getActiveClassName(),Le.active||Ce&&!Be),Object(ie.a)(le,this.getDisabledClassName(),Le.disabled),Object(ie.a)(le,this.getSelectedClassName(),this.isChildrenSelected()),le));this.internalMenuId||(Le.eventKey?this.internalMenuId="".concat(Le.eventKey,"$Menu"):(Xt+=1,this.internalMenuId="$__$".concat(Xt,"$Menu")));var ut={},ht={},Ct={};Le.disabled||(ut={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ht={onClick:this.onTitleClick},Ct={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var dn={},Kn=Le.direction,On=Kn==="rtl";Be&&(On?dn.paddingRight=Le.inlineIndent*Le.level:dn.paddingLeft=Le.inlineIndent*Le.level);var Nn={};this.getVisible()&&(Nn={"aria-owns":this.internalMenuId});var Bn=null;Ge!=="horizontal"&&(Bn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Bn=I.createElement(this.props.expandIcon,Object(z.a)({},this.props))));var Un=I.createElement("div",Object(S.a)({ref:this.saveSubMenuTitle,style:dn,className:"".concat(Fe,"-title"),role:"button"},Ct,ht,{"aria-expanded":Ce},Nn,{"aria-haspopup":"true",title:typeof Le.title=="string"?Le.title:void 0}),Le.title,Bn||I.createElement("i",{className:"".concat(Fe,"-arrow")})),Ln=this.renderChildren(),zn=((xe=Le.parentMenu)===null||xe===void 0?void 0:xe.isRootMenu)?Le.parentMenu.props.getPopupContainer:function(mr){return mr.parentNode},Xn=sn[Ge],Or=Le.popupOffset?{offset:Le.popupOffset}:{},Yn=G()((fe={},Object(ie.a)(fe,Le.popupClassName,Le.popupClassName&&!Be),Object(ie.a)(fe,"".concat(Fe,"-rtl"),On),fe)),nn=Le.disabled,qt=Le.triggerSubMenuAction,In=Le.subMenuOpenDelay,nr=Le.forceSubMenuRender,Kt=Le.subMenuCloseDelay,rr=Le.builtinPlacements;pe.forEach(function(mr){return delete Le[mr]}),delete Le.onClick;var Rr=On?Object(z.a)(Object(z.a)({},ir),rr):Object(z.a)(Object(z.a)({},_n),rr);delete Le.direction;var Zn=this.getBaseProps(),_r=Be?null:this.getMotion(Zn.mode,Zn.visible);return I.createElement("li",Object(S.a)({},Le,ut,{className:Ze,role:"menuitem"}),I.createElement(Wn,{prefixCls:Fe,popupClassName:G()("".concat(Fe,"-popup"),Yn),getPopupContainer:zn,builtinPlacements:Rr,popupPlacement:Xn,popupVisible:Be?!1:Ce,popupAlign:Or,popup:Be?null:Ln,action:nn||Be?[]:[qt],mouseEnterDelay:In,mouseLeaveDelay:Kt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:nr,popupMotion:_r},Un),Be?Ln:null)}}]),He}(I.Component);Nt.defaultProps={onMouseEnter:J,onMouseLeave:J,onTitleMouseEnter:J,onTitleMouseLeave:J,onTitleClick:J,manualRef:J,mode:"vertical",title:""};var Ut=Object(c.b)(function(Ae,Me){var He=Ae.openKeys,De=Ae.activeKey,le=Ae.selectedKeys,xe=Me.eventKey,fe=Me.subMenuKey;return{isOpen:He.indexOf(xe)>-1,active:De[fe]===xe,selectedKeys:le}})(Nt);Ut.isSubMenu=!0;var jt=Ut,je="menuitem-overflowed",Yt=.5,fn=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(){var De;return Object(R.a)(this,He),De=Me.apply(this,arguments),De.resizeObserver=null,De.mutationObserver=null,De.originalTotalWidth=0,De.overflowedItems=[],De.menuItemSizes=[],De.cancelFrameId=null,De.state={lastVisibleIndex:void 0},De.childRef=I.createRef(),De.getMenuItemNodes=function(){var le=De.props.prefixCls,xe=De.childRef.current;return xe?[].slice.call(xe.children).filter(function(fe){return fe.className.split(" ").indexOf("".concat(le,"-overflowed-submenu"))<0}):[]},De.getOverflowedSubMenuItem=function(le,xe,fe){var Le=De.props,Ce=Le.overflowedIndicator,Fe=Le.level,Be=Le.mode,Ge=Le.prefixCls,Ze=Le.theme;if(Fe!==1||Be!=="horizontal")return null;var ut=De.props.children[0],ht=ut.props,Ct=ht.children,dn=ht.title,Kn=ht.style,On=Object(N.a)(ht,["children","title","style"]),Nn=Object(z.a)({},Kn),Bn="".concat(le,"-overflowed-indicator"),Un="".concat(le,"-overflowed-indicator");xe.length===0&&fe!==!0?Nn=Object(z.a)(Object(z.a)({},Nn),{},{display:"none"}):fe&&(Nn=Object(z.a)(Object(z.a)({},Nn),{},{visibility:"hidden",position:"absolute"}),Bn="".concat(Bn,"-placeholder"),Un="".concat(Un,"-placeholder"));var Ln=Ze?"".concat(Ge,"-").concat(Ze):"",zn={};return pe.forEach(function(Xn){On[Xn]!==void 0&&(zn[Xn]=On[Xn])}),I.createElement(jt,Object(S.a)({title:Ce,className:"".concat(Ge,"-overflowed-submenu"),popupClassName:Ln},zn,{key:Bn,eventKey:Un,disabled:!1,style:Nn}),xe)},De.setChildrenWidthAndResize=function(){if(De.props.mode!=="horizontal")return;var le=De.childRef.current;if(!le)return;var xe=le.children;if(!xe||xe.length===0)return;var fe=le.children[xe.length-1];ke(fe,"display","inline-block");var Le=De.getMenuItemNodes(),Ce=Le.filter(function(Fe){return Fe.className.split(" ").indexOf(je)>=0});Ce.forEach(function(Fe){ke(Fe,"display","inline-block")}),De.menuItemSizes=Le.map(function(Fe){return we(Fe,!0)}),Ce.forEach(function(Fe){ke(Fe,"display","none")}),De.overflowedIndicatorWidth=we(le.children[le.children.length-1],!0),De.originalTotalWidth=De.menuItemSizes.reduce(function(Fe,Be){return Fe+Be},0),De.handleResize(),ke(fe,"display","none")},De.handleResize=function(){if(De.props.mode!=="horizontal")return;var le=De.childRef.current;if(!le)return;var xe=we(le);De.overflowedItems=[];var fe=0,Le;De.originalTotalWidth>xe+Yt&&(Le=-1,De.menuItemSizes.forEach(function(Ce){fe+=Ce,fe+De.overflowedIndicatorWidth<=xe&&(Le+=1)})),De.setState({lastVisibleIndex:Le})},De}return Object(O.a)(He,[{key:"componentDidMount",value:function(){var le=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var xe=this.childRef.current;if(!xe)return;this.resizeObserver=new Qe.default(function(fe){fe.forEach(function(){var Le=le.cancelFrameId;cancelAnimationFrame(Le),le.cancelFrameId=requestAnimationFrame(le.setChildrenWidthAndResize)})}),[].slice.call(xe.children).concat(xe).forEach(function(fe){le.resizeObserver.observe(fe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){le.resizeObserver.disconnect(),[].slice.call(xe.children).concat(xe).forEach(function(fe){le.resizeObserver.observe(fe)}),le.setChildrenWidthAndResize()}),this.mutationObserver.observe(xe,{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(le){var xe=this,fe=this.state.lastVisibleIndex;return(le||[]).reduce(function(Le,Ce,Fe){var Be=Ce;if(xe.props.mode==="horizontal"){var Ge=xe.getOverflowedSubMenuItem(Ce.props.eventKey,[]);fe!==void 0&&xe.props.className.indexOf("".concat(xe.props.prefixCls,"-root"))!==-1&&(Fe>fe&&(Be=I.cloneElement(Ce,{style:{display:"none"},eventKey:"".concat(Ce.props.eventKey,"-hidden"),className:"".concat(je)})),Fe===fe+1&&(xe.overflowedItems=le.slice(fe+1).map(function(ut){return I.cloneElement(ut,{key:ut.props.eventKey,mode:"vertical-left"})}),Ge=xe.getOverflowedSubMenuItem(Ce.props.eventKey,xe.overflowedItems)));var Ze=[].concat(Object(L.a)(Le),[Ge,Be]);return Fe===le.length-1&&Ze.push(xe.getOverflowedSubMenuItem(Ce.props.eventKey,[],!0)),Ze}return[].concat(Object(L.a)(Le),[Be])},[])}},{key:"render",value:function(){var le=this.props,xe=le.visible,fe=le.prefixCls,Le=le.overflowedIndicator,Ce=le.mode,Fe=le.level,Be=le.tag,Ge=le.children,Ze=le.theme,ut=Object(N.a)(le,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ht=Be;return I.createElement(ht,Object(S.a)({ref:this.childRef},ut),this.renderChildren(Ge))}}]),He}(I.Component);fn.defaultProps={tag:"div",className:""};var fr=fn;function pn(Ae){return Ae.length?Ae.every(function(Me){return!!Me.props.disabled}):!0}function Yr(Ae,Me,He){var De=Ae.getState();Ae.setState({activeKey:Object(z.a)(Object(z.a)({},De.activeKey),{},Object(ie.a)({},Me,He))})}function $r(Ae){return Ae.eventKey||"0-menu-"}function kr(Ae,Me){var He=Me,De=Ae.children,le=Ae.eventKey;if(He){var xe;if(Re(De,function(fe,Le){fe&&fe.props&&!fe.props.disabled&&He===X(fe,le,Le)&&(xe=!0)}),xe)return He}return He=null,Ae.defaultActiveFirst&&Re(De,function(fe,Le){!He&&fe&&!fe.props.disabled&&(He=X(fe,le,Le))}),He}function An(Ae){if(!Ae)return;var Me=this.instanceArray.indexOf(Ae);Me!==-1?this.instanceArray[Me]=Ae:this.instanceArray.push(Ae)}var St=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(De){var le;return Object(R.a)(this,He),le=Me.call(this,De),le.onKeyDown=function(xe,fe){var Le=xe.keyCode,Ce;if(le.getFlatInstanceArray().forEach(function(Be){Be&&Be.props.active&&Be.onKeyDown&&(Ce=Be.onKeyDown(xe))}),Ce)return 1;var Fe=null;return(Le===p.a.UP||Le===p.a.DOWN)&&(Fe=le.step(Le===p.a.UP?-1:1)),Fe?(xe.preventDefault(),Yr(le.props.store,$r(le.props),Fe.props.eventKey),typeof fe=="function"&&fe(Fe),1):void 0},le.onItemHover=function(xe){var fe=xe.key,Le=xe.hover;Yr(le.props.store,$r(le.props),Le?fe:null)},le.onDeselect=function(xe){le.props.onDeselect(xe)},le.onSelect=function(xe){le.props.onSelect(xe)},le.onClick=function(xe){le.props.onClick(xe)},le.onOpenChange=function(xe){le.props.onOpenChange(xe)},le.onDestroy=function(xe){le.props.onDestroy(xe)},le.getFlatInstanceArray=function(){return le.instanceArray},le.step=function(xe){var fe=le.getFlatInstanceArray(),Le=le.props.store.getState().activeKey[$r(le.props)],Ce=fe.length;if(!Ce)return null;xe<0&&(fe=fe.concat().reverse());var Fe=-1;if(fe.every(function(ut,ht){return ut&&ut.props.eventKey===Le?(Fe=ht,!1):!0}),!le.props.defaultActiveFirst&&Fe!==-1&&pn(fe.slice(Fe,Ce-1)))return;var Be=(Fe+1)%Ce,Ge=Be;do{var Ze=fe[Ge];if(!Ze||Ze.props.disabled)Ge=(Ge+1)%Ce;else return Ze}while(Ge!==Be);return null},le.renderCommonMenuItem=function(xe,fe,Le){var Ce=le.props.store.getState(),Fe=Object(g.a)(le),Be=Fe.props,Ge=X(xe,Be.eventKey,fe),Ze=xe.props;if(!Ze||typeof xe.type=="string")return xe;var ut=Ge===Ce.activeKey,ht=Object(z.a)(Object(z.a)({mode:Ze.mode||Be.mode,level:Be.level,inlineIndent:Be.inlineIndent,renderMenuItem:le.renderMenuItem,rootPrefixCls:Be.prefixCls,index:fe,parentMenu:Be.parentMenu,manualRef:Ze.disabled?void 0:Object(E.a)(xe.ref,An.bind(Object(g.a)(le))),eventKey:Ge,active:!Ze.disabled&&ut,multiple:Be.multiple,onClick:function(dn){(Ze.onClick||J)(dn),le.onClick(dn)},onItemHover:le.onItemHover,motion:Be.motion,subMenuOpenDelay:Be.subMenuOpenDelay,subMenuCloseDelay:Be.subMenuCloseDelay,forceSubMenuRender:Be.forceSubMenuRender,onOpenChange:le.onOpenChange,onDeselect:le.onDeselect,onSelect:le.onSelect,builtinPlacements:Be.builtinPlacements,itemIcon:Ze.itemIcon||le.props.itemIcon,expandIcon:Ze.expandIcon||le.props.expandIcon},Le),{},{direction:Be.direction});return(Be.mode==="inline"||Ue())&&(ht.triggerSubMenuAction="click"),I.cloneElement(xe,Object(z.a)(Object(z.a)({},ht),{},{key:Ge||fe}))},le.renderMenuItem=function(xe,fe,Le){if(!xe)return null;var Ce=le.props.store.getState(),Fe={openKeys:Ce.openKeys,selectedKeys:Ce.selectedKeys,triggerSubMenuAction:le.props.triggerSubMenuAction,subMenuKey:Le};return le.renderCommonMenuItem(xe,fe,Fe)},De.store.setState({activeKey:Object(z.a)(Object(z.a)({},De.store.getState().activeKey),{},Object(ie.a)({},De.eventKey,kr(De,De.activeKey)))}),le.instanceArray=[],le}return Object(O.a)(He,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(le){return this.props.visible||le.visible||this.props.className!==le.className||!B()(this.props.style,le.style)}},{key:"componentDidUpdate",value:function(le){var xe=this.props,fe="activeKey"in xe?xe.activeKey:xe.store.getState().activeKey[$r(xe)],Le=kr(xe,fe);if(Le!==fe)Yr(xe.store,$r(xe),Le);else if("activeKey"in le){var Ce=kr(le,le.activeKey);Le!==Ce&&Yr(xe.store,$r(xe),Le)}}},{key:"render",value:function(){var le=this,xe=Object(S.a)({},this.props);this.instanceArray=[];var fe=G()(xe.prefixCls,xe.className,"".concat(xe.prefixCls,"-").concat(xe.mode)),Le={className:fe,role:xe.role||"menu"};xe.id&&(Le.id=xe.id),xe.focusable&&(Le.tabIndex=0,Le.onKeyDown=this.onKeyDown);var Ce=xe.prefixCls,Fe=xe.eventKey,Be=xe.visible,Ge=xe.level,Ze=xe.mode,ut=xe.overflowedIndicator,ht=xe.theme;return pe.forEach(function(Ct){return delete xe[Ct]}),delete xe.onClick,I.createElement(fr,Object(S.a)({},xe,{prefixCls:Ce,mode:Ze,tag:"ul",level:Ge,theme:ht,visible:Be,overflowedIndicator:ut},Le),Object(K.a)(xe.children).map(function(Ct,dn){return le.renderMenuItem(Ct,dn,Fe||"0-menu-")}))}}]),He}(I.Component);St.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:J};var pr=Object(c.b)()(St),tr=pr,Hn=U("Kwbf");function Qr(Ae,Me,He){var De=Ae.prefixCls,le=Ae.motion,xe=Ae.defaultMotions,fe=xe===void 0?{}:xe,Le=Ae.openAnimation,Ce=Ae.openTransitionName,Fe=Me.switchingModeFromInline;if(le)return le;if(Object(W.a)(Le)==="object"&&Le)Object(Hn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Le=="string")return{motionName:"".concat(De,"-open-").concat(Le)};if(Ce)return{motionName:Ce};var Be=fe[He];return Be||(Fe?null:fe.other)}var Lt=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(De){var le;Object(R.a)(this,He),le=Me.call(this,De),le.onSelect=function(Le){var Ce=Object(g.a)(le),Fe=Ce.props;if(Fe.selectable){var Be=le.store.getState(),Ge=Be.selectedKeys,Ze=Le.key;Fe.multiple?Ge=Ge.concat([Ze]):Ge=[Ze],"selectedKeys"in Fe||le.store.setState({selectedKeys:Ge}),Fe.onSelect(Object(z.a)(Object(z.a)({},Le),{},{selectedKeys:Ge}))}},le.onClick=function(Le){var Ce=le.getRealMenuMode(),Fe=Object(g.a)(le),Be=Fe.store,Ge=Fe.props.onOpenChange;Ce!=="inline"&&!("openKeys"in le.props)&&(Be.setState({openKeys:[]}),Ge([])),le.props.onClick(Le)},le.onKeyDown=function(Le,Ce){le.innerMenu.getWrappedInstance().onKeyDown(Le,Ce)},le.onOpenChange=function(Le){var Ce=Object(g.a)(le),Fe=Ce.props,Be=le.store.getState().openKeys.concat(),Ge=!1,Ze=function(ht){var Ct=!1;if(ht.open)Ct=Be.indexOf(ht.key)===-1,Ct&&Be.push(ht.key);else{var dn=Be.indexOf(ht.key);Ct=dn!==-1,Ct&&Be.splice(dn,1)}Ge=Ge||Ct};Array.isArray(Le)?Le.forEach(Ze):Ze(Le),Ge&&("openKeys"in le.props||le.store.setState({openKeys:Be}),Fe.onOpenChange(Be))},le.onDeselect=function(Le){var Ce=Object(g.a)(le),Fe=Ce.props;if(Fe.selectable){var Be=le.store.getState().selectedKeys.concat(),Ge=Le.key,Ze=Be.indexOf(Ge);Ze!==-1&&Be.splice(Ze,1),"selectedKeys"in Fe||le.store.setState({selectedKeys:Be}),Fe.onDeselect(Object(z.a)(Object(z.a)({},Le),{},{selectedKeys:Be}))}},le.onMouseEnter=function(Le){le.restoreModeVerticalFromInline();var Ce=le.props.onMouseEnter;Ce&&Ce(Le)},le.onTransitionEnd=function(Le){var Ce=Le.propertyName==="width"&&Le.target===Le.currentTarget,Fe=Le.target.className,Be=Object.prototype.toString.call(Fe)==="[object SVGAnimatedString]"?Fe.animVal:Fe,Ge=Le.propertyName==="font-size"&&Be.indexOf("anticon")>=0;(Ce||Ge)&&le.restoreModeVerticalFromInline()},le.setInnerMenu=function(Le){le.innerMenu=Le},le.isRootMenu=!0;var xe=De.defaultSelectedKeys,fe=De.defaultOpenKeys;return"selectedKeys"in De&&(xe=De.selectedKeys||[]),"openKeys"in De&&(fe=De.openKeys||[]),le.store=Object(c.c)({selectedKeys:xe,openKeys:fe,activeKey:{"0-menu-":kr(De,De.activeKey)}}),le.state={switchingModeFromInline:!1,prevProps:De,inlineOpenKeys:[],store:le.store},le}return Object(O.a)(He,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(le){var xe=this.props,fe=xe.siderCollapsed,Le=xe.inlineCollapsed,Ce=xe.onOpenChange;(!le.inlineCollapsed&&Le||!le.siderCollapsed&&fe)&&Ce([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var le=this.props.collapsedWidth,xe=this.store,fe=this.prevOpenKeys,Le=this.getInlineCollapsed()&&(le===0||le==="0"||le==="0px");Le?(this.prevOpenKeys=xe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):fe&&(this.store.setState({openKeys:fe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var le=this.props.mode,xe=this.state.switchingModeFromInline,fe=this.getInlineCollapsed();return xe&&fe?"inline":fe?"vertical":le}},{key:"getInlineCollapsed",value:function(){var le=this.props,xe=le.inlineCollapsed,fe=le.siderCollapsed;return fe!==void 0?fe:xe}},{key:"restoreModeVerticalFromInline",value:function(){var le=this.state.switchingModeFromInline;le&&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 le=Object(z.a)({},Object(C.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),xe=this.getRealMenuMode();return le.className+=" ".concat(le.prefixCls,"-root"),le.direction==="rtl"&&(le.className+=" ".concat(le.prefixCls,"-rtl")),le=Object(z.a)(Object(z.a)({},le),{},{mode:xe,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Qr(this.props,this.state,xe)}),delete le.openAnimation,delete le.openTransitionName,I.createElement(c.a,{store:this.store},I.createElement(tr,Object(S.a)({},le,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(le,xe){var fe=xe.prevProps,Le=xe.store,Ce=Le.getState(),Fe={},Be={prevProps:le};return fe.mode==="inline"&&le.mode!=="inline"&&(Be.switchingModeFromInline=!0),"openKeys"in le?Fe.openKeys=le.openKeys||[]:((le.inlineCollapsed&&!fe.inlineCollapsed||le.siderCollapsed&&!fe.siderCollapsed)&&(Be.switchingModeFromInline=!0,Be.inlineOpenKeys=Ce.openKeys,Fe.openKeys=[]),(!le.inlineCollapsed&&fe.inlineCollapsed||!le.siderCollapsed&&fe.siderCollapsed)&&(Fe.openKeys=xe.inlineOpenKeys,Be.inlineOpenKeys=[])),Object.keys(Fe).length&&Le.setState(Fe),Be}}]),He}(I.Component);Lt.defaultProps={selectable:!0,onClick:J,onSelect:J,onOpenChange:J,onDeselect:J,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:I.createElement("span",null,"\xB7\xB7\xB7")};var Ft=Lt,It=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(){var De;return Object(R.a)(this,He),De=Me.apply(this,arguments),De.onKeyDown=function(le){var xe=le.keyCode;return xe===p.a.ENTER?(De.onClick(le),!0):void 0},De.onMouseLeave=function(le){var xe=De.props,fe=xe.eventKey,Le=xe.onItemHover,Ce=xe.onMouseLeave;Le({key:fe,hover:!1}),Ce({key:fe,domEvent:le})},De.onMouseEnter=function(le){var xe=De.props,fe=xe.eventKey,Le=xe.onItemHover,Ce=xe.onMouseEnter;Le({key:fe,hover:!0}),Ce({key:fe,domEvent:le})},De.onClick=function(le){var xe=De.props,fe=xe.eventKey,Le=xe.multiple,Ce=xe.onClick,Fe=xe.onSelect,Be=xe.onDeselect,Ge=xe.isSelected,Ze={key:fe,keyPath:[fe],item:Object(g.a)(De),domEvent:le};Ce(Ze),Le?Ge?Be(Ze):Fe(Ze):Ge||Fe(Ze)},De.saveNode=function(le){De.node=le},De}return Object(O.a)(He,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var le=this.props;le.onDestroy&&le.onDestroy(le.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 le,xe=Object(z.a)({},this.props),fe=G()(this.getPrefixCls(),xe.className,(le={},Object(ie.a)(le,this.getActiveClassName(),!xe.disabled&&xe.active),Object(ie.a)(le,this.getSelectedClassName(),xe.isSelected),Object(ie.a)(le,this.getDisabledClassName(),xe.disabled),le)),Le=Object(z.a)(Object(z.a)({},xe.attribute),{},{title:typeof xe.title=="string"?xe.title:void 0,className:fe,role:xe.role||"menuitem","aria-disabled":xe.disabled});xe.role==="option"?Le=Object(z.a)(Object(z.a)({},Le),{},{role:"option","aria-selected":xe.isSelected}):(xe.role===null||xe.role==="none")&&(Le.role="none");var Ce={onClick:xe.disabled?null:this.onClick,onMouseLeave:xe.disabled?null:this.onMouseLeave,onMouseEnter:xe.disabled?null:this.onMouseEnter},Fe=Object(z.a)({},xe.style);xe.mode==="inline"&&(xe.direction==="rtl"?Fe.paddingRight=xe.inlineIndent*xe.level:Fe.paddingLeft=xe.inlineIndent*xe.level),pe.forEach(function(Ge){return delete xe[Ge]}),delete xe.direction;var Be=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Be=I.createElement(this.props.itemIcon,this.props)),I.createElement("li",Object(S.a)({},Object(C.a)(xe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Le,Ce,{style:Fe,ref:this.saveNode}),xe.children,Be)}}]),He}(I.Component);It.isMenuItem=!0,It.defaultProps={onSelect:J,onMouseEnter:J,onMouseLeave:J,manualRef:J};var Jt=Object(c.b)(function(Ae,Me){var He=Ae.activeKey,De=Ae.selectedKeys,le=Me.eventKey,xe=Me.subMenuKey;return{active:He[xe]===le,isSelected:Array.isArray(De)?De.indexOf(le)!==-1:De===le}})(It),Mn=Jt,wn=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(){var De;return Object(R.a)(this,He),De=Me.apply(this,arguments),De.renderInnerMenuItem=function(le){var xe=De.props,fe=xe.renderMenuItem,Le=xe.index;return fe(le,Le,De.props.subMenuKey)},De}return Object(O.a)(He,[{key:"render",value:function(){var le=Object(S.a)({},this.props),xe=le.className,fe=xe===void 0?"":xe,Le=le.rootPrefixCls,Ce="".concat(Le,"-item-group-title"),Fe="".concat(Le,"-item-group-list"),Be=le.title,Ge=le.children;return pe.forEach(function(Ze){return delete le[Ze]}),delete le.direction,I.createElement("li",Object(S.a)({},le,{onClick:function(ut){return ut.stopPropagation()},className:"".concat(fe," ").concat(Le,"-item-group")}),I.createElement("div",{className:Ce,title:typeof Be=="string"?Be:void 0},Be),I.createElement("ul",{className:Fe},I.Children.map(Ge,this.renderInnerMenuItem)))}}]),He}(I.Component);wn.isMenuItemGroup=!0,wn.defaultProps={disabled:!0};var Vn=wn,sr=function(Me){var He=Me.className,De=Me.rootPrefixCls,le=Me.style;return I.createElement("li",{className:"".concat(He," ").concat(De,"-item-divider"),style:le})};sr.defaultProps={disabled:!0,className:"",style:{}};var mi=sr,Gn=Ft,Wi=U("eDIo");function lr(Ae,Me){var He=Ae.prefixCls,De=Ae.editable,le=Ae.locale,xe=Ae.style;return!De||De.showAdd===!1?null:I.createElement("button",{ref:Me,type:"button",className:"".concat(He,"-nav-add"),style:xe,"aria-label":(le==null?void 0:le.addAriaLabel)||"Add tab",onClick:function(Le){De.onEdit("add",{event:Le})}},De.addIcon||"+")}var ii=I.forwardRef(lr);function Zr(Ae,Me){var He=Ae.prefixCls,De=Ae.id,le=Ae.tabs,xe=Ae.locale,fe=Ae.mobile,Le=Ae.moreIcon,Ce=Le===void 0?"More":Le,Fe=Ae.moreTransitionName,Be=Ae.style,Ge=Ae.className,Ze=Ae.editable,ut=Ae.tabBarGutter,ht=Ae.rtl,Ct=Ae.onTabClick,dn=Object(I.useState)(!1),Kn=Object(Y.a)(dn,2),On=Kn[0],Nn=Kn[1],Bn=Object(I.useState)(null),Un=Object(Y.a)(Bn,2),Ln=Un[0],zn=Un[1],Xn="".concat(De,"-more-popup"),Or="".concat(He,"-dropdown"),Yn=Ln!==null?"".concat(Xn,"-").concat(Ln):null,nn=xe==null?void 0:xe.dropdownAriaLabel,qt=I.createElement(Gn,{onClick:function(_r){var mr=_r.key,Nr=_r.domEvent;Ct(mr,Nr),Nn(!1)},id:Xn,tabIndex:-1,role:"listbox","aria-activedescendant":Yn,selectedKeys:[Ln],"aria-label":nn!==void 0?nn:"expanded dropdown"},le.map(function(Zn){return I.createElement(Mn,{key:Zn.key,id:"".concat(Xn,"-").concat(Zn.key),role:"option","aria-controls":De&&"".concat(De,"-panel-").concat(Zn.key),disabled:Zn.disabled},Zn.tab)}));function In(Zn){for(var _r=le.filter(function(li){return!li.disabled}),mr=_r.findIndex(function(li){return li.key===Ln})||0,Nr=_r.length,Fr=0;Fr<Nr;Fr+=1){mr=(mr+Zn+Nr)%Nr;var Lr=_r[mr];if(!Lr.disabled){zn(Lr.key);return}}}function nr(Zn){var _r=Zn.which;if(!On){[p.a.DOWN,p.a.SPACE,p.a.ENTER].includes(_r)&&(Nn(!0),Zn.preventDefault());return}switch(_r){case p.a.UP:In(-1),Zn.preventDefault();break;case p.a.DOWN:In(1),Zn.preventDefault();break;case p.a.ESC:Nn(!1);break;case p.a.SPACE:case p.a.ENTER:Ln!==null&&Ct(Ln,Zn);break}}Object(I.useEffect)(function(){var Zn=document.getElementById(Yn);Zn&&Zn.scrollIntoView&&Zn.scrollIntoView(!1)},[Ln]),Object(I.useEffect)(function(){On||zn(null)},[On]);var Kt=Object(ie.a)({},ht?"marginLeft":"marginRight",ut);le.length||(Kt.visibility="hidden",Kt.order=1);var rr=G()(Object(ie.a)({},"".concat(Or,"-rtl"),ht)),Rr=fe?null:I.createElement(Wi.a,{prefixCls:Or,overlay:qt,trigger:["hover"],visible:On,transitionName:Fe,onVisibleChange:Nn,overlayClassName:rr,mouseEnterDelay:.1,mouseLeaveDelay:.1},I.createElement("button",{type:"button",className:"".concat(He,"-nav-more"),style:Kt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Xn,id:"".concat(De,"-more"),"aria-expanded":On,onKeyDown:nr},Ce));return I.createElement("div",{className:G()("".concat(He,"-nav-operations"),Ge),style:Be,ref:Me},Rr,I.createElement(ii,{prefixCls:He,locale:xe,editable:Ze}))}var Ai=I.forwardRef(Zr),Pa=Object(I.createContext)(null),Lo=.1,ta=.01,Mr=20,lo=Math.pow(.995,Mr);function uo(){var Ae=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(Ae)||/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(Ae.substr(0,4)))}function ha(Ae,Me){var He=Object(I.useState)(),De=Object(Y.a)(He,2),le=De[0],xe=De[1],fe=Object(I.useState)(0),Le=Object(Y.a)(fe,2),Ce=Le[0],Fe=Le[1],Be=Object(I.useState)(0),Ge=Object(Y.a)(Be,2),Ze=Ge[0],ut=Ge[1],ht=Object(I.useState)(),Ct=Object(Y.a)(ht,2),dn=Ct[0],Kn=Ct[1],On=Object(I.useRef)();function Nn(nn){var qt=nn.touches[0],In=qt.screenX,nr=qt.screenY;xe({x:In,y:nr}),window.clearInterval(On.current)}function Bn(nn){if(!le)return;nn.preventDefault();var qt=nn.touches[0],In=qt.screenX,nr=qt.screenY;xe({x:In,y:nr});var Kt=In-le.x,rr=nr-le.y;Me(Kt,rr);var Rr=Date.now();Fe(Rr),ut(Rr-Ce),Kn({x:Kt,y:rr})}function Un(){if(!le)return;if(xe(null),Kn(null),dn){var nn=dn.x/Ze,qt=dn.y/Ze,In=Math.abs(nn),nr=Math.abs(qt);if(Math.max(In,nr)<Lo)return;var Kt=nn,rr=qt;On.current=window.setInterval(function(){if(Math.abs(Kt)<ta&&Math.abs(rr)<ta){window.clearInterval(On.current);return}Kt*=lo,rr*=lo,Me(Kt*Mr,rr*Mr)},Mr)}}var Ln=Object(I.useRef)(0),zn=Object(I.useRef)(!1),Xn=Object(I.useRef)();function Or(nn){var qt=nn.deltaX,In=nn.deltaY,nr=0,Kt=Math.abs(qt),rr=Math.abs(In);Kt===rr?nr=Xn.current==="x"?qt:In:Kt>rr?(nr=qt,Xn.current="x"):(nr=In,Xn.current="y");var Rr=Date.now();Rr-Ln.current>100&&(zn.current=!1),(Me(-nr,-nr)||zn.current)&&(nn.preventDefault(),zn.current=!0),Ln.current=Rr}var Yn=Object(I.useRef)(null);Yn.current={onTouchStart:Nn,onTouchMove:Bn,onTouchEnd:Un,onWheel:Or},I.useEffect(function(){function nn(Kt){Yn.current.onTouchStart(Kt)}function qt(Kt){Yn.current.onTouchMove(Kt)}function In(Kt){Yn.current.onTouchEnd(Kt)}function nr(Kt){Yn.current.onWheel(Kt)}return document.addEventListener("touchmove",qt,{passive:!1}),document.addEventListener("touchend",In,{passive:!1}),Ae.current.addEventListener("touchstart",nn,{passive:!1}),Ae.current.addEventListener("wheel",nr),function(){document.removeEventListener("touchmove",qt),document.removeEventListener("touchend",In)}},[])}function fa(){var Ae=Object(I.useRef)(new Map);function Me(De){return Ae.current.has(De)||Ae.current.set(De,I.createRef()),Ae.current.get(De)}function He(De){Ae.current.delete(De)}return[Me,He]}function $a(Ae,Me){var He=I.useRef(Ae),De=I.useState({}),le=Object(Y.a)(De,2),xe=le[1];function fe(Le){var Ce=typeof Le=="function"?Le(He.current):Le;Ce!==He.current&&Me(Ce,He.current),He.current=Ce,xe({})}return[He.current,fe]}var co=function(Me){var He=Me.position,De=Me.prefixCls,le=Me.extra;if(!le)return null;var xe,fe=le;return He==="right"&&(xe=fe.right||!fe.left&&fe||null),He==="left"&&(xe=fe.left||null),xe?I.createElement("div",{className:"".concat(De,"-extra-content")},xe):null};function ka(Ae,Me){var He,De=I.useContext(Pa),le=De.prefixCls,xe=De.tabs,fe=Ae.className,Le=Ae.style,Ce=Ae.id,Fe=Ae.animated,Be=Ae.activeKey,Ge=Ae.rtl,Ze=Ae.extra,ut=Ae.editable,ht=Ae.locale,Ct=Ae.tabPosition,dn=Ae.tabBarGutter,Kn=Ae.children,On=Ae.onTabClick,Nn=Ae.onTabScroll,Bn=Object(I.useRef)(),Un=Object(I.useRef)(),Ln=Object(I.useRef)(),zn=Object(I.useRef)(),Xn=fa(),Or=Object(Y.a)(Xn,2),Yn=Or[0],nn=Or[1],qt=Ct==="top"||Ct==="bottom",In=$a(0,function(dr,er){qt&&Nn&&Nn({direction:dr>er?"left":"right"})}),nr=Object(Y.a)(In,2),Kt=nr[0],rr=nr[1],Rr=$a(0,function(dr,er){!qt&&Nn&&Nn({direction:dr>er?"top":"bottom"})}),Zn=Object(Y.a)(Rr,2),_r=Zn[0],mr=Zn[1],Nr=Object(I.useState)(0),Fr=Object(Y.a)(Nr,2),Lr=Fr[0],li=Fr[1],Ti=Object(I.useState)(0),gi=Object(Y.a)(Ti,2),Wr=gi[0],wr=gi[1],gr=Object(I.useState)(0),ln=Object(Y.a)(gr,2),vr=ln[0],Oi=ln[1],Hi=Object(I.useState)(0),$i=Object(Y.a)(Hi,2),yr=$i[0],Mi=$i[1],Ki=Object(I.useState)(null),Er=Object(Y.a)(Ki,2),cr=Er[0],Pr=Er[1],Na=Object(I.useState)(null),Za=Object(Y.a)(Na,2),na=Za[0],ga=Za[1],zr=Object(I.useState)(0),Ni=Object(Y.a)(zr,2),Ua=Ni[0],Io=Ni[1],Po=Object(I.useState)(0),mo=Object(Y.a)(Po,2),Ja=mo[0],qa=mo[1],ra=o(new Map),va=Object(Y.a)(ra,2),go=va[0],ja=va[1],ya=i(xe,go,Lr),ia="".concat(le,"-nav-operations-hidden"),Cr=0,wi=0;qt?Ge?(Cr=0,wi=Math.max(0,Lr-cr)):(Cr=Math.min(0,cr-Lr),wi=0):(Cr=Math.min(0,na-Wr),wi=0);function aa(dr){return dr<Cr?[Cr,!1]:dr>wi?[wi,!1]:[dr,!0]}var Qi=Object(I.useRef)(),wa=Object(I.useState)(),oa=Object(Y.a)(wa,2),Ba=oa[0],eo=oa[1];function Fa(){eo(Date.now())}function to(){window.clearTimeout(Qi.current)}ha(Bn,function(dr,er){var ti=!1;function ui(Ji,zi){Ji(function(Aa){var qi=aa(Aa+zi),Jr=Object(Y.a)(qi,2),Oa=Jr[0],Je=Jr[1];return ti=Je,Oa})}if(qt){if(cr>=Lr)return ti;ui(rr,dr)}else{if(na>=Wr)return ti;ui(mr,er)}return to(),Fa(),ti}),Object(I.useEffect)(function(){return to(),Ba&&(Qi.current=window.setTimeout(function(){eo(0)},100)),to},[Ba]);function Gi(){var dr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Be,er=ya.get(dr);if(!er)return;if(qt){var ti=Kt;Ge?er.right<Kt?ti=er.right:er.right+er.width>Kt+cr&&(ti=er.right+er.width-cr):er.left<-Kt?ti=-er.left:er.left+er.width>-Kt+cr&&(ti=-(er.left+er.width-cr)),mr(0),rr(aa(ti)[0])}else{var ui=_r;er.top<-_r?ui=-er.top:er.top+er.height>-_r+na&&(ui=-(er.top+er.height-na)),rr(0),mr(aa(ui)[0])}}var Zi=A(ya,{width:cr,height:na,left:Kt,top:_r},{width:vr,height:yr},{width:Ua,height:Ja},Object(z.a)(Object(z.a)({},Ae),{},{tabs:xe})),no=Object(Y.a)(Zi,2),ro=no[0],ko=no[1],Mo=xe.map(function(dr){var er=dr.key;return I.createElement(u,{id:Ce,prefixCls:le,key:er,rtl:Ge,tab:dr,closable:dr.closable,editable:ut,active:er===Be,tabPosition:Ct,tabBarGutter:dn,renderWrapper:Kn,removeAriaLabel:ht==null?void 0:ht.removeAriaLabel,ref:Yn(er),onClick:function(ui){On(er,ui)},onRemove:function(){nn(er)},onFocus:function(){Gi(er),Fa(),Ge||(Bn.current.scrollLeft=0),Bn.current.scrollTop=0}})}),io=h(function(){var dr,er,ti,ui,Ji,zi,Aa,qi,Jr,Oa=((dr=Bn.current)===null||dr===void 0?void 0:dr.offsetWidth)||0,Je=((er=Bn.current)===null||er===void 0?void 0:er.offsetHeight)||0,$e=((ti=zn.current)===null||ti===void 0?void 0:ti.offsetWidth)||0,Ve=((ui=zn.current)===null||ui===void 0?void 0:ui.offsetHeight)||0,tt=((Ji=Ln.current)===null||Ji===void 0?void 0:Ji.offsetWidth)||0,rt=((zi=Ln.current)===null||zi===void 0?void 0:zi.offsetHeight)||0;Pr(Oa),ga(Je),Io($e),qa(Ve);var vt=(((Aa=Un.current)===null||Aa===void 0?void 0:Aa.offsetWidth)||0)-$e,gt=(((qi=Un.current)===null||qi===void 0?void 0:qi.offsetHeight)||0)-Ve;li(vt),wr(gt);var mt=(Jr=Ln.current)===null||Jr===void 0?void 0:Jr.className.includes(ia);Oi(vt-(mt?0:tt)),Mi(gt-(mt?0:rt)),ja(function(){var $t=new Map;return xe.forEach(function($n){var _i=$n.key,Pn=Yn(_i).current;Pn&&$t.set(_i,{width:Pn.offsetWidth,height:Pn.offsetHeight,left:Pn.offsetLeft,top:Pn.offsetTop})}),$t})}),No=xe.slice(0,ro),Vr=xe.slice(ko+1),Hr=[].concat(Object(L.a)(No),Object(L.a)(Vr)),ai=Object(I.useState)(),Kr=Object(Y.a)(ai,2),Ca=Kr[0],Wa=Kr[1],Ci=ya.get(Be),ao=Object(I.useRef)();function Ha(){f.a.cancel(ao.current)}Object(I.useEffect)(function(){var dr={};return Ci&&(qt?(Ge?dr.right=Ci.right:dr.left=Ci.left,dr.width=Ci.width):(dr.top=Ci.top,dr.height=Ci.height)),Ha(),ao.current=f()(function(){Wa(dr)}),Ha},[Ci,qt,Ge]),Object(I.useEffect)(function(){Gi()},[Be,Ci,ya,qt]),Object(I.useEffect)(function(){io()},[Ge,dn,Be,xe.map(function(dr){return dr.key}).join("_")]);var vo=!!Hr.length,sa="".concat(le,"-nav-wrap"),Ka,Sa,yo,Ga;return qt?Ge?(Sa=Kt>0,Ka=Kt+cr<Lr):(Ka=Kt<0,Sa=-Kt+cr<Lr):(yo=_r<0,Ga=-_r+na<Wr),I.createElement("div",{ref:Me,role:"tablist",className:G()("".concat(le,"-nav"),fe),style:Le,onKeyDown:function(){Fa()}},I.createElement(co,{position:"left",extra:Ze,prefixCls:le}),I.createElement(b.a,{onResize:io},I.createElement("div",{className:G()(sa,(He={},Object(ie.a)(He,"".concat(sa,"-ping-left"),Ka),Object(ie.a)(He,"".concat(sa,"-ping-right"),Sa),Object(ie.a)(He,"".concat(sa,"-ping-top"),yo),Object(ie.a)(He,"".concat(sa,"-ping-bottom"),Ga),He)),ref:Bn},I.createElement(b.a,{onResize:io},I.createElement("div",{ref:Un,className:"".concat(le,"-nav-list"),style:{transform:"translate(".concat(Kt,"px, ").concat(_r,"px)"),transition:Ba?"none":void 0}},Mo,I.createElement(ii,{ref:zn,prefixCls:le,locale:ht,editable:ut,style:{visibility:vo?"hidden":null}}),I.createElement("div",{className:G()("".concat(le,"-ink-bar"),Object(ie.a)({},"".concat(le,"-ink-bar-animated"),Fe.inkBar)),style:Ca}))))),I.createElement(Ai,Object.assign({},Ae,{ref:Ln,prefixCls:le,tabs:Hr,className:!vo&&ia})),I.createElement(co,{position:"right",extra:Ze,prefixCls:le}))}var Ta=I.forwardRef(ka);function ho(Ae){var Me=Ae.id,He=Ae.activeKey,De=Ae.animated,le=Ae.tabPosition,xe=Ae.rtl,fe=Ae.destroyInactiveTabPane,Le=I.useContext(Pa),Ce=Le.prefixCls,Fe=Le.tabs,Be=De.tabPane,Ge=Fe.findIndex(function(Ze){return Ze.key===He});return I.createElement("div",{className:G()("".concat(Ce,"-content-holder"))},I.createElement("div",{className:G()("".concat(Ce,"-content"),"".concat(Ce,"-content-").concat(le),Object(ie.a)({},"".concat(Ce,"-content-animated"),Be)),style:Ge&&Be?Object(ie.a)({},xe?"marginRight":"marginLeft","-".concat(Ge,"00%")):null},Fe.map(function(Ze){return I.cloneElement(Ze.node,{key:Ze.key,prefixCls:Ce,tabKey:Ze.key,id:Me,animated:Be,active:Ze.key===He,destroyInactiveTabPane:fe})})))}function fo(Ae){var Me=Ae.prefixCls,He=Ae.forceRender,De=Ae.className,le=Ae.style,xe=Ae.id,fe=Ae.active,Le=Ae.animated,Ce=Ae.destroyInactiveTabPane,Fe=Ae.tabKey,Be=Ae.children,Ge=I.useState(He),Ze=Object(Y.a)(Ge,2),ut=Ze[0],ht=Ze[1];I.useEffect(function(){fe?ht(!0):Ce&&ht(!1)},[fe,Ce]);var Ct={};return fe||(Le?(Ct.visibility="hidden",Ct.height=0,Ct.overflowY="hidden"):Ct.display="none"),I.createElement("div",{id:xe&&"".concat(xe,"-panel-").concat(Fe),role:"tabpanel",tabIndex:fe?0:-1,"aria-labelledby":xe&&"".concat(xe,"-tab-").concat(Fe),"aria-hidden":!fe,style:Object(z.a)(Object(z.a)({},Ct),le),className:G()("".concat(Me,"-tabpane"),fe&&"".concat(Me,"-tabpane-active"),De)},(fe||ut||He)&&Be)}var Ma=0;function po(Ae){return Object(K.a)(Ae).map(function(Me){if(I.isValidElement(Me)){var He=Me.key!==void 0?String(Me.key):void 0;return Object(z.a)(Object(z.a)({key:He},Me.props),{},{node:Me})}return null}).filter(function(Me){return Me})}function Qa(Ae,Me){var He,De=Ae.id,le=Ae.prefixCls,xe=le===void 0?"rc-tabs":le,fe=Ae.className,Le=Ae.children,Ce=Ae.direction,Fe=Ae.activeKey,Be=Ae.defaultActiveKey,Ge=Ae.editable,Ze=Ae.animated,ut=Ae.tabPosition,ht=ut===void 0?"top":ut,Ct=Ae.tabBarGutter,dn=Ae.tabBarStyle,Kn=Ae.tabBarExtraContent,On=Ae.locale,Nn=Ae.moreIcon,Bn=Ae.moreTransitionName,Un=Ae.destroyInactiveTabPane,Ln=Ae.renderTabBar,zn=Ae.onChange,Xn=Ae.onTabClick,Or=Ae.onTabScroll,Yn=Object(N.a)(Ae,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),nn=po(Le),qt=Ce==="rtl",In;Ze===!1?In={inkBar:!1,tabPane:!1}:In=Object(z.a)({inkBar:!0,tabPane:!1},Ze!==!0?Ze:null);var nr=Object(I.useState)(!1),Kt=Object(Y.a)(nr,2),rr=Kt[0],Rr=Kt[1];Object(I.useEffect)(function(){Rr(uo())},[]);var Zn=Object(n.a)(function(){var yr;return(yr=nn[0])===null||yr===void 0?void 0:yr.key},{value:Fe,defaultValue:Be}),_r=Object(Y.a)(Zn,2),mr=_r[0],Nr=_r[1],Fr=Object(I.useState)(function(){return nn.findIndex(function(yr){return yr.key===mr})}),Lr=Object(Y.a)(Fr,2),li=Lr[0],Ti=Lr[1];Object(I.useEffect)(function(){var yr=nn.findIndex(function(Ki){return Ki.key===mr});if(yr===-1){var Mi;yr=Math.max(0,Math.min(li,nn.length-1)),Nr((Mi=nn[yr])===null||Mi===void 0?void 0:Mi.key)}Ti(yr)},[nn.map(function(yr){return yr.key}).join("_"),mr,li]);var gi=Object(n.a)(null,{value:De}),Wr=Object(Y.a)(gi,2),wr=Wr[0],gr=Wr[1],ln=ht;rr&&!["left","right"].includes(ht)&&(ln="top"),Object(I.useEffect)(function(){De||(gr("rc-tabs-".concat(Ma)),Ma+=1)},[]);function vr(yr,Mi){Xn==null||Xn(yr,Mi),Nr(yr),zn==null||zn(yr)}var Oi={id:wr,activeKey:mr,animated:In,tabPosition:ln,rtl:qt,mobile:rr},Hi,$i=Object(z.a)(Object(z.a)({},Oi),{},{editable:Ge,locale:On,moreIcon:Nn,moreTransitionName:Bn,tabBarGutter:Ct,onTabClick:vr,onTabScroll:Or,extra:Kn,style:dn,panes:Le});return Ln?Hi=Ln($i,Ta):Hi=I.createElement(Ta,Object.assign({},$i)),I.createElement(Pa.Provider,{value:{tabs:nn,prefixCls:xe}},I.createElement("div",Object.assign({ref:Me,id:De,className:G()(xe,"".concat(xe,"-").concat(ln),(He={},Object(ie.a)(He,"".concat(xe,"-mobile"),rr),Object(ie.a)(He,"".concat(xe,"-editable"),Ge),Object(ie.a)(He,"".concat(xe,"-rtl"),qt),He),fe)},Yn),Hi,I.createElement(ho,Object.assign({destroyInactiveTabPane:Un},Oi,{animated:In}))))}var pa=I.forwardRef(Qa);pa.TabPane=fo;var Yi=pa,ma=Ee.b=Yi},kSUc:function(it,Ee,U){},lZu9:function(it,Ee,U){(function(ie){ie(U("VrN/"),U("1eCo"),U("8EBN"))})(function(ie){"use strict";ie.defineMode("markdown",function(Y,N){var z=ie.getMode(Y,"text/html"),I=z.name=="null";function M(m){if(ie.findModeByName){var y=ie.findModeByName(m);y&&(m=y.mime||y.mimes[0])}var H=ie.getMode(Y,m);return H.name=="null"?null:H}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var K in G)G.hasOwnProperty(K)&&N.tokenTypeOverrides[K]&&(G[K]=N.tokenTypeOverrides[K]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,x=/^\[(x| )\](?=\s)/i,f=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,b=/^ {0,3}(?:\={1,}|-{2,})\s*$/,h=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,u=" ";function s(m,y,H){return y.f=y.inline=H,H(m,y)}function i(m,y,H){return y.f=y.block=H,H(m,y)}function D(m){return!m||!/\S/.test(m.string)}function A(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==R){var y=I;if(!y){var H=ie.innerMode(z,m.htmlState);y=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}y&&(m.f=d,m.block=S,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function S(m,y){var H=m.column()===y.indentation,Q=D(y.prevLine.stream),te=y.indentedCode,ae=y.prevLine.hr,Te=y.list!==!1,_e=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var ge=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,Te)){for(y.list=null;ge<y.listStack[y.listStack.length-1];)y.listStack.pop(),y.listStack.length?y.indentation=y.listStack[y.listStack.length-1]:y.list=!1;y.list!==!1&&(y.indentationDiff=ge-y.listStack[y.listStack.length-1])}var ve=!Q&&!ae&&!y.prevLine.header&&(!Te||!te)&&!y.prevLine.fencedCodeEnd,Oe=(y.list===!1||ae||Q)&&y.indentation<=_e&&m.match(n),he=null;if(y.indentationDiff>=4&&(te||y.prevLine.fencedCodeEnd||y.prevLine.header||Q))return m.skipToEnd(),y.indentedCode=!0,G.code;if(m.eatSpace())return null;if(H&&y.indentation<=_e&&(he=m.match(f))&&he[1].length<=6)return y.quote=0,y.header=he[1].length,y.thisLine.header=!0,N.highlightFormatting&&(y.formatting="header"),y.f=y.inline,g(y);if(y.indentation<=_e&&m.eat(">"))return y.quote=H?1:y.quote+1,N.highlightFormatting&&(y.formatting="quote"),m.eatSpace(),g(y);if(!Oe&&!y.setext&&H&&y.indentation<=_e&&(he=m.match(L))){var V=he[1]?"ol":"ul";return y.indentation=ge+m.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,N.taskLists&&m.match(x,!1)&&(y.taskList=!0),y.f=y.inline,N.highlightFormatting&&(y.formatting=["list","list-"+V]),g(y)}else{if(H&&y.indentation<=_e&&(he=m.match(o,!0)))return y.quote=0,y.fencedEndRE=new RegExp(he[1]+"+ *$"),y.localMode=N.fencedCodeBlockHighlighting&&M(he[2]||N.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=ie.startState(y.localMode)),y.f=y.block=O,N.highlightFormatting&&(y.formatting="code-block"),y.code=-1,g(y);if(y.setext||(!ve||!Te)&&!y.quote&&y.list===!1&&!y.code&&!Oe&&!p.test(m.string)&&(he=m.lookAhead(1))&&(he=he.match(b)))return y.setext?(y.header=y.setext,y.setext=0,m.skipToEnd(),N.highlightFormatting&&(y.formatting="header")):(y.header=he[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,g(y);if(Oe)return m.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,G.hr;if(m.peek()==="[")return s(m,y,B)}return s(m,y,y.inline)}function R(m,y){var H=z.token(m,y.htmlState);if(!I){var Q=ie.innerMode(z,y.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||y.md_inside&&m.current().indexOf(">")>-1)&&(y.f=d,y.block=S,y.htmlState=null)}return H}function O(m,y){var H=y.listStack[y.listStack.length-1]||0,Q=y.indentation<H,te=H+3;if(y.fencedEndRE&&y.indentation<=te&&(Q||m.match(y.fencedEndRE))){N.highlightFormatting&&(y.formatting="code-block");var ae;return Q||(ae=g(y)),y.localMode=y.localState=null,y.block=S,y.f=d,y.fencedEndRE=null,y.code=0,y.thisLine.fencedCodeEnd=!0,Q?i(m,y,y.block):ae}else return y.localMode?y.localMode.token(m,y.localState):(m.skipToEnd(),G.code)}function g(m){var y=[];if(m.formatting){y.push(G.formatting),typeof m.formatting=="string"&&(m.formatting=[m.formatting]);for(var H=0;H<m.formatting.length;H++)y.push(G.formatting+"-"+m.formatting[H]),m.formatting[H]==="header"&&y.push(G.formatting+"-"+m.formatting[H]+"-"+m.header),m.formatting[H]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=m.quote?y.push(G.formatting+"-"+m.formatting[H]+"-"+m.quote):y.push("error"))}if(m.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(m.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(m.linkHref?y.push(G.linkHref,"url"):(m.strong&&y.push(G.strong),m.em&&y.push(G.em),m.strikethrough&&y.push(G.strikethrough),m.emoji&&y.push(G.emoji),m.linkText&&y.push(G.linkText),m.code&&y.push(G.code),m.image&&y.push(G.image),m.imageAltText&&y.push(G.imageAltText,"link"),m.imageMarker&&y.push(G.imageMarker)),m.header&&y.push(G.header,G.header+"-"+m.header),m.quote&&(y.push(G.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=m.quote?y.push(G.quote+"-"+m.quote):y.push(G.quote+"-"+N.maxBlockquoteDepth)),m.list!==!1){var Q=(m.listStack.length-1)%3;Q?Q===1?y.push(G.list2):y.push(G.list3):y.push(G.list1)}return m.trailingSpaceNewLine?y.push("trailing-space-new-line"):m.trailingSpace&&y.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function _(m,y){return m.match(h,!0)?g(y):void 0}function d(m,y){var H=y.text(m,y);if(typeof H!="undefined")return H;if(y.list)return y.list=null,g(y);if(y.taskList){var Q=m.match(x,!0)[1]===" ";return Q?y.taskOpen=!0:y.taskClosed=!0,N.highlightFormatting&&(y.formatting="task"),y.taskList=!1,g(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&m.match(/^#+$/,!0))return N.highlightFormatting&&(y.formatting="header"),g(y);var te=m.next();if(y.linkTitle){y.linkTitle=!1;var ae=te;te==="("&&(ae=")"),ae=(ae+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Te="^\\s*(?:[^"+ae+"\\\\]+|\\\\\\\\|\\\\.)"+ae;if(m.match(new RegExp(Te),!0))return G.linkHref}if(te==="`"){var _e=y.formatting;N.highlightFormatting&&(y.formatting="code"),m.eatWhile("`");var ge=m.current().length;if(y.code==0&&(!y.quote||ge==1))return y.code=ge,g(y);if(ge==y.code){var ve=g(y);return y.code=0,ve}else return y.formatting=_e,g(y)}else if(y.code)return g(y);if(te==="\\"&&(m.next(),N.highlightFormatting)){var Oe=g(y),he=G.formatting+"-escape";return Oe?Oe+" "+he:he}if(te==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,N.highlightFormatting&&(y.formatting="image"),g(y);if(te==="["&&y.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,N.highlightFormatting&&(y.formatting="image"),g(y);if(te==="]"&&y.imageAltText){N.highlightFormatting&&(y.formatting="image");var Oe=g(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=C,Oe}if(te==="["&&!y.image)return y.linkText&&m.match(/^.*?\]/)||(y.linkText=!0,N.highlightFormatting&&(y.formatting="link")),g(y);if(te==="]"&&y.linkText){N.highlightFormatting&&(y.formatting="link");var Oe=g(y);return y.linkText=!1,y.inline=y.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?C:d,Oe}if(te==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=c,N.highlightFormatting&&(y.formatting="link");var Oe=g(y);return Oe?Oe+=" ":Oe="",Oe+G.linkInline}if(te==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=c,N.highlightFormatting&&(y.formatting="link");var Oe=g(y);return Oe?Oe+=" ":Oe="",Oe+G.linkEmail}if(N.xml&&te==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var V=m.string.indexOf(">",m.pos);if(V!=-1){var P=m.string.substring(m.start,V);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(P)&&(y.md_inside=!0)}return m.backUp(1),y.htmlState=ie.startState(z),i(m,y,R)}if(N.xml&&te==="<"&&m.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(te==="*"||te==="_"){for(var j=1,$=m.pos==1?" ":m.string.charAt(m.pos-2);j<3&&m.eat(te);)j++;var J=m.peek()||" ",X=!/\s/.test(J)&&(!l.test(J)||/\s/.test($)||l.test($)),ye=!/\s/.test($)&&(!l.test($)||/\s/.test(J)||l.test(J)),Re=null,Ke=null;if(j%2&&(!y.em&&X&&(te==="*"||!ye||l.test($))?Re=!0:y.em==te&&ye&&(te==="*"||!X||l.test(J))&&(Re=!1)),j>1&&(!y.strong&&X&&(te==="*"||!ye||l.test($))?Ke=!0:y.strong==te&&ye&&(te==="*"||!X||l.test(J))&&(Ke=!1)),Ke!=null||Re!=null){N.highlightFormatting&&(y.formatting=Re==null?"strong":Ke==null?"em":"strong em"),Re===!0&&(y.em=te),Ke===!0&&(y.strong=te);var ve=g(y);return Re===!1&&(y.em=!1),Ke===!1&&(y.strong=!1),ve}}else if(te===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return g(y);m.backUp(1)}if(N.strikethrough){if(te==="~"&&m.eatWhile(te)){if(y.strikethrough){N.highlightFormatting&&(y.formatting="strikethrough");var ve=g(y);return y.strikethrough=!1,ve}else if(m.match(/^[^\s]/,!1))return y.strikethrough=!0,N.highlightFormatting&&(y.formatting="strikethrough"),g(y)}else if(te===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return g(y);m.backUp(2)}}if(N.emoji&&te===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,N.highlightFormatting&&(y.formatting="emoji");var pe=g(y);return y.emoji=!1,pe}return te===" "&&(m.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),g(y)}function c(m,y){var H=m.next();if(H===">"){y.f=y.inline=d,N.highlightFormatting&&(y.formatting="link");var Q=g(y);return Q?Q+=" ":Q="",Q+G.linkInline}return m.match(/^[^>]+/,!0),G.linkInline}function C(m,y){if(m.eatSpace())return null;var H=m.next();return H==="("||H==="["?(y.f=y.inline=w(H==="("?")":"]"),N.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,g(y)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(m){return function(y,H){var Q=y.next();if(Q===m){H.f=H.inline=d,N.highlightFormatting&&(H.formatting="link-string");var te=g(H);return H.linkHref=!1,te}return y.match(E[m]),H.linkHref=!0,g(H)}}function B(m,y){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=W,m.next(),N.highlightFormatting&&(y.formatting="link"),y.linkText=!0,g(y)):s(m,y,d)}function W(m,y){if(m.match(/^\]:/,!0)){y.f=y.inline=T,N.highlightFormatting&&(y.formatting="link");var H=g(y);return y.linkText=!1,H}return m.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function T(m,y){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?y.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),y.f=y.inline=d,G.linkHref+" url")}var k={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:d,text:_,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&ie.copyState(z,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?ie.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,y){if(y.formatting=!1,m!=y.thisLine.stream){if(y.header=0,y.hr=!1,m.match(/^\s*$/,!0))return A(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:m},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=R)){var H=m.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(y.indentation=H,y.indentationDiff=null,H>0)return null}}return y.f(m,y)},innerMode:function(m){return m.block==R?{state:m.htmlState,mode:z}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:k}},indent:function(m,y,H){return m.block==R&&z.indent?z.indent(m.htmlState,y,H):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,y,H):ie.Pass},blankLine:A,getType:g,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return k},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},mgmH:function(it,Ee,U){"use strict";U.d(Ee,"d",function(){return b}),U.d(Ee,"b",function(){return h}),U.d(Ee,"e",function(){return o}),U.d(Ee,"c",function(){return p}),U.d(Ee,"n",function(){return l}),U.d(Ee,"g",function(){return u}),U.d(Ee,"h",function(){return s}),U.d(Ee,"j",function(){return D}),U.d(Ee,"a",function(){return A}),U.d(Ee,"l",function(){return S}),U.d(Ee,"f",function(){return R}),U.d(Ee,"k",function(){return O}),U.d(Ee,"m",function(){return g}),U.d(Ee,"i",function(){return _}),U.d(Ee,"o",function(){return d}),U.d(Ee,"t",function(){return c}),U.d(Ee,"s",function(){return C}),U.d(Ee,"p",function(){return E}),U.d(Ee,"q",function(){return w}),U.d(Ee,"r",function(){return B}),U.d(Ee,"v",function(){return W}),U.d(Ee,"u",function(){return T});var ie=U("miYZ"),Y=U("tsqr"),N=U("k1fw"),z=U("9og8"),I=U("WmNS"),M=U.n(I),G=U("oUNq"),K=U("9kvl"),n=U("1vsH"),L=U("m3rI"),x=function(){Object(K.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},f=function(){Object(K.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},b=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return x(),te.next=3,Object(G.t)(Object(N.a)({},y));case 3:if(H=te.sent,!(H.status===0)){te.next=7;break}return te.next=7,Object(n.w)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/export_couser_info.json"),query:y}));case 7:f();case 8:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),h=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.r)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_member_act_score")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),o=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.u)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_score")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_score")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),p=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.s)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),l=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.z)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),u=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.v)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_homework")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),s=function(){var k=Object(z.a)(M.a.mark(function m(y,H){var Q;return M.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,Object(G.x)(Object(N.a)({},y));case 2:Q=ae.sent,Q.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/").concat(H))):Q.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/").concat(H)));case 4:case"end":return ae.stop()}},m)}));return function(y,H){return k.apply(this,arguments)}}(),i=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return x(),te.next=3,Object(G.w)(Object(N.a)({},y));case 3:if(H=te.sent,!(H.status===0)){te.next=7;break}return te.next=7,Object(n.w)("",Object(n.Y)({url:L.a.API_SERVER+"/api/homework_commons/".concat(y.categoryId,"/works_list.zip"),query:y}));case 7:f();case 8:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),D=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return x(),te.next=3,Object(G.A)(Object(N.a)({},y));case 3:if(H=te.sent,!(H.status===0)){te.next=7;break}return te.next=7,Object(n.w)("",Object(n.Y)({url:L.a.API_SERVER+"/api/polls/".concat(y.categoryId,"/commit_result.xlsx"),query:y}));case 7:f();case 8:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),A=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/attendances/export_xlsx_data.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),S=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/video_study_statics.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),R=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/export_course_students_info.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),O=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/item_banks/export.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),g=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),_=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.y)(Object(N.a)({},y));case 2:H=te.sent,H.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/exercise_score"))):H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/exercise_score")));case 4:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),d=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Q.next=3,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/export_records/".concat(y.id,".xlsx"),query:y}));case 3:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),c=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),C=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_training_objectives.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),E=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)(y==null?void 0:y.name,Object(n.Y)({url:L.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),w=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_courses.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),B=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_graduation_requirements.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),W=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/rank_list.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),T=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}()},nEHx:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return ie});var ie;(function(Y){Y.DARK="dark",Y.LIGHT="light",Y.HIGH_CONTRAST="hc"})(ie||(ie={}))},nSDg:function(it,Ee,U){it.exports={flex_box_center:"flex_box_center___2lqeg",flex_space_between:"flex_space_between___RuZ2s",flex_box_vertical_center:"flex_box_vertical_center___2AGHP",flex_box_center_end:"flex_box_center_end___FDazu",flex_box_column:"flex_box_column___1Yqjx",wrp:"wrp____lZAZ",drawer:"drawer___2XpEN",menu:"menu___fZQrG",actived:"actived___1Yg9q",actived2:"actived2___2KHN5",subTag:"subTag___3AbgU",directionName:"directionName___2Xp-L",menuDirection:"menuDirection___1ZMmo",listItem:"listItem___g9W0X",info:"info___1FHWU",title:"title___1VzwI",titleLeft:"titleLeft___yvqaz",titleRight:"titleRight___2Dqm5",search:"search___3pcQt",description:"description___3yQGh",menuCourse:"menuCourse___3iBFc",paginationWrap:"paginationWrap___KxpDN"}},nnTU:function(it,Ee,U){"use strict";U.d(Ee,"b",function(){return G}),U.d(Ee,"a",function(){return K});var ie=U("MI8n"),Y=U("JYp7"),N=U("pmY6"),z=U("24hK"),I=U("746U"),M=U("Cg/j");const G=Object(M.c)("commandService"),K=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,L){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!L)throw new Error("invalid command");return this.registerCommand({id:n,handler:L})}if(n.description){const o=[];for(let l of n.description.args)o.push(l.constraint);const p=n.handler;n.handler=function(l,...u){return Object(I.o)(u,o),p(l,...u)}}const{id:x}=n;let f=this._commands.get(x);f||(f=new z.a,this._commands.set(x,f));let b=f.unshift(n),h=Object(N.i)(()=>{b();const o=this._commands.get(x);(o==null?void 0:o.isEmpty())&&this._commands.delete(x)});return this._onDidRegisterCommand.fire(x),h}registerCommandAlias(n,L){return K.registerCommand(n,(x,...f)=>x.get(G).executeCommand(L,...f))}getCommand(n){const L=this._commands.get(n);return!L||L.isEmpty()?void 0:Y.a.first(L)}getCommands(){const n=new Map;for(const L of this._commands.keys()){const x=this.getCommand(L);x&&n.set(L,x)}return n}};K.registerCommand("noop",()=>{})},osHv:function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){"use strict";var Y=ie.Pos;function N(l,u){return l.line-u.line||l.ch-u.ch}var z="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",I=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+z+"]["+I+"]*)","g");function G(l,u,s,i){this.line=u,this.ch=s,this.cm=l,this.text=l.getLine(u),this.min=i?Math.max(i.from,l.firstLine()):l.firstLine(),this.max=i?Math.min(i.to-1,l.lastLine()):l.lastLine()}function K(l,u){var s=l.cm.getTokenTypeAt(Y(l.line,u));return s&&/\btag\b/.test(s)}function n(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function L(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function x(l){for(;;){var u=l.text.indexOf(">",l.ch);if(u==-1){if(n(l))continue;return}if(!K(l,u+1)){l.ch=u+1;continue}var s=l.text.lastIndexOf("/",u),i=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,i?"selfClose":"regular"}}function f(l){for(;;){var u=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(u==-1){if(L(l))continue;return}if(!K(l,u+1)){l.ch=u;continue}M.lastIndex=u,l.ch=u;var s=M.exec(l.text);if(s&&s.index==u)return s}}function b(l){for(;;){M.lastIndex=l.ch;var u=M.exec(l.text);if(!u){if(n(l))continue;return}if(!K(l,u.index+1)){l.ch=u.index+1;continue}return l.ch=u.index+u[0].length,u}}function h(l){for(;;){var u=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(u==-1){if(L(l))continue;return}if(!K(l,u+1)){l.ch=u;continue}var s=l.text.lastIndexOf("/",u),i=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,i?"selfClose":"regular"}}function o(l,u){for(var s=[];;){var i=b(l),D,A=l.line,S=l.ch-(i?i[0].length:0);if(!i||!(D=x(l)))return;if(D=="selfClose")continue;if(i[1]){for(var R=s.length-1;R>=0;--R)if(s[R]==i[2]){s.length=R;break}if(R<0&&(!u||u==i[2]))return{tag:i[2],from:Y(A,S),to:Y(l.line,l.ch)}}else s.push(i[2])}}function p(l,u){for(var s=[];;){var i=h(l);if(!i)return;if(i=="selfClose"){f(l);continue}var D=l.line,A=l.ch,S=f(l);if(!S)return;if(S[1])s.push(S[2]);else{for(var R=s.length-1;R>=0;--R)if(s[R]==S[2]){s.length=R;break}if(R<0&&(!u||u==S[2]))return{tag:S[2],from:Y(l.line,l.ch),to:Y(D,A)}}}}ie.registerHelper("fold","xml",function(l,u){for(var s=new G(l,u.line,0);;){var i=b(s);if(!i||s.line!=u.line)return;var D=x(s);if(!D)return;if(!i[1]&&D!="selfClose"){var A=Y(s.line,s.ch),S=o(s,i[2]);return S&&N(S.from,A)>0?{from:A,to:S.from}:null}}}),ie.findMatchingTag=function(l,u,s){var i=new G(l,u.line,u.ch,s);if(i.text.indexOf(">")==-1&&i.text.indexOf("<")==-1)return;var D=x(i),A=D&&Y(i.line,i.ch),S=D&&f(i);if(!D||!S||N(i,u)>0)return;var R={from:Y(i.line,i.ch),to:A,tag:S[2]};return D=="selfClose"?{open:R,close:null,at:"open"}:S[1]?{open:p(i,S[2]),close:R,at:"close"}:(i=new G(l,A.line,A.ch,s),{open:R,close:o(i,S[2]),at:"open"})},ie.findEnclosingTag=function(l,u,s,i){for(var D=new G(l,u.line,u.ch,s);;){var A=p(D,i);if(!A)break;var S=new G(l,u.line,u.ch,s),R=o(S,A.tag);if(R)return{open:A,close:R}}},ie.scanForClosingTag=function(l,u,s,i){var D=new G(l,u.line,u.ch,i?{from:0,to:i}:null);return o(D,s)}})},p5ED:function(it,Ee,U){"use strict";var ie=U("+L6B"),Y=U("2/Rp"),N=U("5Dmo"),z=U("3S7+"),I=U("k1fw"),M=U("9og8"),G=U("tJVT"),K=U("WmNS"),n=U.n(K),L=U("q1tI"),x=U.n(L),f=U("vHTk"),b=U.n(f),h=U("yEEn"),o=U("ZW9T"),p=U("1vsH"),l=U("V0Rq"),u=U("m3rI");Ee.a=function(s){var i,D,A,S,R,O,g,_=s.editOffice,d=_===void 0?"view":_,c=s.data,C=s.theme,E=s.type,w=s.filename,B=s.monacoEditor,W=s.className,T=s.style,k=s.close,m=s.onClose,y=s.hasMask,H=s.disabledDownload,Q=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),te=Object(G.a)(Q,2),ae=te[0],Te=te[1],_e=Object(L.useState)(""),ge=Object(G.a)(_e,2),ve=ge[0],Oe=ge[1],he=Object(L.useState)(),V=Object(G.a)(he,2),P=V[0],j=V[1],$=window.ENV==="build"?"/react/build":"",J=u.a.PROXY_SERVER||location.origin,X,ye=1024*1024,Re=10*ye,Ke=Object(L.useRef)();(i=c)!==null&&i!==void 0&&i.startsWith("/api")&&E!=="txt"&&(c=(u.a.API_SERVER||location.origin)+c),E==="office"&&(X=Object(p.T)(c).filesize,X>Re&&(E="other")),w&&B&&(B.filename=w),Object(L.useEffect)(function(){var Ue,Qe,nt=(Ue=document.cookie)===null||Ue===void 0||((Qe=Ue.replace(/\s/g,""))===null||Qe===void 0)?void 0:Qe.split(";");nt==null||nt.map(function(ot){var qe=ot.split("=");qe[0]==="_educoder_session"&&Oe(qe[1])})},[]),Object(L.useEffect)(function(){E==="office"&&pe()},[E,c]);var pe=function(){var Ue=Object(M.a)(n.a.mark(function Qe(){var nt,ot,qe;return n.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return console.log("data:",c),nt=c,c.startsWith("http")||(nt=location.origin+nt),ot=new URL(nt).pathname.split("/").pop(),lt.next=6,Object(l.V)({attachment_id:ot});case 6:qe=lt.sent,j(qe);case 8:case"end":return lt.stop()}},Qe)}));return function(){return Ue.apply(this,arguments)}}(),we=function(){if(c.startsWith("http")||c.startsWith("blob:")){ke();return}Object(p.z)(w||"educoder",c,w)},ke=function(){Object(p.x)(w||"educoder",decodeURIComponent(c))};return x.a.createElement("div",{style:Object(I.a)({},T||{}),className:"".concat(y&&b.a.bgBlack," ").concat(E?b.a.wrp:"hide")},k&&x.a.createElement("div",{className:b.a.close,ref:Ke},!H&&x.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ke.current}},x.a.createElement("span",{onClick:ke},x.a.createElement("i",{className:"icon-quxiaozhiding"}))),x.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ke.current}},x.a.createElement("span",{className:"",onClick:m},x.a.createElement("i",{className:"icon-guanbi1"})))),x.a.createElement("div",{className:"".concat(b.a[W]," ").concat(W," ").concat(b.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&x.a.createElement(o.b,B)),E==="audio"&&x.a.createElement("audio",{src:"".concat(((D=c)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((A=c)===null||A===void 0?void 0:A.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),E==="video"&&x.a.createElement(x.a.Fragment,null,((S=c)===null||S===void 0?void 0:S.indexOf("http"))>-1?x.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):x.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),E==="office"&&P&&x.a.createElement("iframe",{src:"".concat($,"/office.html?key=").concat(P.key,"&url=").concat(J+P.url,"&callbackUrl=").concat(J+P.callbackUrl,"&fileType=").concat(P.fileType,"&title=").concat(P.title,"&model=").concat(d,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),E==="html"&&x.a.createElement("iframe",{src:c+"&disposition=inline"}),E==="pdf"&&x.a.createElement("iframe",{src:"".concat($,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!H)}),E==="image"&&x.a.createElement("img",{src:"".concat(((R=c)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((O=c)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(g=c)!==null&&g!==void 0&&g.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),E==="other"&&x.a.createElement("div",null,x.a.createElement(Y.a,{type:"primary",size:"large",onClick:we},x.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&x.a.createElement(Y.a,{type:"primary",size:"large",onClick:we},x.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(it,Ee,U){},pmY6:function(it,Ee,U){"use strict";U.d(Ee,"h",function(){return L}),U.d(Ee,"g",function(){return f}),U.d(Ee,"f",function(){return b}),U.d(Ee,"e",function(){return h}),U.d(Ee,"i",function(){return o}),U.d(Ee,"b",function(){return p}),U.d(Ee,"a",function(){return l}),U.d(Ee,"d",function(){return u}),U.d(Ee,"c",function(){return s});var ie=U("C/vA"),Y=U("JYp7");const N=!1;let z=null;function I(i){z=i}if(N){const i="__is_disposable_tracked__";I(new class{trackDisposable(D){const A=new Error("Potentially leaked disposable").stack;setTimeout(()=>{D[i]||console.log(A)},3e3)}setParent(D,A){if(D&&D!==l.None)try{D[i]=!0}catch(S){}}markAsDisposed(D){if(D&&D!==l.None)try{D[i]=!0}catch(A){}}markAsSingleton(D){}})}function M(i){return z==null||z.trackDisposable(i),i}function G(i){z==null||z.markAsDisposed(i)}function K(i,D){z==null||z.setParent(i,D)}function n(i,D){if(!z)return;for(const A of i)z.setParent(A,D)}function L(i){return z==null||z.markAsSingleton(i),i}class x extends Error{constructor(i){super(`Encountered errors while disposing of store. Errors: [${i.join(", ")}]`);this.errors=i}}function f(i){return typeof i.dispose=="function"&&i.dispose.length===0}function b(i){if(Y.a.is(i)){let D=[];for(const A of i)if(A)try{A.dispose()}catch(S){D.push(S)}if(D.length===1)throw D[0];if(D.length>1)throw new x(D);return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function h(...i){const D=o(()=>b(i));return n(i,D),D}function o(i){const D=M({dispose:Object(ie.a)(()=>{G(D),i()})});return D}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{b(this._toDispose.values())}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return K(i,this),this._isDisposed?p.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}}p.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new p,M(this),K(this._store,this)}dispose(){G(this),this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}}l.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,M(this)}get value(){return this._isDisposed?void 0:this._value}set value(i){var D;if(this._isDisposed||i===this._value)return;(D=this._value)===null||D===void 0||D.dispose(),i&&K(i,this),this._value=i}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,G(this),(i=this._value)===null||i===void 0||i.dispose(),this._value=void 0}clearAndLeak(){const i=this._value;return this._value=void 0,i&&K(i,null),i}}class s{constructor(i){this.object=i}dispose(){}}},psGv:function(it,Ee,U){var ie,Y;(function(){var N;(function(){"use strict";var G=[,,function(x){function f(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}f.prototype.clone_empty=function(){var o=new f(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},f.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},f.prototype.has_match=function(o){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(o))return!0;return!1},f.prototype.set_indent=function(o,p){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=p||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},f.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(o){this.__items.push(o);var p=o.lastIndexOf(`
`);p!==-1?this.__character_count=o.length-p:this.__character_count+=o.length},f.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function b(o,p){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),p=p||"",o.indent_level>0&&(p=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}b.prototype.get_indent_size=function(o,p){var l=this.__base_string_length;return p=p||0,o<0&&(l=0),l+=o*this.__indent_size,l+=p,l},b.prototype.get_indent_string=function(o,p){var l=this.__base_string;return p=p||0,o<0&&(o=0,l=""),p+=o*this.__indent_size,this.__ensure_cache(p),l+=this.__cache[p],l},b.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var o=this.__cache.length,p=0,l="";this.__indent_size&&o>=this.__indent_size&&(p=Math.floor(o/this.__indent_size),o-=p*this.__indent_size,l=new Array(p+1).join(this.__indent_string)),o&&(l+=new Array(o+1).join(" ")),this.__cache.push(l)};function h(o,p){this.__indent_cache=new b(o,p),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(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(o,p){return this.__indent_cache.get_indent_string(o,p)},h.prototype.get_indent_size=function(o,p){return this.__indent_cache.get_indent_size(o,p)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(o){this.trim(!0);var p=this.current_line.pop();p&&(p[p.length-1]===`
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return o!==`
`&&(l=l.replace(/[\n]/g,o)),l},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(o,p){return o=o||0,p=p||0,this.next_line.set_indent(o,p),this.__lines.length>1?(this.current_line.set_indent(o,p),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(o){for(var p=0;p<o.newlines;p++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},h.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(o){for(var p=this.__lines.length;o<p;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},h.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(o,p){for(var l=this.__lines.length-2;l>=0;){var u=this.__lines[l];if(u.is_empty())break;if(u.item(0).indexOf(o)!==0&&u.item(-1)!==p){this.__lines.splice(l+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},x.exports.Output=h},function(x){function f(b,h,o,p){this.type=b,this.text=h,this.comments_before=null,this.newlines=o||0,this.whitespace_before=p||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}x.exports.Token=f},,,function(x){function f(o,p){this.raw_options=b(o,p),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}f.prototype._get_array=function(o,p){var l=this.raw_options[o],u=p||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(u=l.concat()):typeof l=="string"&&(u=l.split(/[^a-zA-Z0-9_\/\-]+/)),u},f.prototype._get_boolean=function(o,p){var l=this.raw_options[o],u=l===void 0?!!p:!!l;return u},f.prototype._get_characters=function(o,p){var l=this.raw_options[o],u=p||"";return typeof l=="string"&&(u=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},f.prototype._get_number=function(o,p){var l=this.raw_options[o];p=parseInt(p,10),isNaN(p)&&(p=0);var u=parseInt(l,10);return isNaN(u)&&(u=p),u},f.prototype._get_selection=function(o,p,l){var u=this._get_selection_list(o,p,l);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+p+`
You passed in: '`+this.raw_options[o]+"'");return u[0]},f.prototype._get_selection_list=function(o,p,l){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[p[0]],!this._is_valid_selection(l,p))throw new Error("Invalid Default Value!");var u=this._get_array(o,l);if(!this._is_valid_selection(u,p))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+p+`
You passed in: '`+this.raw_options[o]+"'");return u},f.prototype._is_valid_selection=function(o,p){return o.length&&p.length&&!o.some(function(l){return p.indexOf(l)===-1})};function b(o,p){var l={};o=h(o);var u;for(u in o)u!==p&&(l[u]=o[u]);if(p&&o[p])for(u in o[p])l[u]=o[p][u];return l}function h(o){var p={},l;for(l in o){var u=l.replace(/-/g,"_");p[u]=o[l]}return p}x.exports.Options=f,x.exports.normalizeOpts=h,x.exports.mergeOpts=b},,function(x){var f=RegExp.prototype.hasOwnProperty("sticky");function b(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__input.charAt(this.__position),this.__position+=1),h},b.prototype.peek=function(h){var o=null;return h=h||0,h+=this.__position,h>=0&&h<this.__input_length&&(o=this.__input.charAt(h)),o},b.prototype.__match=function(h,o){h.lastIndex=o;var p=h.exec(this.__input);return p&&!(f&&h.sticky)&&(p.index!==o&&(p=null)),p},b.prototype.test=function(h,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(h,o):!1},b.prototype.testChar=function(h,o){var p=this.peek(o);return h.lastIndex=0,p!==null&&h.test(p)},b.prototype.match=function(h){var o=this.__match(h,this.__position);return o?this.__position+=o[0].length:o=null,o},b.prototype.read=function(h,o,p){var l="",u;return h&&(u=this.match(h),u&&(l+=u[0])),o&&(u||!h)&&(l+=this.readUntil(o,p)),l},b.prototype.readUntil=function(h,o){var p="",l=this.__position;h.lastIndex=this.__position;var u=h.exec(this.__input);return u?(l=u.index,o&&(l+=u[0].length)):l=this.__input_length,p=this.__input.substring(this.__position,l),this.__position=l,p},b.prototype.readUntilAfter=function(h){return this.readUntil(h,!0)},b.prototype.get_regexp=function(h,o){var p=null,l="g";return o&&f&&(l="y"),typeof h=="string"&&h!==""?p=new RegExp(h,l):h&&(p=new RegExp(h.source,l)),p},b.prototype.get_literal_regexp=function(h){return RegExp(h.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(h){var o=this.__position,p=this.readUntilAfter(h);return this.__position=o,p},b.prototype.lookBack=function(h){var o=this.__position-1;return o>=h.length&&this.__input.substring(o-h.length,o).toLowerCase()===h},x.exports.InputScanner=b},function(x,f,b){var h=b(8).InputScanner,o=b(3).Token,p=b(10).TokenStream,l=b(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(i,D){this._input=new h(i),this._options=D||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new p,this._reset();for(var i,D=new o(u.START,""),A=null,S=[],R=new p;D.type!==u.EOF;){for(i=this._get_next_token(D,A);this._is_comment(i);)R.add(i),i=this._get_next_token(D,A);R.isEmpty()||(i.comments_before=R,R=new p),i.parent=A,this._is_opening(i)?(S.push(A),A=i):A&&this._is_closing(i,A)&&(i.opened=A,A.closed=i,A=S.pop(),i.parent=A),i.previous=D,D.next=i,this.__tokens.add(i),D=i}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(i,D){this._readWhitespace();var A=this._input.read(/.+/g);return A?this._create_token(u.RAW,A):this._create_token(u.EOF,"")},s.prototype._is_comment=function(i){return!1},s.prototype._is_opening=function(i){return!1},s.prototype._is_closing=function(i,D){return!1},s.prototype._create_token=function(i,D){var A=new o(i,D,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return A},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},x.exports.Tokenizer=s,x.exports.TOKEN=u},function(x){function f(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},f.prototype.peek=function(b){var h=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(h=this.__tokens[b]),h},f.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},x.exports.TokenStream=f},function(x,f,b){var h=b(12).Pattern;function o(p,l){h.call(this,p,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new h,o.prototype.__set_whitespace_patterns=function(p,l){p+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+p+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var p=this._input.read(this._match_pattern);if(p===" ")this.whitespace_before_token=" ";else if(p){var l=this.__split(this._newline_regexp,p);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return p},o.prototype.matching=function(p,l){var u=this._create();return u.__set_whitespace_patterns(p,l),u._update(),u},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(p,l){p.lastIndex=0;for(var u=0,s=[],i=p.exec(l);i;)s.push(l.substring(u,i.index)),u=i.index+i[0].length,i=p.exec(l);return u<l.length?s.push(l.substring(u,l.length)):s.push(""),s},x.exports.WhitespacePattern=o},function(x){function f(b,h){this._input=b,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)}f.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(b){var h=this._create();return h._until_after=!0,h._until_pattern=this._input.get_regexp(b),h._update(),h},f.prototype.until=function(b){var h=this._create();return h._until_after=!1,h._until_pattern=this._input.get_regexp(b),h._update(),h},f.prototype.starting_with=function(b){var h=this._create();return h._starting_pattern=this._input.get_regexp(b,!0),h._update(),h},f.prototype.matching=function(b){var h=this._create();return h._match_pattern=this._input.get_regexp(b,!0),h._update(),h},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},x.exports.Pattern=f},function(x){function f(b,h){b=typeof b=="string"?b:b.source,h=typeof h=="string"?h:h.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+h,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+h,"g")}f.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var h={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(b);o;)h[o[1]]=o[2],o=this.__directive_pattern.exec(b);return h},f.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},x.exports.Directives=f},function(x,f,b){var h=b(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function p(l,u){h.call(this,l,u),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var s=new h(l);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}/)}}p.prototype=new h,p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){this.__set_templated_pattern()},p.prototype.disable=function(l){var u=this._create();return u._disabled[l]=!0,u._update(),u},p.prototype.read_options=function(l){var u=this._create();for(var s in o)u._disabled[s]=l.templating.indexOf(s)===-1;return u._update(),u},p.prototype.exclude=function(l){var u=this._create();return u._excluded[l]=!0,u._update(),u},p.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),l+=u,u=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},p.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},p.prototype._read_template=function(){var l="",u=this._input.peek();if(u==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(l=l||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},x.exports.TemplatablePattern=p},,,,function(x,f,b){var h=b(19).Beautifier,o=b(20).Options;function p(l,u,s,i){var D=new h(l,u,s,i);return D.beautify()}x.exports=p,x.exports.defaultOptions=function(){return new o}},function(x,f,b){var h=b(20).Options,o=b(2).Output,p=b(21).Tokenizer,l=b(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=function(C,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new o(C,E)};i.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},i.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},i.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},i.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},i.prototype.print_preserved_newlines=function(C){var E=0;C.type!==l.TEXT&&C.previous.type!==l.TEXT&&(E=C.newlines?1:0),this.preserve_newlines&&(E=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var w=0;w<E;w++)this.print_newline(w>0);return E!==0},i.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},i.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},i.prototype.print_newline=function(C){this._output.add_new_line(C)},i.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},i.prototype.indent=function(){this.indent_level++},i.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var D=function(C){for(var E=null,w=C.next;w.type!==l.EOF&&C.closed!==w;){if(w.type===l.ATTRIBUTE&&w.text==="type"){w.next&&w.next.type===l.EQUALS&&w.next.next&&w.next.next.type===l.VALUE&&(E=w.next.next.text);break}w=w.next}return E},A=function(C,E){var w=null,B=null;return E.closed?(C==="script"?w="text/javascript":C==="style"&&(w="text/css"),w=D(E)||w,w.search("text/css")>-1?B="css":w.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?B="javascript":w.search(/(text|application|dojo)\/(x-)?(html)/)>-1?B="html":w.search(/test\/null/)>-1&&(B="null"),B):null};function S(C,E){return E.indexOf(C)!==-1}function R(C,E,w){this.parent=C||null,this.tag=E?E.tag_name:"",this.indent_level=w||0,this.parser_token=E||null}function O(C){this._printer=C,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(C){var E=new R(this._current_frame,C,this._printer.indent_level);this._current_frame=E},O.prototype._try_pop_frame=function(C){var E=null;return C&&(E=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),E},O.prototype._get_frame=function(C,E){for(var w=this._current_frame;w&&!(C.indexOf(w.tag)!==-1);){if(E&&E.indexOf(w.tag)!==-1){w=null;break}w=w.parent}return w},O.prototype.try_pop=function(C,E){var w=this._get_frame([C],E);return this._try_pop_frame(w)},O.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function g(C,E,w,B){this._source_text=C||"",E=E||{},this._js_beautify=w,this._css_beautify=B,this._tag_stack=null;var W=new h(E,"html");this._options=W,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"}g.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
`,C&&u.test(C)&&(E=C.match(u)[0])),C=C.replace(s,`
`);var w=C.match(/^[\t ]*/)[0],B={text:"",type:""},W=new _,T=new i(this._options,w),k=new p(C,this._options).tokenize();this._tag_stack=new O(T);for(var m=null,y=k.next();y.type!==l.EOF;)y.type===l.TAG_OPEN||y.type===l.COMMENT?(m=this._handle_tag_open(T,y,W,B),W=m):y.type===l.ATTRIBUTE||y.type===l.EQUALS||y.type===l.VALUE||y.type===l.TEXT&&!W.tag_complete?m=this._handle_inside_tag(T,y,W,k):y.type===l.TAG_CLOSE?m=this._handle_tag_close(T,y,W):y.type===l.TEXT?m=this._handle_text(T,y,W):T.add_raw_token(y),B=m,y=k.next();var H=T._output.get_code(E);return H},g.prototype._handle_tag_close=function(C,E,w){var B={text:E.text,type:E.type};return C.alignment_size=0,w.tag_complete=!0,C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),w.is_unformatted?C.add_raw_token(E):(w.tag_start_char==="<"&&(C.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&w.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(E)),w.indent_content&&!(w.is_unformatted||w.is_content_unformatted)&&(C.indent(),w.indent_content=!1),!w.is_inline_element&&!(w.is_unformatted||w.is_content_unformatted)&&C.set_wrap_point(),B},g.prototype._handle_inside_tag=function(C,E,w,B){var W=w.has_wrapped_attrs,T={text:E.text,type:E.type};if(C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),w.is_unformatted)C.add_raw_token(E);else if(w.tag_start_char==="{"&&E.type===l.TEXT)C.print_preserved_newlines(E)?(E.newlines=0,C.add_raw_token(E)):C.print_token(E);else{if(E.type===l.ATTRIBUTE?(C.set_space_before_token(!0),w.attr_count+=1):(E.type===l.EQUALS||E.type===l.VALUE&&E.previous.type===l.EQUALS)&&C.set_space_before_token(!1),E.type===l.ATTRIBUTE&&w.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(E),W=W||E.newlines!==0),this._is_wrap_attributes_force)){var k=w.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&w.attr_count===1){var m=!0,y=0,H;do{if(H=B.peek(y),H.type===l.ATTRIBUTE){m=!1;break}y+=1}while(y<4&&H.type!==l.EOF&&H.type!==l.TAG_CLOSE);k=!m}k&&(C.print_newline(!1),W=!0)}C.print_token(E),W=W||C.previous_token_wrapped(),w.has_wrapped_attrs=W}return T},g.prototype._handle_text=function(C,E,w){var B={text:E.text,type:"TK_CONTENT"};return w.custom_beautifier_name?this._print_custom_beatifier_text(C,E,w):w.is_unformatted||w.is_content_unformatted?C.add_raw_token(E):(C.traverse_whitespace(E),C.print_token(E)),B},g.prototype._print_custom_beatifier_text=function(C,E,w){var B=this;if(E.text!==""){var W=E.text,T,k=1,m="",y="";w.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?T=this._js_beautify:w.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?T=this._css_beautify:w.custom_beautifier_name==="html"&&(T=function(_e,ge){var ve=new g(_e,ge,B._js_beautify,B._css_beautify);return ve.beautify()}),this._options.indent_scripts==="keep"?k=0:this._options.indent_scripts==="separate"&&(k=-C.indent_level);var H=C.get_full_indent(k);if(W=W.replace(/\n[ \t]*$/,""),w.custom_beautifier_name!=="html"&&W[0]==="<"&&W.match(/^(<!--|<!\[CDATA\[)/)){var Q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(W);if(!Q){C.add_raw_token(E);return}m=H+Q[1]+`
`,W=Q[4],Q[5]&&(y=H+Q[5]),W=W.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(`
`)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(E.whitespace_before=Q[0]))}if(W)if(T){var te=function(){this.eol=`
`};te.prototype=this._options.raw_options;var ae=new te;W=T(H+W,ae)}else{var Te=E.whitespace_before;Te&&(W=W.replace(new RegExp(`
(`+Te+")?","g"),`
`)),W=H+W.replace(/\n/g,`
`+H)}m&&(W?W=m+W+`
`+y:W=m+y),C.print_newline(!1),W&&(E.text=W,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},g.prototype._handle_tag_open=function(C,E,w,B){var W=this._get_tag_open_token(E);return(w.is_unformatted||w.is_content_unformatted)&&!w.is_empty_element&&E.type===l.TAG_OPEN&&E.text.indexOf("</")===0?(C.add_raw_token(E),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(C.traverse_whitespace(E),this._set_tag_position(C,E,W,w,B),W.is_inline_element||C.set_wrap_point(),C.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(W.alignment_size=E.text.length+1),!W.tag_complete&&!W.is_unformatted&&(C.alignment_size=W.alignment_size),W};var _=function(C,E){if(this.parent=C||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="",!E)this.tag_complete=!0;else{var w;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(w=E.text.match(/^<([^\s>]*)/),this.tag_check=w?w[1]:""):(w=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=w?w[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===l.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||E.closed&&E.closed.text==="/>";var B=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(B=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(B)))}};g.prototype._get_tag_open_token=function(C){var E=new _(this._tag_stack.get_parser_token(),C);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||S(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&S(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&S(E.tag_check,this._options.content_unformatted),E.is_inline_element=S(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},g.prototype._set_tag_position=function(C,E,w,B,W){if(w.is_empty_element||(w.is_end_tag?w.start_tag_token=this._tag_stack.try_pop(w.tag_name):(this._do_optional_end_element(w)&&(w.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(w),(w.tag_name==="script"||w.tag_name==="style")&&!(w.is_unformatted||w.is_content_unformatted)&&(w.custom_beautifier_name=A(w.tag_check,E)))),S(w.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),w.is_empty_element){if(w.tag_start_char==="{"&&w.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),w.indent_content=!0;var T=C.current_line_has_match(/{{#if/);T||C.print_newline(!1)}w.tag_name==="!--"&&W.type===l.TAG_CLOSE&&B.is_end_tag&&w.text.indexOf(`
`)===-1||(w.is_inline_element||w.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,w))}else if(w.is_end_tag){var k=!1;k=w.start_tag_token&&w.start_tag_token.multiline_content,k=k||!w.is_inline_element&&!(B.is_inline_element||B.is_unformatted)&&!(W.type===l.TAG_CLOSE&&w.start_tag_token===B)&&W.type!=="TK_CONTENT",(w.is_content_unformatted||w.is_unformatted)&&(k=!1),k&&C.print_newline(!1)}else w.indent_content=!w.custom_beautifier_name,w.tag_start_char==="<"&&(w.tag_name==="html"?w.indent_content=this._options.indent_inner_html:w.tag_name==="head"?w.indent_content=this._options.indent_head_inner_html:w.tag_name==="body"&&(w.indent_content=this._options.indent_body_inner_html)),!(w.is_inline_element||w.is_unformatted)&&(W.type!=="TK_CONTENT"||w.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,w)},g.prototype._calcluate_parent_multiline=function(C,E){E.parent&&C._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var d=["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"],c=["a","audio","del","ins","map","noscript","video"];g.prototype._do_optional_end_element=function(C){var E=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(C.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&d.indexOf(C.tag_name)!==-1){var w=C.parent.parent;(!w||c.indexOf(w.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),E},x.exports.Beautifier=g},function(x,f,b){var h=b(6).Options;function o(p){h.call(this,p,"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"])}o.prototype=new h,x.exports.Options=o},function(x,f,b){var h=b(9).Tokenizer,o=b(9).TOKEN,p=b(13).Directives,l=b(14).TemplatablePattern,u=b(12).Pattern,s={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:o.START,RAW:o.RAW,EOF:o.EOF},i=new p(/<\!--/,/-->/),D=function(A,S){h.call(this,A,S),this._current_tag_name="";var R=new l(this._input).read_options(this._options),O=new u(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.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 g=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(g).until_after(g)}};D.prototype=new h,D.prototype._is_comment=function(A){return!1},D.prototype._is_opening=function(A){return A.type===s.TAG_OPEN},D.prototype._is_closing=function(A,S){return A.type===s.TAG_CLOSE&&S&&((A.text===">"||A.text==="/>")&&S.text[0]==="<"||A.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},D.prototype._reset=function(){this._current_tag_name=""},D.prototype._get_next_token=function(A,S){var R=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(s.EOF,""):(R=R||this._read_open_handlebars(O,S),R=R||this._read_attribute(O,A,S),R=R||this._read_close(O,S),R=R||this._read_raw_content(O,A,S),R=R||this._read_content_word(O),R=R||this._read_comment_or_cdata(O),R=R||this._read_processing(O),R=R||this._read_open(O,S),R=R||this._create_token(s.UNKNOWN,this._input.next()),R)},D.prototype._read_comment_or_cdata=function(A){var S=null,R=null,O=null;if(A==="<"){var g=this._input.peek(1);g==="!"&&(R=this.__patterns.comment.read(),R?(O=i.get_directives(R),O&&O.ignore==="start"&&(R+=i.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(S=this._create_token(s.COMMENT,R),S.directives=O)}return S},D.prototype._read_processing=function(A){var S=null,R=null,O=null;if(A==="<"){var g=this._input.peek(1);(g==="!"||g==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(S=this._create_token(s.COMMENT,R),S.directives=O)}return S},D.prototype._read_open=function(A,S){var R=null,O=null;return S||A==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),O=this._create_token(s.TAG_OPEN,R)),O},D.prototype._read_open_handlebars=function(A,S){var R=null,O=null;return S||this._options.indent_handlebars&&A==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),O=this._create_token(s.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),O=this._create_token(s.TAG_OPEN,R))),O},D.prototype._read_close=function(A,S){var R=null,O=null;return S&&(S.text[0]==="<"&&(A===">"||A==="/"&&this._input.peek(1)===">")?(R=this._input.next(),A==="/"&&(R+=this._input.next()),O=this._create_token(s.TAG_CLOSE,R)):S.text[0]==="{"&&A==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(s.TAG_CLOSE,"}}"))),O},D.prototype._read_attribute=function(A,S,R){var O=null,g="";if(R&&R.text[0]==="<")if(A==="=")O=this._create_token(s.EQUALS,this._input.next());else if(A==='"'||A==="'"){var _=this._input.next();A==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),O=this._create_token(s.VALUE,_)}else g=this.__patterns.attribute.read(),g&&(S.type===s.EQUALS?O=this._create_token(s.VALUE,g):O=this._create_token(s.ATTRIBUTE,g));return O},D.prototype._is_content_unformatted=function(A){return this._options.void_elements.indexOf(A)===-1&&(this._options.content_unformatted.indexOf(A)!==-1||this._options.unformatted.indexOf(A)!==-1)},D.prototype._read_raw_content=function(A,S,R){var O="";if(R&&R.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(S.type===s.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var g=S.opened.text.substr(1).toLowerCase();if(g==="script"||g==="style"){var _=this._read_comment_or_cdata(A);if(_)return _.type=s.TEXT,_;O=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(g)&&(O=this._input.readUntil(new RegExp("</"+g+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(s.TEXT,O):null},D.prototype._read_content_word=function(A){var S="";if(this._options.unformatted_content_delimiter&&(A===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(s.TEXT,S)},x.exports.Tokenizer=D,x.exports.TOKEN=s}],K={};function n(x){var f=K[x];if(f!==void 0)return f.exports;var b=K[x]={exports:{}};return G[x](b,b.exports,n),b.exports}var L=n(18);N=L})();var z=N;if(!0)!(ie=[U,U("6UM0"),U("TXwP")],Y=function(G){var K=U("6UM0"),n=U("TXwP");return{html_beautify:function(L,x){return z(L,x,K.js_beautify,n.css_beautify)}}}.apply(Ee,ie),Y!==void 0&&(it.exports=Y));else var I,M})()},"rAM+":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return Y});var ie=U("Qw5x");function Y(N,z){var I;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(I=Object(ie.a)(N))||z&&N&&typeof N.length=="number"){I&&(N=I);var M=0,G=function(){};return{s:G,n:function(){return M>=N.length?{done:!0}:{done:!1,value:N[M++]}},e:function(f){throw f},f:G}}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 K=!0,n=!1,L;return{s:function(){I=N[Symbol.iterator]()},n:function(){var f=I.next();return K=f.done,f},e:function(f){n=!0,L=f},f:function(){try{!K&&I.return!=null&&I.return()}finally{if(n)throw L}}}}},rUJ1:function(it,Ee){const U=/[&<>"']/,ie=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},I=O=>z[O];function M(O,g){if(g){if(U.test(O))return O.replace(ie,I)}else if(Y.test(O))return O.replace(N,I);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function K(O){return O.replace(G,(g,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const n=/(^|[^\[])\^/g;function L(O,g){O=O.source||O,g=g||"";const _={replace:(d,c)=>(c=c.source||c,c=c.replace(n,"$1"),O=O.replace(d,c),_),getRegex:()=>new RegExp(O,g)};return _}const x=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(O,g,_){if(O){let d;try{d=decodeURIComponent(K(_)).replace(x,"").toLowerCase()}catch(c){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}g&&!f.test(_)&&(_=u(g,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(d){return null}return _}const h={},o=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,g){h[" "+O]||(o.test(O)?h[" "+O]=O+"/":h[" "+O]=A(O,"/",!0)),O=h[" "+O];const _=O.indexOf(":")===-1;return g.substring(0,2)==="//"?_?g:O.replace(p,"$1")+g:g.charAt(0)==="/"?_?g:O.replace(l,"$1")+g:O+g}const s={exec:function(){}};function i(O){let g=1,_,d;for(;g<arguments.length;g++){_=arguments[g];for(d in _)Object.prototype.hasOwnProperty.call(_,d)&&(O[d]=_[d])}return O}function D(O,g){const _=O.replace(/\|/g,(C,E,w)=>{let B=!1,W=E;for(;--W>=0&&w[W]==="\\";)B=!B;return B?"|":" |"}),d=_.split(/ \|/);let c=0;if(d.length>g)d.splice(g);else for(;d.length<g;)d.push("");for(;c<d.length;c++)d[c]=d[c].trim().replace(/\\\|/g,"|");return d}function A(O,g,_){const d=O.length;if(d===0)return"";let c=0;for(;c<d;){const C=O.charAt(d-c-1);if(C===g&&!_)c++;else if(C!==g&&_)c++;else break}return O.substr(0,d-c)}function S(O,g){if(O.indexOf(g[1])===-1)return-1;const _=O.length;let d=0,c=0;for(;c<_;c++)if(O[c]==="\\")c++;else if(O[c]===g[0])d++;else if(O[c]===g[1]&&(d--,d<0))return c;return-1}function R(O){O&&O.sanitize&&!O.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")}it.exports={escape:M,unescape:K,edit:L,cleanUrl:b,resolveUrl:u,noopTest:s,merge:i,splitCells:D,rtrim:A,findClosingBracket:S,checkSanitizeDeprecation:R}},sboe:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return N});var ie=U("q1tI"),Y=U.n(ie),N=ie.createContext(null)},sesT:function(it,Ee){it.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAoCAYAAACb3CikAAAAAXNSR0IArs4c6QAABJFJREFUWEftWF1oHFUU/u7MZmazm4Q0tS/RmARSba0tDVazqyB9sVYlDzWRllopErWlER9EFFGRIuqDT0UoQaO0adKkQqui+FKhQmqSQn8o1cbYQH9Iia3QNN387Pwemdmdyd472Z0kRMhD7ssddu4997vnfOc7Z5YRkYwlMNgyECEKyx4RabmEPfL39mdham0EqgIYAEJmDg7xrbfSmZ3BGECUmZ3hPWfnFCB/gbXHP3PXillDf754lQhVsxrKQvIO8jHm/SEUKiQluhYPHb0SAGJdajYzXuBvMKtHGAMRgXlXnqceOXsjUrQJj3b9KAD5jZkXDxqePQKBgcGZXQ9ln53ZBSq8DxAwZL1rT2JvFq0/1iYA+TKiXzidnjEY5lr+aMczuR7ynp0572DS58rG7o94IKP7VW10aNLbKJItQN5c9mVcxnE78FoMpRNWST6s1He28ECG3oulUyP3/NAQoNS+Drl0zTyj76UND8y6NwjjWrubPV4yADgZ3dT1HA/kwlsVU8bYbf9UIqhVjZDj1XmAzC901uR1aCM/+7ZcpjF2tvjxjgQHZPqP1kp7YuKGLxuiMATgBJSDd0EAZ1ZUfM4wR0CG4g0d6zgg2vnWWkObuJIvDiIZxXVzImfOpqxHbsYTh6o5IPr5fesMffKiH0SBfcF0FnWXd0FY+ru7mTQeTxxayQFJn9uTNPWp3nw6EaYjhQtCMK0coBKYGUt2RDkgU2dbtpCh/+Ipq5OPal0LImWLkzXm+CC04W+zPMpmDpgWSx6J82Qd2N1sk9XjhdG5ofJgIyIli5M15sQ1aNd/8qtgthZOxJKd5bxHBl55A2Qf9JVQULSwZA0PDU/vTM6xu7Fk5308R87s+sC27P1e+gaVMX9Zn0VYg8VZSDP3nmC348muSt4j/S8fAOzWXOXL7ScClkNdEKb5LvzLseTRDTxH+nYcI6DJ54hYxAL9iChQC6gEDL/Gkj1bRSADYNiUWy3V1Xsglz2ygBOCRdAavwx9+KucCkKQZOlItKH7VR5I//ZREFbNSDxBqd4GuaR2cWpN6ir0Gz/w/Y3EPo0lej6eAXJpX9l06t87fIcappSCshZqUvNcRZbVl5SGzu99IOaZnUnD1Ho9W16Z5sgqGJt3VonNNIDi4hU1qG8f8YFo/U2vEdlt3FniSWLnM19hEe1J0j/R5IkH3Et7Xbzev+0bsq3duUBCinzh74W50JtF2tUnT+zlgfQ1/gWiukL7w9qTMFkRHSJH1GciieOnZoCca16tp6cGuS+g2RAFm1hBswVdKfyFdVN56t0aYLPbOLqhMfteeJ/I+iQARDAkNj4BD+RZb7BSjKeLUEK3XJbpKEdRRf3h0voPW3zxJPpOMU5/PQxQVRj35hL2QNcG4K6pYnLsFmyDYKQJKzfstVZtfHoF8PCUD8T8fcsOss3uhRwStseCjRQB2nQaZtoCiqpRvv5tirKxd9T7nz+Qu58ZvZv7GZBwfgxr7ebSk1pQYbAYdNuEIREiJXWAUoNI+RNQKh6DfOdUj1K5dZd4iSX8t0SYv/+n98seER37H8mkzkc00C7pAAAAAElFTkSuQmCC"},spXi:function(it,Ee,U){it.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(it,Ee,U){"use strict";var ie=U("VTBJ"),Y=U("1OyB"),N=U("vuIU"),z=U("Ji7U"),I=U("LK+K"),M=U("q1tI"),G=U.n(M),K=U("m+aA"),n=U("Zm9Q"),L=U("Kwbf"),x=U("c+Xe"),f=U("bdgK"),b="rc-observer-key",h=function(o){Object(z.a)(l,o);var p=Object(I.a)(l);function l(){var u;return Object(Y.a)(this,l),u=p.apply(this,arguments),u.resizeObserver=null,u.childNode=null,u.currentElement=null,u.state={width:0,height:0,offsetHeight:0,offsetWidth:0},u.onResize=function(s){var i=u.props.onResize,D=s[0].target,A=D.getBoundingClientRect(),S=A.width,R=A.height,O=D.offsetWidth,g=D.offsetHeight,_=Math.floor(S),d=Math.floor(R);if(u.state.width!==_||u.state.height!==d||u.state.offsetWidth!==O||u.state.offsetHeight!==g){var c={width:_,height:d,offsetWidth:O,offsetHeight:g};u.setState(c),i&&Promise.resolve().then(function(){i(Object(ie.a)(Object(ie.a)({},c),{},{offsetWidth:O,offsetHeight:g}))})}},u.setChildNode=function(s){u.childNode=s},u}return Object(N.a)(l,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var s=this.props.disabled;if(s){this.destroyObserver();return}var i=Object(K.a)(this.childNode||this),D=i!==this.currentElement;D&&(this.destroyObserver(),this.currentElement=i),!this.resizeObserver&&i&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(i))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var s=this.props.children,i=Object(n.a)(s);if(i.length>1)Object(L.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(i.length===0)return Object(L.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var D=i[0];if(M.isValidElement(D)&&Object(x.c)(D)){var A=D.ref;i[0]=M.cloneElement(D,{ref:Object(x.a)(A,this.setChildNode)})}return i.length===1?i[0]:i.map(function(S,R){return!M.isValidElement(S)||"key"in S&&S.key!==null?S:M.cloneElement(S,{key:"".concat(b,"-").concat(R)})})}}]),l}(M.Component);h.displayName="ResizeObserver",Ee.a=h},t9D7:function(it,Ee,U){"use strict";U.d(Ee,"b",function(){return G}),U.d(Ee,"g",function(){return n}),U.d(Ee,"d",function(){return L}),U.d(Ee,"e",function(){return x}),U.d(Ee,"a",function(){return f}),U.d(Ee,"f",function(){return o}),U.d(Ee,"c",function(){return p});var ie=U("Vhoy"),Y=U("MI8n"),N=U("pmY6"),z=U("Cg/j"),I=U("ic2d"),M=U("nEHx");const G=Object(z.c)("themeService");var K;(function(l){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}l.isThemeColor=u})(K||(K={}));function n(l){return{id:l}}var L;(function(l){function u(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||K.isThemeColor(R.color))}l.isThemeIcon=u;const s=new RegExp(`^\\$\\((${ie.a.iconNameExpression}(?:${ie.a.iconModifierExpression})?)\\)$`);function i(R){const O=s.exec(R);if(!O)return;let[,g]=O;return{id:g}}l.fromString=i;function D(R,O){let g=R.id;const _=g.lastIndexOf("~");return _!==-1&&(g=g.substring(0,_)),O&&(g=`${g}~${O}`),{id:g}}l.modify=D;function A(R,O){var g,_;return R.id===O.id&&((g=R.color)===null||g===void 0?void 0:g.id)===((_=O.color)===null||_===void 0?void 0:_.id)}l.isEqual=A;function S(R,O){return{id:R.id,color:O?n(O):void 0}}l.asThemeIcon=S,l.asClassNameArray=ie.a.asClassNameArray,l.asClassName=ie.a.asClassName,l.asCSSSelector=ie.a.asCSSSelector})(L||(L={}));function x(l){switch(l){case M.a.DARK:return"vs-dark";case M.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class b{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Y.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(N.i)(()=>{const u=this.themingParticipants.indexOf(l);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new b;I.a.add(f.ThemingContribution,h);function o(l){return h.onColorThemeChange(l)}class p extends N.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},tK3L:function(it,Ee,U){it.exports={flex_box_center:"flex_box_center___3uV00",flex_space_between:"flex_space_between___253zc",flex_box_vertical_center:"flex_box_vertical_center___3Nn4F",flex_box_center_end:"flex_box_center_end___3N00E",flex_box_column:"flex_box_column___wngbD",page:"page___1qj_b",wrap:"wrap___1vIxE",title:"title___3EB7K",select:"select___3yoep",contentWrap:"contentWrap___2vBaG",pngIcon:"pngIcon___3tbYk",tabsWrap:"tabsWrap___35WZr",searchWrap:"searchWrap___3zxJK",addQuestionBtn:"addQuestionBtn___3pN4A",search:"search___Qt6zp",searchIcon:"searchIcon___1fYTO",batchWrap:"batchWrap___1QFBy",customTable:"customTable___4pmq7",row:"row___mgwpl",contentListWrap:"contentListWrap___sfO91",li:"li___2kFZ7",bottom:"bottom___1-hPm",actionLeftItem:"actionLeftItem___3mz5t",questionTypeName:"questionTypeName___2Vr34",more:"more___Oo-pR",btnAdd:"btnAdd___3ROdW",cancelC:"cancelC___3SmK1",addC:"addC___3VFkF",actonBtn:"actonBtn___3j8EO",batch:"batch___1YJ8c",btns:"btns___33g-Q",btn:"btn___3yAUt",treeWrapper:"treeWrapper___3Sn4Z",treeHeader:"treeHeader___1fITD",treeContent:"treeContent___3wYv9",action:"action___2Ys8R",sendModal:"sendModal___3kKOa",line:"line___2PBOX",del:"del___1X0CN",divider:"divider___3XDiC",headerWrapper:"headerWrapper___3F2Wp",exportBtn:"exportBtn___3nux1"}},ulZh:function(it,Ee,U){typeof window!="undefined"&&function(Y,N){it.exports=N()}(this,function(){return function(ie){var Y={};function N(z){if(Y[z])return Y[z].exports;var I=Y[z]={i:z,l:!1,exports:{}};return ie[z].call(I.exports,I,I.exports,N),I.l=!0,I.exports}return N.m=ie,N.c=Y,N.d=function(z,I,M){N.o(z,I)||Object.defineProperty(z,I,{enumerable:!0,get:M})},N.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},N.t=function(z,I){if(I&1&&(z=N(z)),I&8)return z;if(I&4&&typeof z=="object"&&z&&z.__esModule)return z;var M=Object.create(null);if(N.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:z}),I&2&&typeof z!="string")for(var G in z)N.d(M,G,function(K){return z[K]}.bind(null,G));return M},N.n=function(z){var I=z&&z.__esModule?function(){return z.default}:function(){return z};return N.d(I,"a",I),I},N.o=function(z,I){return Object.prototype.hasOwnProperty.call(z,I)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,Y,N){"use strict";var z=Object.prototype.hasOwnProperty,I="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(I=!1));function G(x,f,b){this.fn=x,this.context=f,this.once=b||!1}function K(x,f,b,h,o){if(typeof b!="function")throw new TypeError("The listener must be a function");var p=new G(b,h||x,o),l=I?I+f:f;return x._events[l]?x._events[l].fn?x._events[l]=[x._events[l],p]:x._events[l].push(p):(x._events[l]=p,x._eventsCount++),x}function n(x,f){--x._eventsCount===0?x._events=new M:delete x._events[f]}function L(){this._events=new M,this._eventsCount=0}L.prototype.eventNames=function(){var f=[],b,h;if(this._eventsCount===0)return f;for(h in b=this._events)z.call(b,h)&&f.push(I?h.slice(1):h);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(b)):f},L.prototype.listeners=function(f){var b=I?I+f:f,h=this._events[b];if(!h)return[];if(h.fn)return[h.fn];for(var o=0,p=h.length,l=new Array(p);o<p;o++)l[o]=h[o].fn;return l},L.prototype.listenerCount=function(f){var b=I?I+f:f,h=this._events[b];return h?h.fn?1:h.length:0},L.prototype.emit=function(f,b,h,o,p,l){var u=I?I+f:f;if(!this._events[u])return!1;var s=this._events[u],i=arguments.length,D,A;if(s.fn){s.once&&this.removeListener(f,s.fn,void 0,!0);switch(i){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,b),!0;case 3:return s.fn.call(s.context,b,h),!0;case 4:return s.fn.call(s.context,b,h,o),!0;case 5:return s.fn.call(s.context,b,h,o,p),!0;case 6:return s.fn.call(s.context,b,h,o,p,l),!0}for(A=1,D=new Array(i-1);A<i;A++)D[A-1]=arguments[A];s.fn.apply(s.context,D)}else{var S=s.length,R;for(A=0;A<S;A++){s[A].once&&this.removeListener(f,s[A].fn,void 0,!0);switch(i){case 1:s[A].fn.call(s[A].context);break;case 2:s[A].fn.call(s[A].context,b);break;case 3:s[A].fn.call(s[A].context,b,h);break;case 4:s[A].fn.call(s[A].context,b,h,o);break;default:if(!D)for(R=1,D=new Array(i-1);R<i;R++)D[R-1]=arguments[R];s[A].fn.apply(s[A].context,D)}}}return!0},L.prototype.on=function(f,b,h){return K(this,f,b,h,!1)},L.prototype.once=function(f,b,h){return K(this,f,b,h,!0)},L.prototype.removeListener=function(f,b,h,o){var p=I?I+f:f;if(!this._events[p])return this;if(!b)return n(this,p),this;var l=this._events[p];if(l.fn)l.fn===b&&(!o||l.once)&&(!h||l.context===h)&&n(this,p);else{for(var u=0,s=[],i=l.length;u<i;u++)(l[u].fn!==b||o&&!l[u].once||h&&l[u].context!==h)&&s.push(l[u]);s.length?this._events[p]=s.length===1?s[0]:s:n(this,p)}return this},L.prototype.removeAllListeners=function(f){var b;return f?(b=I?I+f:f,this._events[b]&&n(this,b)):(this._events=new M,this._eventsCount=0),this},L.prototype.off=L.prototype.removeListener,L.prototype.addListener=L.prototype.on,L.prefixed=I,L.EventEmitter=L,ie.exports=L},"./node_modules/url-toolkit/src/url-toolkit.js":function(ie,Y,N){(function(z){var I=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,K=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(L,x,f){if(f=f||{},L=L.trim(),x=x.trim(),!x){if(!f.alwaysNormalize)return L;var b=n.parseURL(L);if(!b)throw new Error("Error trying to parse base URL.");return b.path=n.normalizePath(b.path),n.buildURLFromParts(b)}var h=n.parseURL(x);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return f.alwaysNormalize?(h.path=n.normalizePath(h.path),n.buildURLFromParts(h)):x;var o=n.parseURL(L);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var p=M.exec(o.path);o.netLoc=p[1],o.path=p[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(l.netLoc=o.netLoc,h.path[0]!=="/"))if(!h.path)l.path=o.path,h.params||(l.params=o.params,h.query||(l.query=o.query));else{var u=o.path,s=u.substring(0,u.lastIndexOf("/")+1)+h.path;l.path=n.normalizePath(s)}return l.path===null&&(l.path=f.alwaysNormalize?n.normalizePath(h.path):h.path),n.buildURLFromParts(l)},parseURL:function(L){var x=I.exec(L);return x?{scheme:x[1]||"",netLoc:x[2]||"",path:x[3]||"",params:x[4]||"",query:x[5]||"",fragment:x[6]||""}:null},normalizePath:function(L){for(L=L.split("").reverse().join("").replace(G,"");L.length!==(L=L.replace(K,"")).length;);return L.split("").reverse().join("")},buildURLFromParts:function(L){return L.scheme+L.netLoc+L.path+L.params+L.query+L.fragment}};ie.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(ie,Y,N){function z(f){var b={};function h(p){if(b[p])return b[p].exports;var l=b[p]={i:p,l:!1,exports:{}};return f[p].call(l.exports,l,l.exports,h),l.l=!0,l.exports}h.m=f,h.c=b,h.i=function(p){return p},h.d=function(p,l,u){h.o(p,l)||Object.defineProperty(p,l,{configurable:!1,enumerable:!0,get:u})},h.r=function(p){Object.defineProperty(p,"__esModule",{value:!0})},h.n=function(p){var l=p&&p.__esModule?function(){return p.default}:function(){return p};return h.d(l,"a",l),l},h.o=function(p,l){return Object.prototype.hasOwnProperty.call(p,l)},h.p="/",h.oe=function(p){throw console.error(p),p};var o=h(h.s=ENTRY_MODULE);return o.default||o}var I="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+I+").*?\\)";function G(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function K(f){return!isNaN(1*f)}function n(f,b,h){var o={};o[h]=[];var p=b.toString(),l=p.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return o;for(var u=l[1],s=new RegExp("(\\\\n|\\W)"+G(u)+M,"g"),i;i=s.exec(p);){if(i[3]==="dll-reference")continue;o[h].push(i[3])}for(s=new RegExp("\\("+G(u)+'\\("(dll-reference\\s('+I+'))"\\)\\)'+M,"g");i=s.exec(p);)f[i[2]]||(o[h].push(i[1]),f[i[2]]=N(i[1]).m),o[i[2]]=o[i[2]]||[],o[i[2]].push(i[4]);for(var D=Object.keys(o),A=0;A<D.length;A++)for(var S=0;S<o[D[A]].length;S++)K(o[D[A]][S])&&(o[D[A]][S]=1*o[D[A]][S]);return o}function L(f){var b=Object.keys(f);return b.reduce(function(h,o){return h||f[o].length>0},!1)}function x(f,b){for(var h={main:[b]},o={main:[]},p={main:{}};L(h);)for(var l=Object.keys(h),u=0;u<l.length;u++){var s=l[u],i=h[s],D=i.pop();if(p[s]=p[s]||{},p[s][D]||!f[s][D])continue;p[s][D]=!0,o[s]=o[s]||[],o[s].push(D);for(var A=n(f,f[s][D],s),S=Object.keys(A),R=0;R<S.length;R++)h[S[R]]=h[S[R]]||[],h[S[R]]=h[S[R]].concat(A[S[R]])}return o}ie.exports=function(f,b){b=b||{};var h={main:N.m},o=b.all?{main:Object.keys(h.main)}:x(h,f),p="";Object.keys(o).filter(function(D){return D!=="main"}).forEach(function(D){for(var A=0;o[D][A];)A++;o[D].push(A),h[D][A]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",p=p+"var "+D+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(A))+")({"+o[D].map(function(S){return""+JSON.stringify(S)+": "+h[D][S].toString()}).join(",")+`});
`}),p=p+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+o.main.map(function(D){return""+JSON.stringify(D)+": "+h.main[D].toString()}).join(",")+"}))(self);";var l=new window.Blob([p],{type:"text/javascript"});if(b.bare)return l;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,s=u.createObjectURL(l),i=new window.Worker(s);return i.objectURL=s,i}},"./src/config.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"hlsDefaultConfig",function(){return R}),N.d(Y,"mergeConfig",function(){return g}),N.d(Y,"enableStreamingMode",function(){return _});var z=N("./src/controller/abr-controller.ts"),I=N("./src/controller/audio-stream-controller.ts"),M=N("./src/controller/audio-track-controller.ts"),G=N("./src/controller/subtitle-stream-controller.ts"),K=N("./src/controller/subtitle-track-controller.ts"),n=N("./src/controller/buffer-controller.ts"),L=N("./src/controller/timeline-controller.ts"),x=N("./src/controller/cap-level-controller.ts"),f=N("./src/controller/fps-controller.ts"),b=N("./src/controller/eme-controller.ts"),h=N("./src/controller/cmcd-controller.ts"),o=N("./src/utils/xhr-loader.ts"),p=N("./src/utils/fetch-loader.ts"),l=N("./src/utils/cues.ts"),u=N("./src/utils/mediakeys-helper.ts"),s=N("./src/utils/logger.ts");function i(){return i=Object.assign||function(d){for(var c=1;c<arguments.length;c++){var C=arguments[c];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(d[E]=C[E])}return d},i.apply(this,arguments)}function D(d,c){var C=Object.keys(d);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(d);c&&(E=E.filter(function(w){return Object.getOwnPropertyDescriptor(d,w).enumerable})),C.push.apply(C,E)}return C}function A(d){for(var c=1;c<arguments.length;c++){var C=arguments[c]!=null?arguments[c]:{};c%2?D(Object(C),!0).forEach(function(E){S(d,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(C)):D(Object(C)).forEach(function(E){Object.defineProperty(d,E,Object.getOwnPropertyDescriptor(C,E))})}return d}function S(d,c,C){return c in d?Object.defineProperty(d,c,{value:C,enumerable:!0,configurable:!0,writable:!0}):d[c]=C,d}var R=A(A({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:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:z.default,bufferController:n.default,capLevelController:x.default,fpsController:f.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:K.default,timelineController:L.TimelineController,audioStreamController:I.default,audioTrackController:M.default,emeController:b.default,cmcdController:h.default});function O(){return{cueHandler:l.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 g(d,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return i({},d,c)}function _(d){var c=d.loader;if(c!==p.default&&c!==o.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),d.progressive=!1;else{var C=Object(p.fetchSupported)();C&&(d.loader=p.default,d.progressive=!0,d.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),I=N("./src/utils/ewma-bandwidth-estimator.ts"),M=N("./src/events.ts"),G=N("./src/utils/buffer-helper.ts"),K=N("./src/errors.ts"),n=N("./src/types/loader.ts"),L=N("./src/utils/logger.ts");function x(h,o){for(var p=0;p<o.length;p++){var l=o[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function f(h,o,p){return o&&x(h.prototype,o),p&&x(h,p),h}var b=function(){function h(p){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=p;var l=p.config;this.bwEstimator=new I.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var o=h.prototype;return o.registerListeners=function(){var l=this.hls;l.on(M.Events.FRAG_LOADING,this.onFragLoading,this),l.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(M.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off(M.Events.FRAG_LOADING,this.onFragLoading,this),l.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(M.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(l,u){var s=u.frag;if(s.type===n.PlaylistLevelType.MAIN&&!this.timer){var i;this.fragCurrent=s,this.partCurrent=(i=u.part)!=null?i:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(l,u){var s=this.hls.config;u.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,i=s.autoLevelEnabled,D=s.config,A=s.media;if(!l||!A)return;var S=u?u.stats:l.stats,R=u?u.duration:l.duration;if(S.aborted){L.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||A.paused||!A.playbackRate||!A.readyState)return;var O=performance.now()-S.loading.start,g=Math.abs(A.playbackRate);if(O<=500*R/g)return;var _=s.levels,d=s.minAutoLevel,c=_[l.level],C=S.total||Math.max(S.loaded,Math.round(R*c.maxBitrate/8)),E=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/O),w=(C-S.loaded)/E,B=A.currentTime,W=(G.BufferHelper.bufferInfo(A,B,D.maxBufferHole).end-B)/g;if(W>=2*R/g||w<=W)return;var T=Number.POSITIVE_INFINITY,k;for(k=l.level-1;k>d;k--){var m=_[k].maxBitrate;if(T=R*m/(8*.8*E),T<W)break}if(T>=w)return;var y=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+l.sn+(u?" part "+u.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+k+`
Current BW estimate: `+(Object(z.isFiniteNumber)(y)?(y/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+w.toFixed(3)+` s
Estimated load time for the next fragment: `+T.toFixed(3)+` s
Time to underbuffer: `+W.toFixed(3)+" s"),s.nextLoadLevel=k,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),s.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:u,stats:S})},o.onFragLoaded=function(l,u){var s=u.frag,i=u.part;if(s.type===n.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(s.sn)){var D=i?i.stats:s.stats,A=i?i.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[s.level],R=(S.loaded?S.loaded.bytes:0)+D.loaded,O=(S.loaded?S.loaded.duration:0)+A;S.loaded={bytes:R,duration:O},S.realBitrate=Math.round(8*R/O)}if(s.bitrateTest){var g={stats:D,frag:s,part:i,id:s.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,g),s.bitrateTest=!1}}},o.onFragBuffered=function(l,u){var s=u.frag,i=u.part,D=i?i.stats:s.stats;if(D.aborted)return;if(s.type!==n.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var A=D.parsing.end-D.loading.start;this.bwEstimator.sample(A,D.loaded),D.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=A/1e3:this.bitrateTestDelay=0},o.onError=function(l,u){switch(u.details){case K.ErrorDetails.FRAG_LOAD_ERROR:case K.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,i=s.maxAutoLevel,D=s.config,A=s.minAutoLevel,S=s.media,R=u?u.duration:l?l.duration:0,O=S?S.currentTime:0,g=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():D.abrEwmaDefaultEstimate,d=(G.BufferHelper.bufferInfo(S,O,D.maxBufferHole).end-O)/g,c=this.findBestLevel(_,A,i,d,D.abrBandWidthFactor,D.abrBandWidthUpFactor);if(c>=0)return c;L.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=R?Math.min(R,D.maxStarvationDelay):D.maxStarvationDelay,E=D.abrBandWidthFactor,w=D.abrBandWidthUpFactor;if(!d){var B=this.bitrateTestDelay;if(B){var W=R?Math.min(R,D.maxLoadingDelay):D.maxLoadingDelay;C=W-B,L.logger.trace("bitrate test took "+Math.round(1e3*B)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=w=1}}return c=this.findBestLevel(_,A,i,d+C,E,w),Math.max(c,0)},o.findBestLevel=function(l,u,s,i,D,A){for(var S,R=this.fragCurrent,O=this.partCurrent,g=this.lastLoadedFragLevel,_=this.hls.levels,d=_[g],c=!!(d!=null&&(S=d.details)!==null&&S!==void 0&&S.live),C=d==null?void 0:d.codecSet,E=O?O.duration:R?R.duration:0,w=s;w>=u;w--){var B=_[w];if(!B||C&&B.codecSet!==C)continue;var W=B.details,T=(O?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||E,k=void 0;w<=g?k=D*l:k=A*l;var m=_[w].maxBitrate,y=m*T/k;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(k)+"/"+m+"/"+T+"/"+i+"/"+y),k>m&&(!y||c&&!this.bitrateTestDelay||y<i))return w}return-1},f(h,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,u=this.bwEstimator;if(l!==-1&&(!u||!u.canEstimate()))return l;var s=this.getNextABRAutoLevel();return l!==-1&&(s=Math.min(l,s)),s},set:function(l){this._nextAutoLevel=l}}]),h}();Y.default=b},"./src/controller/audio-stream-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),I=N("./src/controller/base-stream-controller.ts"),M=N("./src/events.ts"),G=N("./src/utils/buffer-helper.ts"),K=N("./src/controller/fragment-tracker.ts"),n=N("./src/types/level.ts"),L=N("./src/types/loader.ts"),x=N("./src/loader/fragment.ts"),f=N("./src/demux/chunk-cache.ts"),b=N("./src/demux/transmuxer-interface.ts"),h=N("./src/types/transmuxer.ts"),o=N("./src/controller/fragment-finders.ts"),p=N("./src/utils/discontinuities.ts"),l=N("./src/errors.ts"),u=N("./src/utils/logger.ts");function s(){return s=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(R[_]=g[_])}return R},s.apply(this,arguments)}function i(R,O){R.prototype=Object.create(O.prototype),R.prototype.constructor=R,D(R,O)}function D(R,O){return D=Object.setPrototypeOf||function(_,d){return _.__proto__=d,_},D(R,O)}var A=100,S=function(R){i(O,R);function O(_,d){var c;return c=R.call(this,_,d,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var g=O.prototype;return g.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},g._registerListeners=function(){var d=this.hls;d.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),d.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.on(M.Events.ERROR,this.onError,this),d.on(M.Events.BUFFER_RESET,this.onBufferReset,this),d.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),d.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g._unregisterListeners=function(){var d=this.hls;d.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),d.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),d.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),d.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),d.off(M.Events.ERROR,this.onError,this),d.off(M.Events.BUFFER_RESET,this.onBufferReset,this),d.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),d.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),d.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},g.onInitPtsFound=function(d,c){var C=c.frag,E=c.id,w=c.initPTS;if(E==="main"){var B=C.cc;this.initPTS[C.cc]=w,this.log("InitPTS for cc: "+B+" found from main: "+w),this.videoTrackCC=B,this.state===I.State.WAITING_INIT_PTS&&this.tick()}},g.startLoad=function(d){if(!this.levels){this.startPosition=d,this.state=I.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(A),this.fragLoadError=0,c>0&&d===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=I.State.IDLE):(this.loadedmetadata=!1,this.state=I.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()},g.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_TRACK:{var d,c=this.levels,C=this.trackId,E=c==null||((d=c[C])===null||d===void 0)?void 0:d.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=I.State.WAITING_INIT_PTS}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var w,B=performance.now(),W=this.retryDate;(!W||B>=W||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=I.State.IDLE);break}case I.State.WAITING_INIT_PTS:{var T=this.waitingData;if(T){var k=T.frag,m=T.part,y=T.cache,H=T.complete;if(this.initPTS[k.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.FRAG_LOADING;var Q=y.flush(),te={frag:k,part:m,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(te),H&&R.prototype._handleFragmentLoadComplete.call(this,te)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+k.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ae=this.getLoadPosition(),Te=G.BufferHelper.bufferInfo(this.mediaBuffer,ae,this.config.maxBufferHole),_e=Object(o.fragmentWithinToleranceTest)(Te.end,this.config.maxFragLookUpTolerance,k);_e<0&&(u.logger.log("Waiting fragment cc ("+k.cc+") @ "+k.start+" cancelled because another fragment at "+Te.end+" is needed"),this.clearWaitingFragment())}}else this.state=I.State.IDLE}}this.onTickEnd()},g.clearWaitingFragment=function(){var d=this.waitingData;d&&(this.fragmentTracker.removeFragment(d.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.IDLE)},g.onTickEnd=function(){var d=this.media;if(!d||!d.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:d,C=c.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=d.currentTime},g.doTickIdle=function(){var d,c,C=this.hls,E=this.levels,w=this.media,B=this.trackId,W=C.config;if(!E||!E[B])return;if(!w&&(this.startFragRequested||!W.startFragPrefetch))return;var T=E[B],k=T.details;if(!k||k.live&&this.levelLastLoaded!==B||this.waitForCdnTuneIn(k)){this.state=I.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,x.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var m=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(m===null)return;var y=m.len,H=this.getMaxBufferLength(),Q=this.audioSwitch;if(y>=H&&!Q)return;if(!Q&&this._streamEnded(m,k)){C.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=I.State.ENDED;return}var te=k.fragments,ae=te[0].start,Te=m.end;if(Q){var _e=this.getLoadPosition();Te=_e,k.PTSKnown&&_e<ae&&((m.end>ae||m.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=ae+.05))}var ge=this.getNextFragment(Te,k);if(!ge){this.bufferFlushed=!0;return}((d=ge.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((c=ge.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(ge,k):this.loadFragment(ge,k,Te)},g.getMaxBufferLength=function(){var d=R.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return c===null?d:Math.max(d,c.len)},g.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},g.onAudioTracksUpdated=function(d,c){var C=c.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},g.onAudioTrackSwitching=function(d,c){var C=!!c.url;this.trackId=c.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(A):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=I.State.IDLE):this.state=I.State.STOPPED,this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},g.onLevelLoaded=function(d,c){this.mainDetails=c.details},g.onAudioTrackLoaded=function(d,c){var C,E=this.levels,w=c.details,B=c.id;if(!E){this.warn("Audio tracks were reset while loading level "+B);return}this.log("Track "+B+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var W=E[B],T=0;if(w.live||(C=W.details)!==null&&C!==void 0&&C.live){var k=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!k)return;!W.details&&w.hasProgramDateTime&&k.hasProgramDateTime?(Object(p.alignMediaPlaylistByPDT)(w,k),T=w.fragments[0].start):T=this.alignPlaylists(w,W.details)}W.details=w,this.levelLastLoaded=B,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(W.details,T),this.state===I.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=I.State.IDLE),this.tick()},g._handleFragmentLoadProgress=function(d){var c,C=d.frag,E=d.part,w=d.payload,B=this.config,W=this.trackId,T=this.levels;if(!T){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var k=T[W];console.assert(k,"Audio track is defined on fragment load progress");var m=k.details;console.assert(m,"Audio track details are defined on fragment load progress");var y=B.defaultAudioCodec||k.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new b.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[C.cc],te=(c=C.initSegment)===null||c===void 0?void 0:c.data;if(Q!==void 0){var ae=!1,Te=E?E.index:-1,_e=Te!==-1,ge=new h.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,w.byteLength,Te,_e);H.push(w,te,y,"",C,E,m.totalduration,ae,ge,Q)}else{u.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+m.startSN+" ,"+m.endSN+"],track "+W);var ve=this.waitingData=this.waitingData||{frag:C,part:E,cache:new f.default,complete:!1},Oe=ve.cache;Oe.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=I.State.WAITING_INIT_PTS}},g._handleFragmentLoadComplete=function(d){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,d)},g.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},g.onBufferCreated=function(d,c){var C=c.tracks.audio;C&&(this.mediaBuffer=C.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},g.onFragBuffered=function(d,c){var C=c.frag,E=c.part;if(C.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(E?" p: "+E.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},g.onError=function(d,c){switch(c.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:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,c);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==I.State.ERROR&&this.state!==I.State.STOPPED&&(this.state=c.fatal?I.State.ERROR:I.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);E&&E.len>.5&&(C=!this.reduceMaxBufferLength(E.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},g.onBufferFlushed=function(d,c){var C=c.type;C===x.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},g._handleTransmuxComplete=function(d){var c,C="audio",E=this.hls,w=d.remuxResult,B=d.chunkMeta,W=this.getCurrentContext(B);if(!W){this.warn("The loading context changed while buffering fragment "+B.sn+" of level "+B.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(B.level);return}var T=W.frag,k=W.part,m=w.audio,y=w.text,H=w.id3,Q=w.initSegment;if(this.fragContextChanged(T))return;if(this.state=I.State.PARSING,this.audioSwitch&&m&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,T,B),E.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:C,tracks:Q.tracks})),m){var te=m.startPTS,ae=m.endPTS,Te=m.startDTS,_e=m.endDTS;k&&(k.elementaryStreams[x.ElementaryStreamTypes.AUDIO]={startPTS:te,endPTS:ae,startDTS:Te,endDTS:_e}),T.setElementaryStreamInfo(x.ElementaryStreamTypes.AUDIO,te,ae,Te,_e),this.bufferFragmentData(m,T,k,B)}if(H!=null&&(c=H.samples)!==null&&c!==void 0&&c.length){var ge=s({frag:T,id:C},H);E.trigger(M.Events.FRAG_PARSING_METADATA,ge)}if(y){var ve=s({frag:T,id:C},y);E.trigger(M.Events.FRAG_PARSING_USERDATA,ve)}},g._bufferInitSegment=function(d,c,C){if(this.state!==I.State.PARSING)return;d.video&&delete d.video;var E=d.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,d);var w=E.initSegment;if(w!=null&&w.byteLength){var B={type:"audio",frag:c,part:null,chunkMeta:C,parent:c.type,data:w};this.hls.trigger(M.Events.BUFFER_APPENDING,B)}this.tick()},g.loadFragment=function(d,c,C){var E=this.fragmentTracker.getState(d);this.fragCurrent=d,(this.audioSwitch||E===K.FragmentState.NOT_LOADED||E===K.FragmentState.PARTIAL)&&(d.sn==="initSegment"?this._loadInitSegment(d):c.live&&!Object(z.isFiniteNumber)(this.initPTS[d.cc])?(this.log("Waiting for video PTS in continuity counter "+d.cc+" of live stream before loading audio fragment "+d.sn+" of level "+this.trackId),this.state=I.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,d,c,C)))},g.completeAudioSwitch=function(){var d=this.hls,c=this.media,C=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,d.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:C})},O}(I.default);Y.default=S},"./src/controller/audio-track-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),I=N("./src/errors.ts"),M=N("./src/controller/base-playlist-controller.ts"),G=N("./src/types/loader.ts");function K(b,h){for(var o=0;o<h.length;o++){var p=h[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(b,p.key,p)}}function n(b,h,o){return h&&K(b.prototype,h),o&&K(b,o),b}function L(b,h){b.prototype=Object.create(h.prototype),b.prototype.constructor=b,x(b,h)}function x(b,h){return x=Object.setPrototypeOf||function(p,l){return p.__proto__=l,p},x(b,h)}var f=function(b){L(h,b);function h(p){var l;return l=b.call(this,p,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var o=h.prototype;return o.registerListeners=function(){var l=this.hls;l.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(z.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var l=this.hls;l.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(z.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,b.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(l,u){this.tracks=u.audioTracks||[]},o.onAudioTrackLoaded=function(l,u){var s=u.id,i=u.details,D=this.tracksInGroup[s];if(!D){this.warn("Invalid audio track id "+s);return}var A=D.details;D.details=u.details,this.log("audioTrack "+s+" loaded ["+i.startSN+"-"+i.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,u,A))},o.onLevelLoading=function(l,u){this.switchLevel(u.level)},o.onLevelSwitching=function(l,u){this.switchLevel(u.level)},o.switchLevel=function(l){var u=this.hls.levels[l];if(!(u!=null&&u.audioGroupIds))return;var s=u.audioGroupIds[u.urlId];if(this.groupId!==s){this.groupId=s;var i=this.tracks.filter(function(A){return!s||A.groupId===s});this.selectDefaultTrack&&!i.some(function(A){return A.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var D={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(z.Events.AUDIO_TRACKS_UPDATED,D),this.selectInitialTrack()}},o.onError=function(l,u){if(b.prototype.onError.call(this,l,u),u.fatal||!u.context)return;u.context.type===G.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},o.setAudioTrack=function(l){var u=this.tracksInGroup;if(l<0||l>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=u[this.trackId];this.log("Now switching to audio-track index "+l);var i=u[l],D=i.id,A=i.groupId,S=A===void 0?"":A,R=i.name,O=i.type,g=i.url;if(this.trackId=l,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:D,groupId:S,name:R,type:O,url:g}),i.details&&!i.details.live)return;var _=this.switchParams(i.url,s==null?void 0:s.details);this.loadPlaylist(_)},o.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,s=this.findTrackId(u)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(l){for(var u=this.tracksInGroup,s=0;s<u.length;s++){var i=u[s];if((!this.selectDefaultTrack||i.default)&&(!l||l===i.name))return i.id}return-1},o.loadPlaylist=function(l){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var s=u.id,i=u.groupId,D=u.url;if(l)try{D=l.addDirectives(D)}catch(A){this.warn("Could not construct new URL with HLS Delivery Directives: "+A)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(z.Events.AUDIO_TRACK_LOADING,{url:D,id:s,groupId:i,deliveryDirectives:l||null})}},n(h,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),h}(M.default);Y.default=f},"./src/controller/base-playlist-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var z=N("./src/polyfills/number.ts"),I=N("./src/types/level.ts"),M=N("./src/controller/level-helper.ts"),G=N("./src/utils/logger.ts"),K=N("./src/errors.ts"),n=function(){function L(f,b){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,b+":"),this.warn=G.logger.warn.bind(G.logger,b+":"),this.hls=f}var x=L.prototype;return x.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},x.onError=function(b,h){h.fatal&&h.type===K.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},x.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},x.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},x.stopLoad=function(){this.canLoad=!1,this.clearTimer()},x.switchParams=function(b,h){var o=h==null?void 0:h.renditionReports;if(o)for(var p=0;p<o.length;p++){var l=o[p],u=""+l.URI;if(u===b.substr(-u.length)){var s=parseInt(l["LAST-MSN"]),i=parseInt(l["LAST-PART"]);if(h&&this.hls.config.lowLatencyMode){var D=Math.min(h.age-h.partTarget,h.targetduration);i!==void 0&&D>h.partTarget&&(i+=1)}if(Object(z.isFiniteNumber)(s))return new I.HlsUrlParameters(s,Object(z.isFiniteNumber)(i)?i:void 0,I.HlsSkip.No)}}},x.loadPlaylist=function(b){},x.shouldLoadTrack=function(b){return this.canLoad&&b&&!!b.url&&(!b.details||b.details.live)},x.playlistLoaded=function(b,h,o){var p=this,l=h.details,u=h.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(l.advancedDateTime=Date.now()-s,l.live||o!=null&&o.live){if(l.reloaded(o),o&&this.log("live playlist "+b+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),o&&l.fragments.length>0&&Object(M.mergeDetails)(o,l),!this.canLoad||!l.live)return;var i,D=void 0,A=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var S=this.hls.config.lowLatencyMode,R=l.lastPartSn,O=l.endSN,g=l.lastPartIndex,_=g!==-1,d=R===O,c=S?0:g;_?(D=d?O+1:R,A=d?c:g+1):D=O+1;var C=l.age,E=C+l.ageHeader,w=Math.min(E-l.partTarget,l.targetduration*1.5);if(w>0){if(o&&w>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+w+" with playlist age: "+l.age),w=0;else{var B=Math.floor(w/l.targetduration);if(D+=B,A!==void 0){var W=Math.round(w%l.targetduration/l.partTarget);A+=W}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+w+" skip sn "+B+" to part "+A)}l.tuneInGoal=w}if(i=this.getDeliveryDirectives(l,h.deliveryDirectives,D,A),S||!d){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(l,h.deliveryDirectives,D,A);var T=Object(M.computeReloadInterval)(l,u);D!==void 0&&l.canBlockReload&&(T-=l.partTarget||1),this.log("reload live playlist "+b+" in "+Math.round(T)+" ms"),this.timer=self.setTimeout(function(){return p.loadPlaylist(i)},T)}else this.clearTimer()},x.getDeliveryDirectives=function(b,h,o,p){var l=Object(I.getSkipValue)(b,o);return h!=null&&h.skip&&b.deltaUpdateFailed&&(o=h.msn,p=h.part,l=I.HlsSkip.No),new I.HlsUrlParameters(o,p,l)},x.retryLoadingOrFail=function(b){var h=this,o=this.hls.config,p=this.retryCount<o.levelLoadingMaxRetry;if(p){var l;if(this.retryCount++,b.details.indexOf("LoadTimeOut")>-1&&(l=b.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+b.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+b.details+'"')}}else this.warn('cannot recover from error "'+b.details+'"'),this.clearTimer(),b.fatal=!0;return p},L}()},"./src/controller/base-stream-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"State",function(){return O}),N.d(Y,"default",function(){return g});var z=N("./src/polyfills/number.ts"),I=N("./src/task-loop.ts"),M=N("./src/controller/fragment-tracker.ts"),G=N("./src/utils/buffer-helper.ts"),K=N("./src/utils/logger.ts"),n=N("./src/events.ts"),L=N("./src/errors.ts"),x=N("./src/types/transmuxer.ts"),f=N("./src/utils/mp4-tools.ts"),b=N("./src/utils/discontinuities.ts"),h=N("./src/controller/fragment-finders.ts"),o=N("./src/controller/level-helper.ts"),p=N("./src/loader/fragment-loader.ts"),l=N("./src/crypt/decrypter.ts"),u=N("./src/utils/time-ranges.ts"),s=N("./src/types/loader.ts");function i(_,d){for(var c=0;c<d.length;c++){var C=d[c];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(_,C.key,C)}}function D(_,d,c){return d&&i(_.prototype,d),c&&i(_,c),_}function A(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function S(_,d){_.prototype=Object.create(d.prototype),_.prototype.constructor=_,R(_,d)}function R(_,d){return R=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},R(_,d)}var O={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"},g=function(_){S(d,_);function d(C,E,w){var B;return B=_.call(this)||this,B.hls=void 0,B.fragPrevious=null,B.fragCurrent=null,B.fragmentTracker=void 0,B.transmuxer=null,B._state=O.STOPPED,B.media=void 0,B.mediaBuffer=void 0,B.config=void 0,B.bitrateTest=!1,B.lastCurrentTime=0,B.nextLoadPosition=0,B.startPosition=0,B.loadedmetadata=!1,B.fragLoadError=0,B.retryDate=0,B.levels=null,B.fragmentLoader=void 0,B.levelLastLoaded=null,B.startFragRequested=!1,B.decrypter=void 0,B.initPTS=[],B.onvseeking=null,B.onvended=null,B.logPrefix="",B.log=void 0,B.warn=void 0,B.logPrefix=w,B.log=K.logger.log.bind(K.logger,w+":"),B.warn=K.logger.warn.bind(K.logger,w+":"),B.hls=C,B.fragmentLoader=new p.default(C.config),B.fragmentTracker=E,B.config=C.config,B.decrypter=new l.default(C,C.config),C.on(n.Events.KEY_LOADED,B.onKeyLoaded,A(B)),B}var c=d.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(E){},c.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},c._streamEnded=function(E,w){var B=this.fragCurrent,W=this.fragmentTracker;if(!w.live&&B&&B.sn===w.endSN&&!E.nextStart){var T=W.getState(B);return T===M.FragmentState.PARTIAL||T===M.FragmentState.OK}return!1},c.onMediaAttached=function(E,w){var B=this.media=this.mediaBuffer=w.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),B.addEventListener("seeking",this.onvseeking),B.addEventListener("ended",this.onvended);var W=this.config;this.levels&&W.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(W.startPosition)},c.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var E=this.config,w=this.fragCurrent,B=this.media,W=this.mediaBuffer,T=this.state,k=B?B.currentTime:0,m=G.BufferHelper.bufferInfo(W||B,k,E.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(k)?k.toFixed(3):k)+", state: "+T),T===O.ENDED)this.resetLoadingState();else if(w&&!m.len){var y=E.maxFragLookUpTolerance,H=w.start-y,Q=w.start+w.duration+y,te=k>Q;(k<H||te)&&(te&&w.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),w.loader.abort()),this.resetLoadingState())}B&&(this.lastCurrentTime=k),!this.loadedmetadata&&!m.len&&(this.nextLoadPosition=this.startPosition=k),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(E,w){if(this.state!==O.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var B=this.levels[w.frag.level].details;B&&this.loadFragment(w.frag,B,w.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),_.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(n.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,_.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(E,w){this.log("Loading key for "+E.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=O.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},c.loadFragment=function(E,w,B){this._loadFragForPlayback(E,w,B)},c._loadFragForPlayback=function(E,w,B){var W=this,T=function(m){if(W.fragContextChanged(E)){W.warn("Fragment "+E.sn+(m.part?" p: "+m.part.index:"")+" of level "+E.level+" was dropped during download."),W.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,W._handleFragmentLoadProgress(m)};this._doFragLoad(E,w,B,T).then(function(k){if(!k)return;W.fragLoadError=0;var m=W.state;if(W.fragContextChanged(E)){(m===O.FRAG_LOADING||m===O.BACKTRACKING||!W.fragCurrent&&m===O.PARSING)&&(W.fragmentTracker.removeFragment(E),W.state=O.IDLE);return}if("payload"in k&&(W.log("Loaded fragment "+E.sn+" of level "+E.level),W.hls.trigger(n.Events.FRAG_LOADED,k),W.state===O.BACKTRACKING)){W.fragmentTracker.backtrack(E,k),W.resetFragmentLoading(E);return}W._handleFragmentLoadComplete(k)}).catch(function(k){W.warn(k),W.resetFragmentLoading(E)})},c.flushMainBuffer=function(E,w,B){if(B===void 0&&(B=null),!(E-w))return;var W={startOffset:E,endOffset:w,type:B};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,W)},c._loadInitSegment=function(E){var w=this;this._doFragLoad(E).then(function(B){if(!B||w.fragContextChanged(E)||!w.levels)throw new Error("init load aborted");return B}).then(function(B){var W=w.hls,T=B.payload,k=E.decryptdata;if(T&&T.byteLength>0&&k&&k.key&&k.iv&&k.method==="AES-128"){var m=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(T),k.key.buffer,k.iv.buffer).then(function(y){var H=self.performance.now();return W.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:y,stats:{tstart:m,tdecrypt:H}}),B.payload=y,B})}return B}).then(function(B){var W=w.fragCurrent,T=w.hls,k=w.levels;if(!k)throw new Error("init load aborted, missing levels");var m=k[E.level].details;console.assert(m,"Level details are defined when init segment is loaded");var y=E.stats;w.state=O.IDLE,w.fragLoadError=0,E.data=new Uint8Array(B.payload),y.parsing.start=y.buffering.start=self.performance.now(),y.parsing.end=y.buffering.end=self.performance.now(),B.frag===W&&T.trigger(n.Events.FRAG_BUFFERED,{stats:y,frag:W,part:null,id:E.type}),w.tick()}).catch(function(B){w.warn(B),w.resetFragmentLoading(E)})},c.fragContextChanged=function(E){var w=this.fragCurrent;return!E||!w||E.level!==w.level||E.sn!==w.sn||E.urlId!==w.urlId},c.fragBufferedComplete=function(E,w){var B=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+u.default.toString(G.BufferHelper.getBuffered(B))),this.state=O.IDLE,this.tick()},c._handleFragmentLoadComplete=function(E){var w=this.transmuxer;if(!w)return;var B=E.frag,W=E.part,T=E.partsLoaded,k=!T||T.length===0||T.some(function(y){return!y}),m=new x.ChunkMetadata(B.level,B.sn,B.stats.chunkCount+1,0,W?W.index:-1,!k);w.flush(m)},c._handleFragmentLoadProgress=function(E){},c._doFragLoad=function(E,w,B,W){var T=this;if(B===void 0&&(B=null),!this.levels)throw new Error("frag load aborted, missing levels");if(B=Math.max(E.start,B||0),this.config.lowLatencyMode&&w){var k=w.partList;if(k&&W){B>E.end&&w.fragmentHint&&(E=w.fragmentHint);var m=this.getNextPart(k,E,B);if(m>-1){var y=k[m];return this.log("Loading part sn: "+E.sn+" p: "+y.index+" cc: "+E.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+m+"-"+(k.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(B.toFixed(3))),this.nextLoadPosition=y.start+y.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:k[m],targetBufferTime:B}),this.doFragPartsLoad(E,k,m,W).catch(function(H){return T.handleFragLoadError(H)})}else if(!E.url||this.loadedEndOfParts(k,B))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(B.toFixed(3))),Object(z.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:B}),this.fragmentLoader.load(E,W).catch(function(H){return T.handleFragLoadError(H)})},c.doFragPartsLoad=function(E,w,B,W){var T=this;return new Promise(function(k,m){var y=[],H=function Q(te){var ae=w[te];T.fragmentLoader.loadPart(E,ae,W).then(function(Te){y[ae.index]=Te;var _e=Te.part;T.hls.trigger(n.Events.FRAG_LOADED,Te);var ge=w[te+1];if(ge&&ge.fragment===E)Q(te+1);else return k({frag:E,part:_e,partsLoaded:y})}).catch(m)};H(B)})},c.handleFragLoadError=function(E){var w=E.data;return w&&w.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(n.Events.ERROR,w),null},c._handleTransmuxerFlush=function(E){var w=this.getCurrentContext(E);if(!w||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var B=w.frag,W=w.part,T=w.level,k=self.performance.now();B.stats.parsing.end=k,W&&(W.stats.parsing.end=k),this.updateLevelTiming(B,W,T,E.partial)},c.getCurrentContext=function(E){var w=this.levels,B=E.level,W=E.sn,T=E.part;if(!w||!w[B])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+B+". The current chunk will not be buffered."),null;var k=w[B],m=T>-1?Object(o.getPartWith)(k,W,T):null,y=m?m.fragment:Object(o.getFragmentWithSN)(k,W,this.fragCurrent);return y?{frag:y,part:m,level:k}:null},c.bufferFragmentData=function(E,w,B,W){if(!E||this.state!==O.PARSING)return;var T=E.data1,k=E.data2,m=T;if(T&&k&&(m=Object(f.appendUint8Array)(T,k)),!m||!m.length)return;var y={type:E.type,frag:w,part:B,chunkMeta:W,parent:w.type,data:m};this.hls.trigger(n.Events.BUFFER_APPENDING,y),E.dropped&&E.independent&&!B&&this.flushBufferGap(w)},c.flushBufferGap=function(E){var w=this.media;if(!w)return;if(!G.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,E.start);return}var B=w.currentTime,W=G.BufferHelper.bufferInfo(w,B,0),T=E.duration,k=Math.min(this.config.maxFragLookUpTolerance*2,T*.25),m=Math.max(Math.min(E.start-k,W.end-k),B+k);E.start-m>k&&this.flushMainBuffer(m,E.start)},c.getFwdBufferInfo=function(E,w){var B=this.config,W=this.getLoadPosition();if(!Object(z.isFiniteNumber)(W))return null;var T=G.BufferHelper.bufferInfo(E,W,B.maxBufferHole);if(T.len===0&&T.nextStart!==void 0){var k=this.fragmentTracker.getBufferedFrag(W,w);if(k&&T.nextStart<k.end)return G.BufferHelper.bufferInfo(E,W,Math.max(T.nextStart,B.maxBufferHole))}return T},c.getMaxBufferLength=function(E){var w=this.config,B;return E?B=Math.max(8*w.maxBufferSize/E,w.maxBufferLength):B=w.maxBufferLength,Math.min(B,w.maxMaxBufferLength)},c.reduceMaxBufferLength=function(E){var w=this.config,B=E||w.maxBufferLength;return w.maxMaxBufferLength>=B?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(E,w){var B,W,T=w.fragments,k=T.length;if(!k)return null;var m=this.config,y=T[0].start,H;if(w.live){var Q=m.initialLiveManifestSize;if(k<Q)return this.warn("Not enough fragments to start playback (have: "+k+", need: "+Q+")"),null;!w.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(w,T),this.startPosition=H?this.hls.liveSyncPosition||H.start:E)}else E<=y&&(H=T[0]);if(!H){var te=m.lowLatencyMode?w.partEnd:w.fragmentEnd;H=this.getFragmentAtPosition(E,te,w)}return(B=H)!==null&&B!==void 0&&B.initSegment&&!((W=H)!==null&&W!==void 0&&W.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},c.getNextPart=function(E,w,B){for(var W=-1,T=!1,k=!0,m=0,y=E.length;m<y;m++){var H=E[m];if(k=k&&!H.independent,W>-1&&B<H.start)break;var Q=H.loaded;!Q&&(T||H.independent||k)&&H.fragment===w&&(W=m),T=Q}return W},c.loadedEndOfParts=function(E,w){var B=E[E.length-1];return B&&w>B.start&&B.loaded},c.getInitialLiveFragment=function(E,w){var B=this.fragPrevious,W=null;if(B){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+B.programDateTime),W=Object(h.findFragmentByPDT)(w,B.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var T=B.sn+1;if(T>=E.startSN&&T<=E.endSN){var k=w[T-E.startSN];B.cc===k.cc&&(W=k,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(h.findFragWithCC)(w,B.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var m=this.hls.liveSyncPosition;m!==null&&(W=this.getFragmentAtPosition(m,this.bitrateTest?E.fragmentEnd:E.edge,E))}return W},c.getFragmentAtPosition=function(E,w,B){var W=this.config,T=this.fragPrevious,k=B.fragments,m=B.endSN,y=B.fragmentHint,H=W.maxFragLookUpTolerance,Q=!!(W.lowLatencyMode&&B.partList&&y);Q&&y&&!this.bitrateTest&&(k=k.concat(y),m=y.sn);var te;if(E<w){var ae=E>w-H?0:H;te=Object(h.findFragmentByPTS)(T,k,E,ae)}else te=k[k.length-1];if(te){var Te=te.sn-B.startSN,_e=T&&te.level===T.level,ge=k[Te+1],ve=this.fragmentTracker.getState(te);if(ve===M.FragmentState.BACKTRACKED){te=null;for(var Oe=Te;k[Oe]&&this.fragmentTracker.getState(k[Oe])===M.FragmentState.BACKTRACKED;)T?te=k[Oe--]:te=k[--Oe];te||(te=ge)}else T&&te.sn===T.sn&&!Q&&(_e&&(te.sn<m&&this.fragmentTracker.getState(ge)!==M.FragmentState.OK?(this.log("SN "+te.sn+" just loaded, load next one: "+ge.sn),te=ge):te=null))}return te},c.synchronizeToLiveEdge=function(E){var w=this.config,B=this.media;if(!B)return;var W=this.hls.liveSyncPosition,T=B.currentTime,k=E.fragments[0].start,m=E.edge,y=T>=k-w.maxFragLookUpTolerance&&T<=m;if(W!==null&&B.duration>W&&(T<W||!y)){var H=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*E.targetduration;(!y&&B.readyState<4||T<m-H)&&(this.loadedmetadata||(this.nextLoadPosition=W),B.readyState&&(this.warn("Playback: "+T.toFixed(3)+" is located too far from the end of live sliding playlist: "+m+", reset currentTime to : "+W.toFixed(3)),B.currentTime=W))}},c.alignPlaylists=function(E,w){var B=this.levels,W=this.levelLastLoaded,T=this.fragPrevious,k=W!==null?B[W]:null,m=E.fragments.length;if(!m)return this.warn("No fragments in live playlist"),0;var y=E.fragments[0].start,H=!w,Q=E.alignedSliding&&Object(z.isFiniteNumber)(y);if(H||!Q&&!y){Object(b.alignStream)(T,k,E);var te=E.fragments[0].start;return this.log("Live playlist sliding: "+te.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+E.startSN+" prev-sn: "+(T?T.sn:"na")+" fragments: "+m),te}return y},c.waitForCdnTuneIn=function(E){var w=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*w)},c.setStartPosition=function(E,w){var B=this.startPosition;if(B<w&&(B=-1),B===-1||this.lastCurrentTime===-1){var W=E.startTimeOffset;Object(z.isFiniteNumber)(W)?(B=w+W,W<0&&(B+=E.totalduration),B=Math.min(Math.max(w,B),w+E.totalduration),this.log("Start time offset "+W+" found in playlist, adjust startPosition to "+B),this.startPosition=B):E.live?B=this.hls.liveSyncPosition||w:this.startPosition=B=0,this.lastCurrentTime=B}this.nextLoadPosition=B},c.getLoadPosition=function(){var E=this.media,w=0;return this.loadedmetadata&&E?w=E.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},c.handleFragLoadAborted=function(E,w){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(w?" part"+w.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},c.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=O.IDLE)},c.onFragmentOrKeyLoadError=function(E,w){if(w.fatal)return;var B=w.frag;if(!B||B.type!==E)return;var W=this.fragCurrent;console.assert(W&&B.sn===W.sn&&B.level===W.level&&B.urlId===W.urlId,"Frag load error must match current frag to retry");var T=this.config;if(this.fragLoadError+1<=T.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(B.level))return;var k=Math.min(Math.pow(2,this.fragLoadError)*T.fragLoadingRetryDelay,T.fragLoadingMaxRetryTimeout);this.warn("Fragment "+B.sn+" of "+E+" "+B.level+" failed to load, retrying in "+k+"ms"),this.retryDate=self.performance.now()+k,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(E===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(K.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},c.afterBufferFlushed=function(E,w,B){if(!E)return;var W=G.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(w,W,B),this.state===O.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},c.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[E].details:null;if(w!=null&&w.live)return this.startPosition=-1,this.setStartPosition(w,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(E,w,B,W){var T=this,k=B.details;console.assert(!!k,"level.details must be defined");var m=Object.keys(E.elementaryStreams).reduce(function(y,H){var Q=E.elementaryStreams[H];if(Q){var te=Q.endPTS-Q.startPTS;if(te<=0)return T.warn("Could not parse fragment "+E.sn+" "+H+" duration reliably ("+te+") resetting transmuxer to fallback to playlist timing"),T.resetTransmuxer(),y||!1;var ae=W?0:Object(o.updateFragPTSDTS)(k,E,Q.startPTS,Q.endPTS,Q.startDTS,Q.endDTS);return T.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:k,level:B,drift:ae,type:H,frag:E,start:Q.startPTS,end:Q.endPTS}),!0}return y},!1);m?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:w})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},D(d,[{key:"state",get:function(){return this._state},set:function(E){var w=this._state;w!==E&&(this._state=E,this.log(w+"->"+E))}}]),d}(I.default)},"./src/controller/buffer-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return h});var z=N("./src/polyfills/number.ts"),I=N("./src/events.ts"),M=N("./src/utils/logger.ts"),G=N("./src/errors.ts"),K=N("./src/utils/buffer-helper.ts"),n=N("./src/utils/mediasource-helper.ts"),L=N("./src/loader/fragment.ts"),x=N("./src/controller/buffer-operation-queue.ts"),f=Object(n.getMediaSource)(),b=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function o(l){var u=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 s=u.hls,i=u.media,D=u.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),i&&(u.updateMediaElementDuration(),s.trigger(I.Events.MEDIA_ATTACHED,{media:i})),D&&D.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var p=o.prototype;return p.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},p.destroy=function(){this.unregisterListeners(),this.details=null},p.registerListeners=function(){var u=this.hls;u.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(I.Events.BUFFER_RESET,this.onBufferReset,this),u.on(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(I.Events.BUFFER_EOS,this.onBufferEos,this),u.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(I.Events.FRAG_PARSED,this.onFragParsed,this),u.on(I.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var u=this.hls;u.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(I.Events.BUFFER_RESET,this.onBufferReset,this),u.off(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(I.Events.BUFFER_EOS,this.onBufferEos,this),u.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(I.Events.FRAG_PARSED,this.onFragParsed,this),u.off(I.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new x.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},p.onManifestParsed=function(u,s){var i=2;(s.audio&&!s.video||!s.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},p.onMediaAttaching=function(u,s){var i=this.media=s.media;if(i&&f){var D=this.mediaSource=new f;D.addEventListener("sourceopen",this._onMediaSourceOpen),D.addEventListener("sourceended",this._onMediaSourceEnded),D.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(D),this._objectUrl=i.src}},p.onMediaDetaching=function(){var u=this.media,s=this.mediaSource,i=this._objectUrl;if(s){if(M.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(D){M.logger.warn("[buffer-controller]: onMediaDetaching: "+D.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(i&&self.URL.revokeObjectURL(i),u.src===i?(u.removeAttribute("src"),u.load()):M.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(I.Events.MEDIA_DETACHED,void 0)},p.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(s){var i=u.sourceBuffer[s];try{i&&(u.removeBufferListeners(s),u.mediaSource&&u.mediaSource.removeSourceBuffer(i),u.sourceBuffer[s]=void 0)}catch(D){M.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",D)}}),this._initSourceBuffer()},p.onBufferCodecs=function(u,s){var i=this,D=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(A){if(D){var S=i.tracks[A];if(S&&typeof S.buffer.changeType=="function"){var R=s[A],O=R.codec,g=R.levelCodec,_=R.container,d=(S.levelCodec||S.codec).replace(b,"$1"),c=(g||O).replace(b,"$1");if(d!==c){var C=_+";codecs="+(g||O);i.appendChangeType(A,C)}}}else i.pendingTracks[A]=s[A]}),D)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},p.appendChangeType=function(u,s){var i=this,D=this.operationQueue,A={execute:function(){var R=i.sourceBuffer[u];R&&(M.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),R.changeType(s)),D.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(R){M.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",R)}};D.append(A,u)},p.onBufferAppending=function(u,s){var i=this,D=this.hls,A=this.operationQueue,S=this.tracks,R=s.data,O=s.type,g=s.frag,_=s.part,d=s.chunkMeta,c=d.buffering[O],C=self.performance.now();c.start=C;var E=g.stats.buffering,w=_?_.stats.buffering:null;E.start===0&&(E.start=C),w&&w.start===0&&(w.start=C);var B=S.audio,W=O==="audio"&&d.id===1&&(B==null?void 0:B.container)==="audio/mpeg",T={execute:function(){if(c.executeStart=self.performance.now(),W){var m=i.sourceBuffer[O];if(m){var y=g.start-m.timestampOffset;Math.abs(y)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+g.start+" (delta: "+y+") sn: "+g.sn+")"),m.timestampOffset=g.start)}}i.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var m=self.performance.now();c.executeEnd=c.end=m,E.first===0&&(E.first=m),w&&w.first===0&&(w.first=m);var y=i.sourceBuffer,H={};for(var Q in y)H[Q]=K.BufferHelper.getBuffered(y[Q]);i.appendError=0,i.hls.trigger(I.Events.BUFFER_APPENDED,{type:O,frag:g,part:_,chunkMeta:d,parent:g.type,timeRanges:H})},onError:function(m){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",m);var y={type:G.ErrorTypes.MEDIA_ERROR,parent:g.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:m,fatal:!1};m.code===DOMException.QUOTA_EXCEEDED_ERR?y.details=G.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,y.details=G.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>D.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+D.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),y.fatal=!0)),D.trigger(I.Events.ERROR,y)}};A.append(T,O)},p.onBufferFlushing=function(u,s){var i=this,D=this.operationQueue,A=function(R){return{execute:i.removeExecutor.bind(i,R,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(I.Events.BUFFER_FLUSHED,{type:R})},onError:function(g){M.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",g)}}};s.type?D.append(A(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){D.append(A(S),S)})},p.onFragParsed=function(u,s){var i=this,D=s.frag,A=s.part,S=[],R=A?A.elementaryStreams:D.elementaryStreams;R[L.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(R[L.ElementaryStreamTypes.AUDIO]&&S.push("audio"),R[L.ElementaryStreamTypes.VIDEO]&&S.push("video"));var O=function(){var _=self.performance.now();D.stats.buffering.end=_,A&&(A.stats.buffering.end=_);var d=A?A.stats:D.stats;i.hls.trigger(I.Events.FRAG_BUFFERED,{frag:D,part:A,stats:d,id:D.type})};S.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+D.type+" level: "+D.level+" sn: "+D.sn),this.blockBuffers(O,S)},p.onFragChanged=function(u,s){this.flushBackBuffer()},p.onBufferEos=function(u,s){var i=this,D=this.getSourceBufferTypes().reduce(function(A,S){var R=i.sourceBuffer[S];return(!s.type||s.type===S)&&(R&&!R.ended&&(R.ended=!0,M.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),A&&!!(!R||R.ended)},!0);D&&this.blockBuffers(function(){var A=i.mediaSource;if(!A||A.readyState!=="open")return;A.endOfStream()})},p.onLevelUpdated=function(u,s){var i=s.details;if(!i.fragments.length)return;this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},p.flushBackBuffer=function(){var u=this.hls,s=this.details,i=this.media,D=this.sourceBuffer;if(!i||s===null)return;var A=this.getSourceBufferTypes();if(!A.length)return;var S=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(z.isFiniteNumber)(S)||S<0)return;var R=i.currentTime,O=s.levelTargetDuration,g=Math.max(S,O),_=Math.floor(R/O)*O-g;A.forEach(function(d){var c=D[d];if(c){var C=K.BufferHelper.getBuffered(c);C.length>0&&_>C.start(0)&&(u.trigger(I.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),s.live&&u.trigger(I.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),u.trigger(I.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:d}))}})},p.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,s=this.hls,i=this.media,D=this.mediaSource,A=u.fragments[0].start+u.totalduration,S=i.duration,R=Object(z.isFiniteNumber)(D.duration)?D.duration:0;u.live&&s.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),D.duration=Infinity,this.updateSeekableRange(u)):(A>R&&A>S||!Object(z.isFiniteNumber)(S))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+A.toFixed(3)),D.duration=A)},p.updateSeekableRange=function(u){var s=this.mediaSource,i=u.fragments,D=i.length;if(D&&u.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var A=Math.max(0,i[0].start),S=Math.max(A,A+u.totalduration);s.setLiveSeekableRange(A,S)}},p.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,s=this.operationQueue,i=this.pendingTracks,D=Object.keys(i).length;if(D&&!u||D===2){this.createSourceBuffers(i),this.pendingTracks={};var A=this.getSourceBufferTypes();if(A.length===0){this.hls.trigger(I.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}A.forEach(function(S){s.executeNext(S)})}},p.createSourceBuffers=function(u){var s=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var D=0;for(var A in u)if(!s[A]){var S=u[A];if(!S)throw Error("source buffer exists for track "+A+", however track does not");var R=S.levelCodec||S.codec,O=S.container+";codecs="+R;M.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var g=s[A]=i.addSourceBuffer(O),_=A;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[A]={buffer:g,codec:R,container:S.container,levelCodec:S.levelCodec,id:S.id},D++}catch(d){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+d.message),this.hls.trigger(I.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,mimeType:O})}}D&&this.hls.trigger(I.Events.BUFFER_CREATED,{tracks:this.tracks})},p._onSBUpdateStart=function(u){var s=this.operationQueue,i=s.current(u);i.onStart()},p._onSBUpdateEnd=function(u){var s=this.operationQueue,i=s.current(u);i.onComplete(),s.shiftAndExecuteNext(u)},p._onSBUpdateError=function(u,s){M.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(I.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(u);i&&i.onError(s)},p.removeExecutor=function(u,s,i){var D=this.media,A=this.mediaSource,S=this.operationQueue,R=this.sourceBuffer,O=R[u];if(!D||!A||!O){M.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var g=Object(z.isFiniteNumber)(D.duration)?D.duration:Infinity,_=Object(z.isFiniteNumber)(A.duration)?A.duration:Infinity,d=Math.max(0,s),c=Math.min(i,g,_);c>d?(M.logger.log("[buffer-controller]: Removing ["+d+","+c+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(d,c)):S.shiftAndExecuteNext(u)},p.appendExecutor=function(u,s){var i=this.operationQueue,D=this.sourceBuffer,A=D[s];if(!A){M.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(s);return}A.ended=!1,console.assert(!A.updating,s+" sourceBuffer must not be updating"),A.appendBuffer(u)},p.blockBuffers=function(u,s){var i=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var D=this.operationQueue,A=s.map(function(S){return D.appendBlocker(S)});Promise.all(A).then(function(){u(),s.forEach(function(S){var R=i.sourceBuffer[S];(!R||!R.updating)&&D.shiftAndExecuteNext(S)})})},p.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},p.addBufferListener=function(u,s,i){var D=this.sourceBuffer[u];if(!D)return;var A=i.bind(this,u);this.listeners[u].push({event:s,listener:A}),D.addEventListener(s,A)},p.removeBufferListeners=function(u){var s=this.sourceBuffer[u];if(!s)return;this.listeners[u].forEach(function(i){s.removeEventListener(i.event,i.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return I});var z=N("./src/utils/logger.ts"),I=function(){function M(K){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=K}var G=M.prototype;return G.append=function(n,L){var x=this.queues[L];x.push(n),x.length===1&&this.buffers[L]&&this.executeNext(L)},G.insertAbort=function(n,L){var x=this.queues[L];x.unshift(n),this.executeNext(L)},G.appendBlocker=function(n){var L,x=new Promise(function(b){L=b}),f={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,n),x},G.executeNext=function(n){var L=this.buffers,x=this.queues,f=L[n],b=x[n];if(b.length){var h=b[0];try{h.execute()}catch(o){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(o),(!f||!f.updating)&&(b.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},M}()},"./src/controller/cap-level-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts");function I(K,n){for(var L=0;L<n.length;L++){var x=n[L];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(K,x.key,x)}}function M(K,n,L){return n&&I(K.prototype,n),L&&I(K,L),K}var G=function(){function K(L){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=L,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var n=K.prototype;return n.setStreamController=function(x){this.streamController=x},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var x=this.hls;x.on(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),x.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),x.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.on(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),x.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var x=this.hls;x.off(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),x.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),x.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),x.off(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),x.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(x,f){K.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},n.onMediaAttaching=function(x,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},n.onManifestParsed=function(x,f){var b=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,b.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onBufferCodecs=function(x,f){var b=this.hls;b.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var x=this.hls.levels;if(x.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(x.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},n.getMaxLevel=function(x){var f=this,b=this.hls.levels;if(!b.length)return-1;var h=b.filter(function(o,p){return K.isLevelAllowed(p,f.restrictedLevels)&&p<=x});return this.clientRect=null,K.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},n.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()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var x=this.media,f={width:0,height:0};if(x){var b=x.getBoundingClientRect();f.width=b.width,f.height=b.height,!f.width&&!f.height&&(f.width=b.right-b.left||x.width||0,f.height=b.bottom-b.top||x.height||0)}return this.clientRect=f,f},K.isLevelAllowed=function(x,f){return f===void 0&&(f=[]),f.indexOf(x)===-1},K.getMaxLevelByMediaSize=function(x,f,b){if(!x||!x.length)return-1;for(var h=function(s,i){return i?s.width!==i.width||s.height!==i.height:!0},o=x.length-1,p=0;p<x.length;p+=1){var l=x[p];if((l.width>=f||l.height>=b)&&h(l,x[p+1])){o=p;break}}return o},M(K,[{key:"mediaWidth",get:function(){return this.getDimensions().width*K.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*K.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var x=1;try{x=self.devicePixelRatio}catch(f){}return x}}]),K}();Y.default=G},"./src/controller/cmcd-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return h});var z=N("./src/events.ts"),I=N("./src/types/cmcd.ts"),M=N("./src/utils/buffer-helper.ts"),G=N("./src/utils/logger.ts");function K(o,p){for(var l=0;l<p.length;l++){var u=p[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function n(o,p,l){return p&&K(o.prototype,p),l&&K(o,l),o}function L(o,p){var l=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(l)return(l=l.call(o)).next.bind(l);if(Array.isArray(o)||(l=x(o))||p&&o&&typeof o.length=="number"){l&&(o=l);var u=0;return function(){return u>=o.length?{done:!0}:{done:!1,value:o[u++]}}}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 x(o,p){if(!o)return;if(typeof o=="string")return f(o,p);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return f(o,p)}function f(o,p){(p==null||p>o.length)&&(p=o.length);for(var l=0,u=new Array(p);l<p;l++)u[l]=o[l];return u}function b(){return b=Object.assign||function(o){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(o[u]=l[u])}return o},b.apply(this,arguments)}var h=function(){function o(l){var u=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(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(D){try{u.apply(D,{ot:I.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(A){G.logger.warn("Could not generate manifest CMCD data.",A)}},this.applyFragmentData=function(D){try{var A=D.frag,S=u.hls.levels[A.level],R=u.getObjectType(A),O={d:A.duration*1e3,ot:R};(R===I.CMCDObjectType.VIDEO||R===I.CMCDObjectType.AUDIO||R==I.CMCDObjectType.MUXED)&&(O.br=S.bitrate/1e3,O.tb=u.getTopBandwidth(R),O.bl=u.getBufferLength(R)),u.apply(D,O)}catch(g){G.logger.warn("Could not generate segment CMCD data.",g)}},this.hls=l;var s=this.config=l.config,i=s.cmcd;i!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||o.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}var p=o.prototype;return p.registerListeners=function(){var u=this.hls;u.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this)},p.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},p.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},p.onMediaAttached=function(u,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},p.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},p.onBufferCreated=function(u,s){var i,D;this.audioBuffer=(i=s.tracks.audio)===null||i===void 0?void 0:i.buffer,this.videoBuffer=(D=s.tracks.video)===null||D===void 0?void 0:D.buffer},p.createData=function(){var u;return{v:I.CMCDVersion,sf:I.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},p.apply=function(u,s){s===void 0&&(s={}),b(s,this.createData());var i=s.ot===I.CMCDObjectType.INIT||s.ot===I.CMCDObjectType.VIDEO||s.ot===I.CMCDObjectType.MUXED;if(this.starved&&i&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var D=o.toHeaders(s);if(!Object.keys(D).length)return;u.headers||(u.headers={}),b(u.headers,D)}else{var A=o.toQuery(s);if(!A)return;u.url=o.appendQueryToUri(u.url,A)}},p.getObjectType=function(u){var s=u.type;return s==="subtitle"?I.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?I.CMCDObjectType.INIT:s==="audio"?I.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?I.CMCDObjectType.VIDEO:I.CMCDObjectType.MUXED:void 0},p.getTopBandwidth=function(u){for(var s=0,i=u===I.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,D=L(i),A;!(A=D()).done;){var S=A.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},p.getBufferLength=function(u){var s=this.hls.media,i=u===I.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!s)return NaN;var D=M.BufferHelper.bufferInfo(i,s.currentTime,this.config.maxBufferHole);return D.len*1e3},p.createPlaylistLoader=function(){var u=this.config.pLoader,s=this.applyPlaylistData,i=u||this.config.loader;return function(){function D(S){this.loader=void 0,this.loader=new i(S)}var A=D.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(R,O,g){s(R),this.loader.load(R,O,g)},n(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},p.createFragmentLoader=function(){var u=this.config.fLoader,s=this.applyFragmentData,i=u||this.config.loader;return function(){function D(S){this.loader=void 0,this.loader=new i(S)}var A=D.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(R,O,g){s(R),this.loader.load(R,O,g)},n(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},o.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},o.serialize=function(u){for(var s=[],i=function(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},D=function(W){return Math.round(W)},A=function(W){return D(W/100)*100},S=function(W){return encodeURIComponent(W)},R={br:D,d:D,bl:A,dl:A,mtp:A,nor:S,rtp:A,tb:D},O=Object.keys(u||{}).sort(),g=L(O),_;!(_=g()).done;){var d=_.value,c=u[d];if(!i(c))continue;if(d==="v"&&c===1)continue;if(d=="pr"&&c===1)continue;var C=R[d];C&&(c=C(c));var E=typeof c,w=void 0;d==="ot"||d==="sf"||d==="st"?w=d+"="+c:E==="boolean"?w=d:E==="number"?w=d+"="+c:w=d+"="+JSON.stringify(c),s.push(w)}return s.join(",")},o.toHeaders=function(u){for(var s=Object.keys(u),i={},D=["Object","Request","Session","Status"],A=[{},{},{},{}],S={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},R=0,O=s;R<O.length;R++){var g=O[R],_=S[g]!=null?S[g]:1;A[_][g]=u[g]}for(var d=0;d<A.length;d++){var c=o.serialize(A[d]);c&&(i["CMCD-"+D[d]]=c)}return i},o.toQuery=function(u){return"CMCD="+encodeURIComponent(o.serialize(u))},o.appendQueryToUri=function(u,s){if(!s)return u;var i=u.includes("?")?"&":"?";return""+u+i+s},o}()},"./src/controller/eme-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),I=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),G=N("./src/utils/mediakeys-helper.ts");function K(h,o){for(var p=0;p<o.length;p++){var l=o[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function n(h,o,p){return o&&K(h.prototype,o),p&&K(h,p),h}var L=3,x=function(o,p,l){var u={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(s){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:l.audioRobustness||""})}),p.forEach(function(s){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:l.videoRobustness||""})}),[u]},f=function(o,p,l,u){switch(o){case G.KeySystems.WIDEVINE:return x(p,l,u);default:throw new Error("Unknown key-system: "+o)}},b=function(){function h(p){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=p,this._config=p.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 o=h.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(l){switch(l){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},o._attemptKeySystemAccess=function(l,u,s){var i=this,D=f(l,u,s,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var A=this.requestMediaKeySystemAccess(l,D);this.mediaKeysPromise=A.then(function(S){return i._onMediaKeySystemAccessObtained(l,S)}),A.catch(function(S){M.logger.error('Failed to obtain key-system "'+l+'" access:',S)})},o._onMediaKeySystemAccessObtained=function(l,u){var s=this;M.logger.log('Access for key-system "'+l+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:l};this._mediaKeysList.push(i);var D=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(A){return i.mediaKeys=A,M.logger.log('Media-keys created for key-system "'+l+'"'),s._onMediaKeysCreated(),A});return D.catch(function(A){M.logger.error("Failed to create media-keys:",A)}),D},o._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),l._onNewMediaKeySession(u.mediaKeysSession))})},o._onNewMediaKeySession=function(l){var u=this;M.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(s){u._onKeySessionMessage(l,s.message)},!1)},o._onKeySessionMessage=function(l,u){M.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(s){M.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),l.update(s)})},o.onMediaEncrypted=function(l){var u=this;if(M.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(D){if(!u._media)return;u._attemptSetMediaKeys(D),u._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(s).catch(s)},o._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(l,u){var s=this,i=this._mediaKeysList[0];if(!i){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(i.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var D=i.mediaKeysSession;if(!D){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+l+'" init data type'),i.mediaKeysSessionInitialized=!0,D.generateRequest(l,u).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(A){M.logger.error("Error generating key-session request:",A),s.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(l,u,s){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,l,u,s);var D=this._licenseXhrSetup;if(D)try{D.call(this.hls,i,l),D=void 0}catch(A){M.logger.error(A)}try{i.readyState||i.open("POST",l,!0),D&&D.call(this.hls,i,l)}catch(A){throw new Error("issue setting up KeySystem license XHR "+A)}return i},o._onLicenseRequestReadyStageChange=function(l,u,s,i){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var D=l.response,A=this._licenseResponseCallback;if(A)try{D=A.call(this.hls,l,u)}catch(R){M.logger.error(R)}i(D)}else{if(M.logger.error("License Request XHR failed ("+u+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>L){this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=L-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,i)}break}},o._generateLicenseRequestChallenge=function(l,u){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},o._requestLicense=function(l,u){M.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(s.mediaKeySystemDomain),D=this._createLicenseXhr(i,l,u);M.logger.log("Sending license request to URL: "+i);var A=this._generateLicenseRequestChallenge(s,l);D.send(A)}catch(S){M.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(l,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var l=this._media,u=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(l,u){if(!this._emeEnabled)return;var s=u.levels.map(function(D){return D.audioCodec}).filter(function(D){return!!D}),i=u.levels.map(function(D){return D.videoCodec}).filter(function(D){return!!D});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,s,i)},n(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();Y.default=b},"./src/controller/fps-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),I=N("./src/utils/logger.ts"),M=function(){function G(n){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=n,this.registerListeners()}var K=G.prototype;return K.setStreamController=function(L){this.streamController=L},K.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},K.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},K.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},K.onMediaAttaching=function(L,x){var f=this.hls.config;if(f.capLevelOnFPSDrop){var b=x.media instanceof self.HTMLVideoElement?x.media:null;this.media=b,b&&typeof b.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},K.checkFPS=function(L,x,f){var b=performance.now();if(x){if(this.lastTime){var h=b-this.lastTime,o=f-this.lastDroppedFrames,p=x-this.lastDecodedFrames,l=1e3*o/h,u=this.hls;if(u.trigger(z.Events.FPS_DROP,{currentDropped:o,currentDecoded:p,totalDroppedFrames:f}),l>0&&o>u.config.fpsDroppedMonitoringThreshold*p){var s=u.currentLevel;I.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=s)&&(s=s-1,u.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:u.currentLevel}),u.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=b,this.lastDroppedFrames=f,this.lastDecodedFrames=x}},K.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var x=L.getVideoPlaybackQuality();this.checkFPS(L,x.totalVideoFrames,x.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},G}();Y.default=M},"./src/controller/fragment-finders.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"findFragmentByPDT",function(){return M}),N.d(Y,"findFragmentByPTS",function(){return G}),N.d(Y,"fragmentWithinToleranceTest",function(){return K}),N.d(Y,"pdtWithinToleranceTest",function(){return n}),N.d(Y,"findFragWithCC",function(){return L});var z=N("./src/polyfills/number.ts"),I=N("./src/utils/binary-search.ts");function M(x,f,b){if(f===null||!Array.isArray(x)||!x.length||!Object(z.isFiniteNumber)(f))return null;var h=x[0].programDateTime;if(f<(h||0))return null;var o=x[x.length-1].endProgramDateTime;if(f>=(o||0))return null;b=b||0;for(var p=0;p<x.length;++p){var l=x[p];if(n(f,b,l))return l}return null}function G(x,f,b,h){b===void 0&&(b=0),h===void 0&&(h=0);var o=null;if(x?o=f[x.sn-f[0].sn+1]||null:b===0&&f[0].start===0&&(o=f[0]),o&&K(b,h,o)===0)return o;var p=I.default.search(f,K.bind(null,b,h));return p||o}function K(x,f,b){x===void 0&&(x=0),f===void 0&&(f=0);var h=Math.min(f,b.duration+(b.deltaPTS?b.deltaPTS:0));return b.start+b.duration-h<=x?1:b.start-h>x&&b.start?-1:0}function n(x,f,b){var h=Math.min(f,b.duration+(b.deltaPTS?b.deltaPTS:0))*1e3,o=b.endProgramDateTime||0;return o-h>x}function L(x,f){return I.default.search(x,function(b){return b.cc<f?1:b.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"FragmentState",function(){return M}),N.d(Y,"FragmentTracker",function(){return G});var z=N("./src/events.ts"),I=N("./src/types/loader.ts"),M;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(M||(M={}));var G=function(){function L(f){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=f,this._registerListeners()}var x=L.prototype;return x._registerListeners=function(){var b=this.hls;b.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),b.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),b.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},x._unregisterListeners=function(){var b=this.hls;b.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),b.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),b.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},x.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},x.getAppendedFrag=function(b,h){if(h===I.PlaylistLevelType.MAIN){var o=this.activeFragment,p=this.activeParts;if(!o)return null;if(p)for(var l=p.length;l--;){var u=p[l],s=u?u.end:o.appendedPTS;if(u.start<=b&&s!==void 0&&b<=s)return l>9&&(this.activeParts=p.slice(l-9)),u}else if(o.start<=b&&o.appendedPTS!==void 0&&b<=o.appendedPTS)return o}return this.getBufferedFrag(b,h)},x.getBufferedFrag=function(b,h){for(var o=this.fragments,p=Object.keys(o),l=p.length;l--;){var u=o[p[l]];if((u==null?void 0:u.body.type)===h&&u.buffered){var s=u.body;if(s.start<=b&&b<=s.end)return s}}return null},x.detectEvictedFragments=function(b,h,o){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(!u.buffered){u.body.type===o&&p.removeFragment(u.body);return}var s=u.range[b];if(!s)return;s.time.some(function(i){var D=!p.isTimeBuffered(i.startPTS,i.endPTS,h);return D&&p.removeFragment(u.body),D})})},x.detectPartialFragments=function(b){var h=this,o=this.timeRanges,p=b.frag,l=b.part;if(!o||p.sn==="initSegment")return;var u=n(p),s=this.fragments[u];if(!s)return;Object.keys(o).forEach(function(i){var D=p.elementaryStreams[i];if(!D)return;var A=o[i],S=l!==null||D.partial===!0;s.range[i]=h.getBufferedTimes(p,l,S,A)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},x.fragBuffered=function(b){var h=n(b),o=this.fragments[h];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},x.getBufferedTimes=function(b,h,o,p){for(var l={time:[],partial:o},u=h?h.start:b.start,s=h?h.end:b.end,i=b.minEndPTS||s,D=b.maxStartPTS||u,A=0;A<p.length;A++){var S=p.start(A)-this.bufferPadding,R=p.end(A)+this.bufferPadding;if(D>=S&&i<=R){l.time.push({startPTS:Math.max(u,p.start(A)),endPTS:Math.min(s,p.end(A))});break}else if(u<R&&s>S)l.partial=!0,l.time.push({startPTS:Math.max(u,p.start(A)),endPTS:Math.min(s,p.end(A))});else if(s<=S)break}return l},x.getPartialFragment=function(b){var h=null,o,p,l,u=0,s=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(D){var A=i[D];if(!A)return;K(A)&&(p=A.body.start-s,l=A.body.end+s,b>=p&&b<=l&&(o=Math.min(b-p,l-b),u<=o&&(h=A.body,u=o)))}),h},x.getState=function(b){var h=n(b),o=this.fragments[h];return o?o.buffered?K(o)?M.PARTIAL:M.OK:o.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},x.backtrack=function(b,h){var o=n(b),p=this.fragments[o];if(!p||p.backtrack)return null;var l=p.backtrack=h||p.loaded;return p.loaded=null,l},x.getBacktrackData=function(b){var h=n(b),o=this.fragments[h];if(o){var p,l=o.backtrack;if(l!=null&&(p=l.payload)!==null&&p!==void 0&&p.byteLength)return l;this.removeFragment(b)}return null},x.isTimeBuffered=function(b,h,o){for(var p,l,u=0;u<o.length;u++){if(p=o.start(u)-this.bufferPadding,l=o.end(u)+this.bufferPadding,b>=p&&h<=l)return!0;if(h<=p)return!1}return!1},x.onFragLoaded=function(b,h){var o=h.frag,p=h.part;if(o.sn==="initSegment"||o.bitrateTest||p)return;var l=n(o);this.fragments[l]={body:o,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},x.onBufferAppended=function(b,h){var o=this,p=h.frag,l=h.part,u=h.timeRanges;if(p.type===I.PlaylistLevelType.MAIN)if(this.activeFragment=p,l){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(l)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(i){var D=u[i];if(o.detectEvictedFragments(i,D),!l)for(var A=0;A<D.length;A++)p.appendedPTS=Math.max(D.end(A),p.appendedPTS||0)})},x.onFragBuffered=function(b,h){this.detectPartialFragments(h)},x.hasFragment=function(b){var h=n(b);return!!this.fragments[h]},x.removeFragmentsInRange=function(b,h,o){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(u.buffered){var s=u.body;s.type===o&&s.start<h&&s.end>b&&p.removeFragment(s)}})},x.removeFragment=function(b){var h=n(b);b.stats.loaded=0,b.clearElementaryStreamInfo(),delete this.fragments[h]},x.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function K(L){var x,f;return L.buffered&&(((x=L.range.video)===null||x===void 0?void 0:x.partial)||((f=L.range.audio)===null||f===void 0?void 0:f.partial))}function n(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return K}),N.d(Y,"MAX_START_GAP_JUMP",function(){return n}),N.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),N.d(Y,"SKIP_BUFFER_RANGE_START",function(){return x}),N.d(Y,"default",function(){return f});var z=N("./src/utils/buffer-helper.ts"),I=N("./src/errors.ts"),M=N("./src/events.ts"),G=N("./src/utils/logger.ts"),K=250,n=2,L=.1,x=.05,f=function(){function b(o,p,l,u){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=o,this.media=p,this.fragmentTracker=l,this.hls=u}var h=b.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(p){var l=this.config,u=this.media,s=this.stalled,i=u.currentTime,D=u.seeking,A=this.seeking&&!D,S=!this.seeking&&D;if(this.seeking=D,i!==p){if(this.moved=!0,s!==null){if(this.stallReported){var R=self.performance.now()-s;G.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||A)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!z.BufferHelper.getBuffered(u).length)return;var O=z.BufferHelper.bufferInfo(u,i,0),g=O.len>0,_=O.nextStart||0;if(!g&&!_)return;if(D){var d=O.len>n,c=!_||_-i>n&&!this.fragmentTracker.getPartialFragment(i);if(d||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(_,O.start||0)-i,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=w==null||((C=w.details)===null||C===void 0)?void 0:C.live,W=B?w.details.targetduration*2:n;if(E>0&&E<=W){this._trySkipBufferHole(null);return}}var T=self.performance.now();if(s===null){this.stalled=T;return}var k=T-s;!D&&k>=K&&this._reportStall(O.len);var m=z.BufferHelper.bufferInfo(u,i,l.maxBufferHole);this._tryFixBufferStall(m,k)},h._tryFixBufferStall=function(p,l){var u=this.config,s=this.fragmentTracker,i=this.media,D=i.currentTime,A=s.getPartialFragment(D);if(A){var S=this._trySkipBufferHole(A);if(S)return}p.len>u.maxBufferHole&&l>u.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(p){var l=this.hls,u=this.media,s=this.stallReported;s||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+p+")"),l.trigger(M.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},h._trySkipBufferHole=function(p){for(var l=this.config,u=this.hls,s=this.media,i=s.currentTime,D=0,A=z.BufferHelper.getBuffered(s),S=0;S<A.length;S++){var R=A.start(S);if(i+l.maxBufferHole>=D&&i<R){var O=Math.max(R+x,s.currentTime+L);return G.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+O),this.moved=!0,this.stalled=null,s.currentTime=O,p&&u.trigger(M.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+O,frag:p}),O}D=A.end(S)}return 0},h._tryNudgeBuffer=function(){var p=this.config,l=this.hls,u=this.media,s=u.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<p.nudgeMaxRetry){var D=s+i*p.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+s+" to "+D),u.currentTime=D,l.trigger(M.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+p.nudgeMaxRetry+" nudges"),l.trigger(M.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},b}()},"./src/controller/id3-track-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),I=N("./src/utils/texttrack-utils.ts"),M=N("./src/demux/id3.ts"),G=.25,K=function(){function n(x){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=x,this._registerListeners()}var L=n.prototype;return L.destroy=function(){this._unregisterListeners()},L._registerListeners=function(){var f=this.hls;f.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L._unregisterListeners=function(){var f=this.hls;f.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},L.onMediaAttached=function(f,b){this.media=b.media},L.onMediaDetaching=function(){if(!this.id3Track)return;Object(I.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},L.getID3Track=function(f){if(!this.media)return;for(var b=0;b<f.length;b++){var h=f[b];if(h.kind==="metadata"&&h.label==="id3")return Object(I.sendAddTrackEvent)(h,this.media),h}return this.media.addTextTrack("metadata","id3")},L.onFragParsingMetadata=function(f,b){if(!this.media)return;var h=b.frag,o=b.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var p=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<o.length;l++){var u=M.getID3Frames(o[l].data);if(u){var s=o[l].pts,i=l<o.length-1?o[l+1].pts:h.end,D=i-s;D<=0&&(i=s+G);for(var A=0;A<u.length;A++){var S=u[A];if(!M.isTimeStampFrame(S)){var R=new p(s,i,"");R.value=S,this.id3Track.addCue(R)}}}}},L.onBufferFlushing=function(f,b){var h=b.startOffset,o=b.endOffset,p=b.type;if(!p||p==="audio"){var l=this.id3Track;l&&Object(I.removeCuesInRange)(l,h,o)}},n}();Y.default=K},"./src/controller/latency-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var z=N("./src/errors.ts"),I=N("./src/events.ts"),M=N("./src/utils/logger.ts");function G(L,x){for(var f=0;f<x.length;f++){var b=x[f];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(L,b.key,b)}}function K(L,x,f){return x&&G(L.prototype,x),f&&G(L,f),L}var n=function(){function L(f){var b=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 b.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var x=L.prototype;return x.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},x.registerListeners=function(){this.hls.on(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(I.Events.ERROR,this.onError,this)},x.unregisterListeners=function(){this.hls.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(I.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(I.Events.ERROR,this.onError)},x.onMediaAttached=function(b,h){this.media=h.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},x.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},x.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},x.onLevelUpdated=function(b,h){var o=h.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},x.onError=function(b,h){if(h.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},x.timeupdate=function(){var b=this.media,h=this.levelDetails;if(!b||!h)return;this.currentTime=b.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var p=this.config,l=p.lowLatencyMode,u=p.maxLiveSyncPlaybackRate;if(!l||u===1)return;var s=this.targetLatency;if(s===null)return;var i=o-s,D=Math.min(this.maxLatency,s+h.targetduration),A=i<D;if(h.live&&A&&i>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),R=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;b.playbackRate=Math.min(S,Math.max(1,R))}else b.playbackRate!==1&&b.playbackRate!==0&&(b.playbackRate=1)},x.estimateLiveEdge=function(){var b=this.levelDetails;return b===null?null:b.edge+b.age},x.computeLatency=function(){var b=this.estimateLiveEdge();return b===null?null:b-this.currentTime},K(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var b=this.config,h=this.levelDetails;return b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:h?b.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var b=this.levelDetails;if(b===null)return null;var h=b.holdBack,o=b.partHoldBack,p=b.targetduration,l=this.config,u=l.liveSyncDuration,s=l.liveSyncDurationCount,i=l.lowLatencyMode,D=this.hls.userConfig,A=i&&o||h;(D.liveSyncDuration||D.liveSyncDurationCount||A===0)&&(A=u!==void 0?u:s*p);var S=p,R=1;return A+Math.min(this.stallCount*R,S)}},{key:"liveSyncPosition",get:function(){var b=this.estimateLiveEdge(),h=this.targetLatency,o=this.levelDetails;if(b===null||h===null||o===null)return null;var p=o.edge,l=b-h-this.edgeStalled,u=p-o.totalduration,s=p-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(u,l),s)}},{key:"drift",get:function(){var b=this.levelDetails;return b===null?1:b.drift}},{key:"edgeStalled",get:function(){var b=this.levelDetails;if(b===null)return 0;var h=(this.config.lowLatencyMode&&b.partTarget||b.targetduration)*3;return Math.max(b.age-h,0)}},{key:"forwardBufferLength",get:function(){var b=this.media,h=this.levelDetails;if(!b||!h)return 0;var o=b.buffered.length;return o?b.buffered.end(o-1):h.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return l});var z=N("./src/types/level.ts"),I=N("./src/events.ts"),M=N("./src/errors.ts"),G=N("./src/utils/codecs.ts"),K=N("./src/controller/level-helper.ts"),n=N("./src/controller/base-playlist-controller.ts"),L=N("./src/types/loader.ts");function x(){return x=Object.assign||function(u){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var D in i)Object.prototype.hasOwnProperty.call(i,D)&&(u[D]=i[D])}return u},x.apply(this,arguments)}function f(u,s){for(var i=0;i<s.length;i++){var D=s[i];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(u,D.key,D)}}function b(u,s,i){return s&&f(u.prototype,s),i&&f(u,i),u}function h(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,o(u,s)}function o(u,s){return o=Object.setPrototypeOf||function(D,A){return D.__proto__=A,D},o(u,s)}var p=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(u){h(s,u);function s(D){var A;return A=u.call(this,D,"[level-controller]")||this,A._levels=[],A._firstLevel=-1,A._startLevel=void 0,A.currentLevelIndex=-1,A.manualLevelIndex=-1,A.onParsedComplete=void 0,A._registerListeners(),A}var i=s.prototype;return i._registerListeners=function(){var A=this.hls;A.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),A.on(I.Events.ERROR,this.onError,this)},i._unregisterListeners=function(){var A=this.hls;A.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),A.off(I.Events.ERROR,this.onError,this)},i.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},i.startLoad=function(){var A=this._levels;A.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},i.onManifestLoaded=function(A,S){var R=[],O=[],g=[],_,d={},c,C=!1,E=!1,w=!1;if(S.levels.forEach(function(k){var m=k.attrs;C=C||!!(k.width&&k.height),E=E||!!k.videoCodec,w=w||!!k.audioCodec,p&&k.audioCodec&&k.audioCodec.indexOf("mp4a.40.34")!==-1&&(k.audioCodec=void 0);var y=k.bitrate+"-"+k.attrs.RESOLUTION+"-"+k.attrs.CODECS;c=d[y],c?c.url.push(k.url):(c=new z.Level(k),d[y]=c,R.push(c)),m&&(m.AUDIO&&Object(K.addGroupId)(c,"audio",m.AUDIO),m.SUBTITLES&&Object(K.addGroupId)(c,"text",m.SUBTITLES))}),(C||E)&&w&&(R=R.filter(function(k){var m=k.videoCodec,y=k.width,H=k.height;return!!m||!!(y&&H)})),R=R.filter(function(k){var m=k.audioCodec,y=k.videoCodec;return(!m||Object(G.isCodecSupportedInMp4)(m,"audio"))&&(!y||Object(G.isCodecSupportedInMp4)(y,"video"))}),S.audioTracks&&(O=S.audioTracks.filter(function(k){return!k.audioCodec||Object(G.isCodecSupportedInMp4)(k.audioCodec,"audio")}),Object(K.assignTrackIdsByGroup)(O)),S.subtitles&&(g=S.subtitles,Object(K.assignTrackIdsByGroup)(g)),R.length>0){_=R[0].bitrate,R.sort(function(k,m){return k.bitrate-m.bitrate}),this._levels=R;for(var B=0;B<R.length;B++)if(R[B].bitrate===_){this._firstLevel=B,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+_);break}var W=w&&!E,T={levels:R,audioTracks:O,subtitleTracks:g,firstLevel:this._firstLevel,stats:S.stats,audio:w,video:E,altAudio:!W&&O.some(function(k){return!!k.url})};this.hls.trigger(I.Events.MANIFEST_PARSED,T),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(I.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},i.onError=function(A,S){if(u.prototype.onError.call(this,A,S),S.fatal)return;var R=S.context,O=this._levels[this.currentLevelIndex];if(R&&(R.type===L.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&R.groupId===O.audioGroupIds[O.urlId]||R.type===L.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&R.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var g=!1,_=!0,d;switch(S.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var c=this._levels[S.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(d=S.frag.level)):d=S.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(_=!1),d=R.level),g=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:d=S.level,g=!0;break}d!==void 0&&this.recoverLevel(S,d,g,_)},i.recoverLevel=function(A,S,R,O){var g=A.details,_=this._levels[S];if(_.loadError++,R){var d=this.retryLoadingOrFail(A);if(d)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var c=_.url.length;if(c>1&&_.loadError<c)A.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var C=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(g+": switch to "+C),A.levelRetry=!0,this.hls.nextAutoLevel=C)}}},i.redundantFailover=function(A){var S=this._levels[A],R=S.url.length;if(R>1){var O=(S.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(g){g.urlId=O}),this.level=A}},i.onFragLoaded=function(A,S){var R=S.frag;if(R!==void 0&&R.type===L.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},i.onLevelLoaded=function(A,S){var R,O=S.level,g=S.details,_=this._levels[O];if(!_){var d;this.warn("Invalid level index "+O),(d=S.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(g.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(O,S,_.details)):(R=S.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(g.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(A,S){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,g=this.hls.audioTracks[S.id].groupId,_=0;_<R.audioGroupIds.length;_++)if(R.audioGroupIds[_]===g){O=_;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},i.loadPlaylist=function(A){var S=this.currentLevelIndex,R=this._levels[S];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,g=R.url[O];if(A)try{g=A.addDirectives(g)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+S+(A?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+O+" "+g),this.clearTimer(),this.hls.trigger(I.Events.LEVEL_LOADING,{url:g,level:S,id:O,deliveryDirectives:A||null})}},i.removeLevel=function(A,S){var R=function(_,d){return d!==S},O=this._levels.filter(function(g,_){return _!==A?!0:g.url.length>1&&S!==void 0?(g.url=g.url.filter(R),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(R)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(R)),g.urlId=0,!0):!1}).map(function(g,_){var d=g.details;return d!=null&&d.fragments&&d.fragments.forEach(function(c){c.level=_}),g});this._levels=O,this.hls.trigger(I.Events.LEVELS_UPDATED,{levels:O})},b(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(A){var S,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===A&&(S=R[A])!==null&&S!==void 0&&S.details)return;if(A<0||A>=R.length){var O=A<0;if(this.hls.trigger(I.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:O,reason:"invalid level idx"}),O)return;A=Math.min(A,R.length-1)}this.clearTimer();var g=this.currentLevelIndex,_=R[g],d=R[A];this.log("switching to level "+A+" from "+g),this.currentLevelIndex=A;var c=x({},d,{level:A,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete c._urlId,this.hls.trigger(I.Events.LEVEL_SWITCHING,c);var C=d.details;if(!C||C.live){var E=this.switchParams(d.uri,_==null?void 0:_.details);this.loadPlaylist(E)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(A){this.manualLevelIndex=A,this._startLevel===void 0&&(this._startLevel=A),A!==-1&&(this.level=A)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(A){this._firstLevel=A}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var A=this.hls.config.startLevel;return A!==void 0?A:this._firstLevel}else return this._startLevel},set:function(A){this._startLevel=A}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(A){this.level=A,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=A)}}]),s}(n.default)},"./src/controller/level-helper.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"addGroupId",function(){return M}),N.d(Y,"assignTrackIdsByGroup",function(){return G}),N.d(Y,"updatePTS",function(){return K}),N.d(Y,"updateFragPTSDTS",function(){return L}),N.d(Y,"mergeDetails",function(){return x}),N.d(Y,"mapPartIntersection",function(){return f}),N.d(Y,"mapFragmentIntersection",function(){return b}),N.d(Y,"adjustSliding",function(){return h}),N.d(Y,"addSliding",function(){return o}),N.d(Y,"computeReloadInterval",function(){return p}),N.d(Y,"getFragmentWithSN",function(){return l}),N.d(Y,"getPartWith",function(){return u});var z=N("./src/polyfills/number.ts"),I=N("./src/utils/logger.ts");function M(s,i,D){switch(i){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(D);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(D);break}}function G(s){var i={};s.forEach(function(D){var A=D.groupId||"";D.id=i[A]=i[A]||0,i[A]++})}function K(s,i,D){var A=s[i],S=s[D];n(A,S)}function n(s,i){var D=i.startPTS;if(Object(z.isFiniteNumber)(D)){var A=0,S;i.sn>s.sn?(A=D-s.start,S=s):(A=s.start-D,S=i),S.duration!==A&&(S.duration=A)}else if(i.sn>s.sn){var R=s.cc===i.cc;R&&s.minEndPTS?i.start=s.start+(s.minEndPTS-s.start):i.start=s.start+s.duration}else i.start=Math.max(s.start-i.duration,0)}function L(s,i,D,A,S,R){var O=A-D;O<=0&&(I.logger.warn("Fragment should have a positive duration",i),A=D+i.duration,R=S+i.duration);var g=D,_=A,d=i.startPTS,c=i.endPTS;if(Object(z.isFiniteNumber)(d)){var C=Math.abs(d-D);Object(z.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(C,i.deltaPTS):i.deltaPTS=C,g=Math.max(D,d),D=Math.min(D,d),S=Math.min(S,i.startDTS),_=Math.min(A,c),A=Math.max(A,c),R=Math.max(R,i.endDTS)}i.duration=A-D;var E=D-i.start;i.appendedPTS=A,i.start=i.startPTS=D,i.maxStartPTS=g,i.startDTS=S,i.endPTS=A,i.minEndPTS=_,i.endDTS=R;var w=i.sn;if(!s||w<s.startSN||w>s.endSN)return 0;var B,W=w-s.startSN,T=s.fragments;for(T[W]=i,B=W;B>0;B--)n(T[B],T[B-1]);for(B=W;B<T.length-1;B++)n(T[B],T[B+1]);return s.fragmentHint&&n(T[T.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,E}function x(s,i){for(var D=null,A=s.fragments,S=A.length-1;S>=0;S--){var R=A[S].initSegment;if(R){D=R;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,g;if(b(s,i,function(B,W){B.relurl&&(O=B.cc-W.cc),Object(z.isFiniteNumber)(B.startPTS)&&Object(z.isFiniteNumber)(B.endPTS)&&(W.start=W.startPTS=B.startPTS,W.startDTS=B.startDTS,W.appendedPTS=B.appendedPTS,W.maxStartPTS=B.maxStartPTS,W.endPTS=B.endPTS,W.endDTS=B.endDTS,W.minEndPTS=B.minEndPTS,W.duration=B.endPTS-B.startPTS,W.duration&&(g=W),i.PTSKnown=i.alignedSliding=!0),W.elementaryStreams=B.elementaryStreams,W.loader=B.loader,W.stats=B.stats,W.urlId=B.urlId,B.initSegment&&(W.initSegment=B.initSegment,D=B.initSegment)}),D){var _=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;_.forEach(function(B){var W;(!B.initSegment||B.initSegment.relurl===((W=D)===null||W===void 0?void 0:W.relurl))&&(B.initSegment=D)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(B){return!B}),i.deltaUpdateFailed)){I.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var d=i.skippedSegments;d--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var c=i.fragments;if(O){I.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<c.length;C++)c[C].cc+=O}i.skippedSegments&&(i.startCC=i.fragments[0].cc),f(s.partList,i.partList,function(B,W){W.elementaryStreams=B.elementaryStreams,W.stats=B.stats}),g?L(i,g,g.startPTS,g.endPTS,g.startDTS,g.endDTS):h(s,i),c.length&&(i.totalduration=i.edge-c[0].start),i.driftStartTime=s.driftStartTime,i.driftStart=s.driftStart;var E=i.advancedDateTime;if(i.advanced&&E){var w=i.edge;i.driftStart||(i.driftStartTime=E,i.driftStart=w),i.driftEndTime=E,i.driftEnd=w}else i.driftEndTime=s.driftEndTime,i.driftEnd=s.driftEnd,i.advancedDateTime=s.advancedDateTime}function f(s,i,D){if(s&&i)for(var A=0,S=0,R=s.length;S<=R;S++){var O=s[S],g=i[S+A];O&&g&&O.index===g.index&&O.fragment.sn===g.fragment.sn?D(O,g):A--}}function b(s,i,D){for(var A=i.skippedSegments,S=Math.max(s.startSN,i.startSN)-i.startSN,R=(s.fragmentHint?1:0)+(A?i.endSN:Math.min(s.endSN,i.endSN))-i.startSN,O=i.startSN-s.startSN,g=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,_=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,d=S;d<=R;d++){var c=_[O+d],C=g[d];A&&!C&&d<A&&(C=i.fragments[d]=c),c&&C&&D(c,C)}}function h(s,i){var D=i.startSN+i.skippedSegments-s.startSN,A=s.fragments;if(D<0||D>=A.length)return;o(i,A[D].start)}function o(s,i){if(i){for(var D=s.fragments,A=s.skippedSegments;A<D.length;A++)D[A].start+=i;s.fragmentHint&&(s.fragmentHint.start+=i)}}function p(s,i){var D=1e3*s.levelTargetDuration,A=D/2,S=s.age,R=S>0&&S<D*3,O=i.loading.end-i.loading.start,g,_=s.availabilityDelay;if(s.updated===!1)if(R){var d=333*s.misses;g=Math.max(Math.min(A,O*2),d),s.availabilityDelay=(s.availabilityDelay||0)+g}else g=A;else R?(_=Math.min(_||D/2,S),s.availabilityDelay=_,g=_+D-S):g=D-O;return Math.round(g)}function l(s,i,D){if(!s||!s.details)return null;var A=s.details,S=A.fragments[i-A.startSN];return S||(S=A.fragmentHint,S&&S.sn===i?S:i<A.startSN&&D&&D.sn===i?D:null)}function u(s,i,D){if(!s||!s.details)return null;var A=s.details.partList;if(A)for(var S=A.length;S--;){var R=A[S];if(R.index===D&&R.fragment.sn===i)return R}return null}},"./src/controller/stream-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return A});var z=N("./src/polyfills/number.ts"),I=N("./src/controller/base-stream-controller.ts"),M=N("./src/is-supported.ts"),G=N("./src/events.ts"),K=N("./src/utils/buffer-helper.ts"),n=N("./src/controller/fragment-tracker.ts"),L=N("./src/types/loader.ts"),x=N("./src/loader/fragment.ts"),f=N("./src/demux/transmuxer-interface.ts"),b=N("./src/types/transmuxer.ts"),h=N("./src/controller/gap-controller.ts"),o=N("./src/errors.ts"),p=N("./src/utils/logger.ts");function l(S,R){for(var O=0;O<R.length;O++){var g=R[O];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(S,g.key,g)}}function u(S,R,O){return R&&l(S.prototype,R),O&&l(S,O),S}function s(S,R){S.prototype=Object.create(R.prototype),S.prototype.constructor=S,i(S,R)}function i(S,R){return i=Object.setPrototypeOf||function(g,_){return g.__proto__=_,g},i(S,R)}var D=100,A=function(S){s(R,S);function R(g,_){var d;return d=S.call(this,g,_,"[stream-controller]")||this,d.audioCodecSwap=!1,d.gapController=null,d.level=-1,d._forceStartLoad=!1,d.altAudio=!1,d.audioOnly=!1,d.fragPlaying=null,d.onvplaying=null,d.onvseeked=null,d.fragLastKbps=0,d.stalled=!1,d.couldBacktrack=!1,d.audioCodecSwitch=!1,d.videoBuffer=null,d._registerListeners(),d}var O=R.prototype;return O._registerListeners=function(){var _=this.hls;_.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),_.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.on(G.Events.ERROR,this.onError,this),_.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),_.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var _=this.hls;_.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.off(G.Events.ERROR,this.onError,this),_.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),_.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(_){if(this.levels){var d=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(D),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=c.startLevel;C===-1&&(c.config.testBandwidth?(C=0,this.bitrateTest=!0):C=c.nextAutoLevel),this.level=c.nextLoadLevel=C,this.loadedmetadata=!1}d>0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),_=d),this.state=I.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=I.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_LEVEL:{var _,d=this.levels,c=this.level,C=d==null||((_=d[c])===null||_===void 0)?void 0:_.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=I.State.IDLE;break}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var E,w=self.performance.now(),B=this.retryDate;(!B||w>=B||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=I.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var _,d,c=this.hls,C=this.levelLastLoaded,E=this.levels,w=this.media,B=c.config,W=c.nextLoadLevel;if(C===null||!w&&(this.startFragRequested||!B.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[W])return;var T=E[W];this.level=c.nextLoadLevel=W;var k=T.details;if(!k||this.state===I.State.WAITING_LEVEL||k.live&&this.levelLastLoaded!==W){this.state=I.State.WAITING_LEVEL;return}var m=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,L.PlaylistLevelType.MAIN);if(m===null)return;var y=m.len,H=this.getMaxBufferLength(T.maxBitrate);if(y>=H)return;if(this._streamEnded(m,k)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,Q),this.state=I.State.ENDED;return}var te=m.end,ae=this.getNextFragment(te,k);if(this.couldBacktrack&&!this.fragPrevious&&ae&&ae.sn!=="initSegment"){var Te=ae.sn-k.startSN;Te>1&&(ae=k.fragments[Te-1],this.fragmentTracker.removeFragment(ae))}if(ae&&this.fragmentTracker.getState(ae)===n.FragmentState.OK&&this.nextLoadPosition>te){var _e=this.audioOnly&&!this.altAudio?x.ElementaryStreamTypes.AUDIO:x.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,_e,L.PlaylistLevelType.MAIN),ae=this.getNextFragment(this.nextLoadPosition,k)}if(!ae)return;ae.initSegment&&!ae.initSegment.data&&!this.bitrateTest&&(ae=ae.initSegment),((_=ae.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((d=ae.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ae,k):this.loadFragment(ae,k,te)},O.loadFragment=function(_,d,c){var C,E=this.fragmentTracker.getState(_);if(this.fragCurrent=_,E===n.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(_);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?_.sn==="initSegment"?this._loadInitSegment(_):this.bitrateTest?(_.bitrateTest=!0,this.log("Fragment "+_.sn+" of level "+_.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(_)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,_,d,c)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(_){var d=this.fragmentTracker.getAppendedFrag(_,L.PlaylistLevelType.MAIN);return d&&"fragment"in d?d.fragment:d},O.getBufferedFrag=function(_){return this.fragmentTracker.getBufferedFrag(_,L.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(_){return _?this.getBufferedFrag(_.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var _=this.levels,d=this.media;if(d!=null&&d.readyState){var c,C=this.getAppendedFrag(d.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!d.paused&&_){var E=this.hls.nextLoadLevel,w=_[E],B=this.fragLastKbps;B&&this.fragCurrent?c=this.fragCurrent.duration*w.maxBitrate/(1e3*B)+1:c=0}else c=0;var W=this.getBufferedFrag(d.currentTime+c);if(W){var T=this.followingBufferedFrag(W);if(T){this.abortCurrentFrag();var k=T.maxStartPTS?T.maxStartPTS:T.start,m=T.duration,y=Math.max(W.end,k+Math.min(Math.max(m-this.config.maxFragLookUpTolerance,m*.5),m*.75));this.flushMainBuffer(y,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===I.State.KEY_LOADING&&(this.state=I.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(_,d){S.prototype.flushMainBuffer.call(this,_,d,this.altAudio?"video":null)},O.onMediaAttached=function(_,d){S.prototype.onMediaAttached.call(this,_,d);var c=d.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,c,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var _=this.media;_&&(_.removeEventListener("playing",this.onvplaying),_.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var _=this.media,d=_?_.currentTime:null;Object(z.isFiniteNumber)(d)&&this.log("Media seeked to "+d.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(_,d){var c=!1,C=!1,E;d.levels.forEach(function(w){E=w.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(c=!0),E.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=c&&C&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=d.levels,this.startFragRequested=!1},O.onLevelLoading=function(_,d){var c=this.levels;if(!c||this.state!==I.State.IDLE)return;var C=c[d.level];(!C.details||C.details.live&&this.levelLastLoaded!==d.level||this.waitForCdnTuneIn(C.details))&&(this.state=I.State.WAITING_LEVEL)},O.onLevelLoaded=function(_,d){var c,C=this.levels,E=d.level,w=d.details,B=w.totalduration;if(!C){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+B);var W=this.fragCurrent;W&&(this.state===I.State.FRAG_LOADING||this.state===I.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==d.level&&W.loader&&(this.state=I.State.IDLE,W.loader.abort()));var T=C[E],k=0;if(w.live||(c=T.details)!==null&&c!==void 0&&c.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;k=this.alignPlaylists(w,T.details)}if(T.details=w,this.levelLastLoaded=E,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:w,level:E}),this.state===I.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=I.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,k),this.tick()},O._handleFragmentLoadProgress=function(_){var d,c=_.frag,C=_.part,E=_.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var B=w[c.level],W=B.details;if(!W){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var T=B.videoCodec,k=W.PTSKnown||!W.live,m=(d=c.initSegment)===null||d===void 0?void 0:d.data,y=this._getAudioCodec(B),H=this.transmuxer=this.transmuxer||new f.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=C?C.index:-1,te=Q!==-1,ae=new b.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,E.byteLength,Q,te),Te=this.initPTS[c.cc];H.push(E,m,y,T,c,C,W.totalduration,k,ae,Te)},O.onAudioTrackSwitching=function(_,d){var c=this.altAudio,C=!!d.url,E=d.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var w=this.fragCurrent;w!=null&&w.loader&&(this.log("Switching to main audio track, cancel main fragment load"),w.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var B=this.hls;c&&B.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),B.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:E})}},O.onAudioTrackSwitched=function(_,d){var c=d.id,C=!!this.hls.audioTracks[c].url;if(C){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=C,this.tick()},O.onBufferCreated=function(_,d){var c=d.tracks,C,E,w=!1;for(var B in c){var W=c[B];if(W.id==="main"){if(E=B,C=W,B==="video"){var T=c[B];T&&(this.videoBuffer=T.buffer)}}else w=!0}w&&C?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(_,d){var c=d.frag,C=d.part;if(c&&c.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(C?" p: "+C.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===I.State.PARSED&&(this.state=I.State.IDLE);return}var E=C?C.stats:c.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,C)},O.onError=function(_,d){switch(d.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,d);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==I.State.ERROR&&(d.fatal?(this.warn(""+d.details),this.state=I.State.ERROR):!d.levelRetry&&this.state===I.State.WAITING_LEVEL&&(this.state=I.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="main"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var c=!0,C=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);C&&C.len>.5&&(c=!this.reduceMaxBufferLength(C.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var _=this.media,d=this.gapController;if(!_||!d||!_.readyState)return;var c=K.BufferHelper.getBuffered(_);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):d.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=I.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(_,d){var c=d.type;if(c!==x.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(c===x.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,c,L.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(_,d){this.levels=d.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var _=this.media,d=_.currentTime,c=this.startPosition;if(c>=0&&d<c){if(_.seeking){p.logger.log("could not seek to "+c+", already seeking at "+d);return}var C=K.BufferHelper.getBuffered(_),E=C.length?C.start(0):0,w=E-c;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(p.logger.log("adjusting start position by "+w+" to match buffer start"),c+=w,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+d),_.currentTime=c}},O._getAudioCodec=function(_){var d=this.config.defaultAudioCodec||_.audioCodec;return this.audioCodecSwap&&d&&(this.log("Swapping audio codec"),d.indexOf("mp4a.40.5")!==-1?d="mp4a.40.2":d="mp4a.40.5"),d},O._loadBitrateTestFrag=function(_){var d=this;this._doFragLoad(_).then(function(c){var C=d.hls;if(!c||C.nextLoadLevel||d.fragContextChanged(_))return;d.fragLoadError=0,d.state=I.State.IDLE,d.startFragRequested=!1,d.bitrateTest=!1;var E=_.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),C.trigger(G.Events.FRAG_LOADED,c)})},O._handleTransmuxComplete=function(_){var d,c="main",C=this.hls,E=_.remuxResult,w=_.chunkMeta,B=this.getCurrentContext(w);if(!B){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(w.level);return}var W=B.frag,T=B.part,k=B.level,m=E.video,y=E.text,H=E.id3,Q=E.initSegment,te=this.altAudio?void 0:E.audio;if(this.fragContextChanged(W))return;if(this.state=I.State.PARSING,Q){Q.tracks&&(this._bufferInitSegment(k,Q.tracks,W,w),C.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:c,tracks:Q.tracks}));var ae=Q.initPTS,Te=Q.timescale;Object(z.isFiniteNumber)(ae)&&(this.initPTS[W.cc]=ae,C.trigger(G.Events.INIT_PTS_FOUND,{frag:W,id:c,initPTS:ae,timescale:Te}))}if(m&&E.independent!==!1){if(k.details){var _e=m.startPTS,ge=m.endPTS,ve=m.startDTS,Oe=m.endDTS;if(T)T.elementaryStreams[m.type]={startPTS:_e,endPTS:ge,startDTS:ve,endDTS:Oe};else if(m.firstKeyFrame&&m.independent&&(this.couldBacktrack=!0),m.dropped&&m.independent){var he=this.getLoadPosition()+this.config.maxBufferHole;if(he<_e){this.backtrack(W);return}W.setElementaryStreamInfo(m.type,W.start,ge,W.start,Oe,!0)}W.setElementaryStreamInfo(m.type,_e,ge,ve,Oe),this.bufferFragmentData(m,W,T,w)}}else if(E.independent===!1){this.backtrack(W);return}if(te){var V=te.startPTS,P=te.endPTS,j=te.startDTS,$=te.endDTS;T&&(T.elementaryStreams[x.ElementaryStreamTypes.AUDIO]={startPTS:V,endPTS:P,startDTS:j,endDTS:$}),W.setElementaryStreamInfo(x.ElementaryStreamTypes.AUDIO,V,P,j,$),this.bufferFragmentData(te,W,T,w)}if(H!=null&&(d=H.samples)!==null&&d!==void 0&&d.length){var J={frag:W,id:c,samples:H.samples};C.trigger(G.Events.FRAG_PARSING_METADATA,J)}if(y){var X={frag:W,id:c,samples:y.samples};C.trigger(G.Events.FRAG_PARSING_USERDATA,X)}},O._bufferInitSegment=function(_,d,c,C){var E=this;if(this.state!==I.State.PARSING)return;this.audioOnly=!!d.audio&&!d.video,this.altAudio&&!this.audioOnly&&delete d.audio;var w=d.audio,B=d.video,W=d.audiovideo;if(w){var T=_.audioCodec,k=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(T&&(T.indexOf("mp4a.40.5")!==-1?T="mp4a.40.2":T="mp4a.40.5"),w.metadata.channelCount!==1&&k.indexOf("firefox")===-1&&(T="mp4a.40.5")),k.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(T="mp4a.40.2",this.log("Android: force audio codec to "+T)),_.audioCodec&&_.audioCodec!==T&&this.log('Swapping manifest audio codec "'+_.audioCodec+'" for "'+T+'"'),w.levelCodec=T,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(T||"")+"/"+(_.audioCodec||"")+"/"+w.codec+"]")}B&&(B.levelCodec=_.videoCodec,B.id="main",this.log("Init video buffer, container:"+B.container+", codecs[level/parsed]=["+(_.videoCodec||"")+"/"+B.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(_.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,d),Object.keys(d).forEach(function(m){var y=d[m],H=y.initSegment;H!=null&&H.byteLength&&E.hls.trigger(G.Events.BUFFER_APPENDING,{type:m,data:H,frag:c,part:null,chunkMeta:C,parent:c.type})}),this.tick()},O.backtrack=function(_){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(_);var d=this.fragmentTracker.backtrack(_);this.fragPrevious=null,this.nextLoadPosition=_.start,d?this.resetFragmentLoading(_):this.state=I.State.BACKTRACKING},O.checkFragmentChanged=function(){var _=this.media,d=null;if(_&&_.readyState>1&&_.seeking===!1){var c=_.currentTime;if(K.BufferHelper.isBuffered(_,c)?d=this.getAppendedFrag(c):K.BufferHelper.isBuffered(_,c+.1)&&(d=this.getAppendedFrag(c+.1)),d){var C=this.fragPlaying,E=d.level;(!C||d.sn!==C.sn||C.level!==E||d.urlId!==C.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:d}),(!C||C.level!==E)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=d)}}},u(R,[{key:"nextLevel",get:function(){var _=this.nextBufferedFrag;return _?_.level:-1}},{key:"currentLevel",get:function(){var _=this.media;if(_){var d=this.getAppendedFrag(_.currentTime);if(d)return d.level}return-1}},{key:"nextBufferedFrag",get:function(){var _=this.media;if(_){var d=this.getAppendedFrag(_.currentTime);return this.followingBufferedFrag(d)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(I.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"SubtitleStreamController",function(){return s});var z=N("./src/events.ts"),I=N("./src/utils/logger.ts"),M=N("./src/utils/buffer-helper.ts"),G=N("./src/controller/fragment-finders.ts"),K=N("./src/utils/discontinuities.ts"),n=N("./src/controller/level-helper.ts"),L=N("./src/controller/fragment-tracker.ts"),x=N("./src/controller/base-stream-controller.ts"),f=N("./src/types/loader.ts"),b=N("./src/types/level.ts");function h(i,D){for(var A=0;A<D.length;A++){var S=D[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(i,S.key,S)}}function o(i,D,A){return D&&h(i.prototype,D),A&&h(i,A),i}function p(i,D){i.prototype=Object.create(D.prototype),i.prototype.constructor=i,l(i,D)}function l(i,D){return l=Object.setPrototypeOf||function(S,R){return S.__proto__=R,S},l(i,D)}var u=500,s=function(i){p(D,i);function D(S,R){var O;return O=i.call(this,S,R,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var A=D.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var R=this.hls;R.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(z.Events.ERROR,this.onError,this),R.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var R=this.hls;R.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(z.Events.ERROR,this.onError,this),R.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.startLoad=function(){this.stopLoad(),this.state=x.State.IDLE,this.setInterval(u),this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},A.onLevelLoaded=function(R,O){this.mainDetails=O.details},A.onSubtitleFragProcessed=function(R,O){var g=O.frag,_=O.success;if(this.fragPrevious=g,this.state=x.State.IDLE,!_)return;var d=this.tracksBuffered[this.currentTrackId];if(!d)return;for(var c,C=g.start,E=0;E<d.length;E++)if(C>=d[E].start&&C<=d[E].end){c=d[E];break}var w=g.start+g.duration;c?c.end=w:(c={start:C,end:w},d.push(c)),this.fragmentTracker.fragBuffered(g)},A.onBufferFlushing=function(R,O){var g=O.startOffset,_=O.endOffset;if(g===0&&_!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,c=this.levels;if(!c.length||!c[d]||!c[d].details)return;var C=c[d].details,E=C.targetduration,w=_-E;if(w<=0)return;O.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(B){for(var W=0;W<B.length;){if(B[W].end<=w){B.shift();continue}else if(B[W].start<w)B[W].start=w;else break;W++}}),this.fragmentTracker.removeFragmentsInRange(g,w,f.PlaylistLevelType.SUBTITLE)}},A.onError=function(R,O){var g,_=O.frag;if(!_||_.type!==f.PlaylistLevelType.SUBTITLE)return;(g=this.fragCurrent)!==null&&g!==void 0&&g.loader&&this.fragCurrent.loader.abort(),this.state=x.State.IDLE},A.onSubtitleTracksUpdated=function(R,O){var g=this,_=O.subtitleTracks;this.tracksBuffered=[],this.levels=_.map(function(d){return new b.Level(d)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(d){g.tracksBuffered[d.id]=[]}),this.mediaBuffer=null},A.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var g=this.levels[this.currentTrackId];g!=null&&g.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,g&&this.setInterval(u)},A.onSubtitleTrackLoaded=function(R,O){var g,_=O.details,d=O.id,c=this.currentTrackId,C=this.levels;if(!C.length)return;var E=C[c];if(d>=C.length||d!==c||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(g=E.details)!==null&&g!==void 0&&g.live){var w=this.mainDetails;if(_.deltaUpdateFailed||!w)return;var B=w.fragments[0];if(!E.details)_.hasProgramDateTime&&w.hasProgramDateTime?Object(K.alignMediaPlaylistByPDT)(_,w):B&&Object(n.addSliding)(_,B.start);else{var W=this.alignPlaylists(_,E.details);W===0&&B&&Object(n.addSliding)(_,B.start)}}if(E.details=_,this.levelLastLoaded=d,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===x.State.IDLE){var T=Object(G.findFragmentByPTS)(null,_.fragments,this.media.currentTime,0);T||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},A._handleFragmentLoadComplete=function(R){var O=R.frag,g=R.payload,_=O.decryptdata,d=this.hls;if(this.fragContextChanged(O))return;if(g&&g.byteLength>0&&_&&_.key&&_.iv&&_.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(g),_.key.buffer,_.iv.buffer).then(function(C){var E=performance.now();d.trigger(z.Events.FRAG_DECRYPTED,{frag:O,payload:C,stats:{tstart:c,tdecrypt:E}})})}},A.doTick=function(){if(!this.media){this.state=x.State.IDLE;return}if(this.state===x.State.IDLE){var R,O=this.currentTrackId,g=this.levels;if(!g.length||!g[O]||!g[O].details)return;var _=g[O].details,d=_.targetduration,c=this.config,C=this.media,E=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-d,c.maxBufferHole),w=E.end,B=E.len,W=this.getMaxBufferLength()+d;if(B>W)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var T=_.fragments,k=T.length,m=_.edge,y,H=this.fragPrevious;if(w<m){var Q=c.maxFragLookUpTolerance;H&&_.hasProgramDateTime&&(y=Object(G.findFragmentByPDT)(T,H.endProgramDateTime,Q)),y||(y=Object(G.findFragmentByPTS)(H,T,w,Q),!y&&H&&H.start<T[0].start&&(y=T[0]))}else y=T[k-1];(R=y)!==null&&R!==void 0&&R.encrypted?(I.logger.log("Loading key for "+y.sn),this.state=x.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:y})):y&&this.fragmentTracker.getState(y)===L.FragmentState.NOT_LOADED&&this.loadFragment(y,_,w)}},A.loadFragment=function(R,O,g){this.fragCurrent=R,i.prototype.loadFragment.call(this,R,O,g)},o(D,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),D}(x.default)},"./src/controller/subtitle-track-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),I=N("./src/utils/texttrack-utils.ts"),M=N("./src/controller/base-playlist-controller.ts"),G=N("./src/types/loader.ts");function K(h,o){for(var p=0;p<o.length;p++){var l=o[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function n(h,o,p){return o&&K(h.prototype,o),p&&K(h,p),h}function L(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,x(h,o)}function x(h,o){return x=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},x(h,o)}var f=function(h){L(o,h);function o(l){var u;return u=h.call(this,l,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var p=o.prototype;return p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,h.prototype.destroy.call(this)},p.registerListeners=function(){var u=this.hls;u.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(z.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(z.Events.ERROR,this.onError,this)},p.onMediaAttached=function(u,s){if(this.media=s.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)},p.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},p.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 u=b(this.media.textTracks);u.forEach(function(s){Object(I.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},p.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},p.onSubtitleTrackLoaded=function(u,s){var i=s.id,D=s.details,A=this.trackId,S=this.tracksInGroup[A];if(!S){this.warn("Invalid subtitle track id "+i);return}var R=S.details;S.details=s.details,this.log("subtitle track "+i+" loaded ["+D.startSN+"-"+D.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,s,R))},p.onLevelLoading=function(u,s){this.switchLevel(s.level)},p.onLevelSwitching=function(u,s){this.switchLevel(s.level)},p.switchLevel=function(u){var s=this.hls.levels[u];if(!(s!=null&&s.textGroupIds))return;var i=s.textGroupIds[s.urlId];if(this.groupId!==i){var D=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,A=this.tracks.filter(function(O){return!i||O.groupId===i});this.tracksInGroup=A;var S=this.findTrackId(D==null?void 0:D.name)||this.findTrackId();this.groupId=i;var R={subtitleTracks:A};this.log("Updating subtitle tracks, "+A.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,R),S!==-1&&this.setSubtitleTrack(S,D)}},p.findTrackId=function(u){for(var s=this.tracksInGroup,i=0;i<s.length;i++){var D=s[i];if((!this.selectDefaultTrack||D.default)&&(!u||u===D.name))return D.id}return-1},p.onError=function(u,s){if(h.prototype.onError.call(this,u,s),s.fatal||!s.context)return;s.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},p.loadPlaylist=function(u){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var i=s.id,D=s.groupId,A=s.url;if(u)try{A=u.addDirectives(A)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(z.Events.SUBTITLE_TRACK_LOADING,{url:A,id:i,groupId:D,deliveryDirectives:u||null})}},p.toggleTrackModes=function(u){var s=this,i=this.media,D=this.subtitleDisplay,A=this.trackId;if(!i)return;var S=b(i.textTracks),R=S.filter(function(_){return _.groupId===s.groupId});if(u===-1)[].slice.call(S).forEach(function(_){_.mode="disabled"});else{var O=R[A];O&&(O.mode="disabled")}var g=R[u];g&&(g.mode=D?"showing":"hidden")},p.setSubtitleTrack=function(u,s){var i,D=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(i=D[u])!==null&&i!==void 0&&i.details)||u<-1||u>=D.length)return;this.clearTimer();var A=D[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,A){var S=A.id,R=A.groupId,O=R===void 0?"":R,g=A.name,_=A.type,d=A.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:O,name:g,type:_,url:d});var c=this.switchParams(A.url,s==null?void 0:s.details);this.loadPlaylist(c)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:u})},p.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=b(this.media.textTracks),i=0;i<s.length;i++)if(s[i].mode==="hidden")u=i;else if(s[i].mode==="showing"){u=i;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},n(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,s)}}]),o}(M.default);function b(h){for(var o=[],p=0;p<h.length;p++){var l=h[p];l.kind==="subtitles"&&l.label&&o.push(h[p])}return o}Y.default=f},"./src/controller/timeline-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"TimelineController",function(){return b});var z=N("./src/polyfills/number.ts"),I=N("./src/events.ts"),M=N("./src/utils/cea-608-parser.ts"),G=N("./src/utils/output-filter.ts"),K=N("./src/utils/webvtt-parser.ts"),n=N("./src/utils/texttrack-utils.ts"),L=N("./src/utils/imsc1-ttml-parser.ts"),x=N("./src/types/loader.ts"),f=N("./src/utils/logger.ts"),b=function(){function l(s){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=p(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var i=new G.default(this,"textTrack1"),D=new G.default(this,"textTrack2"),A=new G.default(this,"textTrack3"),S=new G.default(this,"textTrack4");this.cea608Parser1=new M.default(1,i,D),this.cea608Parser2=new M.default(3,A,S)}s.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(I.Events.FRAG_LOADING,this.onFragLoading,this),s.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=l.prototype;return u.destroy=function(){var i=this.hls;i.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.off(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.off(I.Events.FRAG_LOADING,this.onFragLoading,this),i.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.off(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(i,D,A,S,R){for(var O=!1,g=R.length;g--;){var _=R[g],d=o(_[0],_[1],D,A);if(d>=0&&(_[0]=Math.min(_[0],D),_[1]=Math.max(_[1],A),O=!0,d/(A-D)>.5))return}if(O||R.push([D,A]),this.config.renderTextTracksNatively){var c=this.captionsTracks[i];this.Cues.newCue(c,D,A,S)}else{var C=this.Cues.newCue(null,D,A,S);this.hls.trigger(I.Events.CUES_PARSED,{type:"captions",cues:C,track:i})}},u.onInitPtsFound=function(i,D){var A=this,S=D.frag,R=D.id,O=D.initPTS,g=D.timescale,_=this.unparsedVttFrags;R==="main"&&(this.initPTS[S.cc]=O,this.timescale[S.cc]=g),_.length&&(this.unparsedVttFrags=[],_.forEach(function(d){A.onFragLoaded(I.Events.FRAG_LOADED,d)}))},u.getExistingTrack=function(i){var D=this.media;if(D)for(var A=0;A<D.textTracks.length;A++){var S=D.textTracks[A];if(S[i])return S}return null},u.createCaptionsTrack=function(i){this.config.renderTextTracksNatively?this.createNativeTrack(i):this.createNonNativeTrack(i)},u.createNativeTrack=function(i){if(this.captionsTracks[i])return;var D=this.captionsProperties,A=this.captionsTracks,S=this.media,R=D[i],O=R.label,g=R.languageCode,_=this.getExistingTrack(i);if(_)A[i]=_,Object(n.clearCurrentCues)(A[i]),Object(n.sendAddTrackEvent)(A[i],S);else{var d=this.createTextTrack("captions",O,g);d&&(d[i]=!0,A[i]=d)}},u.createNonNativeTrack=function(i){if(this.nonNativeCaptionsTracks[i])return;var D=this.captionsProperties[i];if(!D)return;var A=D.label,S={_id:i,label:A,kind:"captions",default:D.media?!!D.media.default:!1,closedCaptions:D.media};this.nonNativeCaptionsTracks[i]=S,this.hls.trigger(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(i,D,A){var S=this.media;return S?S.addTextTrack(i,D,A):void 0},u.onMediaAttaching=function(i,D){this.media=D.media,this._cleanTracks()},u.onMediaDetaching=function(){var i=this.captionsTracks;Object.keys(i).forEach(function(D){Object(n.clearCurrentCues)(i[D]),delete i[D]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=p(),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())},u._cleanTracks=function(){var i=this.media;if(!i)return;var D=i.textTracks;if(D)for(var A=0;A<D.length;A++)Object(n.clearCurrentCues)(D[A])},u.onSubtitleTracksUpdated=function(i,D){var A=this;this.textTracks=[];var S=D.subtitleTracks||[],R=S.some(function(d){return d.textCodec===L.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var O=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var g=this.media?this.media.textTracks:[];this.tracks.forEach(function(d,c){var C;if(c<g.length){for(var E=null,w=0;w<g.length;w++)if(h(g[w],d)){E=g[w];break}E&&(C=E)}C?Object(n.clearCurrentCues)(C):(C=A.createTextTrack("subtitles",d.name,d.lang),C&&(C.mode="disabled")),C&&(C.groupId=d.groupId,A.textTracks.push(C))})}else if(!O&&this.tracks&&this.tracks.length){var _=this.tracks.map(function(d){return{label:d.name,kind:d.type.toLowerCase(),default:d.default,subtitleTrack:d}});this.hls.trigger(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:_})}}},u.onManifestLoaded=function(i,D){var A=this;this.config.enableCEA708Captions&&D.captions&&D.captions.forEach(function(S){var R=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!R)return;var O="textTrack"+R[1],g=A.captionsProperties[O];if(!g)return;g.label=S.name,S.lang&&(g.languageCode=S.lang),g.media=S})},u.onFragLoading=function(i,D){var A=this.cea608Parser1,S=this.cea608Parser2,R=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(A&&S))return;if(D.frag.type===x.PlaylistLevelType.MAIN){var g,_,d=D.frag.sn,c=(g=D==null||((_=D.part)===null||_===void 0)?void 0:_.index)!=null?g:-1;d===R+1||d===R&&c===O+1||(A.reset(),S.reset()),this.lastSn=d,this.lastPartIndex=c}},u.onFragLoaded=function(i,D){var A=D.frag,S=D.payload,R=this.initPTS,O=this.unparsedVttFrags;if(A.type===x.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(z.isFiniteNumber)(R[A.cc])){O.push(D),R.length&&this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Missing initial subtitle PTS")});return}var g=A.decryptdata;if(g==null||g.key==null||g.method!=="AES-128"){var _=this.tracks[A.level],d=this.vttCCs;d[A.cc]||(d[A.cc]={start:A.start,prevCC:this.prevCC,new:!0},this.prevCC=A.cc),_&&_.textCodec===L.IMSC1_CODEC?this._parseIMSC1(A,S):this._parseVTTs(A,S,d)}}else this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(i,D){var A=this,S=this.hls;Object(L.parseIMSC1)(D,this.initPTS[i.cc],this.timescale[i.cc],function(R){A._appendCues(R,i.level),S.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(R){f.logger.log("Failed to parse IMSC1: "+R),S.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:R})})},u._parseVTTs=function(i,D,A){var S=this,R=this.hls;Object(K.parseWebVTT)(D,this.initPTS[i.cc],this.timescale[i.cc],A,i.cc,i.start,function(O){S._appendCues(O,i.level),R.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(O){S._fallbackToIMSC1(i,D),f.logger.log("Failed to parse VTT cue: "+O),R.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:O})})},u._fallbackToIMSC1=function(i,D){var A=this,S=this.tracks[i.level];S.textCodec||Object(L.parseIMSC1)(D,this.initPTS[i.cc],this.timescale[i.cc],function(){S.textCodec=L.IMSC1_CODEC,A._parseIMSC1(i,D)},function(){S.textCodec="wvtt"})},u._appendCues=function(i,D){var A=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[D];if(S.mode==="disabled")return;i.forEach(function(g){return Object(n.addCueToTrack)(S,g)})}else{var R=this.tracks[D],O=R.default?"default":"subtitles"+D;A.trigger(I.Events.CUES_PARSED,{type:"subtitles",cues:i,track:O})}},u.onFragDecrypted=function(i,D){var A=D.frag;if(A.type===x.PlaylistLevelType.SUBTITLE){if(!Object(z.isFiniteNumber)(this.initPTS[A.cc])){this.unparsedVttFrags.push(D);return}this.onFragLoaded(I.Events.FRAG_LOADED,D)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(i,D){var A=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(A&&S))return;for(var R=0;R<D.samples.length;R++){var O=D.samples[R].bytes;if(O){var g=this.extractCea608Data(O);A.addData(D.samples[R].pts,g[0]),S.addData(D.samples[R].pts,g[1])}}},u.onBufferFlushing=function(i,D){var A=D.startOffset,S=D.endOffset,R=D.endOffsetSubtitles,O=D.type,g=this.media;if(!g||g.currentTime<S)return;if(!O||O==="video"){var _=this.captionsTracks;Object.keys(_).forEach(function(c){return Object(n.removeCuesInRange)(_[c],A,S)})}if(this.config.renderTextTracksNatively&&(A===0&&R!==void 0)){var d=this.textTracks;Object.keys(d).forEach(function(c){return Object(n.removeCuesInRange)(d[c],A,R)})}},u.extractCea608Data=function(i){for(var D=i[0]&31,A=2,S=[[],[]],R=0;R<D;R++){var O=i[A++],g=127&i[A++],_=127&i[A++],d=(4&O)!==0,c=3&O;if(g===0&&_===0)continue;d&&((c===0||c===1)&&(S[c].push(g),S[c].push(_)))}return S},l}();function h(l,u){return l&&l.label===u.name&&!(l.textTrack1||l.textTrack2)}function o(l,u,s,i){return Math.min(u,i)-Math.max(l,s)}function p(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function I(G,K){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=K}var M=I.prototype;return M.decrypt=function(K,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,K)},I}()},"./src/crypt/aes-decryptor.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"removePadding",function(){return I}),N.d(Y,"default",function(){return M});var z=N("./src/utils/typed-array.ts");function I(G){var K=G.byteLength,n=K&&new DataView(G.buffer).getUint8(K-1);return n?Object(z.sliceUint8)(G,0,K-n):G}var M=function(){function G(){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 K=G.prototype;return K.uint8ArrayToUint32Array_=function(L){for(var x=new DataView(L),f=new Uint32Array(4),b=0;b<4;b++)f[b]=x.getUint32(b*4);return f},K.initTable=function(){var L=this.sBox,x=this.invSBox,f=this.subMix,b=f[0],h=f[1],o=f[2],p=f[3],l=this.invSubMix,u=l[0],s=l[1],i=l[2],D=l[3],A=new Uint32Array(256),S=0,R=0,O=0;for(O=0;O<256;O++)O<128?A[O]=O<<1:A[O]=O<<1^283;for(O=0;O<256;O++){var g=R^R<<1^R<<2^R<<3^R<<4;g=g>>>8^g&255^99,L[S]=g,x[g]=S;var _=A[S],d=A[_],c=A[d],C=A[g]*257^g*16843008;b[S]=C<<24|C>>>8,h[S]=C<<16|C>>>16,o[S]=C<<8|C>>>24,p[S]=C,C=c*16843009^d*65537^_*257^S*16843008,u[g]=C<<24|C>>>8,s[g]=C<<16|C>>>16,i[g]=C<<8|C>>>24,D[g]=C,S?(S=_^A[A[A[c^_]]],R^=A[A[R]]):S=R=1}},K.expandKey=function(L){for(var x=this.uint8ArrayToUint32Array_(L),f=!0,b=0;b<x.length&&f;)f=x[b]===this.key[b],b++;if(f)return;this.key=x;var h=this.keySize=x.length;if(h!==4&&h!==6&&h!==8)throw new Error("Invalid aes key size="+h);var o=this.ksRows=(h+6+1)*4,p,l,u=this.keySchedule=new Uint32Array(o),s=this.invKeySchedule=new Uint32Array(o),i=this.sBox,D=this.rcon,A=this.invSubMix,S=A[0],R=A[1],O=A[2],g=A[3],_,d;for(p=0;p<o;p++){if(p<h){_=u[p]=x[p];continue}d=_,p%h===0?(d=d<<8|d>>>24,d=i[d>>>24]<<24|i[d>>>16&255]<<16|i[d>>>8&255]<<8|i[d&255],d^=D[p/h|0]<<24):h>6&&p%h===4&&(d=i[d>>>24]<<24|i[d>>>16&255]<<16|i[d>>>8&255]<<8|i[d&255]),u[p]=_=(u[p-h]^d)>>>0}for(l=0;l<o;l++)p=o-l,l&3?d=u[p]:d=u[p-4],l<4||p<=4?s[l]=d:s[l]=S[i[d>>>24]]^R[i[d>>>16&255]]^O[i[d>>>8&255]]^g[i[d&255]],s[l]=s[l]>>>0},K.networkToHostOrderSwap=function(L){return L<<24|(L&65280)<<8|(L&16711680)>>8|L>>>24},K.decrypt=function(L,x,f){for(var b=this.keySize+6,h=this.invKeySchedule,o=this.invSBox,p=this.invSubMix,l=p[0],u=p[1],s=p[2],i=p[3],D=this.uint8ArrayToUint32Array_(f),A=D[0],S=D[1],R=D[2],O=D[3],g=new Int32Array(L),_=new Int32Array(g.length),d,c,C,E,w,B,W,T,k,m,y,H,Q,te,ae=this.networkToHostOrderSwap;x<g.length;){for(k=ae(g[x]),m=ae(g[x+1]),y=ae(g[x+2]),H=ae(g[x+3]),w=k^h[0],B=H^h[1],W=y^h[2],T=m^h[3],Q=4,te=1;te<b;te++)d=l[w>>>24]^u[B>>16&255]^s[W>>8&255]^i[T&255]^h[Q],c=l[B>>>24]^u[W>>16&255]^s[T>>8&255]^i[w&255]^h[Q+1],C=l[W>>>24]^u[T>>16&255]^s[w>>8&255]^i[B&255]^h[Q+2],E=l[T>>>24]^u[w>>16&255]^s[B>>8&255]^i[W&255]^h[Q+3],w=d,B=c,W=C,T=E,Q=Q+4;d=o[w>>>24]<<24^o[B>>16&255]<<16^o[W>>8&255]<<8^o[T&255]^h[Q],c=o[B>>>24]<<24^o[W>>16&255]<<16^o[T>>8&255]<<8^o[w&255]^h[Q+1],C=o[W>>>24]<<24^o[T>>16&255]<<16^o[w>>8&255]<<8^o[B&255]^h[Q+2],E=o[T>>>24]<<24^o[w>>16&255]<<16^o[B>>8&255]<<8^o[W&255]^h[Q+3],_[x]=ae(d^A),_[x+1]=ae(E^S),_[x+2]=ae(C^R),_[x+3]=ae(c^O),A=k,S=m,R=y,O=H,x=x+4}return _.buffer},G}()},"./src/crypt/decrypter.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return x});var z=N("./src/crypt/aes-crypto.ts"),I=N("./src/crypt/fast-aes-key.ts"),M=N("./src/crypt/aes-decryptor.ts"),G=N("./src/utils/logger.ts"),K=N("./src/utils/mp4-tools.ts"),n=N("./src/utils/typed-array.ts"),L=16,x=function(){function f(h,o,p){var l=p===void 0?{}:p,u=l.removePKCS7Padding,s=u===void 0?!0:u;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=h,this.config=o,this.removePKCS7Padding=s,s)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(D){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var b=f.prototype;return b.destroy=function(){this.observer=null},b.isSync=function(){return this.config.enableSoftwareAES},b.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var p=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(p):p},b.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},b.decrypt=function(o,p,l,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),p,l);var s=this.flush();s&&u(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),p,l).then(u)},b.softwareDecrypt=function(o,p,l){var u=this.currentIV,s=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(o=Object(K.appendUint8Array)(i,o),this.remainderData=null);var D=this.getValidChunk(o);if(!D.length)return null;u&&(l=u);var A=this.softwareDecrypter;A||(A=this.softwareDecrypter=new M.default),A.expandKey(p);var S=s;return this.currentResult=A.decrypt(D.buffer,0,l),this.currentIV=Object(n.sliceUint8)(D,-16).buffer,S||null},b.webCryptoDecrypt=function(o,p,l){var u=this,s=this.subtle;return(this.key!==p||!this.fastAesKey)&&(this.key=p,this.fastAesKey=new I.default(s,p)),this.fastAesKey.expandKey().then(function(i){if(!s)return Promise.reject(new Error("web crypto not initialized"));var D=new z.default(s,l);return D.decrypt(o.buffer,i)}).catch(function(i){return u.onWebCryptoError(i,o,p,l)})},b.onWebCryptoError=function(o,p,l,u){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(p,l,u)},b.getValidChunk=function(o){var p=o,l=o.length-o.length%L;return l!==o.length&&(p=Object(n.sliceUint8)(o,0,l),this.remainderData=Object(n.sliceUint8)(o,l)),p},b.logOnce=function(o){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function I(G,K){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=K}var M=I.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},I}()},"./src/demux/aacdemuxer.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/demux/base-audio-demuxer.ts"),I=N("./src/demux/adts.ts"),M=N("./src/utils/logger.ts"),G=N("./src/demux/id3.ts");function K(x,f){x.prototype=Object.create(f.prototype),x.prototype.constructor=x,n(x,f)}function n(x,f){return n=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},n(x,f)}var L=function(x){K(f,x);function f(h,o){var p;return p=x.call(this)||this,p.observer=void 0,p.config=void 0,p.observer=h,p.config=o,p}var b=f.prototype;return b.resetInitSegment=function(o,p,l){x.prototype.resetInitSegment.call(this,o,p,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var p=G.getID3Data(o,0)||[],l=p.length,u=o.length;l<u;l++)if(I.probe(o,l))return M.logger.log("ADTS sync word found !"),!0;return!1},b.canParse=function(o,p){return I.canParse(o,p)},b.appendFrame=function(o,p,l){I.initTrackConfig(o,this.observer,p,l,o.manifestCodec);var u=I.appendFrame(o,p,l,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},f}(z.default);L.minProbeByteLength=9,Y.default=L},"./src/demux/adts.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"getAudioConfig",function(){return G}),N.d(Y,"isHeaderPattern",function(){return K}),N.d(Y,"getHeaderLength",function(){return n}),N.d(Y,"getFullFrameLength",function(){return L}),N.d(Y,"canGetFrameLength",function(){return x}),N.d(Y,"isHeader",function(){return f}),N.d(Y,"canParse",function(){return b}),N.d(Y,"probe",function(){return h}),N.d(Y,"initTrackConfig",function(){return o}),N.d(Y,"getFrameDuration",function(){return p}),N.d(Y,"parseFrameHeader",function(){return l}),N.d(Y,"appendFrame",function(){return u});var z=N("./src/utils/logger.ts"),I=N("./src/errors.ts"),M=N("./src/events.ts");function G(s,i,D,A){var S,R,O,g,_=navigator.userAgent.toLowerCase(),d=A,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((i[D+2]&192)>>>6)+1;var C=(i[D+2]&60)>>>2;if(C>c.length-1){s.trigger(M.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return O=(i[D+2]&1)<<2,O|=(i[D+3]&192)>>>6,z.logger.log("manifest codec:"+A+", ADTS type:"+S+", samplingIndex:"+C),/firefox/i.test(_)?C>=6?(S=5,g=new Array(4),R=C-3):(S=2,g=new Array(2),R=C):_.indexOf("android")!==-1?(S=2,g=new Array(2),R=C):(S=5,g=new Array(4),A&&(A.indexOf("mp4a.40.29")!==-1||A.indexOf("mp4a.40.5")!==-1)||!A&&C>=6?R=C-3:((A&&A.indexOf("mp4a.40.2")!==-1&&(C>=6&&O===1||/vivaldi/i.test(_))||!A&&O===1)&&(S=2,g=new Array(2)),R=C)),g[0]=S<<3,g[0]|=(C&14)>>1,g[1]|=(C&1)<<7,g[1]|=O<<3,S===5&&(g[1]|=(R&14)>>1,g[2]=(R&1)<<7,g[2]|=2<<2,g[3]=0),{config:g,samplerate:c[C],channelCount:O,codec:"mp4a.40."+S,manifestCodec:d}}function K(s,i){return s[i]===255&&(s[i+1]&246)===240}function n(s,i){return s[i+1]&1?7:9}function L(s,i){return(s[i+3]&3)<<11|s[i+4]<<3|(s[i+5]&224)>>>5}function x(s,i){return i+5<s.length}function f(s,i){return i+1<s.length&&K(s,i)}function b(s,i){return x(s,i)&&K(s,i)&&L(s,i)<=s.length-i}function h(s,i){if(f(s,i)){var D=n(s,i);if(i+D>=s.length)return!1;var A=L(s,i);if(A<=D)return!1;var S=i+A;return S===s.length||f(s,S)}return!1}function o(s,i,D,A,S){if(!s.samplerate){var R=G(i,D,A,S);if(!R)return;s.config=R.config,s.samplerate=R.samplerate,s.channelCount=R.channelCount,s.codec=R.codec,s.manifestCodec=R.manifestCodec,z.logger.log("parsed codec:"+s.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function p(s){return 1024*9e4/s}function l(s,i,D,A,S){var R=n(s,i),O=L(s,i);if(O-=R,O>0){var g=D+A*S;return{headerLength:R,frameLength:O,stamp:g}}}function u(s,i,D,A,S){var R=p(s.samplerate),O=l(i,D,A,S,R);if(O){var g=O.frameLength,_=O.headerLength,d=O.stamp,c=_+g,C=Math.max(0,D+c-i.length),E;C?(E=new Uint8Array(c-_),E.set(i.subarray(D+_,i.length),0)):E=i.subarray(D+_,D+c);var w={unit:E,pts:d};return C||s.samples.push(w),{sample:w,length:c,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"initPTSFn",function(){return L});var z=N("./src/polyfills/number.ts"),I=N("./src/demux/id3.ts"),M=N("./src/demux/dummy-demuxed-track.ts"),G=N("./src/utils/mp4-tools.ts"),K=N("./src/utils/typed-array.ts"),n=function(){function x(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=x.prototype;return f.resetInitSegment=function(h,o,p){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(h,o){return!1},f.appendFrame=function(h,o,p){},f.demux=function(h,o){this.cachedData&&(h=Object(G.appendUint8Array)(this.cachedData,h),this.cachedData=null);var p=I.getID3Data(h,0),l=p?p.length:0,u,s,i=this._audioTrack,D=this._id3Track,A=p?I.getTimeStamp(p):void 0,S=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(A,o)),p&&p.length>0&&D.samples.push({pts:this.initPTS,dts:this.initPTS,data:p}),s=this.initPTS;l<S;){if(this.canParse(h,l)){var R=this.appendFrame(i,h,l);R?(this.frameIndex++,s=R.sample.pts,l+=R.length,u=l):l=S}else I.canParse(h,l)?(p=I.getID3Data(h,l),D.samples.push({pts:s,dts:s,data:p}),l+=p.length,u=l):l++;if(l===S&&u!==S){var O=Object(K.sliceUint8)(h,u);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:i,avcTrack:Object(M.dummyTrack)(),id3Track:D,textTrack:Object(M.dummyTrack)()}},f.demuxSampleAes=function(h,o,p){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(h){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},f.destroy=function(){},x}(),L=function(f,b){return Object(z.isFiniteNumber)(f)?f*90:b*9e4};Y.default=n},"./src/demux/chunk-cache.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function M(){this.chunks=[],this.dataLength=0}var G=M.prototype;return G.push=function(n){this.chunks.push(n),this.dataLength+=n.length},G.flush=function(){var n=this.chunks,L=this.dataLength,x;if(n.length)n.length===1?x=n[0]:x=I(n,L);else return new Uint8Array(0);return this.reset(),x},G.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function I(M,G){for(var K=new Uint8Array(G),n=0,L=0;L<M.length;L++){var x=M[L];K.set(x,n),n+=x.length}return K}},"./src/demux/dummy-demuxed-track.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"dummyTrack",function(){return z});function z(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/utils/logger.ts"),I=function(){function M(K){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=K,this.bytesAvailable=K.byteLength,this.word=0,this.bitsAvailable=0}var G=M.prototype;return G.loadWord=function(){var n=this.data,L=this.bytesAvailable,x=n.byteLength-L,f=new Uint8Array(4),b=Math.min(4,L);if(b===0)throw new Error("no bytes available");f.set(n.subarray(x,x+b)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=b*8,this.bytesAvailable-=b},G.skipBits=function(n){var L;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,L=n>>3,n-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var L=Math.min(this.bitsAvailable,n),x=this.word>>>32-L;return n>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=n-L,L>0&&this.bitsAvailable?x<<L|this.readBits(L):x},G.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},G.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(n){for(var L=8,x=8,f,b=0;b<n;b++)x!==0&&(f=this.readEG(),x=(L+f+256)%256),L=x===0?L:x},G.readSPS=function(){var n=0,L=0,x=0,f=0,b,h,o,p=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),s=this.readBoolean.bind(this),i=this.skipBits.bind(this),D=this.skipEG.bind(this),A=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);p();var R=p();if(l(5),i(3),p(),A(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var O=u();if(O===3&&i(1),A(),A(),i(1),s())for(h=O!==3?8:12,o=0;o<h;o++)s()&&(o<6?S(16):S(64))}A();var g=u();if(g===0)u();else if(g===1)for(i(1),D(),D(),b=u(),o=0;o<b;o++)D();A(),i(1);var _=u(),d=u(),c=l(1);c===0&&i(1),i(1),s()&&(n=u(),L=u(),x=u(),f=u());var C=[1,1];if(s()&&s()){var E=p();switch(E){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[p()<<8|p(),p()<<8|p()];break}}}return{width:Math.ceil((_+1)*16-n*2-L*2),height:(2-c)*(d+1)*16-(c?2:4)*(x+f),pixelRatio:C}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();Y.default=I},"./src/demux/id3.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"isHeader",function(){return z}),N.d(Y,"isFooter",function(){return I}),N.d(Y,"getID3Data",function(){return M}),N.d(Y,"canParse",function(){return K}),N.d(Y,"getTimeStamp",function(){return n}),N.d(Y,"isTimeStampFrame",function(){return L}),N.d(Y,"getID3Frames",function(){return f}),N.d(Y,"decodeFrame",function(){return b}),N.d(Y,"utf8ArrayToStr",function(){return u}),N.d(Y,"testables",function(){return s});var z=function(S,R){return R+10<=S.length&&(S[R]===73&&S[R+1]===68&&S[R+2]===51&&(S[R+3]<255&&S[R+4]<255&&(S[R+6]<128&&S[R+7]<128&&S[R+8]<128&&S[R+9]<128)))},I=function(S,R){return R+10<=S.length&&(S[R]===51&&S[R+1]===68&&S[R+2]===73&&(S[R+3]<255&&S[R+4]<255&&(S[R+6]<128&&S[R+7]<128&&S[R+8]<128&&S[R+9]<128)))},M=function(S,R){for(var O=R,g=0;z(S,R);){g+=10;var _=G(S,R+6);g+=_,I(S,R+10)&&(g+=10),R+=g}return g>0?S.subarray(O,O+g):void 0},G=function(S,R){var O=0;return O=(S[R]&127)<<21,O|=(S[R+1]&127)<<14,O|=(S[R+2]&127)<<7,O|=S[R+3]&127,O},K=function(S,R){return z(S,R)&&G(S,R+6)+10<=S.length-R},n=function(S){for(var R=f(S),O=0;O<R.length;O++){var g=R[O];if(L(g))return l(g)}return},L=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},x=function(S){var R=String.fromCharCode(S[0],S[1],S[2],S[3]),O=G(S,4),g=10;return{type:R,size:O,data:S.subarray(g,g+O)}},f=function(S){for(var R=0,O=[];z(S,R);){var g=G(S,R+6);R+=10;for(var _=R+g;R+8<_;){var d=x(S.subarray(R)),c=b(d);c&&O.push(c),R+=d.size+10}I(S,R)&&(R+=10)}return O},b=function(S){return S.type==="PRIV"?h(S):S.type[0]==="W"?p(S):o(S)},h=function(S){if(S.size<2)return;var R=u(S.data,!0),O=new Uint8Array(S.data.subarray(R.length+1));return{key:S.type,info:R,data:O.buffer}},o=function(S){if(S.size<2)return;if(S.type==="TXXX"){var R=1,O=u(S.data.subarray(R),!0);R+=O.length+1;var g=u(S.data.subarray(R));return{key:S.type,info:O,data:g}}var _=u(S.data.subarray(1));return{key:S.type,data:_}},p=function(S){if(S.type==="WXXX"){if(S.size<2)return;var R=1,O=u(S.data.subarray(R),!0);R+=O.length+1;var g=u(S.data.subarray(R));return{key:S.type,info:O,data:g}}var _=u(S.data);return{key:S.type,data:_}},l=function(S){if(S.data.byteLength===8){var R=new Uint8Array(S.data),O=R[3]&1,g=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return g/=45,O&&(g+=4772185884e-2),Math.round(g)}return},u=function(S,R){R===void 0&&(R=!1);var O=D();if(O){var g=O.decode(S);if(R){var _=g.indexOf("\0");return _!==-1?g.substring(0,_):g}return g.replace(/\0/g,"")}for(var d=S.length,c,C,E,w="",B=0;B<d;){if(c=S[B++],c===0&&R)return w;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=String.fromCharCode(c);break;case 12:case 13:C=S[B++],w+=String.fromCharCode((c&31)<<6|C&63);break;case 14:C=S[B++],E=S[B++],w+=String.fromCharCode((c&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return w},s={decodeTextFrame:o},i;function D(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/demux/base-audio-demuxer.ts"),I=N("./src/demux/id3.ts"),M=N("./src/utils/logger.ts"),G=N("./src/demux/mpegaudio.ts");function K(x,f){x.prototype=Object.create(f.prototype),x.prototype.constructor=x,n(x,f)}function n(x,f){return n=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},n(x,f)}var L=function(x){K(f,x);function f(){return x.apply(this,arguments)||this}var b=f.prototype;return b.resetInitSegment=function(o,p,l){x.prototype.resetInitSegment.call(this,o,p,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var p=I.getID3Data(o,0)||[],l=p.length,u=o.length;l<u;l++)if(G.probe(o,l))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},b.canParse=function(o,p){return G.canParse(o,p)},b.appendFrame=function(o,p,l){return this.initPTS===null?void 0:G.appendFrame(o,p,l,this.initPTS,this.frameIndex)},f}(z.default);L.minProbeByteLength=4,Y.default=L},"./src/demux/mp4demuxer.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/utils/mp4-tools.ts"),I=N("./src/demux/dummy-demuxed-track.ts"),M=function(){function G(n,L){this.remainderData=null,this.config=void 0,this.config=L}var K=G.prototype;return K.resetTimeStamp=function(){},K.resetInitSegment=function(){},K.resetContiguity=function(){},G.probe=function(L){return Object(z.findBox)({data:L,start:0,end:Math.min(L.length,16384)},["moof"]).length>0},K.demux=function(L){var x=L,f=Object(I.dummyTrack)();if(this.config.progressive){this.remainderData&&(x=Object(z.appendUint8Array)(this.remainderData,L));var b=Object(z.segmentValidRange)(x);this.remainderData=b.remainder,f.samples=b.valid||new Uint8Array}else f.samples=x;return{audioTrack:Object(I.dummyTrack)(),avcTrack:f,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},K.flush=function(){var L=Object(I.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(I.dummyTrack)(),avcTrack:L,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},K.demuxSampleAes=function(L,x,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},K.destroy=function(){},G}();M.minProbeByteLength=1024,Y.default=M},"./src/demux/mpegaudio.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"appendFrame",function(){return n}),N.d(Y,"parseHeader",function(){return L}),N.d(Y,"isHeaderPattern",function(){return x}),N.d(Y,"isHeader",function(){return f}),N.d(Y,"canParse",function(){return b}),N.d(Y,"probe",function(){return h});var z=null,I=[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],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],K=[0,1,1,4];function n(o,p,l,u,s){if(l+24>p.length)return;var i=L(p,l);if(i&&l+i.frameLength<=p.length){var D=i.samplesPerFrame*9e4/i.sampleRate,A=u+s*D,S={unit:p.subarray(l,l+i.frameLength),pts:A,dts:A};return o.config=[],o.channelCount=i.channelCount,o.samplerate=i.sampleRate,o.samples.push(S),{sample:S,length:i.frameLength,missing:0}}}function L(o,p){var l=o[p+1]>>3&3,u=o[p+1]>>1&3,s=o[p+2]>>4&15,i=o[p+2]>>2&3;if(l!==1&&s!==0&&s!==15&&i!==3){var D=o[p+2]>>1&1,A=o[p+3]>>6,S=l===3?3-u:u===3?3:4,R=I[S*14+s-1]*1e3,O=l===3?0:l===2?1:2,g=M[O*3+i],_=A===3?1:2,d=G[l][u],c=K[u],C=d*8*c,E=Math.floor(d*R/g+D)*c;if(z===null){var w=navigator.userAgent||"",B=w.match(/Chrome\/(\d+)/i);z=B?parseInt(B[1]):0}var W=!!z&&z<=87;return W&&u===2&&R>=224e3&&A===0&&(o[p+3]=o[p+3]|128),{sampleRate:g,channelCount:_,frameLength:E,samplesPerFrame:C}}}function x(o,p){return o[p]===255&&(o[p+1]&224)===224&&(o[p+1]&6)!==0}function f(o,p){return p+1<o.length&&x(o,p)}function b(o,p){var l=4;return x(o,p)&&l<=o.length-p}function h(o,p){if(p+1<o.length&&x(o,p)){var l=4,u=L(o,p),s=l;u!=null&&u.frameLength&&(s=u.frameLength);var i=p+s;return i===o.length||f(o,i)}return!1}},"./src/demux/sample-aes.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/crypt/decrypter.ts"),I=N("./src/demux/tsdemuxer.ts"),M=function(){function G(n,L,x){this.keyData=void 0,this.decrypter=void 0,this.keyData=x,this.decrypter=new z.default(n,L,{removePKCS7Padding:!1})}var K=G.prototype;return K.decryptBuffer=function(L,x){this.decrypter.decrypt(L,this.keyData.key.buffer,this.keyData.iv.buffer,x)},K.decryptAacSample=function(L,x,f,b){var h=L[x].unit,o=h.subarray(16,h.length-h.length%16),p=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),l=this;this.decryptBuffer(p,function(u){var s=new Uint8Array(u);h.set(s,16),b||l.decryptAacSamples(L,x+1,f)})},K.decryptAacSamples=function(L,x,f){for(;;x++){if(x>=L.length){f();return}if(L[x].unit.length<32)continue;var b=this.decrypter.isSync();if(this.decryptAacSample(L,x,f,b),!b)return}},K.getAvcEncryptedData=function(L){for(var x=Math.floor((L.length-48)/160)*16+16,f=new Int8Array(x),b=0,h=32;h<=L.length-16;h+=160,b+=16)f.set(L.subarray(h,h+16),b);return f},K.getAvcDecryptedUnit=function(L,x){for(var f=new Uint8Array(x),b=0,h=32;h<=L.length-16;h+=160,b+=16)L.set(f.subarray(b,b+16),h);return L},K.decryptAvcSample=function(L,x,f,b,h,o){var p=Object(I.discardEPB)(h.data),l=this.getAvcEncryptedData(p),u=this;this.decryptBuffer(l.buffer,function(s){h.data=u.getAvcDecryptedUnit(p,s),o||u.decryptAvcSamples(L,x,f+1,b)})},K.decryptAvcSamples=function(L,x,f,b){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;x++,f=0){if(x>=L.length){b();return}for(var h=L[x].units;!(f>=h.length);f++){var o=h[f];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var p=this.decrypter.isSync();if(this.decryptAvcSample(L,x,f,b,o,p),!p)return}}},G}();Y.default=M},"./src/demux/transmuxer-interface.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return h});var z=N("./node_modules/webworkify-webpack/index.js"),I=N.n(z),M=N("./src/events.ts"),G=N("./src/demux/transmuxer.ts"),K=N("./src/utils/logger.ts"),n=N("./src/errors.ts"),L=N("./src/utils/mediasource-helper.ts"),x=N("./node_modules/eventemitter3/index.js"),f=N.n(x),b=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function o(l,u,s,i){var D=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=l,this.id=u,this.onTransmuxComplete=s,this.onFlush=i;var A=l.config,S=function(d,c){c=c||{},c.frag=D.frag,c.id=D.id,l.trigger(d,c)};this.observer=new x.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,S),this.observer.on(M.Events.ERROR,S);var R={mp4:b.isTypeSupported("video/mp4"),mpeg:b.isTypeSupported("audio/mpeg"),mp3:b.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(A.enableWorker&&typeof Worker!="undefined"){K.logger.log("demuxing in webworker");var g;try{g=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(_){l.trigger(M.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},g.postMessage({cmd:"init",typeSupported:R,vendor:O,id:u,config:JSON.stringify(A)})}catch(_){K.logger.warn("Error in worker:",_),K.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new G.default(this.observer,R,A,O,u),this.worker=null}}else this.transmuxer=new G.default(this.observer,R,A,O,u)}var p=o.prototype;return p.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},p.push=function(u,s,i,D,A,S,R,O,g,_){var d=this;g.transmuxing.start=self.performance.now();var c=this.transmuxer,C=this.worker,E=S?S.start:A.start,w=A.decryptdata,B=this.frag,W=!(B&&A.cc===B.cc),T=!(B&&g.level===B.level),k=B?g.sn-B.sn:-1,m=this.part?g.part-this.part.index:1,y=!T&&(k===1||k===0&&m===1),H=self.performance.now();(T||k||A.stats.parsing.start===0)&&(A.stats.parsing.start=H),S&&(m||!y)&&(S.stats.parsing.start=H);var Q=new G.TransmuxState(W,y,O,T,E);if(!y||W){K.logger.log("[transmuxer-interface, "+A.type+"]: Starting new transmux session for sn: "+g.sn+" p: "+g.part+" level: "+g.level+" id: "+g.id+`
discontinuity: `+W+`
trackSwitch: `+T+`
contiguous: `+y+`
accurateTimeOffset: `+O+`
timeOffset: `+E);var te=new G.TransmuxConfig(i,D,s,R,_);this.configureTransmuxer(te)}if(this.frag=A,this.part=S,C)C.postMessage({cmd:"demux",data:u,decryptdata:w,chunkMeta:g,state:Q},u instanceof ArrayBuffer?[u]:[]);else if(c){var ae=c.push(u,w,g,Q);Object(G.isPromise)(ae)?ae.then(function(Te){d.handleTransmuxComplete(Te)}):this.handleTransmuxComplete(ae)}},p.flush=function(u){var s=this;u.transmuxing.start=self.performance.now();var i=this.transmuxer,D=this.worker;if(D)D.postMessage({cmd:"flush",chunkMeta:u});else if(i){var A=i.flush(u);Object(G.isPromise)(A)?A.then(function(S){s.handleFlushResult(S,u)}):this.handleFlushResult(A,u)}},p.handleFlushResult=function(u,s){var i=this;u.forEach(function(D){i.handleTransmuxComplete(D)}),this.onFlush(s)},p.onWorkerMessage=function(u){var s=u.data,i=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,i.trigger(s.event,s.data);break}}},p.configureTransmuxer=function(u){var s=this.worker,i=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):i&&i.configure(u)},p.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},o}()},"./src/demux/transmuxer-worker.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var z=N("./src/demux/transmuxer.ts"),I=N("./src/events.ts"),M=N("./src/utils/logger.ts"),G=N("./node_modules/eventemitter3/index.js"),K=N.n(G);function n(h){var o=new G.EventEmitter,p=function(u,s){h.postMessage({event:u,data:s})};o.on(I.Events.FRAG_DECRYPTED,p),o.on(I.Events.ERROR,p),h.addEventListener("message",function(l){var u=l.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);h.transmuxer=new z.default(o,u.typeSupported,s,u.vendor,u.id),Object(M.enableLogs)(s.debug),p("init",null);break}case"configure":{h.transmuxer.configure(u.config);break}case"demux":{var i=h.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(z.isPromise)(i)?i.then(function(S){L(h,S)}):L(h,i);break}case"flush":{var D=u.chunkMeta,A=h.transmuxer.flush(D);Object(z.isPromise)(A)?A.then(function(S){f(h,S,D)}):f(h,A,D);break}default:break}})}function L(h,o){if(b(o.remuxResult))return;var p=[],l=o.remuxResult,u=l.audio,s=l.video;u&&x(p,u),s&&x(p,s),h.postMessage({event:"transmuxComplete",data:o},p)}function x(h,o){o.data1&&h.push(o.data1.buffer),o.data2&&h.push(o.data2.buffer)}function f(h,o,p){o.forEach(function(l){L(h,l)}),h.postMessage({event:"flush",data:p})}function b(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"isPromise",function(){return A}),N.d(Y,"TransmuxConfig",function(){return S}),N.d(Y,"TransmuxState",function(){return R});var z=N("./src/events.ts"),I=N("./src/errors.ts"),M=N("./src/crypt/decrypter.ts"),G=N("./src/demux/aacdemuxer.ts"),K=N("./src/demux/mp4demuxer.ts"),n=N("./src/demux/tsdemuxer.ts"),L=N("./src/demux/mp3demuxer.ts"),x=N("./src/remux/mp4-remuxer.ts"),f=N("./src/remux/passthrough-remuxer.ts"),b=N("./src/demux/chunk-cache.ts"),h=N("./src/utils/mp4-tools.ts"),o=N("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(O){o.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var l=[{demux:n.default,remux:x.default},{demux:K.default,remux:f.default},{demux:G.default,remux:x.default},{demux:L.default,remux:x.default}],u=1024;l.forEach(function(O){var g=O.demux;u=Math.max(u,g.minProbeByteLength)});var s=function(){function O(_,d,c,C,E){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 b.default,this.observer=_,this.typeSupported=d,this.config=c,this.vendor=C,this.id=E}var g=O.prototype;return g.configure=function(d){this.transmuxConfig=d,this.decrypter&&this.decrypter.reset()},g.push=function(d,c,C,E){var w=this,B=C.transmuxing;B.executeStart=p();var W=new Uint8Array(d),T=this.cache,k=this.config,m=this.currentTransmuxState,y=this.transmuxConfig;E&&(this.currentTransmuxState=E);var H=i(W,c);if(H&&H.method==="AES-128"){var Q=this.getDecrypter();if(k.enableSoftwareAES){var te=Q.softwareDecrypt(W,H.key.buffer,H.iv.buffer);if(!te)return B.executeEnd=p(),D(C);W=new Uint8Array(te)}else return this.decryptionPromise=Q.webCryptoDecrypt(W,H.key.buffer,H.iv.buffer).then(function(Re){var Ke=w.push(Re,null,C);return w.decryptionPromise=null,Ke}),this.decryptionPromise}var ae=E||m,Te=ae.contiguous,_e=ae.discontinuity,ge=ae.trackSwitch,ve=ae.accurateTimeOffset,Oe=ae.timeOffset,he=y.audioCodec,V=y.videoCodec,P=y.defaultInitPts,j=y.duration,$=y.initSegmentData;if((_e||ge)&&this.resetInitSegment($,he,V,j),_e&&this.resetInitialTimestamp(P),Te||this.resetContiguity(),this.needsProbing(W,_e,ge)){if(T.dataLength){var J=T.flush();W=Object(h.appendUint8Array)(J,W)}this.configureTransmuxer(W,y)}var X=this.transmux(W,H,Oe,ve,C),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,B.executeEnd=p(),X},g.flush=function(d){var c=this,C=d.transmuxing;C.executeStart=p();var E=this.decrypter,w=this.cache,B=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return c.flush(d)});var T=[],k=B.timeOffset;if(E){var m=E.flush();m&&T.push(this.push(m,null,d))}var y=w.dataLength;w.reset();var H=this.demuxer,Q=this.remuxer;if(!H||!Q)return y>=u&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=p(),[D(d)];var te=H.flush(k);return A(te)?te.then(function(ae){return c.flushRemux(T,ae,d),T}):(this.flushRemux(T,te,d),T)},g.flushRemux=function(d,c,C){var E=c.audioTrack,w=c.avcTrack,B=c.id3Track,W=c.textTrack,T=this.currentTransmuxState,k=T.accurateTimeOffset,m=T.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var y=this.remuxer.remux(E,w,B,W,m,k,!0,this.id);d.push({remuxResult:y,chunkMeta:C}),C.transmuxing.executeEnd=p()},g.resetInitialTimestamp=function(d){var c=this.demuxer,C=this.remuxer;if(!c||!C)return;c.resetTimeStamp(d),C.resetTimeStamp(d)},g.resetContiguity=function(){var d=this.demuxer,c=this.remuxer;if(!d||!c)return;d.resetContiguity(),c.resetNextTimestamp()},g.resetInitSegment=function(d,c,C,E){var w=this.demuxer,B=this.remuxer;if(!w||!B)return;w.resetInitSegment(c,C,E),B.resetInitSegment(d,c,C)},g.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},g.transmux=function(d,c,C,E,w){var B;return c&&c.method==="SAMPLE-AES"?B=this.transmuxSampleAes(d,c,C,E,w):B=this.transmuxUnencrypted(d,C,E,w),B},g.transmuxUnencrypted=function(d,c,C,E){var w=this.demuxer.demux(d,c,!1,!this.config.progressive),B=w.audioTrack,W=w.avcTrack,T=w.id3Track,k=w.textTrack,m=this.remuxer.remux(B,W,T,k,c,C,!1,this.id);return{remuxResult:m,chunkMeta:E}},g.transmuxSampleAes=function(d,c,C,E,w){var B=this;return this.demuxer.demuxSampleAes(d,c,C).then(function(W){var T=B.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,C,E,!1,B.id);return{remuxResult:T,chunkMeta:w}})},g.configureTransmuxer=function(d,c){for(var C=this.config,E=this.observer,w=this.typeSupported,B=this.vendor,W=c.audioCodec,T=c.defaultInitPts,k=c.duration,m=c.initSegmentData,y=c.videoCodec,H,Q=0,te=l.length;Q<te;Q++)if(l[Q].demux.probe(d)){H=l[Q];break}H||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:K.default,remux:f.default});var ae=this.demuxer,Te=this.remuxer,_e=H.remux,ge=H.demux;(!Te||!(Te instanceof _e))&&(this.remuxer=new _e(E,C,w,B)),(!ae||!(ae instanceof ge))&&(this.demuxer=new ge(E,C,w),this.probe=ge.probe),this.resetInitSegment(m,W,y,k),this.resetInitialTimestamp(T)},g.needsProbing=function(d,c,C){return!this.demuxer||!this.remuxer||c||C},g.getDecrypter=function(){var d=this.decrypter;return d||(d=this.decrypter=new M.default(this.observer,this.config)),d},O}();function i(O,g){var _=null;return O.byteLength>0&&g!=null&&g.key!=null&&g.iv!==null&&g.method!=null&&(_=g),_}var D=function(g){return{remuxResult:{},chunkMeta:g}};function A(O){return"then"in O&&O.then instanceof Function}var S=function(g,_,d,c,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=g,this.videoCodec=_,this.initSegmentData=d,this.duration=c,this.defaultInitPts=C},R=function(g,_,d,c,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=g,this.contiguous=_,this.accurateTimeOffset=d,this.trackSwitch=c,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"discardEPB",function(){return D});var z=N("./src/demux/adts.ts"),I=N("./src/demux/mpegaudio.ts"),M=N("./src/demux/exp-golomb.ts"),G=N("./src/demux/id3.ts"),K=N("./src/demux/sample-aes.ts"),n=N("./src/events.ts"),L=N("./src/utils/mp4-tools.ts"),x=N("./src/utils/logger.ts"),f=N("./src/errors.ts"),b={video:1,audio:2,id3:3,text:4},h=function(){function A(R,O,g){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=R,this.config=O,this.typeSupported=g}A.probe=function(O){var g=A.syncOffset(O);return g<0?!1:(g&&x.logger.warn("MPEG2-TS detected but first sync word found @ offset "+g+", junk ahead ?"),!0)},A.syncOffset=function(O){for(var g=Math.min(1e3,O.length-3*188),_=0;_<g;){if(O[_]===71&&O[_+188]===71&&O[_+2*188]===71)return _;_++}return-1},A.createTrack=function(O,g){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:b[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?g:void 0}};var S=A.prototype;return S.resetInitSegment=function(O,g,_){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=A.createTrack("video",_),this._audioTrack=A.createTrack("audio",_),this._id3Track=A.createTrack("id3",_),this._txtTrack=A.createTrack("text",_),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=g,this._duration=_},S.resetTimeStamp=function(){},S.resetContiguity=function(){var O=this._audioTrack,g=this._avcTrack,_=this._id3Track;O&&(O.pesData=null),g&&(g.pesData=null),_&&(_.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(O,g,_,d){_===void 0&&(_=!1),d===void 0&&(d=!1),_||(this.sampleAes=null);var c,C=this._avcTrack,E=this._audioTrack,w=this._id3Track,B=C.pid,W=C.pesData,T=E.pid,k=w.pid,m=E.pesData,y=w.pesData,H=!1,Q=this.pmtParsed,te=this._pmtId,ae=O.length;if(this.remainderData&&(O=Object(L.appendUint8Array)(this.remainderData,O),ae=O.length,this.remainderData=null),ae<188&&!d)return this.remainderData=O,{audioTrack:E,avcTrack:C,id3Track:w,textTrack:this._txtTrack};var Te=Math.max(0,A.syncOffset(O));ae-=(ae+Te)%188,ae<O.byteLength&&!d&&(this.remainderData=new Uint8Array(O.buffer,ae,O.buffer.byteLength-ae));for(var _e=Te;_e<ae;_e+=188)if(O[_e]===71){var ge=!!(O[_e+1]&64),ve=((O[_e+1]&31)<<8)+O[_e+2],Oe=(O[_e+3]&48)>>4,he=void 0;if(Oe>1){if(he=_e+5+O[_e+4],he===_e+188)continue}else he=_e+4;switch(ve){case B:ge&&(W&&(c=u(W))&&this.parseAVCPES(c,!1),W={data:[],size:0}),W&&(W.data.push(O.subarray(he,_e+188)),W.size+=_e+188-he);break;case T:ge&&(m&&(c=u(m))&&(E.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),m={data:[],size:0}),m&&(m.data.push(O.subarray(he,_e+188)),m.size+=_e+188-he);break;case k:ge&&(y&&(c=u(y))&&this.parseID3PES(c),y={data:[],size:0}),y&&(y.data.push(O.subarray(he,_e+188)),y.size+=_e+188-he);break;case 0:ge&&(he+=O[he]+1),te=this._pmtId=p(O,he);break;case te:{ge&&(he+=O[he]+1);var V=l(O,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);B=V.avc,B>0&&(C.pid=B),T=V.audio,T>0&&(E.pid=T,E.isAAC=V.isAAC),k=V.id3,k>0&&(w.pid=k),H&&!Q&&(x.logger.log("reparse from beginning"),H=!1,_e=Te-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=W,E.pesData=m,w.pesData=y;var P={audioTrack:E,avcTrack:C,id3Track:w,textTrack:this._txtTrack};return d&&this.extractRemainingSamples(P),P},S.flush=function(){var O=this.remainderData;this.remainderData=null;var g;return O?g=this.demux(O,-1,!1,!0):g={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(g),this.sampleAes?this.decrypt(g,this.sampleAes):g},S.extractRemainingSamples=function(O){var g=O.audioTrack,_=O.avcTrack,d=O.id3Track,c=_.pesData,C=g.pesData,E=d.pesData,w;c&&(w=u(c))?(this.parseAVCPES(w,!0),_.pesData=null):_.pesData=c,C&&(w=u(C))?(g.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),g.pesData=null):(C!=null&&C.size&&x.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=C),E&&(w=u(E))?(this.parseID3PES(w),d.pesData=null):d.pesData=E},S.demuxSampleAes=function(O,g,_){var d=this.demux(O,_,!0,!this.config.progressive),c=this.sampleAes=new K.default(this.observer,this.config,g);return this.decrypt(d,c)},S.decrypt=function(O,g){return new Promise(function(_){var d=O.audioTrack,c=O.avcTrack;d.samples&&d.isAAC?g.decryptAacSamples(d.samples,0,function(){c.samples?g.decryptAvcSamples(c.samples,0,0,function(){_(O)}):_(O)}):c.samples&&g.decryptAvcSamples(c.samples,0,0,function(){_(O)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(O,g){var _=this,d=this._avcTrack,c=this.parseAVCNALu(O.data),C=!1,E=this.avcSample,w,B=!1;O.data=null,E&&c.length&&!d.audFound&&(s(E,d),E=this.avcSample=o(!1,O.pts,O.dts,"")),c.forEach(function(W){switch(W.type){case 1:{w=!0,E||(E=_.avcSample=o(!0,O.pts,O.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var T=W.data;if(B&&T.length>4){var k=new M.default(T).readSliceType();(k===2||k===4||k===7||k===9)&&(E.key=!0)}break}case 5:w=!0,E||(E=_.avcSample=o(!0,O.pts,O.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{w=!0,C&&E&&(E.debug+="SEI ");var m=new M.default(D(W.data));m.readUByte();for(var y=0,H=0,Q=!1,te=0;!Q&&m.bytesAvailable>1;){y=0;do te=m.readUByte(),y+=te;while(te===255);H=0;do te=m.readUByte(),H+=te;while(te===255);if(y===4&&m.bytesAvailable!==0){Q=!0;var ae=m.readUByte();if(ae===181){var Te=m.readUShort();if(Te===49){var _e=m.readUInt();if(_e===1195456820){var ge=m.readUByte();if(ge===3){for(var ve=m.readUByte(),Oe=m.readUByte(),he=31&ve,V=[ve,Oe],P=0;P<he;P++)V.push(m.readUByte()),V.push(m.readUByte()),V.push(m.readUByte());i(_._txtTrack.samples,{type:3,pts:O.pts,bytes:V})}}}}}else if(y===5&&m.bytesAvailable!==0){if(Q=!0,H>16){for(var j=[],$=0;$<16;$++)j.push(m.readUByte().toString(16)),($===3||$===5||$===7||$===9)&&j.push("-");for(var J=H-16,X=new Uint8Array(J),ye=0;ye<J;ye++)X[ye]=m.readUByte();i(_._txtTrack.samples,{pts:O.pts,payloadType:y,uuid:j.join(""),userData:Object(G.utf8ArrayToStr)(X),userDataBytes:X})}}else if(H<m.bytesAvailable)for(var Re=0;Re<H;Re++)m.readUByte()}break}case 7:if(w=!0,B=!0,C&&E&&(E.debug+="SPS "),!d.sps){var Ke=new M.default(W.data),pe=Ke.readSPS();d.width=pe.width,d.height=pe.height,d.pixelRatio=pe.pixelRatio,d.sps=[W.data],d.duration=_._duration;for(var we=W.data.subarray(1,4),ke="avc1.",Ue=0;Ue<3;Ue++){var Qe=we[Ue].toString(16);Qe.length<2&&(Qe="0"+Qe),ke+=Qe}d.codec=ke}break;case 8:w=!0,C&&E&&(E.debug+="PPS "),d.pps||(d.pps=[W.data]);break;case 9:w=!1,d.audFound=!0,E&&s(E,d),E=_.avcSample=o(!1,O.pts,O.dts,C?"AUD ":"");break;case 12:w=!1;break;default:w=!1,E&&(E.debug+="unknown NAL "+W.type+" ");break}if(E&&w){var nt=E.units;nt.push(W)}}),g&&E&&(s(E,d),this.avcSample=null)},S.getLastNalUnit=function(){var O,g=this.avcSample,_;if(!g||g.units.length===0){var d=this._avcTrack.samples;g=d[d.length-1]}if((O=g)!==null&&O!==void 0&&O.units){var c=g.units;_=c[c.length-1]}return _},S.parseAVCNALu=function(O){var g=O.byteLength,_=this._avcTrack,d=_.naluState||0,c=d,C=[],E=0,w,B,W,T=-1,k=0;for(d===-1&&(T=0,k=O[0]&31,d=0,E=1);E<g;){if(w=O[E++],!d){d=w?0:1;continue}if(d===1){d=w?0:2;continue}if(!w)d=3;else if(w===1){if(T>=0){var m={data:O.subarray(T,E-d-1),type:k};C.push(m)}else{var y=this.getLastNalUnit();if(y&&(c&&E<=4-c&&(y.state&&(y.data=y.data.subarray(0,y.data.byteLength-c))),B=E-d-1,B>0)){var H=new Uint8Array(y.data.byteLength+B);H.set(y.data,0),H.set(O.subarray(0,B),y.data.byteLength),y.data=H,y.state=0}}E<g?(W=O[E]&31,T=E,k=W,d=0):d=-1}else d=0}if(T>=0&&d>=0){var Q={data:O.subarray(T,g),type:k,state:d};C.push(Q)}if(C.length===0){var te=this.getLastNalUnit();if(te){var ae=new Uint8Array(te.data.byteLength+O.byteLength);ae.set(te.data,0),ae.set(O,te.data.byteLength),te.data=ae}}return _.naluState=d,C},S.parseAACPES=function(O){var g=0,_=this._audioTrack,d=this.aacOverFlow,c=O.data;if(d){this.aacOverFlow=null;var C=d.sample.unit.byteLength,E=Math.min(d.missing,C),w=C-E;d.sample.unit.set(c.subarray(0,E),w),_.samples.push(d.sample),g=d.missing}var B,W;for(B=g,W=c.length;B<W-1&&!z.isHeader(c,B);B++);if(B!==g){var T,k;if(B<W-1?(T="AAC PES did not start with ADTS header,offset:"+B,k=!1):(T="no ADTS header found in AAC PES",k=!0),x.logger.warn("parsing error:"+T),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:k,reason:T}),k)return}z.initTrackConfig(_,this.observer,c,B,this.audioCodec);var m;if(O.pts!==void 0)m=O.pts;else if(d){var y=z.getFrameDuration(_.samplerate);m=d.sample.pts+y}else{x.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;B<W;)if(z.isHeader(c,B)){if(B+5<W){var Q=z.appendFrame(_,c,B,m,H);if(Q)if(Q.missing)this.aacOverFlow=Q;else{B+=Q.length,H++;continue}}break}else B++},S.parseMPEGPES=function(O){var g=O.data,_=g.length,d=0,c=0,C=O.pts;if(C===void 0){x.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<_;)if(I.isHeader(g,c)){var E=I.appendFrame(this._audioTrack,g,c,C,d);if(E)c+=E.length,d++;else break}else c++},S.parseID3PES=function(O){if(O.pts===void 0){x.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},A}();h.minProbeByteLength=188;function o(A,S,R,O){return{key:A,frame:!1,pts:S,dts:R,units:[],debug:O,length:0}}function p(A,S){return(A[S+10]&31)<<8|A[S+11]}function l(A,S,R,O){var g={audio:-1,avc:-1,id3:-1,isAAC:!0},_=(A[S+1]&15)<<8|A[S+2],d=S+3+_-4,c=(A[S+10]&15)<<8|A[S+11];for(S+=12+c;S<d;){var C=(A[S+1]&31)<<8|A[S+2];switch(A[S]){case 207:if(!O){x.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:g.audio===-1&&(g.audio=C);break;case 21:g.id3===-1&&(g.id3=C);break;case 219:if(!O){x.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:g.avc===-1&&(g.avc=C);break;case 3:case 4:R?g.audio===-1&&(g.audio=C,g.isAAC=!1):x.logger.log("MPEG audio found, not supported in this browser");break;case 36:x.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((A[S+3]&15)<<8|A[S+4])+5}return g}function u(A){var S=0,R,O,g,_,d,c=A.data;if(!A||A.size===0)return null;for(;c[0].length<19&&c.length>1;){var C=new Uint8Array(c[0].length+c[1].length);C.set(c[0]),C.set(c[1],c[0].length),c[0]=C,c.splice(1,1)}R=c[0];var E=(R[0]<<16)+(R[1]<<8)+R[2];if(E===1){if(O=(R[4]<<8)+R[5],O&&O>A.size-6)return null;var w=R[7];w&192&&(_=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,w&64?(d=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,_-d>60*9e4&&(x.logger.warn(Math.round((_-d)/9e4)+"s delta between PTS and DTS, align them"),_=d)):d=_),g=R[8];var B=g+9;if(A.size<=B)return null;A.size-=B;for(var W=new Uint8Array(A.size),T=0,k=c.length;T<k;T++){R=c[T];var m=R.byteLength;if(B)if(B>m){B-=m;continue}else R=R.subarray(B),m-=B,B=0;W.set(R,S),S+=m}return O&&(O-=g+3),{data:W,pts:_,dts:d,len:O}}return null}function s(A,S){if(A.units.length&&A.frame){if(A.pts===void 0){var R=S.samples,O=R.length;if(O){var g=R[O-1];A.pts=g.pts,A.dts=g.dts}else{S.dropped++;return}}S.samples.push(A)}A.debug.length&&x.logger.log(A.pts+"/"+A.dts+":"+A.debug)}function i(A,S){var R=A.length;if(R>0){if(S.pts>=A[R-1].pts)A.push(S);else for(var O=R-1;O>=0;O--)if(S.pts<A[O].pts){A.splice(O,0,S);break}}else A.push(S)}function D(A){for(var S=A.byteLength,R=[],O=1;O<S-2;)A[O]===0&&A[O+1]===0&&A[O+2]===3?(R.push(O+2),O+=2):O++;if(R.length===0)return A;var g=S-R.length,_=new Uint8Array(g),d=0;for(O=0;O<g;d++,O++)d===R[0]&&(d++,R.shift()),_[O]=A[d];return _}Y.default=h},"./src/errors.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"ErrorTypes",function(){return z}),N.d(Y,"ErrorDetails",function(){return I});var z;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(z||(z={}));var I;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(I||(I={}))},"./src/events.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"Events",function(){return z});var z;(function(I){I.MEDIA_ATTACHING="hlsMediaAttaching",I.MEDIA_ATTACHED="hlsMediaAttached",I.MEDIA_DETACHING="hlsMediaDetaching",I.MEDIA_DETACHED="hlsMediaDetached",I.BUFFER_RESET="hlsBufferReset",I.BUFFER_CODECS="hlsBufferCodecs",I.BUFFER_CREATED="hlsBufferCreated",I.BUFFER_APPENDING="hlsBufferAppending",I.BUFFER_APPENDED="hlsBufferAppended",I.BUFFER_EOS="hlsBufferEos",I.BUFFER_FLUSHING="hlsBufferFlushing",I.BUFFER_FLUSHED="hlsBufferFlushed",I.MANIFEST_LOADING="hlsManifestLoading",I.MANIFEST_LOADED="hlsManifestLoaded",I.MANIFEST_PARSED="hlsManifestParsed",I.LEVEL_SWITCHING="hlsLevelSwitching",I.LEVEL_SWITCHED="hlsLevelSwitched",I.LEVEL_LOADING="hlsLevelLoading",I.LEVEL_LOADED="hlsLevelLoaded",I.LEVEL_UPDATED="hlsLevelUpdated",I.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",I.LEVELS_UPDATED="hlsLevelsUpdated",I.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",I.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",I.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",I.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",I.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",I.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",I.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",I.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",I.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",I.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",I.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",I.CUES_PARSED="hlsCuesParsed",I.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",I.INIT_PTS_FOUND="hlsInitPtsFound",I.FRAG_LOADING="hlsFragLoading",I.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",I.FRAG_LOADED="hlsFragLoaded",I.FRAG_DECRYPTED="hlsFragDecrypted",I.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",I.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",I.FRAG_PARSING_METADATA="hlsFragParsingMetadata",I.FRAG_PARSED="hlsFragParsed",I.FRAG_BUFFERED="hlsFragBuffered",I.FRAG_CHANGED="hlsFragChanged",I.FPS_DROP="hlsFpsDrop",I.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",I.ERROR="hlsError",I.DESTROYING="hlsDestroying",I.KEY_LOADING="hlsKeyLoading",I.KEY_LOADED="hlsKeyLoaded",I.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",I.BACK_BUFFER_REACHED="hlsBackBufferReached"})(z||(z={}))},"./src/hls.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return A});var z=N("./node_modules/url-toolkit/src/url-toolkit.js"),I=N.n(z),M=N("./src/loader/playlist-loader.ts"),G=N("./src/loader/key-loader.ts"),K=N("./src/controller/id3-track-controller.ts"),n=N("./src/controller/latency-controller.ts"),L=N("./src/controller/level-controller.ts"),x=N("./src/controller/fragment-tracker.ts"),f=N("./src/controller/stream-controller.ts"),b=N("./src/is-supported.ts"),h=N("./src/utils/logger.ts"),o=N("./src/config.ts"),p=N("./node_modules/eventemitter3/index.js"),l=N.n(p),u=N("./src/events.ts"),s=N("./src/errors.ts");function i(S,R){for(var O=0;O<R.length;O++){var g=R[O];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(S,g.key,g)}}function D(S,R,O){return R&&i(S.prototype,R),O&&i(S,O),S}var A=function(){S.isSupported=function(){return Object(b.isSupported)()};function S(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.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 g=this.config=Object(o.mergeConfig)(S.DefaultConfig,O);this.userConfig=O,Object(h.enableLogs)(g.debug),this._autoLevelCapping=-1,g.progressive&&Object(o.enableStreamingMode)(g);var _=g.abrController,d=g.bufferController,c=g.capLevelController,C=g.fpsController,E=this.abrController=new _(this),w=this.bufferController=new d(this),B=this.capLevelController=new c(this),W=new C(this),T=new M.default(this),k=new G.default(this),m=new K.default(this),y=this.levelController=new L.default(this),H=new x.FragmentTracker(this),Q=this.streamController=new f.default(this,H);B.setStreamController(Q),W.setStreamController(Q);var te=[y,Q];this.networkControllers=te;var ae=[T,k,E,w,B,W,m,H];this.audioTrackController=this.createController(g.audioTrackController,null,te),this.createController(g.audioStreamController,H,te),this.subtitleTrackController=this.createController(g.subtitleTrackController,null,te),this.createController(g.subtitleStreamController,H,te),this.createController(g.timelineController,null,ae),this.emeController=this.createController(g.emeController,null,ae),this.cmcdController=this.createController(g.cmcdController,null,ae),this.latencyController=this.createController(n.default,null,ae),this.coreComponents=ae}var R=S.prototype;return R.createController=function(g,_,d){if(g){var c=_?new g(this,_):new g(this);return d&&d.push(c),c}return null},R.on=function(g,_,d){d===void 0&&(d=this),this._emitter.on(g,_,d)},R.once=function(g,_,d){d===void 0&&(d=this),this._emitter.once(g,_,d)},R.removeAllListeners=function(g){this._emitter.removeAllListeners(g)},R.off=function(g,_,d,c){d===void 0&&(d=this),this._emitter.off(g,_,d,c)},R.listeners=function(g){return this._emitter.listeners(g)},R.emit=function(g,_,d){return this._emitter.emit(g,_,d)},R.trigger=function(g,_){if(this.config.debug)return this.emit(g,g,_);try{return this.emit(g,g,_)}catch(d){h.logger.error("An internal error happened while handling event "+g+'. Error message: "'+d.message+'". Here is a stacktrace:',d),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:g,error:d})}return!1},R.listenerCount=function(g){return this._emitter.listenerCount(g)},R.destroy=function(){h.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(g){return g.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(g){return g.destroy()}),this.coreComponents.length=0},R.attachMedia=function(g){h.logger.log("attachMedia"),this._media=g,this.trigger(u.Events.MEDIA_ATTACHING,{media:g})},R.detachMedia=function(){h.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(g){this.stopLoad();var _=this.media,d=this.url,c=this.url=z.buildAbsoluteURL(self.location.href,g,{alwaysNormalize:!0});h.logger.log("loadSource:"+c),_&&d&&d!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(_)),this.trigger(u.Events.MANIFEST_LOADING,{url:g})},R.startLoad=function(g){g===void 0&&(g=-1),h.logger.log("startLoad("+g+")"),this.networkControllers.forEach(function(_){_.startLoad(g)})},R.stopLoad=function(){h.logger.log("stopLoad"),this.networkControllers.forEach(function(g){g.stopLoad()})},R.swapAudioCodec=function(){h.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){h.logger.log("recoverMediaError");var g=this._media;this.detachMedia(),g&&this.attachMedia(g)},R.removeLevel=function(g,_){_===void 0&&(_=0),this.levelController.removeLevel(g,_)},D(S,[{key:"levels",get:function(){var g=this.levelController.levels;return g||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(g){h.logger.log("set currentLevel:"+g),this.loadLevel=g,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(g){h.logger.log("set nextLevel:"+g),this.levelController.manualLevel=g,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(g){h.logger.log("set loadLevel:"+g),this.levelController.manualLevel=g}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(g){this.levelController.nextLoadLevel=g}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(g){h.logger.log("set firstLevel:"+g),this.levelController.firstLevel=g}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(g){h.logger.log("set startLevel:"+g),g!==-1&&(g=Math.max(g,this.minAutoLevel)),this.levelController.startLevel=g}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(g){var _=!!g;_!==this.config.capLevelToPlayerSize&&(_?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=_)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(g){this._autoLevelCapping!==g&&(h.logger.log("set autoLevelCapping:"+g),this._autoLevelCapping=g)}},{key:"bandwidthEstimate",get:function(){var g=this.abrController.bwEstimator;return g?g.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var g=this.levels,_=this.config.minAutoBitrate;if(!g)return 0;for(var d=g.length,c=0;c<d;c++)if(g[c].maxBitrate>_)return c;return 0}},{key:"maxAutoLevel",get:function(){var g=this.levels,_=this.autoLevelCapping,d;return _===-1&&g&&g.length?d=g.length-1:d=_,d}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(g){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,g)}},{key:"audioTracks",get:function(){var g=this.audioTrackController;return g?g.audioTracks:[]}},{key:"audioTrack",get:function(){var g=this.audioTrackController;return g?g.audioTrack:-1},set:function(g){var _=this.audioTrackController;_&&(_.audioTrack=g)}},{key:"subtitleTracks",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTrack:-1},set:function(g){var _=this.subtitleTrackController;_&&(_.subtitleTrack=g)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var g=this.subtitleTrackController;return g?g.subtitleDisplay:!1},set:function(g){var _=this.subtitleTrackController;_&&(_.subtitleDisplay=g)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(g){this.config.lowLatencyMode=g}},{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 u.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:o.hlsDefaultConfig},set:function(g){S.defaultConfig=g}}]),S}();A.defaultConfig=void 0},"./src/is-supported.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"isSupported",function(){return M}),N.d(Y,"changeTypeSupported",function(){return G});var z=N("./src/utils/mediasource-helper.ts");function I(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var K=Object(z.getMediaSource)();if(!K)return!1;var n=I(),L=K&&typeof K.isTypeSupported=="function"&&K.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),x=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!L&&!!x}function G(){var K,n=I();return typeof(n==null||((K=n.prototype)===null||K===void 0)?void 0:K.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return h}),N.d(Y,"LoadError",function(){return p});var z=N("./src/polyfills/number.ts"),I=N("./src/errors.ts");function M(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,x(l,u)}function G(l){var u=typeof Map=="function"?new Map:void 0;return G=function(i){if(i===null||!L(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(i))return u.get(i);u.set(i,D)}function D(){return K(i,arguments,f(this).constructor)}return D.prototype=Object.create(i.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),x(D,i)},G(l)}function K(l,u,s){return n()?K=Reflect.construct:K=function(D,A,S){var R=[null];R.push.apply(R,A);var O=Function.bind.apply(D,R),g=new O;return S&&x(g,S.prototype),g},K.apply(null,arguments)}function n(){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(l){return!1}}function L(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function x(l,u){return x=Object.setPrototypeOf||function(i,D){return i.__proto__=D,i},x(l,u)}function f(l){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},f(l)}var b=Math.pow(2,17),h=function(){function l(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var u=l.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(i,D){var A=this,S=i.url;if(!S)return Promise.reject(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(_,d){A.loader&&A.loader.destroy();var c=A.loader=i.loader=O?new O(R):new g(R),C=o(i),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:b};i.stats=c.stats,c.load(C,E,{onSuccess:function(B,W,T,k){A.resetLoader(i,c),_({frag:i,part:null,payload:B.data,networkDetails:k})},onError:function(B,W,T){A.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:B,networkDetails:T}))},onAbort:function(B,W,T){A.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:T}))},onTimeout:function(B,W,T){A.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:T}))},onProgress:function(B,W,T,k){D&&D({frag:i,part:null,payload:T,networkDetails:k})}})})},u.loadPart=function(i,D,A){var S=this;this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(_,d){S.loader&&S.loader.destroy();var c=S.loader=i.loader=O?new O(R):new g(R),C=o(i,D),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:b};D.stats=c.stats,c.load(C,E,{onSuccess:function(B,W,T,k){S.resetLoader(i,c),S.updateStatsFromPart(i,D);var m={frag:i,part:D,payload:B.data,networkDetails:k};A(m),_(m)},onError:function(B,W,T){S.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:D,response:B,networkDetails:T}))},onAbort:function(B,W,T){i.stats.aborted=D.stats.aborted,S.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:D,networkDetails:T}))},onTimeout:function(B,W,T){S.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,part:D,networkDetails:T}))}})})},u.updateStatsFromPart=function(i,D){var A=i.stats,S=D.stats,R=S.total;if(A.loaded+=S.loaded,R){var O=Math.round(i.duration/D.duration),g=Math.min(Math.round(A.loaded/R),O),_=O-g,d=_*Math.round(A.loaded/g);A.total=A.loaded+d}else A.total=Math.max(A.loaded,A.total);var c=A.loading,C=S.loading;c.start?c.first+=C.first-C.start:(c.start=C.start,c.first=C.first),c.end=C.end},u.resetLoader=function(i,D){i.loader=null,this.loader===D&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),D.destroy()},l}();function o(l,u){u===void 0&&(u=null);var s=u||l,i={frag:l,part:u,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},D=s.byteRangeStartOffset,A=s.byteRangeEndOffset;return Object(z.isFiniteNumber)(D)&&Object(z.isFiniteNumber)(A)&&(i.rangeStart=D,i.rangeEnd=A),i}var p=function(l){M(u,l);function u(s){for(var i,D=arguments.length,A=new Array(D>1?D-1:0),S=1;S<D;S++)A[S-1]=arguments[S];return i=l.call.apply(l,[this].concat(A))||this,i.data=void 0,i.data=s,i}return u}(G(Error))},"./src/loader/fragment.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"ElementaryStreamTypes",function(){return h}),N.d(Y,"BaseSegment",function(){return o}),N.d(Y,"Fragment",function(){return p}),N.d(Y,"Part",function(){return l});var z=N("./src/polyfills/number.ts"),I=N("./node_modules/url-toolkit/src/url-toolkit.js"),M=N.n(I),G=N("./src/utils/logger.ts"),K=N("./src/loader/level-key.ts"),n=N("./src/loader/load-stats.ts");function L(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,x(u,s)}function x(u,s){return x=Object.setPrototypeOf||function(D,A){return D.__proto__=A,D},x(u,s)}function f(u,s){for(var i=0;i<s.length;i++){var D=s[i];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(u,D.key,D)}}function b(u,s,i){return s&&f(u.prototype,s),i&&f(u,i),u}var h;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(h||(h={}));var o=function(){function u(i){var D;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(D={},D[h.AUDIO]=null,D[h.VIDEO]=null,D[h.AUDIOVIDEO]=null,D),this.baseurl=i}var s=u.prototype;return s.setByteRange=function(D,A){var S=D.split("@",2),R=[];S.length===1?R[0]=A?A.byteRangeEndOffset:0:R[0]=parseInt(S[1]),R[1]=parseInt(S[0])+R[0],this._byteRange=R},b(u,[{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(I.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(D){this._url=D}}]),u}(),p=function(u){L(s,u);function s(D,A){var S;return S=u.call(this,A)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new n.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=D,S}var i=s.prototype;return i.createInitializationVector=function(A){for(var S=new Uint8Array(16),R=12;R<16;R++)S[R]=A>>8*(15-R)&255;return S},i.setDecryptDataFromLevelKey=function(A,S){var R=A;return(A==null?void 0:A.method)==="AES-128"&&A.uri&&!A.iv&&(R=K.LevelKey.fromURI(A.uri),R.method=A.method,R.iv=this.createInitializationVector(S),R.keyFormat="identity"),R},i.setElementaryStreamInfo=function(A,S,R,O,g,_){_===void 0&&(_=!1);var d=this.elementaryStreams,c=d[A];if(!c){d[A]={startPTS:S,endPTS:R,startDTS:O,endDTS:g,partial:_};return}c.startPTS=Math.min(c.startPTS,S),c.endPTS=Math.max(c.endPTS,R),c.startDTS=Math.min(c.startDTS,O),c.endDTS=Math.max(c.endDTS,g)},i.clearElementaryStreamInfo=function(){var A=this.elementaryStreams;A[h.AUDIO]=null,A[h.VIDEO]=null,A[h.AUDIOVIDEO]=null},b(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var A=this.sn;typeof A!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),A=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,A)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(z.isFiniteNumber)(this.programDateTime))return null;var A=Object(z.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+A*1e3}},{key:"encrypted",get:function(){var A;return!!((A=this.decryptdata)!==null&&A!==void 0&&A.keyFormat&&this.decryptdata.uri)}}]),s}(o),l=function(u){L(s,u);function s(i,D,A,S,R){var O;O=u.call(this,A)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new n.LoadStats,O.duration=i.decimalFloatingPoint("DURATION"),O.gap=i.bool("GAP"),O.independent=i.bool("INDEPENDENT"),O.relurl=i.enumeratedString("URI"),O.fragment=D,O.index=S;var g=i.enumeratedString("BYTERANGE");return g&&O.setByteRange(g,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return b(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var D=this.elementaryStreams;return!!(D.audio||D.video||D.audiovideo)}}]),s}(o)},"./src/loader/key-loader.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return G});var z=N("./src/events.ts"),I=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),G=function(){function K(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var n=K.prototype;return n._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var x in this.loaders){var f=this.loaders[x];f&&f.destroy()}this.loaders={}},n.onKeyLoading=function(x,f){var b=f.frag,h=b.type,o=this.loaders[h];if(!b.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var p=b.decryptdata.uri;if(p!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(o&&(M.logger.warn("abort previous key loader for type:"+h),o.abort()),!p){M.logger.warn("key uri is falsy");return}var u=l.loader,s=b.loader=this.loaders[h]=new u(l);this.decrypturl=p,this.decryptkey=null;var i={url:p,frag:b,responseType:"arraybuffer"},D={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},A={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(i,D,A)}else this.decryptkey&&(b.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:b}))},n.loadsuccess=function(x,f,b){var h=b.frag;if(!h.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(x.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:h})},n.loaderror=function(x,f){var b=f.frag,h=b.loader;h&&h.abort(),delete this.loaders[b.type],this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:b,response:x})},n.loadtimeout=function(x,f){var b=f.frag,h=b.loader;h&&h.abort(),delete this.loaders[b.type],this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:b})},K}()},"./src/loader/level-details.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"LevelDetails",function(){return K});var z=N("./src/polyfills/number.ts");function I(n,L){for(var x=0;x<L.length;x++){var f=L[x];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function M(n,L,x){return L&&I(n.prototype,L),x&&I(n,x),n}var G=10,K=function(){function n(x){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=x}var L=n.prototype;return L.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var b=this.lastPartSn-f.lastPartSn,h=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!h||!!b,this.advanced=this.endSN>f.endSN||b>0||b===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},M(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var b=this.driftEnd-this.driftStart;return b*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"LevelKey",function(){return K});var z=N("./node_modules/url-toolkit/src/url-toolkit.js"),I=N.n(z);function M(n,L){for(var x=0;x<L.length;x++){var f=L[x];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function G(n,L,x){return L&&M(n.prototype,L),x&&M(n,x),n}var K=function(){n.fromURL=function(x,f){return new n(x,f)},n.fromURI=function(x){return new n(x)};function n(L,x){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,x?this._uri=Object(z.buildAbsoluteURL)(L,x,{alwaysNormalize:!0}):this._uri=L}return G(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"LoadStats",function(){return z});var z=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,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s});var z=N("./src/polyfills/number.ts"),I=N("./node_modules/url-toolkit/src/url-toolkit.js"),M=N.n(I),G=N("./src/loader/fragment.ts"),K=N("./src/loader/level-details.ts"),n=N("./src/loader/level-key.ts"),L=N("./src/utils/attr-list.ts"),x=N("./src/utils/logger.ts"),f=N("./src/utils/codecs.ts"),b=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,h=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),p=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("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function u(R){var O,g;return l.test((O=(g=I.parseURL(R))===null||g===void 0?void 0:g.path)!=null?O:"")}var s=function(){function R(){}return R.findGroup=function(g,_){for(var d=0;d<g.length;d++){var c=g[d];if(c.id===_)return c}},R.convertAVC1ToAVCOTI=function(g){var _=g.split(".");if(_.length>2){var d=_.shift()+".";return d+=parseInt(_.shift()).toString(16),d+=("000"+parseInt(_.shift()).toString(16)).substr(-4),d}return g},R.resolve=function(g,_){return I.buildAbsoluteURL(_,g,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(g,_){var d=[],c={},C=!1;b.lastIndex=0;for(var E;(E=b.exec(g))!=null;)if(E[1]){var w=new L.AttrList(E[1]),B={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:R.resolve(E[2],_)},W=w.decimalResolution("RESOLUTION");W&&(B.width=W.width,B.height=W.height),i((w.CODECS||"").split(/[ ,]+/).filter(function(k){return k}),B),B.videoCodec&&B.videoCodec.indexOf("avc1")!==-1&&(B.videoCodec=R.convertAVC1ToAVCOTI(B.videoCodec)),d.push(B)}else if(E[3]){var T=new L.AttrList(E[3]);T["DATA-ID"]&&(C=!0,c[T["DATA-ID"]]=T)}return{levels:d,sessionData:C?c:null}},R.parseMasterPlaylistMedia=function(g,_,d,c){c===void 0&&(c=[]);var C,E=[],w=0;for(h.lastIndex=0;(C=h.exec(g))!==null;){var B=new L.AttrList(C[1]);if(B.TYPE===d){var W={attrs:B,bitrate:0,id:w++,groupId:B["GROUP-ID"],instreamId:B["INSTREAM-ID"],name:B.NAME||B.LANGUAGE||"",type:d,default:B.bool("DEFAULT"),autoselect:B.bool("AUTOSELECT"),forced:B.bool("FORCED"),lang:B.LANGUAGE,url:B.URI?R.resolve(B.URI,_):""};if(c.length){var T=R.findGroup(c,W.groupId)||c[0];D(W,T,"audioCodec"),D(W,T,"textCodec")}E.push(W)}}return E},R.parseLevelPlaylist=function(g,_,d,c,C){var E=new K.LevelDetails(_),w=E.fragments,B=null,W=0,T=0,k=0,m=0,y=null,H=new G.Fragment(c,_),Q,te,ae,Te=-1,_e=!1;for(o.lastIndex=0,E.m3u8=g;(Q=o.exec(g))!==null;){_e&&(_e=!1,H=new G.Fragment(c,_),H.start=k,H.sn=W,H.cc=m,H.level=d,B&&(H.initSegment=B,H.rawProgramDateTime=B.rawProgramDateTime));var ge=Q[1];if(ge){H.duration=parseFloat(ge);var ve=(" "+Q[2]).slice(1);H.title=ve||null,H.tagList.push(ve?["INF",ge,ve]:["INF",ge])}else if(Q[3])Object(z.isFiniteNumber)(H.duration)&&(H.start=k,ae&&(H.levelkey=ae),H.sn=W,H.level=d,H.cc=m,H.urlId=C,w.push(H),H.relurl=(" "+Q[3]).slice(1),S(H,y),y=H,k+=H.duration,W++,T=0,_e=!0);else if(Q[4]){var Oe=(" "+Q[4]).slice(1);y?H.setByteRange(Oe,y):H.setByteRange(Oe)}else if(Q[5])H.rawProgramDateTime=(" "+Q[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),Te===-1&&(Te=w.length);else{if(Q=Q[0].match(p),!Q){x.logger.warn("No matches on slow regex match for level playlist!");continue}for(te=1;te<Q.length&&!(typeof Q[te]!="undefined");te++);var he=(" "+Q[te]).slice(1),V=(" "+Q[te+1]).slice(1),P=Q[te+2]?(" "+Q[te+2]).slice(1):"";switch(he){case"PLAYLIST-TYPE":E.type=V.toUpperCase();break;case"MEDIA-SEQUENCE":W=E.startSN=parseInt(V);break;case"SKIP":{var j=new L.AttrList(V),$=j.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)($)){E.skippedSegments=$;for(var J=$;J--;)w.unshift(null);W+=$}var X=j.enumeratedString("RECENTLY-REMOVED-DATERANGES");X&&(E.recentlyRemovedDateranges=X.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(V);break;case"VERSION":E.version=parseInt(V);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(V||P)&&H.tagList.push(P?[V,P]:[V]);break;case"DIS":m++;case"GAP":H.tagList.push([he]);break;case"BITRATE":H.tagList.push([he,V]);break;case"DISCONTINUITY-SEQ":m=parseInt(V);break;case"KEY":{var ye,Re=new L.AttrList(V),Ke=Re.enumeratedString("METHOD"),pe=Re.URI,we=Re.hexadecimalInteger("IV"),ke=Re.enumeratedString("KEYFORMATVERSIONS"),Ue=Re.enumeratedString("KEYID"),Qe=(ye=Re.enumeratedString("KEYFORMAT"))!=null?ye:"identity",nt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(nt.indexOf(Qe)>-1){x.logger.warn("Keyformat "+Qe+" is not supported from the manifest");continue}else if(Qe!=="identity")continue;Ke&&(ae=n.LevelKey.fromURL(_,pe),pe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ke)>=0&&(ae.method=Ke,ae.keyFormat=Qe,Ue&&(ae.keyID=Ue),ke&&(ae.keyFormatVersions=ke),ae.iv=we));break}case"START":{var ot=new L.AttrList(V),qe=ot.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(qe)&&(E.startTimeOffset=qe);break}case"MAP":{var ft=new L.AttrList(V);H.relurl=ft.URI,ft.BYTERANGE&&H.setByteRange(ft.BYTERANGE),H.level=d,H.sn="initSegment",ae&&(H.levelkey=ae),H.initSegment=null,B=H,_e=!0;break}case"SERVER-CONTROL":{var lt=new L.AttrList(V);E.canBlockReload=lt.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=lt.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&lt.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=lt.optionalFloat("PART-HOLD-BACK",0),E.holdBack=lt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var pt=new L.AttrList(V);E.partTarget=pt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ye=E.partList;Ye||(Ye=E.partList=[]);var Tt=T>0?Ye[Ye.length-1]:void 0,bt=T++,me=new G.Part(new L.AttrList(V),H,_,bt,Tt);Ye.push(me),H.duration+=me.duration;break}case"PRELOAD-HINT":{var ne=new L.AttrList(V);E.preloadHint=ne;break}case"RENDITION-REPORT":{var q=new L.AttrList(V);E.renditionReports=E.renditionReports||[],E.renditionReports.push(q);break}default:x.logger.warn("line parsed but not handled: "+Q);break}}}y&&!y.relurl?(w.pop(),k-=y.duration,E.partList&&(E.fragmentHint=y)):E.partList&&(S(H,y),H.cc=m,E.fragmentHint=H);var se=w.length,ue=w[0],oe=w[se-1];if(k+=E.skippedSegments*E.targetduration,k>0&&se&&oe){E.averagetargetduration=k/se;var ce=oe.sn;E.endSN=ce!=="initSegment"?ce:0,ue&&(E.startCC=ue.cc,ue.initSegment||E.fragments.every(function(be){return be.relurl&&u(be.relurl)})&&(x.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new G.Fragment(c,_),H.relurl=oe.relurl,H.level=d,H.sn="initSegment",ue.initSegment=H,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(k+=E.fragmentHint.duration),E.totalduration=k,E.endCC=m,Te>0&&A(w,Te),E},R}();function i(R,O){["video","audio","text"].forEach(function(g){var _=R.filter(function(c){return Object(f.isCodecType)(c,g)});if(_.length){var d=_.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});O[g+"Codec"]=d.length>0?d[0]:_[0],R=R.filter(function(c){return _.indexOf(c)===-1})}}),O.unknownCodecs=R}function D(R,O,g){var _=O[g];_&&(R[g]=_)}function A(R,O){for(var g=R[O],_=O;_--;){var d=R[_];if(!d)return;d.programDateTime=g.programDateTime-d.duration*1e3,g=d}}function S(R,O){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):O!=null&&O.programDateTime&&(R.programDateTime=O.endProgramDateTime),Object(z.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),I=N("./src/events.ts"),M=N("./src/errors.ts"),G=N("./src/utils/logger.ts"),K=N("./src/utils/mp4-tools.ts"),n=N("./src/loader/m3u8-parser.ts"),L=N("./src/types/loader.ts"),x=N("./src/utils/attr-list.ts");function f(o){var p=o.type;switch(p){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function b(o,p){var l=o.url;return(l===void 0||l.indexOf("data:")===0)&&(l=p.url),l}var h=function(){function o(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var p=o.prototype;return p.registerListeners=function(){var u=this.hls;u.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(I.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var u=this.hls;u.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(I.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.createInternalLoader=function(u){var s=this.hls.config,i=s.pLoader,D=s.loader,A=i||D,S=new A(s);return u.loader=S,this.loaders[u.type]=S,S},p.getInternalLoader=function(u){return this.loaders[u.type]},p.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},p.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},p.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},p.onManifestLoading=function(u,s){var i=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},p.onLevelLoading=function(u,s){var i=s.id,D=s.level,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:null,level:D,responseType:"text",type:L.PlaylistContextType.LEVEL,url:A,deliveryDirectives:S})},p.onAudioTrackLoading=function(u,s){var i=s.id,D=s.groupId,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:D,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:A,deliveryDirectives:S})},p.onSubtitleTrackLoading=function(u,s){var i=s.id,D=s.groupId,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:D,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:A,deliveryDirectives:S})},p.load=function(u){var s,i=this.hls.config,D=this.getInternalLoader(u);if(D){var A=D.context;if(A&&A.url===u.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),D.abort()}var S,R,O,g;switch(u.type){case L.PlaylistContextType.MANIFEST:S=i.manifestLoadingMaxRetry,R=i.manifestLoadingTimeOut,O=i.manifestLoadingRetryDelay,g=i.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:S=0,R=i.levelLoadingTimeOut;break;default:S=i.levelLoadingMaxRetry,R=i.levelLoadingTimeOut,O=i.levelLoadingRetryDelay,g=i.levelLoadingMaxRetryTimeout;break}if(D=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var _;if(u.type===L.PlaylistContextType.LEVEL&&u.level!==null?_=this.hls.levels[u.level].details:u.type===L.PlaylistContextType.AUDIO_TRACK&&u.id!==null?_=this.hls.audioTracks[u.id].details:u.type===L.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(_=this.hls.subtitleTracks[u.id].details),_){var d=_.partTarget,c=_.targetduration;d&&c&&(R=Math.min(Math.max(d*3,c*.8)*1e3,R))}}var C={timeout:R,maxRetry:S,retryDelay:O,maxRetryDelay:g,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};D.load(u,C,E)},p.loadsuccess=function(u,s,i,D){if(D===void 0&&(D=null),i.isSidxRequest){this.handleSidxRequest(u,i),this.handlePlaylistLoaded(u,s,i,D);return}this.resetInternalLoader(i.type);var A=u.data;if(A.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,i,"no EXTM3U delimiter",D);return}s.parsing.start=performance.now(),A.indexOf("#EXTINF:")>0||A.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,s,i,D):this.handleMasterPlaylist(u,s,i,D)},p.loaderror=function(u,s,i){i===void 0&&(i=null),this.handleNetworkError(s,i,!1,u)},p.loadtimeout=function(u,s,i){i===void 0&&(i=null),this.handleNetworkError(s,i,!0)},p.handleMasterPlaylist=function(u,s,i,D){var A=this.hls,S=u.data,R=b(u,i),O=n.default.parseMasterPlaylist(S,R),g=O.levels,_=O.sessionData;if(!g.length){this.handleManifestParsingError(u,i,"no level found in manifest",D);return}var d=g.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),c=g.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),C=n.default.parseMasterPlaylistMedia(S,R,"AUDIO",d),E=n.default.parseMasterPlaylistMedia(S,R,"SUBTITLES",c),w=n.default.parseMasterPlaylistMedia(S,R,"CLOSED-CAPTIONS");if(C.length){var B=C.some(function(W){return!W.url});!B&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new x.AttrList({}),bitrate:0,url:""}))}A.trigger(I.Events.MANIFEST_LOADED,{levels:g,audioTracks:C,subtitles:E,captions:w,url:R,stats:s,networkDetails:D,sessionData:_})},p.handleTrackOrLevelPlaylist=function(u,s,i,D){var A=this.hls,S=i.id,R=i.level,O=i.type,g=b(u,i),_=Object(z.isFiniteNumber)(S)?S:0,d=Object(z.isFiniteNumber)(R)?R:_,c=f(i),C=n.default.parseLevelPlaylist(u.data,g,d,c,_);if(!C.fragments.length){A.trigger(I.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(O===L.PlaylistContextType.MANIFEST){var E={attrs:new x.AttrList({}),bitrate:0,details:C,name:"",url:g};A.trigger(I.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:g,stats:s,networkDetails:D,sessionData:null})}if(s.parsing.end=performance.now(),C.needSidxRanges){var w,B=(w=C.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:B,isSidxRequest:!0,type:O,level:R,levelDetails:C,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=C,this.handlePlaylistLoaded(u,s,i,D)},p.handleSidxRequest=function(u,s){var i=Object(K.parseSegmentIndex)(new Uint8Array(u.data));if(!i)return;var D=i.references,A=s.levelDetails;D.forEach(function(S,R){var O=S.info,g=A.fragments[R];g.byteRange.length===0&&g.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),g.initSegment&&g.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},p.handleManifestParsingError=function(u,s,i,D){this.hls.trigger(I.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===L.PlaylistContextType.MANIFEST,url:u.url,reason:i,response:u,context:s,networkDetails:D})},p.handleNetworkError=function(u,s,i,D){i===void 0&&(i=!1),G.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var A=M.ErrorDetails.UNKNOWN,S=!1,R=this.getInternalLoader(u);switch(u.type){case L.PlaylistContextType.MANIFEST:A=i?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case L.PlaylistContextType.LEVEL:A=i?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case L.PlaylistContextType.AUDIO_TRACK:A=i?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:A=i?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}R&&this.resetInternalLoader(u.type);var O={type:M.ErrorTypes.NETWORK_ERROR,details:A,fatal:S,url:u.url,loader:R,context:u,networkDetails:s};D&&(O.response=D),this.hls.trigger(I.Events.ERROR,O)},p.handlePlaylistLoaded=function(u,s,i,D){var A=i.type,S=i.level,R=i.id,O=i.groupId,g=i.loader,_=i.levelDetails,d=i.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(u,i,"invalid target duration",D);return}if(!g)return;_.live&&(g.getCacheAge&&(_.ageHeader=g.getCacheAge()||0),(!g.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(A){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(I.Events.LEVEL_LOADED,{details:_,level:S||0,id:R||0,stats:s,networkDetails:D,deliveryDirectives:d});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(I.Events.AUDIO_TRACK_LOADED,{details:_,id:R||0,groupId:O||"",stats:s,networkDetails:D,deliveryDirectives:d});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(I.Events.SUBTITLE_TRACK_LOADED,{details:_,id:R||0,groupId:O||"",stats:s,networkDetails:D,deliveryDirectives:d});break}},o}();Y.default=h},"./src/polyfills/number.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"isFiniteNumber",function(){return z}),N.d(Y,"MAX_SAFE_INTEGER",function(){return I});var z=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},I=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,Y,N){"use strict";N.r(Y);var z=function(){function I(){}return I.getSilentFrame=function(G,K){switch(G){case"mp4a.40.2":if(K===1)return new Uint8Array([0,200,0,128,35,128]);if(K===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(K===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(K===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(K===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(K===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(K===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(K===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(K===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},I}();Y.default=z},"./src/remux/mp4-generator.ts":function(ie,Y,N){"use strict";N.r(Y);var z=Math.pow(2,32)-1,I=function(){function M(){}return M.init=function(){M.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 K;for(K in M.types)M.types.hasOwnProperty(K)&&(M.types[K]=[K.charCodeAt(0),K.charCodeAt(1),K.charCodeAt(2),K.charCodeAt(3)]);var n=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]),L=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]);M.HDLR_TYPES={video:n,audio:L};var x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=f,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var b=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,b,o,b,h),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,x))},M.box=function(K){for(var n=8,L=arguments.length,x=new Array(L>1?L-1:0),f=1;f<L;f++)x[f-1]=arguments[f];for(var b=x.length,h=b;b--;)n+=x[b].byteLength;var o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(K,4),b=0,n=8;b<h;b++)o.set(x[b],n),n+=x[b].byteLength;return o},M.hdlr=function(K){return M.box(M.types.hdlr,M.HDLR_TYPES[K])},M.mdat=function(K){return M.box(M.types.mdat,K)},M.mdhd=function(K,n){n*=K;var L=Math.floor(n/(z+1)),x=Math.floor(n%(z+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,K>>24&255,K>>16&255,K>>8&255,K&255,L>>24,L>>16&255,L>>8&255,L&255,x>>24,x>>16&255,x>>8&255,x&255,85,196,0,0]))},M.mdia=function(K){return M.box(M.types.mdia,M.mdhd(K.timescale,K.duration),M.hdlr(K.type),M.minf(K))},M.mfhd=function(K){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,K>>24,K>>16&255,K>>8&255,K&255]))},M.minf=function(K){return K.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(K)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(K))},M.moof=function(K,n,L){return M.box(M.types.moof,M.mfhd(K),M.traf(L,n))},M.moov=function(K){for(var n=K.length,L=[];n--;)L[n]=M.trak(K[n]);return M.box.apply(null,[M.types.moov,M.mvhd(K[0].timescale,K[0].duration)].concat(L).concat(M.mvex(K)))},M.mvex=function(K){for(var n=K.length,L=[];n--;)L[n]=M.trex(K[n]);return M.box.apply(null,[M.types.mvex].concat(L))},M.mvhd=function(K,n){n*=K;var L=Math.floor(n/(z+1)),x=Math.floor(n%(z+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,K>>24&255,K>>16&255,K>>8&255,K&255,L>>24,L>>16&255,L>>8&255,L&255,x>>24,x>>16&255,x>>8&255,x&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 M.box(M.types.mvhd,f)},M.sdtp=function(K){var n=K.samples||[],L=new Uint8Array(4+n.length),x,f;for(x=0;x<n.length;x++)f=n[x].flags,L[x+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return M.box(M.types.sdtp,L)},M.stbl=function(K){return M.box(M.types.stbl,M.stsd(K),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(K){var n=[],L=[],x,f,b;for(x=0;x<K.sps.length;x++)f=K.sps[x],b=f.byteLength,n.push(b>>>8&255),n.push(b&255),n=n.concat(Array.prototype.slice.call(f));for(x=0;x<K.pps.length;x++)f=K.pps[x],b=f.byteLength,L.push(b>>>8&255),L.push(b&255),L=L.concat(Array.prototype.slice.call(f));var h=M.box(M.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|K.sps.length].concat(n).concat([K.pps.length]).concat(L))),o=K.width,p=K.height,l=K.pixelRatio[0],u=K.pixelRatio[1];return M.box(M.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,o>>8&255,o&255,p>>8&255,p&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]),h,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])))},M.esds=function(K){var n=K.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(K.config).concat([6,1,2]))},M.mp4a=function(K){var n=K.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,K.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),M.box(M.types.esds,M.esds(K)))},M.mp3=function(K){var n=K.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,K.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},M.stsd=function(K){return K.type==="audio"?!K.isAAC&&K.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(K)):M.box(M.types.stsd,M.STSD,M.mp4a(K)):M.box(M.types.stsd,M.STSD,M.avc1(K))},M.tkhd=function(K){var n=K.id,L=K.duration*K.timescale,x=K.width,f=K.height,b=Math.floor(L/(z+1)),h=Math.floor(L%(z+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255,h>>24,h>>16&255,h>>8&255,h&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,x>>8&255,x&255,0,0,f>>8&255,f&255,0,0]))},M.traf=function(K,n){var L=M.sdtp(K),x=K.id,f=Math.floor(n/(z+1)),b=Math.floor(n%(z+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,b>>24,b>>16&255,b>>8&255,b&255])),M.trun(K,L.length+16+20+8+16+8+8),L)},M.trak=function(K){return K.duration=K.duration||4294967295,M.box(M.types.trak,M.tkhd(K),M.mdia(K))},M.trex=function(K){var n=K.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(K,n){var L=K.samples||[],x=L.length,f=12+16*x,b=new Uint8Array(f),h,o,p,l,u,s;for(n+=8+f,b.set([0,0,15,1,x>>>24&255,x>>>16&255,x>>>8&255,x&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),h=0;h<x;h++)o=L[h],p=o.duration,l=o.size,u=o.flags,s=o.cts,b.set([p>>>24&255,p>>>16&255,p>>>8&255,p&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*h);return M.box(M.types.trun,b)},M.initSegment=function(K){M.types||M.init();var n=M.moov(K),L=new Uint8Array(M.FTYP.byteLength+n.byteLength);return L.set(M.FTYP),L.set(n,M.FTYP.byteLength),L},M}();I.types=void 0,I.HDLR_TYPES=void 0,I.STTS=void 0,I.STSC=void 0,I.STCO=void 0,I.STSZ=void 0,I.VMHD=void 0,I.SMHD=void 0,I.STSD=void 0,I.FTYP=void 0,I.DINF=void 0,Y.default=I},"./src/remux/mp4-remuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"normalizePts",function(){return i});var z=N("./src/polyfills/number.ts"),I=N("./src/remux/aac-helper.ts"),M=N("./src/remux/mp4-generator.ts"),G=N("./src/events.ts"),K=N("./src/errors.ts"),n=N("./src/utils/logger.ts"),L=N("./src/types/loader.ts"),x=N("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(R[_]=g[_])}return R},f.apply(this,arguments)}var b=10*1e3,h=1024,o=1152,p=null,l=null,u=!1,s=function(){function R(g,_,d,c){if(c===void 0&&(c=""),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=g,this.config=_,this.typeSupported=d,this.ISGenerated=!1,p===null){var C=navigator.userAgent||"",E=C.match(/Chrome\/(\d+)/i);p=E?parseInt(E[1]):0}if(l===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);l=w?parseInt(w[1]):0}u=!!p&&p<75||!!l&&l<600}var O=R.prototype;return O.destroy=function(){},O.resetTimeStamp=function(_){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=_},O.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(_){var d=!1,c=_.reduce(function(C,E){var w=E.pts-C;return w<-4294967296?(d=!0,i(C,E.pts)):w>0?C:E.pts},_[0].pts);return d&&n.logger.debug("PTS rollover detected"),c},O.remux=function(_,d,c,C,E,w,B,W){var T,k,m,y,H,Q,te=E,ae=E,Te=_.pid>-1,_e=d.pid>-1,ge=d.samples.length,ve=_.samples.length>0,Oe=ge>1,he=(!Te||ve)&&(!_e||Oe)||this.ISGenerated||B;if(he){this.ISGenerated||(m=this.generateIS(_,d,E));var V=this.isVideoContiguous,P=-1;if(Oe&&(P=D(d.samples),!V&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,P>0){n.logger.warn("[mp4-remuxer]: Dropped "+P+" out of "+ge+" video samples due to a missing keyframe");var j=this.getVideoStartPts(d.samples);d.samples=d.samples.slice(P),d.dropped+=P,ae+=(d.samples[0].pts-j)/(d.timescale||9e4)}else P===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+ge+" video samples"),Q=!1);if(this.ISGenerated){if(ve&&Oe){var $=this.getVideoStartPts(d.samples),J=i(_.samples[0].pts,$)-$,X=J/d.inputTimeScale;te+=Math.max(0,X),ae+=Math.max(0,-X)}if(ve){if(_.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),m=this.generateIS(_,d,E)),k=this.remuxAudio(_,te,this.isAudioContiguous,w,_e||Oe||W===L.PlaylistLevelType.AUDIO?ae:void 0),Oe){var ye=k?k.endPTS-k.startPTS:0;d.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),m=this.generateIS(_,d,E)),T=this.remuxVideo(d,ae,V,ye)}}else Oe&&(T=this.remuxVideo(d,ae,V,0));T&&(T.firstKeyFrame=P,T.independent=P!==-1)}}return this.ISGenerated&&(c.samples.length&&(H=this.remuxID3(c,E)),C.samples.length&&(y=this.remuxText(C,E))),{audio:k,video:T,initSegment:m,independent:Q,text:y,id3:H}},O.generateIS=function(_,d,c){var C=_.samples,E=d.samples,w=this.typeSupported,B={},W=!Object(z.isFiniteNumber)(this._initPTS),T="audio/mp4",k,m,y;if(W&&(k=m=Infinity),_.config&&C.length&&(_.timescale=_.samplerate,_.isAAC||(w.mpeg?(T="audio/mpeg",_.codec=""):w.mp3&&(_.codec="mp3")),B.audio={id:"audio",container:T,codec:_.codec,initSegment:!_.isAAC&&w.mpeg?new Uint8Array(0):M.default.initSegment([_]),metadata:{channelCount:_.channelCount}},W&&(y=_.inputTimeScale,k=m=C[0].pts-Math.round(y*c))),d.sps&&d.pps&&E.length&&(d.timescale=d.inputTimeScale,B.video={id:"main",container:"video/mp4",codec:d.codec,initSegment:M.default.initSegment([d]),metadata:{width:d.width,height:d.height}},W)){y=d.inputTimeScale;var H=this.getVideoStartPts(E),Q=Math.round(y*c);m=Math.min(m,i(E[0].dts,H)-Q),k=Math.min(k,H-Q)}if(Object.keys(B).length)return this.ISGenerated=!0,W&&(this._initPTS=k,this._initDTS=m),{tracks:B,initPTS:k,timescale:y}},O.remuxVideo=function(_,d,c,C){var E=_.inputTimeScale,w=_.samples,B=[],W=w.length,T=this._initPTS,k=this.nextAvcDts,m=8,y,H,Q,te=Number.POSITIVE_INFINITY,ae=Number.NEGATIVE_INFINITY,Te=0,_e=!1;if(!c||k===null){var ge=d*E,ve=w[0].pts-i(w[0].dts,w[0].pts);k=ge-ve}for(var Oe=0;Oe<W;Oe++){var he=w[Oe];if(he.pts=i(he.pts-T,k),he.dts=i(he.dts-T,k),he.dts>he.pts){var V=9e4*.2;Te=Math.max(Math.min(Te,he.pts-he.dts),-1*V)}he.dts<w[Oe>0?Oe-1:Oe].dts&&(_e=!0)}_e&&w.sort(function(mn,zt){var Mt=mn.dts-zt.dts,Qn=mn.pts-zt.pts;return Mt||Qn}),H=w[0].dts,Q=w[w.length-1].dts;var P=Math.round((Q-H)/(W-1));if(Te<0){if(Te<P*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(x.toMsFromMpegTsClock)(-P,!0)+" ms");for(var j=Te,$=0;$<W;$++)w[$].dts=j=Math.max(j,w[$].pts-P),w[$].pts=Math.max(j,w[$].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(x.toMsFromMpegTsClock)(Te,!0)+" ms to overcome this issue");for(var J=0;J<W;J++)w[J].dts=w[J].dts+Te}H=w[0].dts}if(c){var X=H-k,ye=X>P,Re=X<-1;if(ye||Re){ye?n.logger.warn("AVC: "+Object(x.toMsFromMpegTsClock)(X,!0)+" ms ("+X+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(x.toMsFromMpegTsClock)(-X,!0)+" ms ("+X+"dts) overlapping between fragments detected"),H=k;var Ke=w[0].pts-X;w[0].dts=H,w[0].pts=Ke,n.logger.log("Video: First PTS/DTS adjusted: "+Object(x.toMsFromMpegTsClock)(Ke,!0)+"/"+Object(x.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(x.toMsFromMpegTsClock)(X,!0)+" ms")}}u&&(H=Math.max(0,H));for(var pe=0,we=0,ke=0;ke<W;ke++){for(var Ue=w[ke],Qe=Ue.units,nt=Qe.length,ot=0,qe=0;qe<nt;qe++)ot+=Qe[qe].data.length;we+=ot,pe+=nt,Ue.length=ot,Ue.dts=Math.max(Ue.dts,H),Ue.pts=Math.max(Ue.pts,Ue.dts,0),te=Math.min(Ue.pts,te),ae=Math.max(Ue.pts,ae)}Q=w[W-1].dts;var ft=we+4*pe+8,lt;try{lt=new Uint8Array(ft)}catch(mn){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:K.ErrorTypes.MUX_ERROR,details:K.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ft,reason:"fail allocating video mdat "+ft});return}var pt=new DataView(lt.buffer);pt.setUint32(0,ft),lt.set(M.default.types.mdat,4);for(var Ye=0;Ye<W;Ye++){for(var Tt=w[Ye],bt=Tt.units,me=0,ne=0,q=bt.length;ne<q;ne++){var se=bt[ne],ue=se.data,oe=se.data.byteLength;pt.setUint32(m,oe),m+=4,lt.set(ue,m),m+=oe,me+=4+oe}if(Ye<W-1)y=w[Ye+1].dts-Tt.dts;else{var ce=this.config,be=Tt.dts-w[Ye>0?Ye-1:Ye].dts;if(ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var Se=Math.floor(ce.maxBufferHole*E),Pe=(C?te+C*E:this.nextAudioPts)-Tt.pts;Pe>Se?(y=Pe-be,y<0&&(y=be),n.logger.log("[mp4-remuxer]: It is approximately "+Pe/90+" ms to the next segment; using duration "+y/90+" ms for the last video frame.")):y=be}else y=be}var We=Math.round(Tt.pts-Tt.dts);B.push(new A(Tt.key,y,me,We))}if(B.length&&p&&p<70){var et=B[0].flags;et.dependsOn=2,et.isNonSync=0}console.assert(y!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=k=Q+y,this.isVideoContiguous=!0;var yt=M.default.moof(_.sequenceNumber++,H,f({},_,{samples:B})),Rt="video",kt={data1:yt,data2:lt,startPTS:te/E,endPTS:(ae+y)/E,startDTS:H/E,endDTS:k/E,type:Rt,hasAudio:!1,hasVideo:!0,nb:B.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(lt.length,"MDAT length must not be zero"),kt},O.remuxAudio=function(_,d,c,C,E){var w=_.inputTimeScale,B=_.samplerate?_.samplerate:w,W=w/B,T=_.isAAC?h:o,k=T*W,m=this._initPTS,y=!_.isAAC&&this.typeSupported.mpeg,H=[],Q=_.samples,te=y?0:8,ae=this.nextAudioPts||-1,Te=d*w;if(this.isAudioContiguous=c=c||Q.length&&ae>0&&(C&&Math.abs(Te-ae)<9e3||Math.abs(i(Q[0].pts-m,Te)-ae)<20*k),Q.forEach(function(ue){ue.pts=i(ue.pts-m,Te)}),!c||ae<0){if(Q=Q.filter(function(ue){return ue.pts>=0}),!Q.length)return;E===0?ae=0:C?ae=Math.max(0,Te):ae=Q[0].pts}if(_.isAAC)for(var _e=E!==void 0,ge=this.config.maxAudioFramesDrift,ve=0,Oe=ae;ve<Q.length;ve++){var he=Q[ve],V=he.pts,P=V-Oe,j=Math.abs(1e3*P/w);if(P<=-ge*k&&_e)ve===0&&(n.logger.warn("Audio frame @ "+(V/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*P/w)+" ms."),this.nextAudioPts=ae=Oe=V);else if(P>=ge*k&&j<b&&_e){var $=Math.round(P/k);Oe=V-$*k,Oe<0&&($--,Oe+=k),ve===0&&(this.nextAudioPts=ae=Oe),n.logger.warn("[mp4-remuxer]: Injecting "+$+" audio frame @ "+(Oe/w).toFixed(3)+"s due to "+Math.round(1e3*P/w)+" ms gap.");for(var J=0;J<$;J++){var X=Math.max(Oe,0),ye=I.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);ye||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ye=he.unit.subarray()),Q.splice(ve,0,{unit:ye,pts:X}),Oe+=k,ve++}}he.pts=Oe,Oe+=k}for(var Re=null,Ke=null,pe,we=0,ke=Q.length;ke--;)we+=Q[ke].unit.byteLength;for(var Ue=0,Qe=Q.length;Ue<Qe;Ue++){var nt=Q[Ue],ot=nt.unit,qe=nt.pts;if(Ke!==null){var ft=H[Ue-1];ft.duration=Math.round((qe-Ke)/W)}else if(c&&_.isAAC&&(qe=ae),Re=qe,we>0){we+=te;try{pe=new Uint8Array(we)}catch(ue){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:K.ErrorTypes.MUX_ERROR,details:K.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:we,reason:"fail allocating audio mdat "+we});return}if(!y){var lt=new DataView(pe.buffer);lt.setUint32(0,we),pe.set(M.default.types.mdat,4)}}else return;pe.set(ot,te);var pt=ot.byteLength;te+=pt,H.push(new A(!0,T,pt,0)),Ke=qe}var Ye=H.length;if(!Ye)return;var Tt=H[H.length-1];this.nextAudioPts=ae=Ke+W*Tt.duration;var bt=y?new Uint8Array(0):M.default.moof(_.sequenceNumber++,Re/W,f({},_,{samples:H}));_.samples=[];var me=Re/w,ne=ae/w,q="audio",se={data1:bt,data2:pe,startPTS:me,endPTS:ne,startDTS:me,endDTS:ne,type:q,hasAudio:!0,hasVideo:!1,nb:Ye};return this.isAudioContiguous=!0,console.assert(pe.length,"MDAT length must not be zero"),se},O.remuxEmptyAudio=function(_,d,c,C){var E=_.inputTimeScale,w=_.samplerate?_.samplerate:E,B=E/w,W=this.nextAudioPts,T=(W!==null?W:C.startDTS*E)+this._initDTS,k=C.endDTS*E+this._initDTS,m=B*h,y=Math.ceil((k-T)/m),H=I.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Q=[],te=0;te<y;te++){var ae=T+te*m;Q.push({unit:H,pts:ae,dts:ae})}return _.samples=Q,this.remuxAudio(_,d,c,!1)},O.remuxID3=function(_,d){var c=_.samples.length;if(!c)return;for(var C=_.inputTimeScale,E=this._initPTS,w=this._initDTS,B=0;B<c;B++){var W=_.samples[B];W.pts=i(W.pts-E,d*C)/C,W.dts=i(W.dts-w,d*C)/C}var T=_.samples;return _.samples=[],{samples:T}},O.remuxText=function(_,d){var c=_.samples.length;if(!c)return;for(var C=_.inputTimeScale,E=this._initPTS,w=0;w<c;w++){var B=_.samples[w];B.pts=i(B.pts-E,d*C)/C}_.samples.sort(function(T,k){return T.pts-k.pts});var W=_.samples;return _.samples=[],{samples:W}},R}();function i(R,O){var g;if(O===null)return R;for(O<R?g=-8589934592:g=8589934592;Math.abs(R-O)>4294967296;)R+=g;return R}function D(R){for(var O=0;O<R.length;O++)if(R[O].key)return O;return-1}var A=function(O,g,_,d){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=g,this.size=_,this.cts=d,this.flags=new S(O)},S=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),I=N("./src/utils/mp4-tools.ts"),M=N("./src/loader/fragment.ts"),G=N("./src/utils/logger.ts"),K=function(){function x(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var f=x.prototype;return f.destroy=function(){},f.resetTimeStamp=function(h){this.initPTS=h,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(h,o,p){this.audioCodec=o,this.videoCodec=p,this.generateInitSegment(h),this.emitInitSegment=!0},f.generateInitSegment=function(h){var o=this.audioCodec,p=this.videoCodec;if(!h||!h.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(I.parseInitSegment)(h);o||(o=L(l.audio,M.ElementaryStreamTypes.AUDIO)),p||(p=L(l.video,M.ElementaryStreamTypes.VIDEO));var u={};l.audio&&l.video?u.audiovideo={container:"video/mp4",codec:o+","+p,initSegment:h,id:"main"}:l.audio?u.audio={container:"audio/mp4",codec:o,initSegment:h,id:"audio"}:l.video?u.video={container:"video/mp4",codec:p,initSegment:h,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},f.remux=function(h,o,p,l,u){var s=this.initPTS,i=this.lastEndDTS,D={audio:void 0,video:void 0,text:l,id3:p,initSegment:void 0};Object(z.isFiniteNumber)(i)||(i=this.lastEndDTS=u||0);var A=o.samples;if(!A||!A.length)return D;var S={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(A),R=this.initData),!R||!R.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),D;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(z.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=n(R,A,i));var O=Object(I.getDuration)(A,R),g=i,_=O+g;Object(I.offsetStartDTS)(R,A,s),O>0?this.lastEndDTS=_:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var d=!!R.audio,c=!!R.video,C="";d&&(C+="audio"),c&&(C+="video");var E={data1:A,startPTS:g,startDTS:g,endPTS:_,endDTS:_,type:C,hasAudio:d,hasVideo:c,nb:1,dropped:0};return D.audio=E.type==="audio"?E:void 0,D.video=E.type!=="audio"?E:void 0,D.text=l,D.id3=p,D.initSegment=S,D},x}(),n=function(f,b,h){return Object(I.getStartDTS)(f,b)-h};function L(x,f){var b=x==null?void 0:x.codec;return b&&b.length>4?b:b==="hvc1"?"hvc1.1.c.L120.90":b==="av01"?"av01.0.04M.08":b==="avc1"||f===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=K},"./src/task-loop.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function I(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=I.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(K){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,K),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},I}()},"./src/types/cmcd.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"CMCDVersion",function(){return z}),N.d(Y,"CMCDObjectType",function(){return I}),N.d(Y,"CMCDStreamingFormat",function(){return M}),N.d(Y,"CMCDStreamType",function(){return G});var z=1,I;(function(K){K.MANIFEST="m",K.AUDIO="a",K.VIDEO="v",K.MUXED="av",K.INIT="i",K.CAPTION="c",K.TIMED_TEXT="tt",K.KEY="k",K.OTHER="o"})(I||(I={}));var M;(function(K){K.DASH="d",K.HLS="h",K.SMOOTH="s",K.OTHER="o"})(M||(M={}));var G;(function(K){K.VOD="v",K.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"HlsSkip",function(){return M}),N.d(Y,"getSkipValue",function(){return G}),N.d(Y,"HlsUrlParameters",function(){return K}),N.d(Y,"Level",function(){return n});function z(L,x){for(var f=0;f<x.length;f++){var b=x[f];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(L,b.key,b)}}function I(L,x,f){return x&&z(L.prototype,x),f&&z(L,f),L}var M;(function(L){L.No="",L.Yes="YES",L.v2="v2"})(M||(M={}));function G(L,x){var f=L.canSkipUntil,b=L.canSkipDateRanges,h=L.endSN,o=x!==void 0?x-h:0;return f&&o<f?b?M.v2:M.Yes:M.No}var K=function(){function L(f,b,h){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=b,this.skip=h}var x=L.prototype;return x.addDirectives=function(b){var h=new self.URL(b);return this.msn!==void 0&&h.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&h.searchParams.set("_HLS_part",this.part.toString()),this.skip&&h.searchParams.set("_HLS_skip",this.skip),h.toString()},L}(),n=function(){function L(x){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=[x.url],this.attrs=x.attrs,this.bitrate=x.bitrate,x.details&&(this.details=x.details),this.id=x.id||0,this.name=x.name,this.width=x.width||0,this.height=x.height||0,this.audioCodec=x.audioCodec,this.videoCodec=x.videoCodec,this.unknownCodecs=x.unknownCodecs,this.codecSet=[x.videoCodec,x.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return I(L,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(f){var b=f%this.url.length;this._urlId!==b&&(this.details=void 0,this._urlId=b)}}]),L}()},"./src/types/loader.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"PlaylistContextType",function(){return z}),N.d(Y,"PlaylistLevelType",function(){return I});var z;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(z||(z={}));var I;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(I||(I={}))},"./src/types/transmuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"ChunkMetadata",function(){return z});var z=function(G,K,n,L,x,f){L===void 0&&(L=0),x===void 0&&(x=-1),f===void 0&&(f=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=I(),this.buffering={audio:I(),video:I(),audiovideo:I()},this.level=G,this.sn=K,this.id=n,this.size=L,this.part=x,this.partial=f};function I(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"AttrList",function(){return M});var z=/^(\d+)x(\d+)$/,I=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function G(n){typeof n=="string"&&(n=G.parseAttrList(n));for(var L in n)n.hasOwnProperty(L)&&(this[L]=n[L])}var K=G.prototype;return K.decimalInteger=function(L){var x=parseInt(this[L],10);return x>Number.MAX_SAFE_INTEGER?Infinity:x},K.hexadecimalInteger=function(L){if(this[L]){var x=(this[L]||"0x").slice(2);x=(x.length&1?"0":"")+x;for(var f=new Uint8Array(x.length/2),b=0;b<x.length/2;b++)f[b]=parseInt(x.slice(b*2,b*2+2),16);return f}else return null},K.hexadecimalIntegerAsNumber=function(L){var x=parseInt(this[L],16);return x>Number.MAX_SAFE_INTEGER?Infinity:x},K.decimalFloatingPoint=function(L){return parseFloat(this[L])},K.optionalFloat=function(L,x){var f=this[L];return f?parseFloat(f):x},K.enumeratedString=function(L){return this[L]},K.bool=function(L){return this[L]==="YES"},K.decimalResolution=function(L){var x=z.exec(this[L]);return x===null?void 0:{width:parseInt(x[1],10),height:parseInt(x[2],10)}},G.parseAttrList=function(L){var x,f={},b='"';for(I.lastIndex=0;(x=I.exec(L))!==null;){var h=x[2];h.indexOf(b)===0&&h.lastIndexOf(b)===h.length-1&&(h=h.slice(1,-1)),f[x[1]]=h}return f},G}()},"./src/utils/binary-search.ts":function(ie,Y,N){"use strict";N.r(Y);var z={search:function(M,G){for(var K=0,n=M.length-1,L=null,x=null;K<=n;){L=(K+n)/2|0,x=M[L];var f=G(x);if(f>0)K=L+1;else if(f<0)n=L-1;else return x}return null}};Y.default=z},"./src/utils/buffer-helper.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"BufferHelper",function(){return M});var z=N("./src/utils/logger.ts"),I={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function G(){}return G.isBuffered=function(n,L){try{if(n){for(var x=G.getBuffered(n),f=0;f<x.length;f++)if(L>=x.start(f)&&L<=x.end(f))return!0}}catch(b){}return!1},G.bufferInfo=function(n,L,x){try{if(n){var f=G.getBuffered(n),b=[],h;for(h=0;h<f.length;h++)b.push({start:f.start(h),end:f.end(h)});return this.bufferedInfo(b,L,x)}}catch(o){}return{len:0,start:L,end:L,nextStart:void 0}},G.bufferedInfo=function(n,L,x){L=Math.max(0,L),n.sort(function(S,R){var O=S.start-R.start;return O||R.end-S.end});var f=[];if(x)for(var b=0;b<n.length;b++){var h=f.length;if(h){var o=f[h-1].end;n[b].start-o<x?n[b].end>o&&(f[h-1].end=n[b].end):f.push(n[b])}else f.push(n[b])}else f=n;for(var p=0,l,u=L,s=L,i=0;i<f.length;i++){var D=f[i].start,A=f[i].end;if(L+x>=D&&L<A)u=D,s=A,p=s-L;else if(L+x<D){l=D;break}}return{len:p,start:u||0,end:s||0,nextStart:l}},G.getBuffered=function(n){try{return n.buffered}catch(L){return z.logger.log("failed to get media.buffered",L),I}},G}()},"./src/utils/cea-608-parser.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"Row",function(){return s}),N.d(Y,"CaptionScreen",function(){return i});var z=N("./src/utils/logger.ts"),I={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},M=function(_){var d=_;return I.hasOwnProperty(_)&&(d=I[_]),String.fromCharCode(d)},G=15,K=100,n={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},L={17:2,18:4,21:6,22:8,23:10,19:13,20:15},x={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},b=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],h;(function(g){g[g.ERROR=0]="ERROR",g[g.TEXT=1]="TEXT",g[g.WARNING=2]="WARNING",g[g.INFO=2]="INFO",g[g.DEBUG=3]="DEBUG",g[g.DATA=3]="DATA"})(h||(h={}));var o=function(){function g(){this.time=null,this.verboseLevel=h.ERROR}var _=g.prototype;return _.log=function(c,C){this.verboseLevel>=c&&z.logger.log(this.time+" ["+c+"] "+C)},g}(),p=function(_){for(var d=[],c=0;c<_.length;c++)d.push(_[c].toString(16));return d},l=function(){function g(d,c,C,E,w){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=d||"white",this.underline=c||!1,this.italics=C||!1,this.background=E||"black",this.flash=w||!1}var _=g.prototype;return _.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},_.setStyles=function(c){for(var C=["foreground","underline","italics","background","flash"],E=0;E<C.length;E++){var w=C[E];c.hasOwnProperty(w)&&(this[w]=c[w])}},_.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},_.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},_.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},_.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},g}(),u=function(){function g(d,c,C,E,w,B){this.uchar=void 0,this.penState=void 0,this.uchar=d||" ",this.penState=new l(c,C,E,w,B)}var _=g.prototype;return _.reset=function(){this.uchar=" ",this.penState.reset()},_.setChar=function(c,C){this.uchar=c,this.penState.copy(C)},_.setPenState=function(c){this.penState.copy(c)},_.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},_.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},_.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},g}(),s=function(){function g(d){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<K;c++)this.chars.push(new u);this.logger=d,this.pos=0,this.currPenState=new l}var _=g.prototype;return _.equals=function(c){for(var C=!0,E=0;E<K;E++)if(!this.chars[E].equals(c.chars[E])){C=!1;break}return C},_.copy=function(c){for(var C=0;C<K;C++)this.chars[C].copy(c.chars[C])},_.isEmpty=function(){for(var c=!0,C=0;C<K;C++)if(!this.chars[C].isEmpty()){c=!1;break}return c},_.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(h.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>K&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=K)},_.moveCursor=function(c){var C=this.pos+c;if(c>1)for(var E=this.pos+1;E<C+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(C)},_.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},_.insertChar=function(c){c>=144&&this.backSpace();var C=M(c);if(this.pos>=K){this.logger.log(h.ERROR,"Cannot insert "+c.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(c){var C;for(C=c;C<K;C++)this.chars[C].reset()},_.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},_.clearToEndOfRow=function(){this.clearFromPos(this.pos)},_.getTextString=function(){for(var c=[],C=!0,E=0;E<K;E++){var w=this.chars[E].uchar;w!==" "&&(C=!1),c.push(w)}return C?"":c.join("")},_.setPenStyles=function(c){this.currPenState.setStyles(c);var C=this.chars[this.pos];C.setPenState(this.currPenState)},g}(),i=function(){function g(d){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<G;c++)this.rows.push(new s(d));this.logger=d,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var _=g.prototype;return _.reset=function(){for(var c=0;c<G;c++)this.rows[c].clear();this.currRow=G-1},_.equals=function(c){for(var C=!0,E=0;E<G;E++)if(!this.rows[E].equals(c.rows[E])){C=!1;break}return C},_.copy=function(c){for(var C=0;C<G;C++)this.rows[C].copy(c.rows[C])},_.isEmpty=function(){for(var c=!0,C=0;C<G;C++)if(!this.rows[C].isEmpty()){c=!1;break}return c},_.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},_.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},_.insertChar=function(c){var C=this.rows[this.currRow];C.insertChar(c)},_.setPen=function(c){var C=this.rows[this.currRow];C.setPenStyles(c)},_.moveCursor=function(c){var C=this.rows[this.currRow];C.moveCursor(c)},_.setCursor=function(c){this.logger.log(h.INFO,"setCursor: "+c);var C=this.rows[this.currRow];C.setCursor(c)},_.setPAC=function(c){this.logger.log(h.INFO,"pacData = "+JSON.stringify(c));var C=c.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var E=0;E<G;E++)this.rows[E].clear();var w=this.currRow+1-this.nrRollUpRows,B=this.lastOutputScreen;if(B){var W=B.rows[w].cueStartTime,T=this.logger.time;if(W&&T!==null&&W<T)for(var k=0;k<this.nrRollUpRows;k++)this.rows[C-this.nrRollUpRows+k+1].copy(B.rows[w+k])}}this.currRow=C;var m=this.rows[this.currRow];if(c.indent!==null){var y=c.indent,H=Math.max(y-1,0);m.setCursor(c.indent),c.color=m.chars[H].penState.foreground}var Q={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(Q)},_.setBkgData=function(c){this.logger.log(h.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},_.setRollUpRows=function(c){this.nrRollUpRows=c},_.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(h.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(h.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(c,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(h.INFO,"Rolling up")},_.getDisplayText=function(c){c=c||!1;for(var C=[],E="",w=-1,B=0;B<G;B++){var W=this.rows[B].getTextString();W&&(w=B+1,c?C.push("Row "+w+": '"+W+"'"):C.push(W.trim()))}return C.length>0&&(c?E="["+C.join(" | ")+"]":E=C.join(`
`)),E},_.getTextAndFormat=function(){return this.rows},g}(),D=function(){function g(d,c,C){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=d,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new i(C),this.nonDisplayedMemory=new i(C),this.lastOutputScreen=new i(C),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var _=g.prototype;return _.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},_.getHandler=function(){return this.outputFilter},_.setHandler=function(c){this.outputFilter=c},_.setPAC=function(c){this.writeScreen.setPAC(c)},_.setBkgData=function(c){this.writeScreen.setBkgData(c)},_.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(h.INFO,"MODE="+c),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=c},_.insertChars=function(c){for(var C=0;C<c.length;C++)this.writeScreen.insertChar(c[C]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(h.INFO,E+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(h.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},_.ccRCL=function(){this.logger.log(h.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},_.ccBS=function(){if(this.logger.log(h.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},_.ccAOF=function(){},_.ccAON=function(){},_.ccDER=function(){this.logger.log(h.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},_.ccRU=function(c){this.logger.log(h.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},_.ccFON=function(){this.logger.log(h.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},_.ccRDC=function(){this.logger.log(h.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},_.ccTR=function(){this.logger.log(h.INFO,"TR"),this.setMode("MODE_TEXT")},_.ccRTD=function(){this.logger.log(h.INFO,"RTD"),this.setMode("MODE_TEXT")},_.ccEDM=function(){this.logger.log(h.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},_.ccCR=function(){this.logger.log(h.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},_.ccENM=function(){this.logger.log(h.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},_.ccEOC=function(){if(this.logger.log(h.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(h.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},_.ccTO=function(c){this.logger.log(h.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},_.ccMIDROW=function(c){var C={flash:!1};if(C.underline=c%2===1,C.italics=c>=46,C.italics)C.foreground="white";else{var E=Math.floor(c/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=w[E]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},_.outputDataUpdate=function(c){c===void 0&&(c=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},_.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},g}(),A=function(){function g(d,c,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new o;this.channels=[null,new D(d,c,E),new D(d+1,C,E)],this.cmdHistory=O(),this.logger=E}var _=g.prototype;return _.getHandler=function(c){return this.channels[c].getHandler()},_.setHandler=function(c,C){this.channels[c].setHandler(C)},_.addData=function(c,C){var E,w,B,W=!1;this.logger.time=c;for(var T=0;T<C.length;T+=2){if(w=C[T]&127,B=C[T+1]&127,w===0&&B===0)continue;if(this.logger.log(h.DATA,"["+p([C[T],C[T+1]])+"] -> ("+p([w,B])+")"),E=this.parseCmd(w,B),E||(E=this.parseMidrow(w,B)),E||(E=this.parsePAC(w,B)),E||(E=this.parseBackgroundAttributes(w,B)),!E&&(W=this.parseChars(w,B),W)){var k=this.currentChannel;if(k&&k>0){var m=this.channels[k];m.insertChars(W)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!W&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+p([w,B])+" orig: "+p([C[T],C[T+1]]))}},_.parseCmd=function(c,C){var E=this.cmdHistory,w=(c===20||c===28||c===21||c===29)&&C>=32&&C<=47,B=(c===23||c===31)&&C>=33&&C<=35;if(!(w||B))return!1;if(R(c,C,E))return S(null,null,E),this.logger.log(h.DEBUG,"Repeated command ("+p([c,C])+") is dropped"),!0;var W=c===20||c===21||c===23?1:2,T=this.channels[W];return c===20||c===21||c===28||c===29?C===32?T.ccRCL():C===33?T.ccBS():C===34?T.ccAOF():C===35?T.ccAON():C===36?T.ccDER():C===37?T.ccRU(2):C===38?T.ccRU(3):C===39?T.ccRU(4):C===40?T.ccFON():C===41?T.ccRDC():C===42?T.ccTR():C===43?T.ccRTD():C===44?T.ccEDM():C===45?T.ccCR():C===46?T.ccENM():C===47&&T.ccEOC():T.ccTO(C-32),S(c,C,E),this.currentChannel=W,!0},_.parseMidrow=function(c,C){var E=0;if((c===17||c===25)&&C>=32&&C<=47){if(c===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[E];return w?(w.ccMIDROW(C),this.logger.log(h.DEBUG,"MIDROW ("+p([c,C])+")"),!0):!1}return!1},_.parsePAC=function(c,C){var E,w=this.cmdHistory,B=(c>=17&&c<=23||c>=25&&c<=31)&&C>=64&&C<=127,W=(c===16||c===24)&&C>=64&&C<=95;if(!(B||W))return!1;if(R(c,C,w))return S(null,null,w),!0;var T=c<=23?1:2;C>=64&&C<=95?E=T===1?n[c]:x[c]:E=T===1?L[c]:f[c];var k=this.channels[T];return k?(k.setPAC(this.interpretPAC(E,C)),S(c,C,w),this.currentChannel=T,!0):!1},_.interpretPAC=function(c,C){var E,w={color:null,italics:!1,indent:null,underline:!1,row:c};return C>95?E=C-96:E=C-64,w.underline=(E&1)===1,E<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((E-16)/2)*4,w},_.parseChars=function(c,C){var E,w=null,B=null;if(c>=25?(E=2,B=c-8):(E=1,B=c),B>=17&&B<=19){var W;B===17?W=C+80:B===18?W=C+112:W=C+144,this.logger.log(h.INFO,"Special char '"+M(W)+"' in channel "+E),w=[W]}else c>=32&&c<=127&&(w=C===0?[c]:[c,C]);if(w){var T=p(w);this.logger.log(h.DEBUG,"Char codes = "+T.join(",")),S(c,C,this.cmdHistory)}return w},_.parseBackgroundAttributes=function(c,C){var E=(c===16||c===24)&&C>=32&&C<=47,w=(c===23||c===31)&&C>=45&&C<=47;if(!(E||w))return!1;var B,W={};c===16||c===24?(B=Math.floor((C-32)/2),W.background=b[B],C%2===1&&(W.background=W.background+"_semi")):C===45?W.background="transparent":(W.foreground="black",C===47&&(W.underline=!0));var T=c<=23?1:2,k=this.channels[T];return k.setBkgData(W),S(c,C,this.cmdHistory),!0},_.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var C=this.channels[c];C&&C.reset()}this.cmdHistory=O()},_.cueSplitAtTime=function(c){for(var C=0;C<this.channels.length;C++){var E=this.channels[C];E&&E.cueSplitAtTime(c)}},g}();function S(g,_,d){d.a=g,d.b=_}function R(g,_,d){return d.a===g&&d.b===_}function O(){return{a:null,b:null}}Y.default=A},"./src/utils/codecs.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"isCodecType",function(){return I}),N.d(Y,"isCodecSupportedInMp4",function(){return M});var z={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 I(G,K){var n=z[K];return!!n&&n[G.slice(0,4)]===!0}function M(G,K){return MediaSource.isTypeSupported((K||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/utils/vttparser.ts"),I=N("./src/utils/webvtt-parser.ts"),M=N("./src/utils/texttrack-utils.ts"),G=/\s/,K={newCue:function(L,x,f,b){for(var h=[],o,p,l,u,s,i=self.VTTCue||self.TextTrackCue,D=0;D<b.rows.length;D++)if(o=b.rows[D],l=!0,u=0,s="",!o.isEmpty()){for(var A=0;A<o.chars.length;A++)G.test(o.chars[A].uchar)&&l?u++:(s+=o.chars[A].uchar,l=!1);o.cueStartTime=x,x===f&&(f+=1e-4),u>=16?u--:u++;var S=Object(z.fixLineBreaks)(s.trim()),R=Object(I.generateCueId)(x,f,S);(!L||!L.cues||!L.cues.getCueById(R))&&(p=new i(x,f,S),p.id=R,p.line=D+1,p.align="left",p.position=10+Math.min(80,Math.floor(u*8/32)*10),h.push(p))}return L&&h.length&&(h.sort(function(O,g){return O.line==="auto"||g.line==="auto"?0:O.line>8&&g.line>8?g.line-O.line:O.line-g.line}),h.forEach(function(O){return Object(M.addCueToTrack)(L,O)})),h}};Y.default=K},"./src/utils/discontinuities.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"findFirstFragWithCC",function(){return G}),N.d(Y,"shouldAlignOnDiscontinuities",function(){return K}),N.d(Y,"findDiscontinuousReferenceFrag",function(){return n}),N.d(Y,"adjustSlidingStart",function(){return x}),N.d(Y,"alignStream",function(){return f}),N.d(Y,"alignPDT",function(){return h}),N.d(Y,"alignFragmentByPDTDelta",function(){return o}),N.d(Y,"alignMediaPlaylistByPDT",function(){return p});var z=N("./src/polyfills/number.ts"),I=N("./src/utils/logger.ts"),M=N("./src/controller/level-helper.ts");function G(l,u){for(var s=null,i=0,D=l.length;i<D;i++){var A=l[i];if(A&&A.cc===u){s=A;break}}return s}function K(l,u,s){return!!(u.details&&(s.endCC>s.startCC||l&&l.cc<s.startCC))}function n(l,u){var s=l.fragments,i=u.fragments;if(!i.length||!s.length){I.logger.log("No fragments to align");return}var D=G(s,i[0].cc);if(!D||D&&!D.startPTS){I.logger.log("No frag in previous level to align on");return}return D}function L(l,u){if(l){var s=l.start+u;l.start=l.startPTS=s,l.endPTS=s+l.duration}}function x(l,u){for(var s=u.fragments,i=0,D=s.length;i<D;i++)L(s[i],l);u.fragmentHint&&L(u.fragmentHint,l),u.alignedSliding=!0}function f(l,u,s){if(!u)return;b(l,s,u),!s.alignedSliding&&u.details&&h(s,u.details),!s.alignedSliding&&u.details&&!s.skippedSegments&&Object(M.adjustSliding)(u.details,s)}function b(l,u,s){if(K(l,s,u)){var i=n(s.details,u);i&&Object(z.isFiniteNumber)(i.start)&&(I.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),x(i.start,u))}}function h(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,i=l.fragments[0].programDateTime,D=(i-s)/1e3+u.fragments[0].start;D&&Object(z.isFiniteNumber)(D)&&(I.logger.log("Adjusting PTS using programDateTime delta "+(i-s)+"ms, sliding:"+D.toFixed(3)+" "+l.url+" "),x(D,l))}function o(l,u){var s=l.programDateTime;if(!s)return;var i=(s-u)/1e3;l.start=l.startPTS=i,l.endPTS=i+l.duration}function p(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,i=u.fragments[0].start,D=s-i*1e3;l.fragments.forEach(function(A){o(A,D)}),l.fragmentHint&&o(l.fragmentHint,D),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/utils/ewma.ts"),I=function(){function M(K,n,L){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=L,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new z.default(K),this.fast_=new z.default(n)}var G=M.prototype;return G.update=function(n,L){var x=this.slow_,f=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new z.default(n,x.getEstimate(),x.getTotalWeight())),this.fast_.halfLife!==L&&(this.fast_=new z.default(L,f.getEstimate(),f.getTotalWeight()))},G.sample=function(n,L){n=Math.max(n,this.minDelayMs_);var x=8*L,f=n/1e3,b=x/f;this.fast_.sample(f,b),this.slow_.sample(f,b)},G.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},M}();Y.default=I},"./src/utils/ewma.ts":function(ie,Y,N){"use strict";N.r(Y);var z=function(){function I(G,K,n){K===void 0&&(K=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=K,this.totalWeight_=n}var M=I.prototype;return M.sample=function(K,n){var L=Math.pow(this.alpha_,K);this.estimate_=n*(1-L)+L*this.estimate_,this.totalWeight_+=K},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var K=1-Math.pow(this.alpha_,this.totalWeight_);if(K)return this.estimate_/K}return this.estimate_},I}();Y.default=z},"./src/utils/fetch-loader.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"fetchSupported",function(){return o});var z=N("./src/polyfills/number.ts"),I=N("./src/loader/load-stats.ts"),M=N("./src/demux/chunk-cache.ts");function G(i,D){i.prototype=Object.create(D.prototype),i.prototype.constructor=i,f(i,D)}function K(i){var D=typeof Map=="function"?new Map:void 0;return K=function(S){if(S===null||!x(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof D!="undefined"){if(D.has(S))return D.get(S);D.set(S,R)}function R(){return n(S,arguments,b(this).constructor)}return R.prototype=Object.create(S.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),f(R,S)},K(i)}function n(i,D,A){return L()?n=Reflect.construct:n=function(R,O,g){var _=[null];_.push.apply(_,O);var d=Function.bind.apply(R,_),c=new d;return g&&f(c,g.prototype),c},n.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function x(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function f(i,D){return f=Object.setPrototypeOf||function(S,R){return S.__proto__=R,S},f(i,D)}function b(i){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},b(i)}function h(){return h=Object.assign||function(i){for(var D=1;D<arguments.length;D++){var A=arguments[D];for(var S in A)Object.prototype.hasOwnProperty.call(A,S)&&(i[S]=A[S])}return i},h.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(i){}return!1}var p=function(){function i(A){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=A.fetchSetup||u,this.controller=new self.AbortController,this.stats=new I.LoadStats}var D=i.prototype;return D.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},D.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},D.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},D.load=function(S,R,O){var g=this,_=this.stats;if(_.loading.start)throw new Error("Loader can only be used once.");_.loading.start=self.performance.now();var d=l(S,this.controller.signal),c=O.onProgress,C=S.responseType==="arraybuffer",E=C?"byteLength":"length";this.context=S,this.config=R,this.callbacks=O,this.request=this.fetchSetup(S,d),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){g.abortInternal(),O.onTimeout(_,S,g.response)},R.timeout),self.fetch(this.request).then(function(w){if(g.response=g.loader=w,!w.ok){var B=w.status,W=w.statusText;throw new s(W||"fetch, bad network response",B,w)}return _.loading.first=Math.max(self.performance.now(),_.loading.start),_.total=parseInt(w.headers.get("Content-Length")||"0"),c&&Object(z.isFiniteNumber)(R.highWaterMark)?g.loadProgressively(w,_,S,R.highWaterMark,c):C?w.arrayBuffer():w.text()}).then(function(w){var B=g.response;self.clearTimeout(g.requestTimeout),_.loading.end=Math.max(self.performance.now(),_.loading.first),_.loaded=_.total=w[E];var W={url:B.url,data:w};c&&!Object(z.isFiniteNumber)(R.highWaterMark)&&c(_,S,w,B),O.onSuccess(W,_,S,B)}).catch(function(w){if(self.clearTimeout(g.requestTimeout),_.aborted)return;var B=w.code||0;O.onError({code:B,text:w.message},S,w.details)})},D.getCacheAge=function(){var S=null;if(this.response){var R=this.response.headers.get("age");S=R?parseFloat(R):null}return S},D.loadProgressively=function(S,R,O,g,_){g===void 0&&(g=0);var d=new M.default,c=S.body.getReader(),C=function E(){return c.read().then(function(w){if(w.done)return d.dataLength&&_(R,O,d.flush(),S),Promise.resolve(new ArrayBuffer(0));var B=w.value,W=B.length;return R.loaded+=W,W<g||d.dataLength?(d.push(B),d.dataLength>=g&&_(R,O,d.flush(),S)):_(R,O,B,S),E()}).catch(function(){return Promise.reject()})};return C()},i}();function l(i,D){var A={method:"GET",mode:"cors",credentials:"same-origin",signal:D,headers:new self.Headers(h({},i.headers))};return i.rangeEnd&&A.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),A}function u(i,D){return new self.Request(i.url,D)}var s=function(i){G(D,i);function D(A,S,R){var O;return O=i.call(this,A)||this,O.code=void 0,O.details=void 0,O.code=S,O.details=R,O}return D}(K(Error));Y.default=p},"./src/utils/imsc1-ttml-parser.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"IMSC1_CODEC",function(){return x}),N.d(Y,"parseIMSC1",function(){return o});var z=N("./src/utils/mp4-tools.ts"),I=N("./src/utils/vttparser.ts"),M=N("./src/utils/vttcue.ts"),G=N("./src/demux/id3.ts"),K=N("./src/utils/timescale-conversion.ts"),n=N("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(g){for(var _=1;_<arguments.length;_++){var d=arguments[_];for(var c in d)Object.prototype.hasOwnProperty.call(d,c)&&(g[c]=d[c])}return g},L.apply(this,arguments)}var x="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,b=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,h={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(g,_,d,c,C){var E=Object(z.findBox)(new Uint8Array(g),["mdat"]);if(E.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var w=E[0],B=Object(G.utf8ArrayToStr)(new Uint8Array(g,w.start,w.end-w.start)),W=Object(K.toTimescaleFromScale)(_,1,d);try{c(p(B,W))}catch(T){C(T)}}function p(g,_){var d=new DOMParser,c=d.parseFromString(g,"text/xml"),C=c.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(E).reduce(function(m,y){return m[y]=C.getAttribute("ttp:"+y)||E[y],m},{}),B=C.getAttribute("xml:space")!=="preserve",W=u(l(C,"styling","style")),T=u(l(C,"layout","region")),k=l(C,"body","[begin]");return[].map.call(k,function(m){var y=s(m,B);if(!y||!m.hasAttribute("begin"))return null;var H=S(m.getAttribute("begin"),w),Q=S(m.getAttribute("dur"),w),te=S(m.getAttribute("end"),w);if(H===null)throw A(m);if(te===null){if(Q===null)throw A(m);te=H+Q}var ae=new M.default(H-_,te-_,y);ae.id=Object(n.generateCueId)(ae.startTime,ae.endTime,ae.text);var Te=T[m.getAttribute("region")],_e=W[m.getAttribute("style")];ae.position=10,ae.size=80;var ge=i(Te,_e),ve=ge.textAlign;if(ve){var Oe=h[ve];Oe&&(ae.lineAlign=Oe),ae.align=ve}return L(ae,ge),ae}).filter(function(m){return m!==null})}function l(g,_,d){var c=g.getElementsByTagName(_)[0];return c?[].slice.call(c.querySelectorAll(d)):[]}function u(g){return g.reduce(function(_,d){var c=d.getAttribute("xml:id");return c&&(_[c]=d),_},{})}function s(g,_){return[].slice.call(g.childNodes).reduce(function(d,c,C){var E;return c.nodeName==="br"&&C?d+`
`:(E=c.childNodes)!==null&&E!==void 0&&E.length?s(c,_):_?d+c.textContent.trim().replace(/\s+/g," "):d+c.textContent},"")}function i(g,_){var d="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(C,E){var w=D(_,d,E)||D(g,d,E);return w&&(C[E]=w),C},{})}function D(g,_,d){return g.hasAttributeNS(_,d)?g.getAttributeNS(_,d):null}function A(g){return new Error("Could not parse ttml timestamp "+g)}function S(g,_){if(!g)return null;var d=Object(I.parseTimeStamp)(g);return d===null&&(f.test(g)?d=R(g,_):b.test(g)&&(d=O(g,_))),d}function R(g,_){var d=f.exec(g),c=(d[4]|0)+(d[5]|0)/_.subFrameRate;return(d[1]|0)*3600+(d[2]|0)*60+(d[3]|0)+c/_.frameRate}function O(g,_){var d=b.exec(g),c=Number(d[1]),C=d[2];switch(C){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/_.frameRate;case"t":return c/_.tickRate}return c}},"./src/utils/logger.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"enableLogs",function(){return n}),N.d(Y,"logger",function(){return L});var z=function(){},I={trace:z,debug:z,log:z,warn:z,info:z,error:z},M=I;function G(x){var f=self.console[x];return f?f.bind(self.console,"["+x+"] >"):z}function K(x){for(var f=arguments.length,b=new Array(f>1?f-1:0),h=1;h<f;h++)b[h-1]=arguments[h];b.forEach(function(o){M[o]=x[o]?x[o].bind(x):G(o)})}function n(x){if(self.console&&x===!0||typeof x=="object"){K(x,"debug","log","info","warn","error");try{M.log()}catch(f){M=I}}else M=I}var L=M},"./src/utils/mediakeys-helper.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"KeySystems",function(){return z}),N.d(Y,"requestMediaKeySystemAccess",function(){return I});var z;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(z||(z={}));var I=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"getMediaSource",function(){return z});function z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"bin2str",function(){return K}),N.d(Y,"readUint16",function(){return n}),N.d(Y,"readUint32",function(){return L}),N.d(Y,"writeUint32",function(){return x}),N.d(Y,"findBox",function(){return f}),N.d(Y,"parseSegmentIndex",function(){return b}),N.d(Y,"parseInitSegment",function(){return h}),N.d(Y,"getStartDTS",function(){return o}),N.d(Y,"getDuration",function(){return p}),N.d(Y,"computeRawDurationFromSamples",function(){return l}),N.d(Y,"offsetStartDTS",function(){return u}),N.d(Y,"segmentValidRange",function(){return s}),N.d(Y,"appendUint8Array",function(){return i});var z=N("./src/utils/typed-array.ts"),I=N("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,G=[].push;function K(D){return String.fromCharCode.apply(null,D)}function n(D,A){"data"in D&&(A+=D.start,D=D.data);var S=D[A]<<8|D[A+1];return S<0?65536+S:S}function L(D,A){"data"in D&&(A+=D.start,D=D.data);var S=D[A]<<24|D[A+1]<<16|D[A+2]<<8|D[A+3];return S<0?4294967296+S:S}function x(D,A,S){"data"in D&&(A+=D.start,D=D.data),D[A]=S>>24,D[A+1]=S>>16&255,D[A+2]=S>>8&255,D[A+3]=S&255}function f(D,A){var S=[];if(!A.length)return S;var R,O,g;"data"in D?(R=D.data,O=D.start,g=D.end):(R=D,O=0,g=R.byteLength);for(var _=O;_<g;){var d=L(R,_),c=K(R.subarray(_+4,_+8)),C=d>1?_+d:g;if(c===A[0])if(A.length===1)S.push({data:R,start:_+8,end:C});else{var E=f({data:R,start:_+8,end:C},A.slice(1));E.length&&G.apply(S,E)}_=C}return S}function b(D){var A=f(D,["moov"]),S=A[0],R=S?S.end:null,O=f(D,["sidx"]);if(!O||!O[0])return null;var g=[],_=O[0],d=_.data[0],c=d===0?8:16,C=L(_,c);c+=4;var E=0,w=0;d===0?c+=8:c+=16,c+=2;var B=_.end+w,W=n(_,c);c+=2;for(var T=0;T<W;T++){var k=c,m=L(_,k);k+=4;var y=m&2147483647,H=(m&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=L(_,k);k+=4,g.push({referenceSize:y,subsegmentDuration:Q,info:{duration:Q/C,start:B,end:B+y-1}}),B+=y,k+=4,c=k}return{earliestPresentationTime:E,timescale:C,version:d,referencesCount:W,references:g,moovEndOffset:R}}function h(D){for(var A=[],S=f(D,["moov","trak"]),R=0;R<S.length;R++){var O=S[R],g=f(O,["tkhd"])[0];if(g){var _=g.data[g.start],d=_===0?12:20,c=L(g,d),C=f(O,["mdia","mdhd"])[0];if(C){_=C.data[C.start],d=_===0?12:20;var E=L(C,d),w=f(O,["mdia","hdlr"])[0];if(w){var B=K(w.data.subarray(w.start+8,w.start+12)),W={soun:I.ElementaryStreamTypes.AUDIO,vide:I.ElementaryStreamTypes.VIDEO}[B];if(W){var T=f(O,["mdia","minf","stbl","stsd"])[0],k=void 0;T&&(k=K(T.data.subarray(T.start+12,T.start+16))),A[c]={timescale:E,type:W},A[W]={timescale:E,id:c,codec:k}}}}}}var m=f(D,["moov","mvex","trex"]);return m.forEach(function(y){var H=L(y,4),Q=A[H];Q&&(Q.default={duration:L(y,12),flags:L(y,20)})}),A}function o(D,A){return f(A,["moof","traf"]).reduce(function(S,R){var O=f(R,["tfdt"])[0],g=O.data[O.start],_=f(R,["tfhd"]).reduce(function(d,c){var C=L(c,4),E=D[C];if(E){var w=L(O,4);g===1&&(w*=Math.pow(2,32),w+=L(O,8));var B=E.timescale||9e4,W=w/B;if(isFinite(W)&&(d===null||W<d))return W}return d},null);return _!==null&&isFinite(_)&&(S===null||_<S)?_:S},null)||0}function p(D,A){for(var S=0,R=0,O=0,g=f(D,["moof","traf"]),_=0;_<g.length;_++){var d=g[_],c=f(d,["tfhd"])[0],C=L(c,4),E=A[C];if(!E)continue;var w=E.default,B=L(c,0)|(w==null?void 0:w.flags),W=w==null?void 0:w.duration;B&8&&(B&2?W=L(c,12):W=L(c,8));for(var T=E.timescale||9e4,k=f(d,["trun"]),m=0;m<k.length;m++){if(W){var y=L(k[m],4);S=W*y}else S=l(k[m]);E.type===I.ElementaryStreamTypes.VIDEO?R+=S/T:E.type===I.ElementaryStreamTypes.AUDIO&&(O+=S/T)}}if(R===0&&O===0){var H=b(D);if(H!=null&&H.references)return H.references.reduce(function(Q,te){return Q+te.info.duration||0},0)}return R||O}function l(D){var A=L(D,0),S=8;A&1&&(S+=4),A&4&&(S+=4);for(var R=0,O=L(D,4),g=0;g<O;g++){if(A&256){var _=L(D,S);R+=_,S+=4}A&512&&(S+=4),A&1024&&(S+=4),A&2048&&(S+=4)}return R}function u(D,A,S){f(A,["moof","traf"]).forEach(function(R){f(R,["tfhd"]).forEach(function(O){var g=L(O,4),_=D[g];if(!_)return;var d=_.timescale||9e4;f(R,["tfdt"]).forEach(function(c){var C=c.data[c.start],E=L(c,4);if(C===0)x(c,4,E-S*d);else{E*=Math.pow(2,32),E+=L(c,8),E-=S*d,E=Math.max(E,0);var w=Math.floor(E/(M+1)),B=Math.floor(E%(M+1));x(c,4,w),x(c,8,B)}})})})}function s(D){var A={valid:null,remainder:null},S=f(D,["moof"]);if(S){if(S.length<2)return A.remainder=D,A}else return A;var R=S[S.length-1];return A.valid=Object(z.sliceUint8)(D,0,R.start-8),A.remainder=Object(z.sliceUint8)(D,R.start-8),A}function i(D,A){var S=new Uint8Array(D.length+A.length);return S.set(D),S.set(A,D.length),S}},"./src/utils/output-filter.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function I(G,K){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=K}var M=I.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(K,n,L){(this.startTime===null||this.startTime>K)&&(this.startTime=K),this.endTime=n,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},I}()},"./src/utils/texttrack-utils.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"sendAddTrackEvent",function(){return I}),N.d(Y,"addCueToTrack",function(){return M}),N.d(Y,"clearCurrentCues",function(){return G}),N.d(Y,"removeCuesInRange",function(){return K}),N.d(Y,"getCuesInRange",function(){return L});var z=N("./src/utils/logger.ts");function I(x,f){var b;try{b=new Event("addtrack")}catch(h){b=document.createEvent("Event"),b.initEvent("addtrack",!1,!1)}b.track=x,f.dispatchEvent(b)}function M(x,f){var b=x.mode;if(b==="disabled"&&(x.mode="hidden"),x.cues&&!x.cues.getCueById(f.id))try{if(x.addCue(f),!x.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(o){z.logger.debug("[texttrack-utils]: "+o);var h=new self.TextTrackCue(f.startTime,f.endTime,f.text);h.id=f.id,x.addCue(h)}b==="disabled"&&(x.mode=b)}function G(x){var f=x.mode;if(f==="disabled"&&(x.mode="hidden"),x.cues)for(var b=x.cues.length;b--;)x.removeCue(x.cues[b]);f==="disabled"&&(x.mode=f)}function K(x,f,b){var h=x.mode;if(h==="disabled"&&(x.mode="hidden"),x.cues&&x.cues.length>0)for(var o=L(x.cues,f,b),p=0;p<o.length;p++)x.removeCue(o[p]);h==="disabled"&&(x.mode=h)}function n(x,f){if(f<x[0].startTime)return 0;var b=x.length-1;if(f>x[b].endTime)return-1;for(var h=0,o=b;h<=o;){var p=Math.floor((o+h)/2);if(f<x[p].startTime)o=p-1;else if(f>x[p].startTime&&h<b)h=p+1;else return p}return x[h].startTime-f<f-x[o].startTime?h:o}function L(x,f,b){var h=[],o=n(x,f);if(o>-1)for(var p=o,l=x.length;p<l;p++){var u=x[p];if(u.startTime>=f&&u.endTime<=b)h.push(u);else if(u.startTime>b)return h}return h}},"./src/utils/time-ranges.ts":function(ie,Y,N){"use strict";N.r(Y);var z={toString:function(M){for(var G="",K=M.length,n=0;n<K;n++)G+="["+M.start(n).toFixed(3)+","+M.end(n).toFixed(3)+"]";return G}};Y.default=z},"./src/utils/timescale-conversion.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"toTimescaleFromBase",function(){return I}),N.d(Y,"toTimescaleFromScale",function(){return M}),N.d(Y,"toMsFromMpegTsClock",function(){return G}),N.d(Y,"toMpegTsClockFromTimescale",function(){return K});var z=9e4;function I(n,L,x,f){x===void 0&&(x=1),f===void 0&&(f=!1);var b=n*L*x;return f?Math.round(b):b}function M(n,L,x,f){return x===void 0&&(x=1),f===void 0&&(f=!1),I(n,L,1/x,f)}function G(n,L){return L===void 0&&(L=!1),I(n,1e3,1/z,L)}function K(n,L){return L===void 0&&(L=1),I(n,z,1/L)}},"./src/utils/typed-array.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"sliceUint8",function(){return z});function z(I,M,G){return Uint8Array.prototype.slice?I.slice(M,G):new Uint8Array(Array.prototype.slice.call(I,M,G))}},"./src/utils/vttcue.ts":function(ie,Y,N){"use strict";N.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var z=["","lr","rl"],I=["start","middle","end","left","right"];function M(x,f){if(typeof f!="string")return!1;if(!Array.isArray(x))return!1;var b=f.toLowerCase();return~x.indexOf(b)?b:!1}function G(x){return M(z,x)}function K(x){return M(I,x)}function n(x){for(var f=arguments.length,b=new Array(f>1?f-1:0),h=1;h<f;h++)b[h-1]=arguments[h];for(var o=1;o<arguments.length;o++){var p=arguments[o];for(var l in p)x[l]=p[l]}return x}function L(x,f,b){var h=this,o={enumerable:!0};h.hasBeenReset=!1;var p="",l=!1,u=x,s=f,i=b,D=null,A="",S=!0,R="auto",O="start",g=50,_="middle",d=50,c="middle";Object.defineProperty(h,"id",n({},o,{get:function(){return p},set:function(E){p=""+E}})),Object.defineProperty(h,"pauseOnExit",n({},o,{get:function(){return l},set:function(E){l=!!E}})),Object.defineProperty(h,"startTime",n({},o,{get:function(){return u},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");u=E,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",n({},o,{get:function(){return s},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");s=E,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",n({},o,{get:function(){return i},set:function(E){i=""+E,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",n({},o,{get:function(){return D},set:function(E){D=E,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",n({},o,{get:function(){return A},set:function(E){var w=G(E);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");A=w,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",n({},o,{get:function(){return S},set:function(E){S=!!E,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",n({},o,{get:function(){return R},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=E,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",n({},o,{get:function(){return O},set:function(E){var w=K(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");O=w,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",n({},o,{get:function(){return g},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");g=E,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",n({},o,{get:function(){return _},set:function(E){var w=K(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");_=w,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",n({},o,{get:function(){return d},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");d=E,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",n({},o,{get:function(){return c},set:function(E){var w=K(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");c=w,this.hasBeenReset=!0}})),h.displayState=void 0}return L.prototype.getCueAsHTML=function(){var x=self.WebVTT;return x.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"parseTimeStamp",function(){return M}),N.d(Y,"fixLineBreaks",function(){return f}),N.d(Y,"VTTParser",function(){return b});var z=N("./src/utils/vttcue.ts"),I=function(){function h(){}var o=h.prototype;return o.decode=function(l,u){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},h}();function M(h){function o(l,u,s,i){return(l|0)*3600+(u|0)*60+(s|0)+parseFloat(i||0)}var p=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?o(p[2],p[3],0,p[4]):o(p[1],p[2],p[3],p[4]):null}var G=function(){function h(){this.values=Object.create(null)}var o=h.prototype;return o.set=function(l,u){!this.get(l)&&u!==""&&(this.values[l]=u)},o.get=function(l,u,s){return s?this.has(l)?this.values[l]:u[s]:this.has(l)?this.values[l]:u},o.has=function(l){return l in this.values},o.alt=function(l,u,s){for(var i=0;i<s.length;++i)if(u===s[i]){this.set(l,u);break}},o.integer=function(l,u){/^-?\d+$/.test(u)&&this.set(l,parseInt(u,10))},o.percent=function(l,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var s=parseFloat(u);if(s>=0&&s<=100)return this.set(l,s),!0}return!1},h}();function K(h,o,p,l){var u=l?h.split(l):[h];for(var s in u){if(typeof u[s]!="string")continue;var i=u[s].split(p);if(i.length!==2)continue;var D=i[0],A=i[1];o(D,A)}}var n=new z.default(0,0,""),L=n.align==="middle"?"middle":"center";function x(h,o,p){var l=h;function u(){var D=M(h);if(D===null)throw new Error("Malformed timestamp: "+l);return h=h.replace(/^[^\sa-zA-Z-]+/,""),D}function s(D,A){var S=new G;K(D,function(g,_){var d;switch(g){case"region":for(var c=p.length-1;c>=0;c--)if(p[c].id===_){S.set(g,p[c].region);break}break;case"vertical":S.alt(g,_,["rl","lr"]);break;case"line":d=_.split(","),S.integer(g,d[0]),S.percent(g,d[0])&&S.set("snapToLines",!1),S.alt(g,d[0],["auto"]),d.length===2&&S.alt("lineAlign",d[1],["start",L,"end"]);break;case"position":d=_.split(","),S.percent(g,d[0]),d.length===2&&S.alt("positionAlign",d[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":S.percent(g,_);break;case"align":S.alt(g,_,["start",L,"end","left","right"]);break}},/:/,/\s/),A.region=S.get("region",null),A.vertical=S.get("vertical","");var R=S.get("line","auto");R==="auto"&&n.line===-1&&(R=-1),A.line=R,A.lineAlign=S.get("lineAlign","start"),A.snapToLines=S.get("snapToLines",!0),A.size=S.get("size",100),A.align=S.get("align",L);var O=S.get("position","auto");O==="auto"&&n.position===50&&(O=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=O}function i(){h=h.replace(/^\s+/,"")}if(i(),o.startTime=u(),i(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);h=h.substr(3),i(),o.endTime=u(),i(),s(h,o)}function f(h){return h.replace(/<br(?: \/)?>/gi,`
`)}var b=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new I,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=h.prototype;return o.parse=function(l){var u=this;l&&(u.buffer+=u.decoder.decode(l,{stream:!0}));function s(){var O=u.buffer,g=0;for(O=f(O);g<O.length&&O[g]!=="\r"&&O[g]!==`
`;)++g;var _=O.substr(0,g);return O[g]==="\r"&&++g,O[g]===`
`&&++g,u.buffer=O.substr(g),_}function i(O){K(O,function(g,_){},/:/)}try{var D="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;D=s();var A=D.match(/^()?WEBVTT([ \t].*)?$/);if(!A||!A[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:D=s();switch(u.state){case"HEADER":/:/.test(D)?i(D):D||(u.state="ID");continue;case"NOTE":D||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(D)){u.state="NOTE";break}if(!D)continue;if(u.cue=new z.default(0,0,""),u.state="CUE",D.indexOf("-->")===-1){u.cue.id=D;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{x(D,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var R=D.indexOf("-->")!==-1;if(!D||R&&(S=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
`),u.cue.text+=D}continue;case"BADCUE":D||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){l.onparsingerror&&l.onparsingerror(u)}return l.onflush&&l.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"generateCueId",function(){return b}),N.d(Y,"parseWebVTT",function(){return o});var z=N("./src/polyfills/number.ts"),I=N("./src/utils/vttparser.ts"),M=N("./src/demux/id3.ts"),G=N("./src/utils/timescale-conversion.ts"),K=N("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,L=function(l,u,s){return s===void 0&&(s=0),l.substr(s,u.length)===u},x=function(l){var u=parseInt(l.substr(-3)),s=parseInt(l.substr(-6,2)),i=parseInt(l.substr(-9,2)),D=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(u)||!Object(z.isFiniteNumber)(s)||!Object(z.isFiniteNumber)(i)||!Object(z.isFiniteNumber)(D))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return u+=1e3*s,u+=60*1e3*i,u+=60*60*1e3*D,u},f=function(l){for(var u=5381,s=l.length;s;)u=u*33^l.charCodeAt(--s);return(u>>>0).toString()};function b(p,l,u){return f(p.toString())+f(l.toString())+f(u)}var h=function(l,u,s){var i=l[u],D=l[i.prevCC];if(!D||!D.new&&i.new){l.ccOffset=l.presentationOffset=i.start,i.new=!1;return}for(;(A=D)!==null&&A!==void 0&&A.new;){var A;l.ccOffset+=i.start-D.start,i.new=!1,i=D,D=l[i.prevCC]}l.presentationOffset=s};function o(p,l,u,s,i,D,A,S){var R=new I.VTTParser,O=Object(M.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(n,`
`).split(`
`),g=[],_=Object(G.toMpegTsClockFromTimescale)(l,u),d="00:00.000",c=0,C=0,E,w=!0,B=!1;R.oncue=function(W){var T=s[i],k=s.ccOffset,m=(c-_)/9e4;if(T!=null&&T.new&&(C!==void 0?k=s.ccOffset=T.start:h(s,i,m)),m&&(k=m-s.presentationOffset),B){var y=W.endTime-W.startTime,H=Object(K.normalizePts)((W.startTime+k-C)*9e4,D*9e4)/9e4;W.startTime=H,W.endTime=H+y}var Q=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(Q)),W.id||(W.id=b(W.startTime,W.endTime,Q)),W.endTime>0&&g.push(W)},R.onparsingerror=function(W){E=W},R.onflush=function(){if(E){S(E);return}A(g)},O.forEach(function(W){if(w)if(L(W,"X-TIMESTAMP-MAP=")){w=!1,B=!0,W.substr(16).split(",").forEach(function(T){L(T,"LOCAL:")?d=T.substr(6):L(T,"MPEGTS:")&&(c=parseInt(T.substr(7)))});try{C=x(d)/1e3}catch(T){B=!1,E=T}return}else W===""&&(w=!1);R.parse(W+`
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/utils/logger.ts"),I=N("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,G=function(){function K(L){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=L?L.xhrSetup:null,this.stats=new I.LoadStats,this.retryDelay=0}var n=K.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var x=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),x&&(x.onreadystatechange=null,x.onprogress=null,x.readyState!==4&&(this.stats.aborted=!0,x.abort()))},n.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(x,f,b){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=x,this.config=f,this.callbacks=b,this.retryDelay=f.retryDelay,this.loadInternal()},n.loadInternal=function(){var x=this.config,f=this.context;if(!x)return;var b=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var o=this.xhrSetup;try{if(o)try{o(b,f.url)}catch(u){b.open("GET",f.url,!0),o(b,f.url)}b.readyState||b.open("GET",f.url,!0);var p=this.context.headers;if(p)for(var l in p)b.setRequestHeader(l,p[l])}catch(u){this.callbacks.onError({code:b.status,text:u.message},f,b);return}f.rangeEnd&&b.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),b.onreadystatechange=this.readystatechange.bind(this),b.onprogress=this.loadprogress.bind(this),b.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),x.timeout),b.send()},n.readystatechange=function(){var x=this.context,f=this.loader,b=this.stats;if(!x||!f)return;var h=f.readyState,o=this.config;if(b.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),b.loading.first===0&&(b.loading.first=Math.max(self.performance.now(),b.loading.start)),h===4){f.onreadystatechange=null,f.onprogress=null;var p=f.status;if(p>=200&&p<300){b.loading.end=Math.max(self.performance.now(),b.loading.first);var l,u;if(x.responseType==="arraybuffer"?(l=f.response,u=l.byteLength):(l=f.responseText,u=l.length),b.loaded=b.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(b,x,l,f),!this.callbacks)return;var i={url:f.responseURL,data:l};this.callbacks.onSuccess(i,b,x,f)}else b.retry>=o.maxRetry||p>=400&&p<499?(z.logger.error(p+" while loading "+x.url),this.callbacks.onError({code:p,text:f.statusText},x,f)):(z.logger.warn(p+" while loading "+x.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,o.maxRetryDelay),b.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var x=this.callbacks;x&&(this.abortInternal(),x.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(x){var f=this.stats;f.loaded=x.loaded,x.lengthComputable&&(f.total=x.total)},n.getCacheAge=function(){var x=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");x=f?parseFloat(f):null}return x},K}();Y.default=G}}).default})},vHTk:function(it,Ee,U){it.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(it,Ee,U){"use strict";var ie=U("+L6B"),Y=U("2/Rp"),N=U("5NDa"),z=U("5rEg"),I=U("y8nQ"),M=U("Vl3Y"),G=U("tJVT"),K=U("q1tI"),n=U.n(K),L=U("a+yL"),x=U.n(L),f=function(h){var o=h.value,p=h.onChange,l=M.a.useForm(),u=Object(G.a)(l,1),s=u[0];Object(K.useEffect)(function(){o&&s.setFieldsValue(o)},o);var i=function(A){p(A)};return n.a.createElement("div",{className:x.a.search},n.a.createElement(M.a,{className:x.a.formWrap,colon:!1,form:s,size:"large",layout:"inline",onFinish:i},n.a.createElement(M.a.Item,{label:"\u5B9E\u8BAD\u4FE1\u606F",name:"keyword",initialValue:""},n.a.createElement(z.a,{style:{width:280,height:40}})),n.a.createElement(M.a.Item,{label:"\u5B66\u6821/\u5355\u4F4D",name:"schools",initialValue:"",style:{margin:"0 40px"}},n.a.createElement(z.a,{style:{width:280,height:40}})),n.a.createElement(M.a.Item,{label:"\u521B\u5EFA\u8005",name:"creator",initialValue:""},n.a.createElement(z.a,{style:{width:200,height:40}})),n.a.createElement(Y.a,{className:x.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};Ee.a=f},wNkr:function(it,Ee){it.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAoCAYAAACFFRgXAAAAAXNSR0IArs4c6QAABIdJREFUWEftWGtMm1UYfg5taScYNhbt5qAFioMRE6aRkGiQP8vEJcZFZ5YYr9Fd3NTID/3hdS5xXoKZZpvrNsBtJotZlkxHyOIIZjLnLiSGxUWHQKXQsoGAjmAp7dcecw609Lt5GN/XTLOdP6f9Lud73ud93ve85yWUUgv+w4MQEkuFR24CNtlbNx7DvmCshtKYFxR5lAKEAGxmI/GbzYYHQYAQy0ZPnrXZkIZ7ApFeBtYwIAAUFASEz9zg6d9sZoOCBu50OfKNAe6flNjS2oN9mN2bAiD/pwY0G6OLXXbZx645S/SkAFZKgFIKQgjYPC2SFNhaJighJ4xNYKQodjnMAKzNjYZLZS5XwZs2jhnJzVEZDHMA631AyY8yCpWAEt7QXY8QePINSsIXYBrWUbAia6gZncooySyiFvmM8DnjZjGsG3KKqFe4XPWaADCLWo9RDftY0M02zyoBKfOGIHEzCRW75hkLOl9/WEr6VLlzCDSgygHKIFOnHXjmCrhgZ2V1SJp45+ya89UziT0162rp5N99rk5i6o2k8kjF9xZYtlyp7TjJNxdRtZYACqCavXBuTbv+zqRgTJQFknuMjsQYMZVHKhJMcOBCwAvO23Wzwmx2KrOfuQnYbEZVcSzSsJ4kOsovoW/Sn1xvs28d9noOYH3PM+iP9OHzogY0jR7FybFWfOTejqWOUuRYc9AwuAf1Q14cLP4KC223IUanFPdxcBtWLXgYh0cOoePvn3TtnrMkLpR3ovxCiWzhlTkPYdOiV/DlH19gde5jeKp7Ld5Y8i4P0g+CW2GBBV+XHseLvuexx7Mf67qfxkA0mFxjd1Ej9g/tw7nxM+YD/v2eK9hxeTtfOBQPwTu4g//+rGA3Vsx/EFUXKzAqjaCl7BQ2+V5AV7hTBqJ5WSvax89iTBrj1xuH9mKbuw4HhurTA/jScj/W+57lH4vGIzgzfppXZk2lLXDanHiu+wlcnPgZJ8ra8LJvAzrDv/Jnc60LMRkP43DJMTQMejEsDfPrDPwnBTvTB1hLEq8ufg2325w4NHwQuwr3YeUvD6D2jtdhJ3a8F3gL2RnZOFF2Cmt/Ww2vp1ElCab7tDHcdlc7/pJGk25m8tjg3Iwnux5HmIbx0qJaTMRDXM9b8t/H3Vn3wpHhQN3Ah2j+8xvsKqyHy+4GRZyvwZ4rmbcM991aBYlG+bVPL9fhu6stMinNOejSnb701hcCzj2dFaY2yXq9AKZ+l0StkhCws2nxm9HcsbevN2gOdiR7qxCwktneYEhKVGti1q/xFK0o31g9XJiXZawengKsPYTHeg1AqadsrUOsYcD+YGj2BbzIBRoFu7KVVLDkFmMM+wdC0nSfZKZ6n2kjyCt6dYUuqvjlKYwQuI0C7uq9KmXabCLu+H0VgbK+kNjeyGQUS4vmG2O49YcOyZ1XiMxMm0YrSnZKTx7pk40g8RtJkyKRKPqCfqyoWm4M8NHjbb3UpGagyE2EIPDoqmpjzcBj3/5YE4tL3nSDZmAtGdaNj9Tcb6zdKmLF7Ps3XgfebAZF6/3vGf4HhYa6OsTsTGoAAAAASUVORK5CYII="},xTzM:function(it,Ee){it.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="},xlxt:function(it,Ee,U){it.exports={flex_box_center:"flex_box_center___1qaRn",flex_space_between:"flex_space_between___3tOTR",flex_box_vertical_center:"flex_box_vertical_center___2XsRs",flex_box_center_end:"flex_box_center_end___3O9De",flex_box_column:"flex_box_column___3bx6a",exportModal:"exportModal___29rdj"}},"yTi+":function(it,Ee,U){it.exports=U.p+"static/AssistantCode3.fdd8db3c.jpeg"}}]);